:root {
  color-scheme: dark;
  --bg: #090908;
  --panel: #141310;
  --line: #3c3425;
  --gold: #eac676;
  --text: #faf2e1;
  --on-gold: #20170a;
  --muted: #c8bda9;
  font: 16px/1.5 "Instrument Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: .5rem 0 0; color: var(--muted); }
h1, h2, h3 { margin: 0; line-height: 1.13; }
h1, h2, .subtitle { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; }
h2 { font-size: clamp(1.65rem, 4vw, 2.12rem); }
h3 { font-size: 1rem; }
:focus-visible, .file-button:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.wrap { width: min(1100px, calc(100% - 40px)); margin-inline: auto; }
.skip, .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { width: auto; height: auto; overflow: visible; clip-path: none; padding: 10px; background: var(--bg); z-index: 5; }
header { border-bottom: 1px solid var(--line); }
.masthead, footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.masthead { min-height: 74px; }
.masthead img { display: block; object-fit: contain; }
.masthead div { display: flex; align-items: center; gap: clamp(10px, 4vw, 34px); }
.masthead div a, footer a { font-size: .88rem; font-weight: 600; }
.hero { text-align: center; padding: clamp(36px, 7vw, 68px) 0 clamp(28px, 5vw, 46px); }
.hero h1 { font-size: clamp(2.8rem, 8vw, 5.4rem); letter-spacing: -.04em; }
.subtitle { margin: .2em 0 .45em; color: var(--gold); font-size: clamp(1.35rem, 4vw, 2.05rem); }
.studio { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); align-items: start; gap: 16px; }
.panel { background: linear-gradient(145deg, #191611, var(--panel) 50%); border: 1px solid var(--line); border-radius: 14px; padding: clamp(16px, 3vw, 28px); }
.capture-frame, .compare-frame { position: relative; display: grid; place-items: center; isolation: isolate; width: min(100%, 340px); aspect-ratio: 4 / 5; margin: 16px auto; overflow: hidden; border-radius: 10px; background: radial-gradient(ellipse, #2b2419, #13110e 76%); border: 1px solid #554633; }
.capture-frame img, .capture-frame video, .compare-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.capture-frame video { transform: scaleX(-1); }
.face-guide { position: absolute; inset: 10% 20% 14%; border: 1px dashed #eac676cc; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 150px #0003; }
.face-guide i { position: absolute; top: 41%; left: 15%; right: 15%; border-top: 1px dashed #eac67699; }
.frame-note, .compare-tags span { padding: 5px 9px; color: #fff6e7; background: #171310e8; border-radius: 5px; font-size: .78rem; }
.frame-note { position: absolute; bottom: 4%; text-align: center; }
.capture-controls { display: flex; flex-wrap: wrap; gap: 8px; }
button, .file-button, select { min-height: 44px; border: 1px solid #786548; border-radius: 7px; background: #211b12; color: var(--text); padding: 7px 12px; font: inherit; font-size: .9rem; }
button, .file-button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:hover:not(:disabled), .file-button:hover { border-color: var(--gold); }
button.primary { border-color: var(--gold); background: var(--gold); color: var(--on-gold); font-weight: 650; }
.file-button { display: inline-grid; place-items: center; position: relative; }
.file-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.status, .privacy { font-size: .85rem; }
.status:empty { display: none; }
.privacy { margin-top: 13px; }
.compare-frame { --split: 50%; }
.compare-empty, .compare-tags { position: absolute; inset: 0; display: flex; justify-content: space-between; padding: 10px; pointer-events: none; }
.compare-empty { align-items: center; justify-content: space-around; color: var(--muted); background: linear-gradient(90deg, transparent calc(50% - .5px), #6a593d 50%, transparent calc(50% + .5px)); }
.compare-tags { align-items: flex-start; }
#before-photo { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.compare-divider { position: absolute; inset: 0 auto 0 var(--split); width: 2px; background: var(--gold); pointer-events: none; }
.compare-divider span { position: absolute; top: 50%; left: 1px; transform: translate(-50%, -50%); width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; color: var(--on-gold); background: var(--gold); font-size: 1.24rem; font-weight: bold; }
.compare-slider { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.compare-frame:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dates label { display: grid; gap: 5px; font-size: .85rem; }
.dates select { width: 100%; min-width: 0; padding-inline: 6px; font-size: .79rem; }
details { margin-top: 14px; }
summary { color: var(--gold); cursor: pointer; padding-block: 8px; }
#photo-count { color: var(--muted); font-size: .85rem; margin-left: .25em; }
#photo-history { margin: 0; padding: 0; list-style: none; }
#photo-history li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.quiz { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 16px 0; }
fieldset { margin: 16px 0 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.goal { display: inline-flex; gap: 8px; align-items: center; padding: 8px 10px; min-height: 44px; border: 1px solid #786548; border-radius: 7px; cursor: pointer; font-size: .9rem; }
.goal:has(:checked) { background: #3a2d14; border-color: var(--gold); }
.goal input { margin: 0; accent-color: var(--gold); width: 16px; height: 16px; }
.suggestions { border-left: 1px solid var(--line); padding-left: 20px; }
.priorities { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; margin: 12px 0 16px; padding: 0; }
.priorities li { border: 1px solid var(--line); border-radius: 999px; background: #292116; color: var(--gold); padding: 4px 10px; font-size: .82rem; }
#serum-results { margin-top: 18px; }
.serum { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 12px; margin-top: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.serum:focus-within { border-color: var(--gold); }
.serum img { object-fit: contain; width: 48px; height: 64px; }
.serum h4 { margin: 2px 0 0; font-size: .98rem; }
.serum h4 a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.serum-goal { margin: 0; color: var(--muted); font-size: .82rem; }
.serum-reason { margin-top: 4px; font-size: .89rem; }
footer { padding: 14px 0 26px; }
@media (max-width: 700px) {
  .wrap { width: calc(100% - 24px); }
  .studio, .quiz { grid-template-columns: 1fr; }
  .suggestions { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
}
