/* ============================================================
   ShedReset v4 — CB Industries craft scaffold
   Concept: the car, after the dog. Anchor: space.
   Font system: Fraunces Variable + Inter Variable (self-hosted, OFL 1.1).
   All motion honours (prefers-reduced-motion). Nothing autoplays sound.
   ============================================================ */

/* --- Fonts (self-hosted; Google Fonts CDN not called) --- */
@font-face {
  font-family: 'Fraunces Variable';
  src: url('fonts/Fraunces-VF.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces Variable';
  src: url('fonts/Fraunces-Italic-VF.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Variable';
  src: url('fonts/Inter-VF.woff2') format('woff2-variations');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--on-surface);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  padding: .5rem 1rem; background: var(--surface-alt); color: var(--on-surface);
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --- Layout primitives --- */
.wrap {
  width: min(1180px, 100% - 2 * var(--space-3));
  margin-inline: auto;
}

/* --- Nav --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  padding: var(--space-3) 0;
  mix-blend-mode: difference;
  pointer-events: none;
}
.nav__inner {
  width: min(1180px, 100% - 2 * var(--space-3));
  margin-inline: auto;
  display: flex; justify-content: space-between; align-items: center;
  pointer-events: auto;
}
.nav__brand {
  display: inline-flex; align-items: center; gap: .5rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.nav__brand svg { color: currentColor; }
.nav__sound {
  color: #fff;
  font-size: .78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: .5rem .75rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  transition: opacity var(--motion-quick) var(--motion-ease-out-quart);
  opacity: 0.72;
}
.nav__sound:hover { opacity: 1; }
.nav__sound[aria-pressed="true"] { background: currentColor; color: var(--surface); }

/* ============================================================
   HERO — the crafted moment.
   Type reveals from heavy/condensed ("shed" state, dense like a coat
   of fur) to light/lofted ("reset" state) via variable-font animation.
   Fraunces variable axes used: wght (300-700), opsz (9-144), SOFT
   (available in the file but not needed here).
   Duration ~4s from load, once. Repeats on hover of the title.
   Reduced-motion: static end-state only, no animation.
   ============================================================ */

.hero {
  min-height: 100dvh;
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  padding: var(--space-8) var(--space-3) var(--space-6);
  background: var(--surface);
  isolation: isolate;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 720px at 22% 32%, rgba(200, 106, 75, 0.09), transparent 68%),
    radial-gradient(900px 540px at 78% 78%, rgba(30, 47, 38, 0.55), transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.hero__inner {
  position: relative;
  z-index: 2;
  width: min(1180px, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Line 1: eyebrow */
.hero__eyebrow {
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  display: inline-flex; align-items: center; gap: .75rem;
}
.hero__eyebrow::before {
  content: "";
  width: 2.5rem; height: 1px;
  background: var(--on-surface-muted);
}

/* Line 2: the wordmark that morphs */
.hero__title {
  font-family: var(--font-display);
  font-size: var(--step-7);
  line-height: 0.86;
  letter-spacing: -0.03em;
  color: var(--on-surface);
  margin: 0;
  /* Custom variable-font axes as CSS variables so we can animate them. */
  --wght: 620;
  --opsz: 24;
  --soft: 30;
  font-variation-settings:
    "wght" var(--wght),
    "opsz" var(--opsz),
    "SOFT" var(--soft);
  /* The reveal happens by animating the CSS variables. */
  animation: shed-reset 4400ms var(--motion-ease-out-expo) 260ms 1 both;
  cursor: default;
}
.hero__title .accent {
  color: var(--accent);
  font-style: italic;
}
.hero__title .accent-warm {
  color: var(--on-surface-muted);
  font-weight: inherit;
}
.hero__title:hover {
  animation: shed-reset 4400ms var(--motion-ease-out-expo) 0ms 1 both;
}

@property --wght { syntax: '<number>'; inherits: true; initial-value: 620; }
@property --opsz { syntax: '<number>'; inherits: true; initial-value: 24; }
@property --soft { syntax: '<number>'; inherits: true; initial-value: 30; }

@keyframes shed-reset {
  0%   { --wght: 620; --opsz: 24;  --soft: 30;  letter-spacing: -0.015em; filter: blur(0.5px); opacity: 0.72; }
  18%  { --wght: 620; --opsz: 24;  --soft: 30;  letter-spacing: -0.015em; filter: blur(0);   opacity: 1; }
  46%  { --wght: 540; --opsz: 60;  --soft: 60;  letter-spacing: -0.028em; }
  76%  { --wght: 380; --opsz: 128; --soft: 90;  letter-spacing: -0.038em; }
  100% { --wght: 320; --opsz: 144; --soft: 100; letter-spacing: -0.042em; }
}

/* Line 3: caption */
.hero__caption {
  max-width: 40ch;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-style: italic;
  font-weight: 400;
  line-height: 1.35;
  color: var(--on-surface-muted);
  margin: 0;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
}
.hero__meta > * { display: inline-flex; align-items: center; gap: .5rem; }
.hero__meta strong { font-weight: 500; color: var(--on-surface); letter-spacing: 0.14em; }

/* CTA */
.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  padding: 0.9rem 1.25rem 0.9rem 1.5rem;
  border: 1px solid var(--keyline);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-surface);
  align-self: flex-start;
  transition: background var(--motion-quick), border-color var(--motion-quick), color var(--motion-quick);
}
.hero__cta:hover {
  background: var(--on-surface);
  color: var(--surface);
  border-color: var(--on-surface);
}
.hero__cta__arrow {
  width: 24px; height: 1px; background: currentColor;
  position: relative;
}
.hero__cta__arrow::after {
  content: ""; position: absolute; right: 0; top: 50%;
  width: 8px; height: 8px;
  border-right: 1px solid currentColor;
  border-top: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

/* ============================================================
   Marker line — scroll indicator + spatial anchor.
   ============================================================ */
.scrollhint {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-4);
  z-index: 3;
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 720px) { .scrollhint { display: none; } }
.scrollhint::after {
  content: "";
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--on-surface-muted), transparent);
  animation: scrollhint 2400ms var(--motion-ease-out-quart) infinite;
}
@keyframes scrollhint {
  0%,10%  { transform: scaleY(0); transform-origin: top; }
  60%     { transform: scaleY(1); transform-origin: top; }
  61%     { transform-origin: bottom; }
  100%    { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================================================
   Manifesto — pinned scroll section.
   Each line reveals its own opsz + weight interpolation as it
   enters the viewport (uses IntersectionObserver + CSS variables).
   ============================================================ */
.manifesto {
  background: var(--surface);
  padding: var(--space-9) 0;
  position: relative;
}
.manifesto__inner {
  width: min(880px, 100% - 2 * var(--space-3));
  margin-inline: auto;
}
.manifesto__label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  margin: 0 0 var(--space-4);
}
.manifesto__lines {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.manifesto__line {
  font-family: var(--font-display);
  font-size: var(--step-5);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--on-surface-muted);
  --wght: 400;
  --opsz: 72;
  font-variation-settings: "wght" var(--wght), "opsz" var(--opsz), "SOFT" 50;
  transition:
    color 900ms var(--motion-ease-out-expo),
    --wght 900ms var(--motion-ease-out-expo),
    --opsz 900ms var(--motion-ease-out-expo);
}
.manifesto__line.-in {
  color: var(--on-surface);
  --wght: 560;
  --opsz: 96;
}
.manifesto__line em { font-style: italic; color: var(--accent); }

/* ============================================================
   Object study — the tool. Big generous imagery, no motion.
   ============================================================ */
.study {
  background: var(--surface-alt);
  padding: var(--space-8) 0;
  color: var(--on-surface);
}
.study__grid {
  width: min(1180px, 100% - 2 * var(--space-3));
  margin-inline: auto;
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .study__grid { grid-template-columns: 5fr 4fr; align-items: center; }
}
.study__copy h2 {
  font-family: var(--font-display);
  font-size: var(--step-5);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.028em;
  margin: 0 0 var(--space-3);
  --wght: 420;
  --opsz: 96;
  font-variation-settings: "wght" var(--wght), "opsz" var(--opsz);
}
.study__copy h2 em { font-style: italic; color: var(--accent-warm); }
.study__copy p {
  font-family: var(--font-body);
  font-size: var(--step-2);
  line-height: 1.5;
  color: var(--on-surface-muted);
  max-width: 42ch;
}
.study__object {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface);
}
.study__object img {
  width: 100%; height: 100%; object-fit: cover;
}
.study__object figcaption {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  right: var(--space-3);
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--on-surface);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* ============================================================
   Waitlist section.
   ============================================================ */
.waitlist {
  background: var(--surface);
  padding: var(--space-9) 0;
  color: var(--on-surface);
}
.waitlist__inner {
  width: min(760px, 100% - 2 * var(--space-3));
  margin-inline: auto;
  text-align: center;
}
.waitlist__label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  margin: 0 0 var(--space-3);
}
.waitlist__title {
  font-family: var(--font-display);
  font-size: var(--step-5);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-4);
  --wght: 380;
  --opsz: 120;
  font-variation-settings: "wght" var(--wght), "opsz" var(--opsz);
}
.waitlist__title em { font-style: italic; color: var(--accent); }
.waitlist__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: stretch;
  margin: var(--space-4) auto 0;
  max-width: 480px;
}
.waitlist__field {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--keyline);
  transition: border-color var(--motion-quick);
}
.waitlist__field:focus-within { border-color: var(--on-surface); }
.waitlist__field input {
  flex: 1;
  min-width: 0;
  padding: 0.9rem 0.5rem;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: var(--step-1);
}
.waitlist__field input::placeholder { color: var(--on-surface-muted); }
.waitlist__field button {
  padding: 0.9rem 1rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-surface);
  transition: color var(--motion-quick);
}
.waitlist__field button:hover { color: var(--accent-warm); }
.waitlist__consent {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--on-surface-muted);
  line-height: 1.5;
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  text-align: left;
}
.waitlist__consent input {
  margin-top: 0.28em;
  accent-color: var(--accent);
}
.waitlist__consent a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--on-surface-muted); }
.waitlist__status {
  margin-top: var(--space-2);
  font-family: var(--font-body);
  font-size: 0.86rem;
  min-height: 1.2em;
  color: var(--on-surface-muted);
}
.waitlist__status.-ok { color: var(--accent-warm); }
.waitlist__status.-err { color: var(--accent); }

/* Path B: display-only "waitlist opens soon" state (Resolution #009) */
.waitlist__soon {
  max-width: 560px;
  margin: var(--space-3) auto 0;
  text-align: center;
  font-family: var(--font-body);
  color: var(--on-surface);
}
.waitlist__soon-line {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  font-weight: 500;
  color: var(--on-surface);
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
}
.waitlist__soon-sub {
  font-size: 0.92rem;
  color: var(--on-surface-muted);
  line-height: 1.55;
  margin: 0 0 var(--space-1);
}
.linkbutton {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--on-surface);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--on-surface-muted);
  text-decoration-thickness: 1px;
}
.linkbutton:hover { color: var(--accent-warm); text-decoration-color: var(--accent-warm); }
.linkbutton:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   Footer — legal, colophon, credits.
   ============================================================ */
.foot {
  background: var(--surface);
  padding: var(--space-6) 0 var(--space-4);
  border-top: 1px solid var(--line);
}
.foot__inner {
  width: min(1180px, 100% - 2 * var(--space-3));
  margin-inline: auto;
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--on-surface-muted);
}
@media (min-width: 720px) {
  .foot__inner { grid-template-columns: 1fr 1fr 1fr; }
}
.foot h3 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--on-surface);
  margin: 0 0 var(--space-2);
  letter-spacing: 0;
}
.foot ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.foot a { text-decoration: none; transition: color var(--motion-quick); }
.foot a:hover { color: var(--on-surface); }
.foot__bottom {
  width: min(1180px, 100% - 2 * var(--space-3));
  margin: var(--space-5) auto 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================================
   Contact dialog — same as v3, restyled.
   ============================================================ */
dialog.contact {
  border: 0;
  padding: 0;
  background: var(--surface-alt);
  color: var(--on-surface);
  width: min(560px, 92vw);
  max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.5), 0 0 0 1px var(--keyline);
}
dialog.contact::backdrop { background: rgba(0,0,0,0.65); backdrop-filter: blur(6px); }
.contact__body { padding: var(--space-5); }
.contact__body h2 {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 400;
  margin: 0 0 var(--space-1);
  --wght: 420;
  --opsz: 60;
  font-variation-settings: "wght" var(--wght), "opsz" var(--opsz);
}
.contact__body p {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--on-surface-muted);
  margin: 0 0 var(--space-3);
}
.contact__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.contact__form label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  margin-bottom: 0.25rem;
}
.contact__form input,
.contact__form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--keyline);
  border-radius: 3px;
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: var(--step-1);
  transition: border-color var(--motion-quick);
}
.contact__form input:focus,
.contact__form textarea:focus { border-color: var(--on-surface); outline: 0; }
.contact__form textarea { min-height: 100px; resize: vertical; }
.contact__actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: var(--space-2);
}
.contact__actions button {
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--keyline);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background var(--motion-quick), color var(--motion-quick);
}
.contact__actions button[type="submit"] { background: var(--on-surface); color: var(--surface); border-color: var(--on-surface); }
.contact__actions button[type="submit"]:hover { background: var(--accent-warm); border-color: var(--accent-warm); }
.contact__actions button[value="cancel"]:hover { background: rgba(245,239,230,0.06); }

/* ============================================================
   Reduced motion — a hard reset (Statute Gate 3 static state).
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero__title, .study__copy h2, .waitlist__title, .manifesto__line, .contact__body h2 {
    animation: none !important;
    transition: none !important;
    --wght: 420;
    --opsz: 96;
    font-variation-settings: "wght" 420, "opsz" 96;
  }
  .scrollhint::after { animation: none; transform: scaleY(1); }
  .manifesto__line.-in { --wght: 560; --opsz: 96; }
}

/* Mobile refinement */
@media (max-width: 720px) {
  .hero { min-height: 92dvh; padding-top: var(--space-7); padding-bottom: var(--space-5); }
  .hero__title { font-size: clamp(3.6rem, 14vw, 6rem); }
  .hero__meta { flex-direction: column; gap: var(--space-1); font-size: 0.72rem; }
  .manifesto__line { font-size: clamp(1.9rem, 8vw, 3.6rem); }
  .study { padding: var(--space-6) 0; }
  .study__copy h2, .waitlist__title { font-size: clamp(2.4rem, 10vw, 4rem); }
  .nav__sound { font-size: 0.68rem; padding: 0.4rem 0.6rem; }
}
