/* croqi home: a film you scroll through. It opens in the atelier at night and ends on a white drawing sheet.
   The app has its own look in app.css. */
@property --draw { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --panel { syntax: '<color>'; inherits: true; initial-value: transparent; }

:root {
  --night: #0b131a;
  --paper: #f7f6f2;
  --ink: #10171c;
  --muted: #55626a;
  --muted-night: #a9b7c0;
  --navy: #234a6b;
  --navy-deep: #1b3b56;
  --line: #d9d6cd;
  --display: 'Fraunces', 'Times New Roman', serif;
  --text: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'DM Mono', ui-monospace, Menlo, monospace;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --gutter: clamp(24px, 6vw, 104px);
  /* the 16:9 film frame: covers the screen, but never grows so far that the jacket leaves a narrow one */
  --frame-w: min(max(100vw, 177.78svh), 239vw);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body.home { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--text); -webkit-font-smoothing: antialiased; }
::selection { background: var(--navy); color: #fff; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
h1, h2 { margin: 0; font-family: var(--display); font-weight: 300; font-optical-sizing: auto; letter-spacing: -.035em; text-wrap: balance; }
h2 { font-size: clamp(38px, 5.2vw, 84px); line-height: 1; }

/* ---------- nav: floats over the film, takes the colour of whatever is under it ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; gap: 28px;
  height: 72px; padding: 0 var(--gutter); color: #fff; transition: color 240ms ease, background-color 240ms ease;
}
.nav.is-ink { color: var(--ink); background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.logo { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; font: 600 22px/1 var(--text); letter-spacing: -.04em; text-decoration: none; }
.logo img { width: 28px; height: 28px; }
.nav-links { display: flex; gap: 26px; font-size: 14px; }
.nav-links a { text-decoration: none; opacity: .78; }
.nav-cta, .footer-cta { font: 500 14px/1 var(--text); text-decoration: none; white-space: nowrap; }
.nav-cta { padding: 10px 16px; border: 1px solid currentColor; border-radius: 99px; transition: transform 140ms var(--ease-out); }
.nav-cta span, .footer-cta span { display: inline-block; margin-left: 4px; transition: transform 200ms var(--ease-out); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border: 1px solid #fff; border-radius: 99px; background: #fff; color: var(--ink);
  font: 600 15px/1 var(--text); letter-spacing: 0; text-decoration: none; cursor: pointer; transition: transform 140ms var(--ease-out);
}
.btn:active, .nav-cta:active { transform: scale(.97); }

/* ---------- the film ---------- */
.film { position: relative; height: 100svh; background: var(--night); color: #fff; }
.has-film .film { height: 820vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--night); }
/* a veil for the words to sit on; it lifts when the paper arrives */
.stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: var(--veil, 1);
  background: linear-gradient(90deg, rgba(11, 19, 26, .82) 0%, rgba(11, 19, 26, .5) 34%, rgba(11, 19, 26, 0) 62%);
}
.frame { position: absolute; left: 50%; top: 50%; width: var(--frame-w); height: calc(var(--frame-w) * 9 / 16); translate: -50% -50%; }
.film-video, .film-still { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.paper { position: absolute; inset: -100vmax; background: var(--paper); clip-path: circle(0vmax at 50% 50%); }
html:not(.has-film) .paper { display: none; }

/* where the jacket lands in the film's last frame (film/geometry.json): the drawing is traced over exactly that */
.sheet { position: absolute; left: 31.98%; top: 12.04%; width: 35.99%; height: 80%; perspective: 1800px; }
.garment { position: absolute; inset: 0; transform-style: preserve-3d; }
.cutout, .layers, .layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.cutout { opacity: 0; }
.layers { transform-style: preserve-3d; color: var(--ink); }
/* two sets of the same lines: white ones drawn in the dark, ink ones that exist only where the light has reached */
.layers-night { color: #fff; }
.has-film #layers { clip-path: circle(0vmax at 50% 47.45%); }
.layer { overflow: visible; }
.layer path { stroke: currentColor; stroke-width: calc(var(--w, 1.2) * var(--unit, 1)); }
.layer-panels path { stroke: none; fill: var(--panel); }
.layer-silhouette { --w: 1.7; }
.layer-seams, .layer-buttons { --w: 1.15; }
.layer-topstitch { --w: .9; }
.layer-topstitch path { stroke-dasharray: calc(3.2 * var(--unit, 1)) calc(2.6 * var(--unit, 1)); }
.layer.draws path { stroke-dasharray: 1; stroke-dashoffset: var(--draw); }
.has-film .layers-night .layer.draws { --draw: 1; }
.has-film .layers-night .layer-topstitch { clip-path: inset(0 0 100% 0); }

.callouts {
  position: absolute; left: 74.5%; top: 30%; display: grid; gap: clamp(14px, 2.4svh, 26px); margin: 0; padding: 0; list-style: none;
  color: var(--ink); font: 400 12px/1.35 var(--mono);
}
.callouts li { position: relative; display: grid; padding-left: 58px; opacity: 0; }
.callouts li::before { content: ''; position: absolute; left: 0; top: .62em; width: 44px; height: 1px; background: currentColor; opacity: .45; }
.callouts b { font: 500 14px/1.2 var(--mono); }
.callouts span { color: var(--muted); }

.titleblock {
  position: absolute; left: -5%; right: -5%; top: 83%; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr .7fr; margin: 0;
  border: 1px solid var(--ink); color: var(--ink); opacity: 0;
}
.titleblock::before { content: ''; position: absolute; left: -1px; right: -1px; bottom: 100%; aspect-ratio: 1 / .99; border: 1px solid var(--ink); border-bottom: 0; pointer-events: none; }
.titleblock div { padding: 8px 12px; border-left: 1px solid var(--line); min-width: 0; }
.titleblock div:first-child { border-left: 0; }
.titleblock dt { font: 500 11px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.titleblock dd { margin: 2px 0 0; font: 500 13px/1.3 var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the words: one sentence per beat, cross-fading as the scroll crosses into it */
.captions { position: absolute; z-index: 2; left: var(--gutter); top: 50%; width: min(25vw, 370px); translate: 0 -50%; mix-blend-mode: difference; }
.caption {
  position: absolute; left: 0; top: 50%; width: 100%; margin: 0; translate: 0 -46%; opacity: 0; filter: blur(6px); pointer-events: none;
  font: 300 clamp(30px, 3.5vw, 56px)/1.04 var(--display); letter-spacing: -.03em; text-wrap: balance;
  transition: opacity 420ms var(--ease-out), translate 520ms var(--ease-out), filter 420ms var(--ease-out);
}
.caption.is-on { opacity: 1; translate: 0 -50%; filter: none; pointer-events: auto; }
.caption small { display: block; max-width: 29ch; margin-top: 20px; font: 400 16px/1.55 var(--text); letter-spacing: 0; color: #b4bfc6; }
/* the headline only ever sits on the dark film, so it needs no blending (which would grey its button) */
.hero-copy { mix-blend-mode: normal; }
.hero-message { width: min(46vw, 640px); }
.hero-message h1 { font-size: clamp(46px, 6.6vw, 112px); line-height: .96; }
.hero-message p { max-width: 36ch; margin: 28px 0 32px; font: 400 18px/1.55 var(--text); letter-spacing: 0; color: #dfe7ec; }
/* with no film running, the page is a still: the headline stays */
html:not(.has-film) .hero-message { opacity: 1; translate: 0 -50%; filter: none; pointer-events: auto; }

.scrollcue { position: absolute; left: 50%; bottom: 26px; z-index: 2; display: none; justify-items: center; gap: 10px; translate: -50% 0; font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #ffffffb3; }
.has-film .scrollcue { display: grid; }
.scrollcue i { display: block; width: 1px; height: 44px; background: linear-gradient(#fff, #fff0); transform-origin: top; animation: cue 1.8s var(--ease-out) infinite; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- after the film: paper ---------- */
.claim, .tools, .tariff, .faq { padding: clamp(96px, 14vw, 200px) var(--gutter) 0; }
.claim { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); align-items: start; }
.claim-body p { max-width: 46ch; margin: 0 0 22px; color: #2c363c; }
.claim-body .claim-note { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); font: 400 13px/1.6 var(--mono); color: var(--muted); }

.tools-head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); align-items: end; }
.tools-head p { max-width: 44ch; margin: 0; color: #2c363c; }
.strip { display: grid; grid-template-columns: 1.25fr .8fr 1.1fr; gap: clamp(14px, 2vw, 32px); align-items: start; margin-top: clamp(56px, 8vw, 120px); }
.strip-item { margin: 0; }
.strip-item img { width: 100%; object-fit: cover; }
.strip-a img { aspect-ratio: 5 / 4; }
.strip-b img { aspect-ratio: 3 / 4; }
.strip-c img { aspect-ratio: 4 / 3; }
.strip-b { margin-top: clamp(48px, 9vw, 150px); }
.strip-c { margin-top: clamp(20px, 4vw, 64px); }
.strip-item figcaption { max-width: 34ch; padding-top: 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.strip-item b { display: block; font: 500 16px/1.4 var(--text); color: var(--ink); }

/* a tariff sheet, the way an atelier would print one: every price visible at once, no toggle to operate */
.tariff-head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); align-items: end; margin-bottom: clamp(40px, 6vw, 88px); }
.tariff-head p { max-width: 46ch; margin: 0; color: #2c363c; }
.tariff-scroll { overflow-x: auto; }
.tariff table { width: 100%; min-width: 720px; border-collapse: collapse; text-align: left; }
.tariff thead th { padding: 0 20px 14px 0; border-bottom: 1px solid var(--ink); font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tariff thead small { margin-left: 6px; letter-spacing: .04em; text-transform: none; }
.tariff tbody th, .tariff td { padding: 30px 20px 30px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tariff tbody th { width: 30%; font: 300 clamp(28px, 3vw, 44px)/1 var(--display); letter-spacing: -.03em; }
.tariff tbody th small, .tariff td small { display: block; max-width: 30ch; margin-top: 12px; font: 400 13px/1.5 var(--text); letter-spacing: 0; color: var(--muted); }
.tariff td b { font: 300 clamp(28px, 3vw, 44px)/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums lining-nums; }
.tariff td small { font-family: var(--mono); font-size: 12px; }
.tariff td a { color: var(--navy); text-underline-offset: 3px; }
.tariff-notes { display: grid; gap: 6px; margin: 26px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }

.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(32px, 6vw, 110px); padding-bottom: clamp(96px, 14vw, 200px); }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0; font: 500 18px/1.4 var(--text); cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; font: 300 26px/1 var(--display); transition: transform 200ms var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { max-width: 62ch; margin: 0 0 26px; color: #2c363c; }

/* the page closes where it opened: the atelier at night */
.waitlist { position: relative; display: grid; align-items: end; min-height: 92svh; padding: clamp(96px, 12vw, 180px) var(--gutter); background: var(--night) url('/assets/home/film-poster.webp') center / cover no-repeat; color: #fff; isolation: isolate; }
.waitlist::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11, 19, 26, .55), rgba(11, 19, 26, .9)); }
.waitlist-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); align-items: end; }
.waitlist label { display: block; margin-bottom: 12px; font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-night); }
.waitlist-row { display: flex; gap: 10px; }
.waitlist input[type="email"] { flex: 1; min-width: 0; height: 52px; padding: 0 20px; border: 1px solid #ffffff59; border-radius: 99px; background: #ffffff14; color: #fff; font: 400 16px var(--text); caret-color: #fff; transition: border-color 160ms ease, background-color 160ms ease; }
.waitlist input[type="email"]::placeholder { color: #ffffff80; }
.waitlist input[type="email"]:focus-visible { outline: none; border-color: #fff; background: #ffffff24; }
.waitlist input[aria-invalid="true"] { border-color: #ffb4a8; }
.btn-light { min-height: 52px; }
#waitlistStatus { min-height: 1.5em; margin: 14px 0 0; font-size: 14px; }
#waitlistStatus[data-kind="error"] { color: #ffb4a8; }
#waitlistStatus[data-kind="ok"] { color: #b9e4c9; }
.waitlist-alt { margin: 6px 0 0; font-size: 14px; color: var(--muted-night); overflow-wrap: anywhere; }

.home-footer { display: flex; flex-wrap: wrap; gap: 16px 24px; justify-content: space-between; align-items: center; padding: 26px var(--gutter); background: var(--night); color: #ffffffb3; border-top: 1px solid #ffffff1f; font: 500 14px/1 var(--text); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 8px 18px; font: 400 13px/1.4 var(--text); }
.footer-legal a { color: #ffffffb3; text-decoration: none; }
.footer-legal a:hover { color: #fff; text-decoration: underline; }

/* the three pictures drift at different speeds as they cross the screen */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .strip-item img { animation: drift linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    .strip-a img { --drift: 40px; } .strip-b img { --drift: -56px; } .strip-c img { --drift: 72px; }
    @keyframes drift { from { translate: 0 var(--drift); } to { translate: 0 calc(var(--drift) * -1); } }
  }
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { opacity: 1; }
  .nav-cta:hover span, .footer-cta:hover span { transform: translate(2px, -2px); }
  .btn:hover { transform: translateY(-1px); }
  .btn:hover:active { transform: scale(.97); }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .claim, .tools-head, .tariff-head, .faq, .waitlist-inner { grid-template-columns: minmax(0, 1fr); }
  .captions { left: 24px; right: 24px; top: auto; bottom: 12svh; width: auto; translate: none; }
  .caption { top: auto; bottom: 0; translate: 0 10px; font-size: clamp(28px, 7.4vw, 40px); }
  .caption.is-on, html:not(.has-film) .hero-message { translate: 0 0; }
  .caption small { margin-top: 12px; font-size: 15px; }
  .hero-message { width: 100%; }
  .hero-message h1 { font-size: clamp(42px, 12vw, 64px); }
  .hero-message p { margin: 18px 0 22px; font-size: 16px; }
  .stage::after { background: linear-gradient(0deg, rgba(11, 19, 26, .88) 0%, rgba(11, 19, 26, .5) 36%, rgba(11, 19, 26, 0) 62%); }
  .callouts { left: 50%; top: calc(50% + 3svh); translate: -50% 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; width: 88vw; }
  .callouts b { font-size: 12px; }
  .callouts li { padding-left: 0; }
  .callouts li::before, .callouts span { display: none; }
  .captions { bottom: 8svh; }
  .titleblock { left: -40%; right: -40%; grid-template-columns: 1.4fr 1fr 1fr; }
  .titleblock div:nth-child(n + 4) { display: none; }
  .strip { grid-template-columns: minmax(0, 1fr); }
  .strip-b, .strip-c { margin-top: 0; }
  .waitlist-row { flex-direction: column; }
  .scrollcue { bottom: 14px; }
  .scrollcue i { height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .caption, .nav, .btn, .nav-cta, .faq summary::after { transition: none; }
  .scrollcue i { animation: none; }
}
