/* =========================================================
   Daydream Hall, version B.
   A light, quiet page around a single 3D object.
   ========================================================= */

/* ---------- colours: the only place colours are defined ---------- */
:root {
  --paper: #F2F1EE;          /* page background, every section */
  --ink: #0E0E0E;            /* text */
  --ink-soft: rgba(14, 14, 14, 0.56);
  --rule: rgba(14, 14, 14, 0.16);
  --accent: var(--ink);      /* raspberry accent goes here later */

  /* 3D logo (read by js/hero3d.js) */
  --logo-3d-ink: #141414;
  --logo-3d-shadow: #0E0E0E;
  --logo-3d-light: #FFFFFF;
  --logo-3d-fill: #F2F1EE;
}

/* ---------- type and spacing ---------- */
:root {
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Space Mono", ui-monospace, Menlo, monospace;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-s: 10px;              /* labels, nav, captions */
  --ls-s: 0.18em;

  --margin: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 768px) {
  :root { --fs-s: 11px; --margin: 32px; }
}
@media (min-width: 1200px) {
  :root { --margin: 44px; }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-width: none;          /* hidden scrollbars, scrolling still works */
  -ms-overflow-style: none;
}
html::-webkit-scrollbar, *::-webkit-scrollbar { display: none; width: 0; height: 0; }
* { scrollbar-width: none; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 5px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 10px 14px; background: var(--ink); color: var(--paper);
  font-family: var(--f-mono); font-size: var(--fs-s); letter-spacing: var(--ls-s); text-transform: uppercase;
  transform: translateY(-200%); transition: transform 300ms var(--ease);
}
.skip-link:focus { transform: none; }

/* small uppercase mono: the voice of everything that is not the 3D object */
.label,
.nav__list a,
.hero__caption,
.hero__meta,
.hero__vertical {
  font-family: var(--f-mono);
  font-size: var(--fs-s);
  font-weight: 400;
  letter-spacing: var(--ls-s);
  text-transform: uppercase;
  line-height: 1.6;
}

/* ---------- paper grain, above everything including the 3D canvas ---------- */
.grain {
  position: fixed; inset: -50%;
  z-index: 60;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* ---------- nav ---------- */
.nav {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 40;
  padding: 22px var(--margin) 0;
}
.nav__list {
  display: flex; justify-content: space-between; align-items: center;
}
.nav__list a { position: relative; display: inline-block; padding: 6px 0; }
.nav__list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 600ms var(--ease);
}
.nav__list a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta { font-weight: 700; }
.only-wide { display: none; }
@media (min-width: 768px) {
  .nav { padding-top: 28px; }
  /* like the reference: links spread across the middle, the corners left quiet */
  .nav__list { padding: 0 12%; }
  .only-wide { display: inline; }
  .only-narrow { display: none; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
}

/* the 3D scene: full hero, under the UI and under the grain */
.hero__gl { position: absolute; inset: 0; z-index: 1; }
.hero3d__canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }

/* the box the 3D logo is placed on: centred, the only large element */
.hero__logo {
  position: absolute;
  z-index: 0;
  left: 50%; top: 44%;
  width: min(66vw, 47vh);
  aspect-ratio: 716 / 650;
  transform: translate(-50%, -50%);
}
/* no WebGL: the flat logo, slightly turned */
.hero.no-gl .hero__logo {
  z-index: 2;
  background: url("../assets/dh-monogram.svg") center / contain no-repeat;
  transform: translate(-50%, -50%) rotate(-6deg);
}

/* the two large, simple elements at the edges */
.hero__mark,
.hero__count {
  position: absolute;
  z-index: 2;
  top: 71%;
  font-family: var(--f-display);
  font-weight: 500;
  font-stretch: 62.5%;
  font-size: clamp(64px, min(12vw, 19vh), 190px);
  line-height: 0.8;
  letter-spacing: -0.01em;
  transform: translateY(-50%);
}
.hero__mark { left: var(--margin); }
.hero__count {
  right: var(--margin);
  display: flex; align-items: center; gap: 0.12em;
}
.hero__rule {
  display: block;
  width: 0.52em; height: max(2px, 0.022em);
  background: currentColor;
  margin-top: 0.02em;
}

/* vertical label on the right edge, read top to bottom */
.hero__vertical {
  position: absolute;
  z-index: 2;
  right: var(--margin);
  top: 17%;
  writing-mode: vertical-rl;
  display: flex; align-items: center; gap: 14px;
}
.hero__vertical::after {
  content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor;
  margin-top: 6px;
}

/* thin bottom bar */
.hero__bar {
  position: absolute;
  z-index: 2;
  left: var(--margin); right: var(--margin); bottom: 22px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 16px;
}
.hero__caption { display: flex; flex-direction: column; }
.hero__caption span:first-child { font-weight: 700; }
.hero__wordmark {
  font-family: var(--f-display);
  font-weight: 900;
  font-stretch: 62.5%;
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero__meta {
  justify-self: end;
  display: flex; align-items: center; gap: 22px;
}
.lang { display: inline-flex; gap: 6px; }
.lang__btn { letter-spacing: inherit; text-transform: inherit; opacity: 0.4; transition: opacity 400ms var(--ease); }
.lang__btn[aria-pressed="true"], .lang__btn:hover { opacity: 1; }

/* phones: the side elements sit below the logo, the bar stacks */
@media (max-width: 767px) {
  .hero__logo { top: 40%; }
  .hero__mark, .hero__count { top: 67%; font-size: clamp(56px, 19vw, 84px); }
  .hero__vertical { top: 12%; right: 12px; }
  .hero__bar {
    bottom: 18px;
    grid-template-columns: 1fr;
    grid-template-areas: "word" "caption" "meta";
    row-gap: 14px;
  }
  .hero__wordmark { grid-area: word; justify-self: center; font-size: 17px; margin-bottom: 8px; }
  .hero__caption { grid-area: caption; letter-spacing: 0.12em; padding-top: 14px; border-top: 1px solid var(--rule); }
  .hero__meta { grid-area: meta; justify-self: stretch; justify-content: space-between; letter-spacing: 0.12em; }
}
@media (min-width: 768px) {
  .hero__wordmark { font-size: 21px; }
  .hero__logo { width: min(54vw, 47vh); }
}

/* ---------- the intro: UI waits while the pieces drift, then fades in around them ---------- */
.ui { transition: opacity 1600ms var(--ease), transform 1600ms var(--ease); }
.hero-intro .ui { opacity: 0; }
.hero-intro .hero__bar { transform: translateY(8px); }
.hero__mark.ui, .hero__count.ui { transition-delay: 150ms; }
.hero__vertical.ui { transition-delay: 300ms; }
.hero__bar.ui { transition-delay: 420ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-intro .ui { opacity: 1; transform: none; }
}

/* =========================================================
   Sections: the same restraint as the hero.
   Three sizes per section: --fs-s labels, .heading, .body.
   ========================================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 20px;
  padding: 0 var(--margin);
}
.grid > * { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 1200px) { .grid { column-gap: 24px; } }

.sec {
  position: relative;
  padding: clamp(112px, 17vh, 200px) 0;
}
.sec[data-section]::before,
.waitlist::before {
  content: "";
  position: absolute; top: 0;
  left: var(--margin); right: var(--margin);
  height: 1px; background: var(--rule);
}
/* corner labels, like the reference */
.sec__corner {
  position: absolute; top: 24px;
  left: var(--margin); right: var(--margin);
  display: flex; justify-content: space-between;
  font-family: var(--f-mono); font-size: var(--fs-s);
  letter-spacing: var(--ls-s); text-transform: uppercase;
}
.sec__corner span:first-child { font-weight: 700; }

.heading {
  margin: 0;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: clamp(22px, 2.3vw, 34px);
  line-height: 1.28;
  letter-spacing: -0.016em;
  max-width: 24ch;
}
.body {
  font-family: var(--f-body);
  font-size: clamp(16px, 1.1vw, 17.5px);
  line-height: 1.7;
  max-width: 52ch;
}
.body--strong { font-weight: 500; }
.body + .body { margin-top: 18px; }
.strong { font-weight: 700; }

/* quiet text link with a drawn arrow: the only call to action style */
.link-cta {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 10px 0 9px;
  border-bottom: 1px solid currentColor;
  font-family: var(--f-mono); font-size: var(--fs-s); font-weight: 700;
  letter-spacing: var(--ls-s); text-transform: uppercase; line-height: 1;
  cursor: pointer;
}
.arrow { position: relative; display: inline-block; width: 22px; height: 1px; background: currentColor; transition: width 600ms var(--ease); }
.arrow::after {
  content: ""; position: absolute; right: 0; top: -3px; width: 6px; height: 6px;
  border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg);
}
.link-cta:hover .arrow { width: 36px; }
button.link-cta[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- intro (after the hero) ---------- */
.intro { text-align: center; padding-top: clamp(120px, 20vh, 220px); }
.intro__label { margin-bottom: 36px; }
.intro__text { margin: 0 auto; max-width: 34ch; }
.intro__cta { margin-top: 44px; }

/* ---------- 02 problem ---------- */
.problem__title { margin-bottom: 48px; }
@media (min-width: 900px) {
  .problem__title { grid-column: 2 / span 5; margin: 0; }
  .problem__body { grid-column: 8 / span 4; padding-top: 6px; }
}

/* ---------- 03 how it works ---------- */
.how__sub { margin-top: 16px; }
.steps { list-style: none; margin: 64px 0 0; padding: 0; display: grid; gap: 44px; }
.step { border-top: 1px solid var(--rule); padding-top: 22px; }
.step__num { display: block; margin-bottom: 26px; font-family: var(--f-mono); font-size: var(--fs-s); font-weight: 700; letter-spacing: var(--ls-s); }
.step__title { margin: 0 0 10px; font-family: var(--f-body); font-weight: 500; font-size: clamp(16px, 1.1vw, 17.5px); line-height: 1.5; }
.step__body { font-size: clamp(16px, 1.1vw, 17.5px); line-height: 1.7; color: var(--ink-soft); max-width: 36ch; }
@media (min-width: 900px) {
  .how__head { grid-column: 2 / span 5; }
  .steps { grid-column: 2 / span 10; grid-template-columns: repeat(3, 1fr); column-gap: 24px; margin-top: 12vh; }
}

/* ---------- 04 the idea ---------- */
.idea__piece { margin: 0 0 48px; width: min(42vw, 180px); }
.idea__piece img { display: block; width: 100%; height: auto; }
.idea__copy .heading { margin-bottom: 28px; }
.idea__copy .link-cta { margin-top: 36px; }
@media (min-width: 900px) {
  .idea__piece { grid-column: 2 / span 3; align-self: center; width: min(100%, 220px); margin: 0; }
  .idea__copy { grid-column: 7 / span 5; }
}

/* ---------- 05 about ---------- */
.about__photo { margin: 0 0 48px; width: min(56vw, 240px); }
.about__frame {
  aspect-ratio: 1 / 1;
  background: rgba(14, 14, 14, 0.05);
  overflow: hidden;
  margin-bottom: 14px;
}
.about__frame img { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.about__copy .heading { margin-bottom: 28px; }
.facts { margin-top: 40px; border-top: 1px solid var(--rule); }
.facts li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 900px) {
  .about__photo { grid-column: 2 / span 3; align-self: start; width: 100%; max-width: 260px; margin: 0; }
  .about__copy { grid-column: 7 / span 5; }
}

/* ---------- 06 faq ---------- */
.faq__title { margin-bottom: 40px; }
@media (min-width: 900px) {
  .faq__title { grid-column: 2 / span 3; margin: 0; }
  .faq__list { grid-column: 6 / span 6; }
}
.faq__item { border-top: 1px solid var(--rule); }
.faq__item:last-child { border-bottom: 1px solid var(--rule); }
.faq__q { margin: 0; font: inherit; }
.faq__btn {
  width: 100%;
  display: grid; grid-template-columns: 40px 1fr 16px; gap: 10px; align-items: baseline;
  padding: 22px 0; text-align: left;
}
.faq__n { font-family: var(--f-mono); font-size: var(--fs-s); letter-spacing: 0.1em; }
.faq__text { font-family: var(--f-body); font-weight: 500; font-size: clamp(16px, 1.1vw, 17.5px); line-height: 1.5; }
.faq__icon { position: relative; width: 11px; height: 11px; align-self: center; justify-self: end; }
.faq__icon::before, .faq__icon::after {
  content: ""; position: absolute; left: 0; top: 50%; width: 11px; height: 1px; background: currentColor;
  transition: transform 600ms var(--ease);
}
.faq__icon::after { transform: rotate(90deg); }
.faq__btn[aria-expanded="true"] .faq__icon::after { transform: rotate(0deg); }
.faq__btn:focus-visible { outline-offset: -1px; }
.faq__a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 700ms var(--ease); }
.faq__a.is-open { grid-template-rows: 1fr; }
.faq__a-inner { overflow: hidden; }
.faq__a p { padding: 0 26px 26px 50px; font-size: clamp(16px, 1.1vw, 17.5px); line-height: 1.7; color: var(--ink-soft); max-width: 60ch; }

/* ---------- waitlist form ---------- */
.waitlist:focus { outline: none; }
.waitlist__head { margin-bottom: 56px; }
.waitlist__head .heading { margin-bottom: 18px; }
@media (min-width: 900px) {
  .waitlist__head { grid-column: 2 / span 4; margin: 0; }
  .waitlist__body { grid-column: 7 / span 5; }
}
.form { display: grid; grid-template-columns: 1fr; column-gap: 24px; row-gap: 30px; align-items: end; }
@media (min-width: 600px) {
  .form { grid-template-columns: 1fr 1fr; }
  .checks, .form__actions { grid-column: 1 / -1; }
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--f-mono); font-size: var(--fs-s); letter-spacing: var(--ls-s); text-transform: uppercase; line-height: 1.5; }
.field__opt { opacity: 0.55; }
.field input, .field select {
  width: 100%;
  appearance: none; -webkit-appearance: none;
  border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
  font-family: var(--f-body); font-size: 17px; line-height: 1.3;
  padding: 8px 0 9px;
}
.field input:focus, .field select:focus { outline: none; border-bottom-width: 2px; padding-bottom: 8px; }
.field input[type="number"] { -moz-appearance: textfield; }
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.select { position: relative; }
.select::after {
  content: ""; position: absolute; right: 3px; top: 50%; width: 6px; height: 6px;
  border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  transform: translateY(-75%) rotate(45deg); pointer-events: none;
}
.field select { padding-right: 24px; cursor: pointer; }
.field select:invalid { color: var(--ink-soft); }
.field__err { min-height: 1em; font-family: var(--f-mono); font-size: var(--fs-s); letter-spacing: 0.04em; line-height: 1.4; }
.field.is-invalid input, .field.is-invalid select { border-bottom-style: dashed; }

.checks { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.check { position: relative; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 15px; line-height: 1.45; }
.check input { position: absolute; opacity: 0; width: 16px; height: 16px; margin: 0; }
.check__box { flex: none; position: relative; width: 16px; height: 16px; border: 1px solid var(--ink); margin-top: 2px; transition: background-color 300ms var(--ease); }
.check__box::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
  border-right: 1.5px solid var(--paper); border-bottom: 1.5px solid var(--paper);
  transform: rotate(45deg) scale(0); transition: transform 300ms var(--ease);
}
.check input:checked + .check__box { background: var(--ink); }
.check input:checked + .check__box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 1px solid var(--ink); outline-offset: 3px; }
.check a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 8px; }
.form__success { border-top: 1px solid var(--rule); padding-top: 28px; }
.form__success:focus { outline: none; }

/* spam trap field: off screen, never seen or focused by people */
.trap { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer: a quiet bar, like the hero's ---------- */
.footer { padding: 0 var(--margin) 22px; }
.footer__bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px;
  padding-top: 26px; border-top: 1px solid var(--rule);
}
.footer__caption { display: flex; flex-direction: column; }
.footer__wordmark {
  font-family: var(--f-display); font-weight: 900; font-stretch: 62.5%;
  font-size: 21px; line-height: 1; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap;
}
.footer__meta { justify-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 22px; }
.footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer__copy { margin-top: 28px; text-align: center; color: var(--ink-soft); }
@media (max-width: 767px) {
  .footer__bar { grid-template-columns: 1fr; grid-template-areas: "word" "caption" "meta"; row-gap: 22px; }
  .footer__wordmark { grid-area: word; justify-self: center; font-size: 17px; }
  .footer__caption { grid-area: caption; }
  .footer__meta { grid-area: meta; justify-self: start; justify-content: flex-start; }
}

/* ---------- scroll reveal: slow and quiet ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 1100ms var(--ease), transform 1100ms var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- legal placeholder pages ---------- */
.doc__nav { display: flex; justify-content: space-between; align-items: center; padding: 26px var(--margin); }
.doc__main { padding: 18vh var(--margin) 120px; max-width: 720px; margin: 0 auto; }
.doc__label { margin-bottom: 32px; }
.doc__alt { color: var(--ink-soft); margin-bottom: 36px; }
