/* Your Family Photo — reveal prototype. Palette and type from branding/BRAND.md:
   ink blue and white, accent blue sparingly, Arial until Gilroy is licensed, body ≥ 18 px. */
:root {
  --ink: #173B55;
  --white: #FFFFFF;
  --accent: #5C9FCB;           /* decoration only: never text or controls */
  --ink-70: rgba(23, 59, 85, .7);
  --line: #D5DEE5;
  --wall: #EEF0F2;
  --font: Gilroy, Arial, sans-serif;
  --gutter: 16px;
  --radius: 10px;
  --t: 450ms;                  /* transitions stay ≤ 0.5 s (plan §3.2) */
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--white); color: var(--ink); font: 18px/1.5 var(--font); }
body { min-height: 100svh; }
img { max-width: 100%; }
h1 { font-size: 30px; line-height: 1.2; margin: 8px 0 8px; }
h2 { font-size: 26px; line-height: 1.25; margin: 8px 0 16px; }
h3 { font-size: 21px; margin: 32px 0 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.proto-bar { background: var(--ink); color: var(--white); font-size: 14px; text-align: center; padding: 6px var(--gutter); }

.screen { max-width: 720px; margin: 0 auto; padding: 16px var(--gutter) 48px; }
.screen.dark { max-width: none; min-height: calc(100svh - 32px); background: var(--ink); color: var(--white);
  display: flex; flex-direction: column; align-items: center; padding-bottom: 24px; }

.brand { margin: 8px 0 16px; }
.brand img { height: 40px; width: auto; }
.brand.small img { height: 30px; }
.lede { font-size: 19px; margin: 0 0 20px; }
.fine { font-size: 16px; color: var(--ink-70); }
.error { color: #9B1C1C; font-weight: bold; }

.tips { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.tips li { display: flex; align-items: center; gap: 14px; }
.tip-icon svg { width: 44px; height: 44px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }

fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: bold; margin-bottom: 8px; padding: 0; }
.optional { font-weight: normal; color: var(--ink-70); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; min-width: 64px; padding: 8px 14px; border-radius: 22px; border: 2px solid var(--line);
  background: var(--white); color: var(--ink); font: inherit; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--white); }
.chip:disabled { opacity: .55; cursor: default; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px;
  border-radius: var(--radius); border: 2px solid var(--ink); font: inherit; font-weight: bold; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--ink); color: var(--white); }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--white); color: var(--ink); }
.btn.secondary-dark { background: transparent; color: var(--white); border-color: var(--white); }
.btn.ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.5); min-height: 44px; font-weight: normal;
  font-size: 16px; padding: 8px 14px; white-space: nowrap; }
.btn.big { width: 100%; min-height: 56px; font-size: 20px; margin-top: 8px; }
.btn:focus-visible, .chip:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- stage (the darkroom) ---------- */
.stage-top { width: 100%; max-width: 900px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0 12px; }
.stage-logo { height: 26px; width: auto; }
.stage { width: 100%; max-width: 900px; flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 52svh; }
.photo-box { position: relative; transition: width var(--t) ease, height var(--t) ease; }
.photo-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }
.photo-box img.top { opacity: 0; }
.photo-box.dim #img-base { filter: brightness(.7); }
.band { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent 0, rgba(255,255,255,.0) 40%, rgba(255,255,255,.35) 50%, rgba(255,255,255,0) 60%, transparent 100%);
  background-size: 300% 100%; mix-blend-mode: screen; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.overlay .shade { fill: rgba(10, 25, 36, .72); }
.overlay .edge { fill: none; stroke: var(--white); stroke-width: 2; }
.overlay .corner { fill: var(--white); }
.overlay .pulse { fill: none; stroke: rgba(255,255,255,.9); stroke-width: 1.5; }
.overlay.editing { pointer-events: auto; touch-action: none; }
.overlay .handle { fill: rgba(255,255,255,.18); stroke: var(--white); stroke-width: 2; cursor: grab; }
.overlay .handle.selected { fill: rgba(92,159,203,.55); }

.caption { min-height: 2.6em; font-size: 20px; text-align: center; margin: 14px var(--gutter) 6px; max-width: 640px; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 8px; }
.steps li { width: 26px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); }
.steps li.done { background: var(--white); }
.steps li.skipped { background: rgba(255,255,255,.1); }

.confirm, .adjust { text-align: center; max-width: 560px; }
.confirm p, .adjust p { margin: 6px 0; }
.adjust .row, .confirm .row { justify-content: center; }
.nudge { display: flex; justify-content: center; gap: 8px; }
.nudge button { width: 48px; height: 48px; border-radius: 24px; border: 2px solid var(--white); background: transparent; color: var(--white); font-size: 22px; cursor: pointer; }

/* ---------- result (daylight) ---------- */
.compare-box { position: relative; margin: 0 auto; max-width: 100%; user-select: none; }
.compare-box img { display: block; width: 100%; height: auto; }
.cmp-before-wrap { position: absolute; inset: 0; overflow: hidden; clip-path: inset(0 100% 0 0); }
.cmp-before-wrap img { width: 100%; height: 100%; }
.cmp-handle { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--white); box-shadow: 0 0 0 1px rgba(0,0,0,.25); left: 0; pointer-events: none; }
.compare-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.slider-label { display: flex; flex-direction: column; flex: 1 1 200px; font-size: 16px; }
input[type=range] { width: 100%; min-height: 44px; accent-color: var(--ink); }

.room { position: relative; background: linear-gradient(#F3F5F6, var(--wall) 70%, #E3E6E9); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 28px 0 0; }
.wall-frame { position: relative; z-index: 1; }
.frame { position: relative; box-shadow: 0 1px 1px rgba(0,0,0,.25), 0 10px 22px rgba(0,0,0,.22), 0 2px 5px rgba(0,0,0,.2);
  background: var(--frame, #3B2A20); transition: background var(--t) ease; }
.frame::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,.28)); }
.mat { position: relative; background: var(--mat-colour, #FBFBF8); box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); transition: background var(--t) ease; overflow: hidden; }
.mat img { display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.12), -1px -1px 0 2px rgba(255,255,255,.55), 1px 1px 0 2px rgba(0,0,0,.08); }
.sweep { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.28) 48%, transparent 60%); background-size: 250% 100%; }
.sweep.run { animation: sweep 1.1s ease-out 1; }
@keyframes sweep { 0% { opacity: 1; background-position: 120% 0; } 100% { opacity: 1; background-position: -40% 0; } }
.sideboard { position: relative; z-index: 0; background: #6E6A66; }
.sideboard .top { height: 8%; background: #57534F; }
.dims { font-weight: bold; margin: 12px 0 2px; }
.hero-frame { display: flex; justify-content: center; padding: 20px 0 8px; background: linear-gradient(#F6F7F8, var(--wall)); border-radius: var(--radius); }
h3.sub { font-size: 18px; margin: 24px 0 8px; }
.label { font-size: 15px; color: var(--ink-70); margin: 0; }

.options { display: grid; gap: 18px; margin-top: 28px; }
.opt-head { margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.opt-name { font-weight: bold; }
.opt-value { color: var(--ink-70); font-size: 16px; }
/* one line on any phone: three equal segments */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.segmented button { min-height: 48px; padding: 6px 4px; border: 0; border-left: 2px solid var(--ink); background: var(--white); color: var(--ink);
  font: inherit; font-size: clamp(14px, 4.2vw, 17px); white-space: nowrap; cursor: pointer; }
.segmented button:first-child { border-left: 0; }
.segmented button[aria-checked="true"] { background: var(--ink); color: var(--white); font-weight: bold; }
.segmented button:disabled { color: rgba(23,59,85,.4); background: #F4F6F8; cursor: default; }
.swatches { display: flex; flex-wrap: nowrap; gap: clamp(8px, 3vw, 12px); padding: 3px; }
.swatch { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 24px; border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--line); cursor: pointer; padding: 0; }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 3px var(--ink); }
.swatch:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.face-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.face-card .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.face-card canvas { width: 100%; height: auto; display: block; border-radius: 4px; }
.face-card p { font-size: 14px; margin: 6px 0 0; color: var(--ink-70); }

.teaser { font-size: 16px; margin: 10px 0 0; }
.teaser a { color: var(--ink); font-weight: bold; }
.unlock { margin-top: 32px; }
.unlock h3 { margin: 0 0 6px; }
.unlock-lede { margin: 0 0 12px; }
.unlock-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.unlock-list li { display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; }
.unlock-list li::before { content: "✓"; grid-row: span 2; width: 28px; height: 28px; border-radius: 14px; background: var(--ink);
  color: var(--white); font-weight: bold; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.u-title { font-weight: bold; }
.u-body { color: var(--ink-70); font-size: 17px; }
.offer { margin-top: 28px; border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px; }
.offer .price { font-size: 20px; font-weight: bold; margin: 0 0 8px; }
.offer ul { padding-left: 20px; margin: 0 0 8px; }
.disclosure { font-size: 16px; margin-top: 20px; }
.debug { margin-top: 24px; font-size: 14px; color: var(--ink-70); }
.debug pre { white-space: pre-wrap; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  :root { --t: 0ms; }
  .sweep.run { animation: none; }
}
@media (min-width: 720px) {
  h1 { font-size: 36px; }
}

/* inside the store: a close control over the frame */
.embed-close { position: fixed; top: 8px; right: 8px; z-index: 10; min-height: 40px; padding: 6px 12px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.6); background: rgba(23,59,85,.85); color: #fff; font: inherit; font-size: 15px; cursor: pointer; }
