/* Desk HQ on the phone. Dark like a reef tank at night: deep green-black water, Desk's sun yellow for what you press. */
:root {
  --water: #0f1c19; --deep: #0a1412; --glass: #172925; --line: #27403a;
  --ink: #e9f0ec; --muted: #93a8a0; --sun: #e3a234; --sun-ink: #1d1404; --danger: #ff8a73;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--water); color: var(--ink); font: 16px/1.5 Figtree, 'Segoe UI', system-ui, sans-serif; }
body { min-height: 100dvh; }
body.busy { overflow: hidden; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.state { padding: 30vh 24px; text-align: center; color: var(--muted); }

main { padding: calc(var(--safe-t) + 18px) 16px calc(var(--safe-b) + 110px); max-width: 720px; margin: 0 auto; }

/* sign-in */
.lock { padding-top: 12vh; }
.lock h1, .reef-top h1 { font: 700 34px/1.1 'Bricolage Grotesque', 'Segoe UI', sans-serif; letter-spacing: -0.02em; margin: 0 0 8px; }
.form { display: grid; gap: 14px; margin-top: 18px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
input { font: inherit; color: inherit; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; width: 100%; }
.err { color: var(--danger); margin: 0; min-height: 1.2em; }
.btn { border: 1px solid var(--line); background: var(--glass); border-radius: 999px; padding: 12px 20px; font-weight: 600; cursor: pointer; text-align: center; }
.btn.primary { background: var(--sun); color: var(--sun-ink); border-color: transparent; }
.btn:disabled { opacity: .6; }
.link { background: none; border: 0; padding: 6px 0; text-decoration: underline; cursor: pointer; }
.link.quiet { color: var(--muted); font-size: 14px; }

/* the reef page */
.reef-top { margin-bottom: 22px; }
.top-row { display: flex; align-items: baseline; justify-content: space-between; }
.age { margin: 10px 0 0; display: grid; }
.age-n { font: 700 56px/1 'Bricolage Grotesque', 'Segoe UI', sans-serif; letter-spacing: -0.03em; color: var(--sun); }
.age-k { color: var(--muted); font-size: 15px; margin-top: 6px; }
.count { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.day h2 { font-size: 15px; font-weight: 600; margin: 22px 0 8px; }
.day h2 span { color: var(--muted); font-weight: 400; margin-left: 6px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tile { position: relative; padding: 0; border: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--glass); cursor: pointer; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pin { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--sun); color: var(--sun-ink); }
.empty { margin-top: 12vh; text-align: center; padding: 0 12px; }
.empty p:first-child { font: 500 22px/1.3 'Bricolage Grotesque', 'Segoe UI', sans-serif; }

/* the bar at the bottom: where the buttons live */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end;
  padding: 8px 24px calc(var(--safe-b) + 10px); background: linear-gradient(transparent, var(--deep) 30%); }
.bar button { background: none; border: 0; display: grid; justify-items: center; gap: 2px; font-size: 12px; color: var(--muted); padding: 6px 12px; cursor: pointer; }
.bar button[aria-current] { color: var(--ink); }
.bar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bar .shoot { width: 72px; height: 72px; border-radius: 50%; background: var(--sun); color: var(--sun-ink); place-items: center; margin-bottom: 2px; box-shadow: 0 0 0 6px var(--deep); }
.bar .shoot svg { width: 32px; height: 32px; stroke-width: 1.9; }

/* camera */
.cam, .show { position: fixed; inset: 0; z-index: 10; background: #000; display: grid; }
.cam video, .cam .onion { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam .onion { pointer-events: none; mix-blend-mode: normal; }
.cam-top, .show-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 12px) 14px 12px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.round { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 0; background: rgba(20, 30, 27, .72); color: #fff; font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.round.big { width: 62px; height: 62px; background: var(--sun); color: var(--sun-ink); font-size: 20px; }
.pill { margin-left: auto; border: 1px solid rgba(255,255,255,.35); background: rgba(20, 30, 27, .72); color: #fff; border-radius: 999px; padding: 9px 16px; font-weight: 600; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--sun); color: var(--sun-ink); border-color: transparent; }
.pill:disabled { opacity: .75; cursor: default; }
.ov-box { flex: 1; display: flex; align-items: center; }
.ov-box[hidden] { display: none; }
.ov-box input { padding: 0; accent-color: var(--sun); background: none; border: 0; }
.cam-msg { position: absolute; inset: 40% 24px auto; text-align: center; color: #fff; display: grid; gap: 14px; justify-items: center; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 18px 16px calc(var(--safe-b) + 22px); background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.cam-hint { color: #dfe7e3; font-size: 13px; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: var(--sun); cursor: pointer; transition: transform .12s; }
.shutter:active, .shutter.flash { transform: scale(.88); }
/* the Reef lens: above the shutter */
.lens { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 128px); display: grid; gap: 8px; justify-items: center; padding: 0 16px; }
.chips { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(10, 20, 18, .7); }
.chip { border: 0; background: none; color: #e9f0ec; border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--sun); color: var(--sun-ink); }
.chip[data-lens="yellow"]::before, .chip[data-lens="orange"]::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: #f2cc3d; vertical-align: 0; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .35); }
.chip[data-lens="orange"]::before { background: #f08a24; }
.lens-k { display: flex; align-items: center; gap: 10px; width: min(320px, 100%); color: #e9f0ec; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: rgba(10, 20, 18, .7); }
.lens-k[hidden] { display: none; }
.lens-k input { flex: 1; padding: 0; background: none; border: 0; accent-color: var(--sun); }
.lens-hw { color: var(--sun); white-space: nowrap; }
.review { position: absolute; inset: 0; background: #000; display: grid; grid-template-rows: 1fr auto; }
.review img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.review-bar { display: grid; gap: 10px; padding: 14px 16px calc(var(--safe-b) + 16px); background: var(--deep); }
.row { display: flex; gap: 10px; justify-content: center; align-items: center; }
.review-bar .row .btn { flex: 1; }

/* slideshow */
.stage { position: absolute; inset: 0; }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .45s ease; }
.stage img.on { opacity: 1; }
.cap { margin: 0; color: #fff; font-size: 14px; line-height: 1.4; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.cap span { color: #cfd9d4; margin-left: 6px; }
.show-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 12px; padding: 18px 16px calc(var(--safe-b) + 18px); background: linear-gradient(transparent, rgba(0,0,0,.7) 35%); }
.scrub { padding: 0; background: none; border: 0; accent-color: var(--sun); }
.show-bottom .row.small .pill { margin: 0; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .stage img { transition: none; } .shutter { transition: none; } }

#toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 110px); z-index: 20; margin: 0 auto; max-width: 420px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--water); font-weight: 600; text-align: center; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; }
#toast.on { opacity: 1; transform: none; }
