@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;1,500;1,600&display=swap');

:root {
  color-scheme: light;
  --paper: #eaf0e9;
  --ink: #18322b;
  --muted: #64766c;
  --line: #c6d2c6;
  --green: #b7ef54;
  --coral: #ff765e;
  --mono: 'DM Mono', 'SFMono-Regular', monospace;
  --sans: 'DM Sans', 'Avenir Next', sans-serif;
  --serif: 'Playfair Display', 'Iowan Old Style', serif;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background-color: var(--paper); background-image: radial-gradient(#708c7533 0.7px, transparent 0.7px); background-size: 8px 8px; font-family: var(--sans); }
a { color: inherit; }
button, select { font: inherit; }
.topbar, .page-footer { display: flex; align-items: center; justify-content: space-between; width: min(1240px, calc(100% - 80px)); margin: 0 auto; }
.topbar { height: 82px; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; text-decoration: none; }
.wordmark-mark { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid var(--ink); border-radius: 50%; }
.wordmark-mark::before { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); content: ''; }
.gallery-link, .text-link { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; text-decoration: none; }
.arrow { color: #527263; font-size: 18px; }
.gallery-actions { display: flex; align-items: center; gap: 22px; }
.gallery-actions form { margin: 0; }
.logout-button { padding: 7px 0; border: 0; color: #64766c; background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; }
.logout-button:hover { color: #a74535; }
.auth-page { display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(300px, 1.1fr); align-items: center; gap: clamp(48px, 9vw, 130px); width: min(960px, calc(100% - 80px)); min-height: calc(100vh - 152px); margin: 0 auto; padding: 60px 0; }
.auth-panel { width: 100%; max-width: 390px; }
.auth-panel h1 { margin: 0; font-family: var(--serif); font-size: clamp(52px, 6vw, 72px); font-weight: 500; line-height: 0.99; }
.auth-copy { margin: 18px 0 28px; color: var(--muted); font-size: 14px; }
.auth-form { display: grid; gap: 10px; }
.auth-form label { margin-top: 8px; font-size: 12px; font-weight: 600; }
.auth-form input { width: 100%; height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: #f4f7f1; font: inherit; }
.auth-form input:focus-visible { outline: 2px solid #638f66; outline-offset: 2px; }
.auth-form .start-button { margin-top: 14px; }
.auth-error { padding: 11px 12px; border-left: 3px solid #a74535; color: #813b31; background: #f9e5df; font-size: 12px; line-height: 1.5; }
.auth-aside { display: flex; min-height: 380px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #aebfaf; background: repeating-linear-gradient(135deg, transparent 0 14px, #ffffff21 14px 15px); }
.auth-aside p { margin: 22px 0 0; color: #48725d; font-family: var(--serif); font-size: 31px; line-height: 1.15; text-align: center; }
.capture-layout { display: grid; grid-template-columns: minmax(310px, 0.78fr) minmax(440px, 1.22fr); align-items: center; gap: clamp(48px, 8vw, 120px); width: min(1120px, calc(100% - 80px)); min-height: calc(100vh - 152px); margin: 0 auto; padding: 54px 0 50px; }
.intro { animation: arrive 600ms both; }
.camera-column { animation: arrive 650ms 100ms both; }
@keyframes arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.eyebrow, .frame-caption, .page-footer, .camera-badge, .photo-date { font-family: var(--mono); text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 22px; color: #597266; font-size: 10px; }
.live-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--coral); }
.intro h1, .gallery-heading h1 { margin: 0; font-family: var(--serif); font-size: clamp(50px, 6vw, 76px); font-weight: 500; line-height: 0.99; }
h1 em { color: #48725d; font-weight: 500; }
.intro-copy { max-width: 360px; margin: 23px 0 35px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.capture-controls { max-width: 345px; }
.field-label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 600; }
.select-wrap { position: relative; }
.select-wrap select { width: 100%; height: 48px; padding: 0 42px 0 14px; appearance: none; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: #f4f7f1; cursor: pointer; }
.select-wrap > span { position: absolute; top: 9px; right: 14px; pointer-events: none; font-size: 21px; }
.capture-controls .start-button { margin-top: 20px; }
.start-button { display: flex; width: 100%; min-height: 52px; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--ink); border-radius: 3px; color: #f6f8ef; background: var(--ink); cursor: pointer; font-size: 13px; font-weight: 600; transition: background 160ms ease, color 160ms ease; }
.start-button:hover { color: var(--ink); background: var(--green); }
.start-button:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid #638f66; outline-offset: 3px; }
.start-button:disabled { cursor: wait; opacity: 0.7; }
.start-button.is-stop { border-color: #a74535; background: #a74535; }
.start-button.is-stop:hover { color: white; background: #883a2e; }
.button-icon { color: var(--coral); font-size: 13px; }
.is-stop .button-icon { color: white; }
.status-line { min-height: 18px; margin: 12px 0 0; color: #62766a; font-size: 11px; line-height: 1.6; }
.session-count { display: flex; align-items: baseline; gap: 7px; margin-top: 21px; color: var(--muted); font-size: 11px; }
.count-value { color: var(--ink); font-family: var(--serif); font-size: 28px; }
.privacy-note { display: flex; gap: 9px; margin: 28px 0 0; color: #718176; font-size: 11px; }
.privacy-note > span { color: #548267; }
.camera-frame { position: relative; overflow: hidden; width: 100%; aspect-ratio: 1.22; border: 1px solid #aebfaf; background: #dce6db; box-shadow: 14px 14px 0 #d5e0d3; }
.camera-frame video { display: none; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-frame.is-live video { display: block; }
.camera-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: repeating-linear-gradient(135deg, transparent 0 14px, #ffffff21 14px 15px); }
.camera-placeholder[hidden] { display: none; }
.camera-placeholder p { margin: 17px 0 5px; font-family: var(--serif); font-size: 21px; }
.camera-placeholder > span { color: #728276; font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.placeholder-lens { display: grid; width: 66px; aspect-ratio: 1; place-items: center; border: 1px solid #9bac9b; border-radius: 50%; }
.placeholder-lens::before { position: absolute; width: 42px; aspect-ratio: 1; border: 1px solid #9bac9b; border-radius: 50%; content: ''; }
.placeholder-lens span { width: 16px; aspect-ratio: 1; border: 1px solid #64816b; border-radius: 50%; background: #b7ef5470; }
.frame-corner { position: absolute; z-index: 1; width: 18px; height: 18px; border-color: #f7f9ef; border-style: solid; }
.corner-tl { top: 18px; left: 18px; border-width: 1px 0 0 1px; }
.corner-tr { top: 18px; right: 18px; border-width: 1px 1px 0 0; }
.corner-bl { bottom: 18px; left: 18px; border-width: 0 0 1px 1px; }
.corner-br { right: 18px; bottom: 18px; border-width: 0 1px 1px 0; }
.camera-badge { position: absolute; z-index: 2; top: 24px; right: 25px; display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid #ffffff85; color: white; background: #18322b9c; font-size: 9px; }
.camera-badge .live-dot { width: 6px; height: 6px; }
.camera-frame.is-live .camera-badge .live-dot { background: var(--green); animation: pulse 1.7s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px #b7ef543b; } }
.capture-flash { position: absolute; z-index: 3; inset: 0; pointer-events: none; background: white; opacity: 0; }
.capture-flash.flash { animation: flash 250ms ease-out; }
@keyframes flash { 20% { opacity: 0.72; } 100% { opacity: 0; } }
.frame-caption { display: flex; justify-content: space-between; margin-top: 15px; color: #708176; font-size: 9px; }
.page-footer { min-height: 70px; border-top: 1px solid var(--line); color: #76877a; font-size: 9px; }
.page-footer > span:first-child { color: #4c6657; }
.gallery-page { width: min(1120px, calc(100% - 80px)); min-height: calc(100vh - 152px); margin: 0 auto; padding: 70px 0 80px; }
.gallery-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 42px; }
.gallery-heading .eyebrow { margin-bottom: 17px; }
.gallery-heading h1 { font-size: clamp(42px, 5vw, 62px); }
.gallery-total { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.gallery-total strong { color: var(--ink); font-family: var(--serif); font-size: 34px; font-weight: 500; }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.photo-card { overflow: hidden; border: 1px solid var(--line); background: #f4f7f1; text-decoration: none; transition: transform 180ms ease, box-shadow 180ms ease; }
.photo-card:hover { transform: translateY(-4px); box-shadow: 5px 7px 0 #cbd7ca; }
.photo-card img { display: block; width: 100%; aspect-ratio: 0.82; object-fit: cover; background: #dce6db; }
.photo-date { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; color: #5c7163; font-size: 8px; }
.photo-date > span { font-family: var(--sans); font-size: 16px; }
.empty-state { display: flex; min-height: 350px; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #aebfaf; text-align: center; }
.empty-state h2 { margin: 18px 0 6px; font-family: var(--serif); font-size: 28px; font-weight: 500; }
.empty-state p { margin: 0 0 19px; color: var(--muted); font-size: 13px; }
.text-link { color: #38674e; }
@media (max-width: 800px) {
  .capture-layout { grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1.15fr); gap: 42px; }
  .intro h1 { font-size: 58px; }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .topbar, .page-footer { width: calc(100% - 36px); }
  .topbar { height: 68px; }
  .capture-layout { display: flex; width: calc(100% - 40px); min-height: auto; flex-direction: column; align-items: stretch; gap: 35px; padding: 42px 0 44px; }
  .auth-page { display: flex; width: calc(100% - 40px); min-height: auto; flex-direction: column; align-items: stretch; gap: 36px; padding: 44px 0; }
  .auth-panel { max-width: none; }
  .auth-aside { min-height: 220px; }
  .auth-aside p { font-size: 25px; }
  .gallery-actions { gap: 12px; }
  .logout-button { font-size: 11px; }
  .intro h1 { font-size: 58px; }
  .intro-copy { margin: 16px 0 25px; }
  .capture-controls { max-width: none; }
  .privacy-note { margin-top: 20px; }
  .camera-frame { aspect-ratio: 0.94; box-shadow: 8px 8px 0 #d5e0d3; }
  .page-footer { min-height: 62px; gap: 16px; font-size: 8px; }
  .page-footer > span:last-child { text-align: right; }
  .gallery-page { width: calc(100% - 40px); min-height: calc(100vh - 130px); padding: 45px 0 60px; }
  .gallery-heading { align-items: flex-start; margin-bottom: 28px; }
  .gallery-heading h1 { max-width: 270px; font-size: 43px; }
  .gallery-total { flex-direction: column; align-items: flex-end; gap: 0; padding-top: 28px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .photo-date { padding: 0 8px; font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}