/* Door Alpha v6 — photography with depth, counters, themes, wall, fold, pre-register.
   Loaded after styles.css. */

/* Photos: oversized so parallax never shows an edge */
.photo { position: absolute; left: 0; right: 0; top: -14%; bottom: -14%; z-index: 0; will-change: transform; }
.photo img { width: 100%; height: 100%; object-fit: cover; max-width: none; }
.photo-section { position: relative; overflow: hidden; }
.photo-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(18,17,16,.82) 0%, rgba(18,17,16,.45) 38%, rgba(18,17,16,.55) 70%, rgba(18,17,16,.96) 100%); }
.photo-section > .wrap { position: relative; z-index: 2; }

/* Hero over the porch: photo, shade, light, then copy and devices */
.hero { padding-bottom: 56px; }
.hero-shade { position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(70% 55% at 50% 30%, rgba(18,17,16,.35), rgba(18,17,16,.82) 75%), linear-gradient(180deg, rgba(18,17,16,.55), rgba(18,17,16,.35) 30%, rgba(18,17,16,.9) 82%, var(--ink)); }
.hero canvas { z-index: 0; mix-blend-mode: screen; opacity: .9; }
.hero-copy, .hero-stage, .stats, .hero-themes { position: relative; z-index: 2; }
.hero-fade { display: none; }

/* Stats line, counts up on view */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 54px; border-top: 1px solid var(--hair-2); border-bottom: 1px solid var(--hair); }
.stat { padding: 26px 0 24px; text-align: center; border-left: 1px solid var(--hair); }
.stat:first-child { border-left: 0; }
.stat span { display: block; font-size: 13.5px; color: var(--mute); letter-spacing: .02em; }
.stat b { display: block; margin-top: 6px; font-family: var(--display); font-weight: 300; font-size: clamp(38px, 4.4vw, 60px); line-height: 1; color: var(--white); font-variant-numeric: lining-nums tabular-nums; }
.stat b.pos { color: #a9d3b6; }
.stats-note { grid-column: 1 / -1; text-align: center; font-size: 13px; color: var(--mute); padding: 0 0 18px; max-width: none; }
.hero-themes { margin-top: 30px; display: flex; justify-content: center; }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: 0; border-top: 1px solid var(--hair); padding: 18px 0; }
  .stat:first-child { border-top: 0; }
}

/* Theme switcher */
.theme-switch { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 6px; border: 1px solid var(--hair-2); border-radius: 999px; background: rgba(18,17,16,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.themes .theme-switch { display: flex; width: max-content; max-width: 100%; margin: 40px auto 0; }
.ts-label { font-size: 12px; letter-spacing: .08em; color: var(--mute); padding: 0 8px 0 10px; }
.theme-switch button { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 500; color: var(--white-2); background: none; border: 0; border-radius: 999px; padding: 8px 14px 8px 8px; cursor: pointer; transition: background .3s var(--ease), color .3s var(--ease); }
.theme-switch button em { font-style: normal; font-weight: 300; }
.theme-switch button:hover { color: var(--white); }
.theme-switch button[aria-pressed="true"] { background: var(--white); color: var(--ink); }
.sw { width: 20px; height: 20px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset; flex: none; }
.sw-od { background: linear-gradient(135deg, #0b0c0f 50%, #8b99ad 50%); }
.sw-ol { background: linear-gradient(135deg, #f2eee4 50%, #3e7d5c 50%); }
.sw-dd { background: linear-gradient(135deg, #0f1512 50%, #7fd9ae 50%); }
.sw-dl { background: linear-gradient(135deg, #f6f3ec 50%, #0e6b4f 50%); }
@media (max-width: 560px) { .ts-label { display: none; } .theme-switch button { padding: 7px 11px 7px 7px; font-size: 13px; } }

/* Statement over the house */
.statement.photo-section { min-height: 96vh; display: grid; align-items: center; padding: 18vh 0; text-align: center; }
.statement.photo-section h2 { text-shadow: 0 2px 40px rgba(18,17,16,.6); }
.statement.photo-section p { color: var(--white); opacity: .82; }

/* Wall of screens */
.wall { overflow-x: clip; }
.wall-head { text-align: center; margin-bottom: 56px; }
.wall-row { display: flex; gap: 26px; width: max-content; padding: 14px 0; transform: translate3d(var(--wx, 0px), 0, 0); will-change: transform; }
.phone.sm { --pw: 220px; }
.wall-note { margin-top: 40px; text-align: center; font-size: 14px; color: var(--mute); max-width: none; }
@media (max-width: 760px) { .phone.sm { --pw: 150px; } .wall-row { gap: 16px; } }

/* Time chapter: key photo, copy and rings, phone */
.time { display: grid; grid-template-columns: .78fr 1.15fr .8fr; gap: 4vw; align-items: center; }
.keycard { position: relative; aspect-ratio: 3 / 4.1; border-radius: 24px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(0,0,0,.85); }
.keycard figcaption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 70px 24px 22px; font-family: var(--display); font-size: 27px; line-height: 1.15; color: var(--white); background: linear-gradient(transparent, rgba(18,17,16,.88)); }
.time .visual { display: grid; place-items: center; perspective: 1800px; }
.time .visual .phone { --pw: min(280px, 70vw); transform: rotateY(calc(var(--ry, 0) * 1deg)) rotateX(calc(var(--rx, 0) * 1deg)); }
.rings { display: flex; flex-wrap: wrap; gap: 26px 34px; margin-top: 36px; }
.ring { position: relative; width: 156px; text-align: center; }
.ring svg { width: 156px; height: 156px; transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; stroke-width: 6; }
.ring .track { stroke: var(--hair-2); }
.ring .arc { stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: var(--off, 0); }
.ring .arc.brass { stroke: var(--brass); filter: drop-shadow(0 0 10px rgba(201,178,122,.45)); }
.ring .arc.sage { stroke: #9ccdb0; filter: drop-shadow(0 0 10px rgba(156,205,176,.4)); }
.ring b { position: absolute; left: 0; right: 0; top: 44px; font-family: var(--display); font-weight: 300; font-size: 58px; line-height: 1; color: var(--white); font-variant-numeric: lining-nums tabular-nums; }
.ring > span { position: absolute; left: 0; right: 0; top: 104px; font-size: 12px; letter-spacing: .06em; color: var(--mute); }
.ring figcaption { margin-top: 14px; font-size: 15px; color: var(--white); }
.ring figcaption em { display: block; font-style: normal; font-size: 13px; color: var(--mute); }
.fine { margin-top: 18px; font-size: 13px; color: var(--mute); }
@media (max-width: 1000px) { .time { grid-template-columns: 1fr 1fr; } .time .visual { grid-column: 1 / -1; } }
@media (max-width: 640px) { .time { grid-template-columns: 1fr; } .keycard { aspect-ratio: 4 / 3.4; } }

/* Cash vs taxable figures */
.figures { margin-top: 34px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--hair); }
.figures div { padding: 18px 0; border-bottom: 1px solid var(--hair); }
.figures div:nth-child(odd):not(.big) { padding-left: 22px; border-left: 1px solid var(--hair); }
.figures .big { grid-column: 1 / -1; }
.figures dt { font-size: 13.5px; color: var(--mute); }
.figures dd { margin-top: 4px; font-family: var(--display); font-weight: 300; font-size: 40px; line-height: 1.05; color: var(--white); font-variant-numeric: lining-nums tabular-nums; }
.figures .big dd { font-size: clamp(54px, 6vw, 84px); color: var(--brass-2); }
.chapter .pull .pull-pre { display: block; margin-bottom: 8px; font-family: var(--display); font-size: 26px; color: var(--white-2); max-width: none; }

/* Made for the fold — one device that opens with scroll.
   The section pins for the length of .fold-track; site.js turns the left leaf from 180deg (closed, cover screen out)
   to 0deg (flat), keeps the device centred, and lights the faces as they turn. Defaults = open and flat. */
.foldsec { position: relative; }
.fold-sticky { position: relative; overflow: hidden; padding: clamp(96px, 12vw, 150px) 0 clamp(70px, 8vw, 110px); }
.fold-sticky .photo { top: -4%; bottom: -4%; transform: scale(var(--pz, 1)); transform-origin: 50% 40%; }
.fold-sticky .photo-shade { background: radial-gradient(60% 50% at 50% 58%, rgba(18,17,16,.25), rgba(18,17,16,.7) 80%), linear-gradient(180deg, rgba(18,17,16,.92) 0%, rgba(18,17,16,.5) 30%, rgba(18,17,16,.55) 75%, rgba(18,17,16,.96) 100%); }
.fold-sticky > .wrap { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.foldsec .head { text-align: center; max-width: 760px; margin: 0 auto; }
.foldsec .head .lede { margin: 0 auto; max-width: 600px; color: var(--white); opacity: .85; }
.js .fold-track { height: 280vh; }
.js .fold-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; padding: 76px 0 28px; }
.js .fold-sticky > .wrap { width: 100%; }
@media (prefers-reduced-motion: reduce) {
  .js .fold-track { height: auto; }
  .js .fold-sticky { position: relative; height: auto; padding: 110px 0 80px; }
}

.fold-stage { position: relative; margin-top: clamp(28px, 4vh, 54px); perspective: 2400px; perspective-origin: 50% 40%; display: flex; justify-content: center; }
/* Two shapes from one build. --hk = height/width of each half of the inner screen (matches its capture);
   cover captures are sized to the cover's media area, so nothing is cropped.
   tall: book-style, square-cornered (inner 960x1040, cover 0.479).  wide: passport-style, rounder (inner 1120x794, cover 0.731). */
.fold { --hk: 2.1667; --frk: .034; --wmax: 640px; --hfit: .9; --fw: min(var(--wmax), 88vw); --fb: calc(var(--fw) * .012); --fr: calc(var(--fw) * var(--frk)); --sr: calc(var(--fr) - var(--fb) * .9);
  position: relative; width: var(--fw); height: calc((var(--fw) / 2 - var(--fb)) * var(--hk) + var(--fb) * 2); transform-style: preserve-3d; }
.fold.wide { --hk: 1.4179; --frk: .05; --wmax: 780px; --hfit: 1.36; }
.js .fold { --fw: min(var(--wmax), 88vw, calc((100svh - 340px) * var(--hfit))); }
.fold-stage[data-shape="wide"] .fold.tall, .fold-stage[data-shape="tall"] .fold.wide { display: none; }
.fold-shape { display: inline-flex; gap: 4px; padding: 4px; margin-top: 22px; border: 1px solid var(--hair-2); border-radius: 999px; background: rgba(18,17,16,.5); }
.fold-shape button { font: inherit; font-size: 13.5px; color: var(--white-2); background: none; border: 0; border-radius: 999px; padding: 7px 16px; cursor: pointer; transition: background .3s var(--ease), color .3s var(--ease); }
.fold-shape button[aria-pressed="true"] { background: var(--white); color: var(--ink); font-weight: 500; }
.fold-body { position: absolute; inset: 0; transform-style: preserve-3d;
  transform: translateX(var(--shift, 0%)) rotateX(var(--frx, 4deg)) rotateY(var(--fry, -5deg)); }

/* Graphite titanium, matching the phone and iPad frames */
.fold .leaf-r, .fold .face { background: linear-gradient(150deg, #66635d 0%, #3d3b37 16%, #282725 46%, #34322e 72%, #6e695f 100%); background-size: 200% 100%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset, 0 1px 0 rgba(255, 255, 255, .13) inset; }
.fold .leaf { position: absolute; top: 0; bottom: 0; width: 50%; transform-style: preserve-3d; }
.fold .leaf-r { right: 0; background-position: 100% 0; border-radius: 0 var(--fr) var(--fr) 0; padding: var(--fb) var(--fb) var(--fb) 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset, 0 1px 0 rgba(255, 255, 255, .13) inset, 0 60px 110px -30px rgba(0, 0, 0, .9), 0 18px 40px rgba(0, 0, 0, .5); }
.fold .leaf-l { left: 0; transform-origin: 100% 50%; transform: rotateY(var(--open, 0deg)); }
.fold .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fold .face-in { background-position: 0 0; border-radius: var(--fr) 0 0 var(--fr); padding: var(--fb) 0 var(--fb) var(--fb); transform: translateZ(.5px); }
/* The cover sits on the back of the left leaf, a body's thickness behind it; when folded it faces out, spine on its left */
.fold .face-out { border-radius: calc(var(--fr) * .55) var(--fr) var(--fr) calc(var(--fr) * .55); padding: var(--fb) var(--fb) var(--fb) calc(var(--fb) * .7);
  transform: translateZ(calc(var(--fw) * -.012)) rotateY(180deg); }

.fold .scr { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--app-ink); }
.fold .leaf-r .scr { border-radius: 0 var(--sr) var(--sr) 0; }
.fold .face-in .scr { border-radius: var(--sr) 0 0 var(--sr); width: calc(100% + 1px); } /* 1px overlap: no seam when flat */
.fold .leaf-r .scr > img, .fold .face-in .scr > img { position: absolute; top: 0; height: 100%; width: calc(var(--fw) - var(--fb) * 2); max-width: none; object-fit: cover; object-position: top left; }
.fold .face-in .scr > img { left: 0; }
.fold .leaf-r .scr > img { left: auto; right: 0; }
.fold .face-out .scr { border-radius: calc(var(--sr) * .7) var(--sr) var(--sr) calc(var(--sr) * .7); display: flex; flex-direction: column; }
.fold .face-out .status { flex: none; height: 5.2%; display: flex; align-items: center; justify-content: space-between; padding: 0 8% 0 10%; color: #f0ede6;
  font-family: -apple-system, "SF Pro Text", var(--sans); font-size: calc(var(--fw) * .017); font-weight: 600; background: var(--app-ink); color: var(--app-fg); }
.fold .face-out .status svg { height: 34%; width: auto; }
.fold .face-out .status i { display: flex; gap: 3px; align-items: center; height: 100%; }
.fold .face-out .media { position: relative; flex: 1; overflow: hidden; }
.fold .face-out .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.fold .punch { position: absolute; z-index: 3; top: calc(var(--fb) + 1.3%); left: 50%; width: 2.2%; aspect-ratio: 1; border-radius: 50%; transform: translateX(-50%);
  background: radial-gradient(circle at 35% 35%, #2c3340, #040506 70%); }
.fold .leaf-r .punch { left: calc(50% - var(--fb) / 2); width: 1.6%; }

/* Light as the leaves turn: shade on the turning faces, a cast shadow on the right half, a crease that vanishes when flat */
.fold .lit, .fold .cast, .fold .crease { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.fold .face-in .lit { background: #000; opacity: var(--shade-in, 0); }
.fold .face-out .lit { background: linear-gradient(270deg, rgba(0,0,0,.2), #000); opacity: var(--shade-out, 0); }
.fold .cast { background: linear-gradient(90deg, rgba(0,0,0,.85), rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 90%); opacity: var(--cast, 0); }
.fold .crease { inset: 0 auto 0 auto; width: 5%; opacity: var(--crease, 0); }
.fold .leaf-r .crease { left: 0; background: linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,0)); }
.fold .face-in .crease { right: 0; background: linear-gradient(270deg, rgba(0,0,0,.45), rgba(0,0,0,0)); }
.fold .shadow { position: absolute; left: 50%; bottom: -6%; width: calc(var(--sw, 1) * 92%); height: 9%; border-radius: 50%;
  transform: translateX(-50%); background: radial-gradient(50% 50% at 50% 50%, rgba(0,0,0,.8), rgba(0,0,0,0) 70%); filter: blur(12px); z-index: -1; }

.fold-caps { display: grid; justify-items: center; margin-top: clamp(20px, 3vh, 40px); color: var(--white-2); font-size: 14px; text-align: center; }
.fold-caps span { grid-area: 1 / 1; transition: opacity .5s ease, transform .5s ease; }
.fold-caps b { display: block; margin-bottom: 4px; font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--white); }
.fold-track[data-state="open"] .cap-closed, .fold-track[data-state="closed"] .cap-open { opacity: 0; transform: translateY(6px); }
@media (min-width: 1000px) {
  .fold-sticky > .wrap { display: grid; grid-template-columns: 360px auto; grid-template-areas: "head stage" "caps stage"; column-gap: clamp(48px, 5.5vw, 80px); justify-content: center; align-items: center; }
  .foldsec .head { grid-area: head; text-align: left; align-self: end; margin: 0; }
  .foldsec .head .lede { margin: 0; }
  .fold-stage { grid-area: stage; margin-top: 0; }
  .fold-caps { grid-area: caps; align-self: start; justify-items: start; text-align: left; margin-top: 36px; }
  .fold { --fw: min(var(--wmax), 50vw); }
  .fold.wide { --wmax: 720px; --fw: min(var(--wmax), 46vw); }
  .js .fold { --fw: min(var(--wmax), 50vw, calc((100svh - 150px) * var(--hfit))); }
  .js .fold.wide { --fw: min(var(--wmax), 46vw, calc((100svh - 150px) * var(--hfit))); }
}

/* Compare note */
.compare-note { text-align: center; margin: 18px auto 0; font-size: 13.5px; color: var(--mute); }

/* Pre-register */
.prereg { text-align: center; }
.prereg .lede { margin-left: auto; margin-right: auto; }
.prereg::before { content: ""; position: absolute; left: 50%; top: 4%; width: 900px; height: 600px; transform: translateX(-50%); background: radial-gradient(50% 50% at 50% 50%, rgba(201,178,122,.14), rgba(201,178,122,0) 70%); pointer-events: none; }
.prereg-form { position: relative; max-width: 560px; margin: 44px auto 0; display: grid; gap: 16px; text-align: left; }
.field label, .platforms legend { display: block; font-size: 13.5px; color: var(--white-2); margin-bottom: 8px; }
.field input { width: 100%; height: 58px; padding: 0 20px; border-radius: 16px; border: 1px solid var(--hair-2); background: var(--ink-2); color: var(--white); font: inherit; font-size: 17px; font-weight: 400; transition: border-color .3s var(--ease); }
.field input::placeholder { color: var(--mute); }
.field input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(201,178,122,.18); }
.platforms { border: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.platforms legend { width: 100%; }
.platforms label { cursor: pointer; }
.platforms input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.platforms span { display: inline-block; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--hair-2); color: var(--white-2); font-size: 14.5px; transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease); }
.platforms input:checked + span { background: var(--white); color: var(--ink); border-color: var(--white); font-weight: 500; }
.platforms input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.prereg-form .cta { width: 100%; height: 58px; font-size: 16.5px; border: 0; cursor: pointer; font-family: inherit; }
.prereg-form .cta[disabled] { opacity: .6; cursor: progress; }
.form-msg { min-height: 1.4em; font-size: 15px; color: var(--white-2); max-width: none; }
.form-msg.ok { color: #a9d3b6; font-size: 17px; }
.form-msg.err { color: #e5a48f; }
.prereg-form .fine { margin-top: 0; }
.prereg-form .fine a { color: var(--brass-2); text-decoration: underline; text-underline-offset: 3px; }
.prereg .stores { justify-content: center; margin-top: 46px; }
.prereg-form.done .field, .prereg-form.done .platforms, .prereg-form.done .cta { display: none; }

/* Hero: the porch photograph gives way to a slow Higgsfield dolly once it can play */
.photo .photo-motion { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.6s ease; }
.photo .photo-motion.on { opacity: 1; }

/* ── Polish pass (independent review, 17 Oct) ── */
/* Typography: lining figures beside the big numbers, no orphaned last words */
h1, h2, h3, .eyebrow, .pull-pre, .cap b, .reel figcaption b, .fold-caps b { font-variant-numeric: lining-nums; }
p, .pull span, figcaption span, .cap span, .step p { text-wrap: pretty; }
.who p { text-wrap: balance; }
.time h2, .chapter h2 { font-size: clamp(40px, 4.6vw, 68px); }

/* Photos melt into the page instead of ending on a line */
.statement .photo-shade { background: linear-gradient(180deg, var(--ink) 0%, rgba(18,17,16,.5) 22%, rgba(18,17,16,.5) 72%, var(--ink) 100%); }

/* One vertical rhythm instead of inline paddings */
.scrolly + .pad { padding-top: clamp(60px, 8vw, 120px); }
.pad.follow { padding-top: clamp(40px, 6vw, 90px); }
.pad.tight { padding-top: 0; }

.stats-note { padding-top: 18px; }
.cap:nth-last-child(-n+2) { border-bottom: 1px solid var(--hair); }
.form-msg:empty { min-height: 0; margin-top: -16px; }

/* Compare: labels sit above the device, never on the app UI */
.compare-labels { display: flex; justify-content: space-between; align-items: center; margin: 0 1.5% 16px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--white-2); }
.compare-labels span { display: inline-flex; align-items: center; gap: 10px; }
.compare-labels span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--hair-2); }
.compare-labels .c-tag-l::before { background: var(--cmp-dark, #0e1015); }
.compare-labels .c-tag-r { flex-direction: row-reverse; }
.compare-labels .c-tag-r::before { background: var(--cmp-light, #fdfbf6); }
html[data-app-theme^="daylight"] .compare-labels { --cmp-dark: #121a16; --cmp-light: #ffffff; }
@media (max-width: 560px) {
  .compare-tabs { display: grid; grid-template-columns: 1fr 1fr; max-width: 340px; margin-inline: auto; }
  .compare-labels { font-size: 11px; }
  .themes .theme-switch, .hero-themes .theme-switch { display: grid; grid-template-columns: 1fr 1fr; border-radius: 22px; width: auto; }
  .theme-switch .ts-label { grid-column: 1 / -1; text-align: center; padding-top: 4px; }
  .trust ul { display: grid; grid-template-columns: 1fr 1fr; justify-items: start; text-align: left; gap: 12px 18px; max-width: 360px; margin: 0 auto; }
}
.fold-caps .fold-shape { grid-area: 2 / 1; }
@media (max-width: 999px) {
  .js .fold.tall { --fw: min(var(--wmax), 88vw, calc((100svh - 440px) * .8)); }
  .fold-caps { margin-top: 16px; }
  .fold-caps b { font-size: 21px; margin-bottom: 2px; }
  .fold-shape { margin-top: 14px; }
}
