/* Homepage only (index.html). Loaded after base.css. */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { line-height: 1.6; }

.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; color: var(--brown); margin: 0;
}
.eyebrow--light { color: var(--grass); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; text-align: center;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  padding: 1rem 1.9rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #4C5229; color: #fff; }

.textlink {
  font-weight: 600; color: var(--ink); text-decoration: none;
  border-bottom: 1.5px solid var(--outline); padding-bottom: 3px;
}
.textlink:hover { color: var(--brown); border-color: var(--brown); }

/* ---------- header: sticky, with section links ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(8px);
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 2rem; }
.nav a:not(.btn) { font-size: .95rem; color: var(--muted); text-decoration: none; }
.nav a:not(.btn):hover { color: var(--ink); }
.nav .btn { padding: .72rem 1.25rem; font-size: .95rem; white-space: nowrap; }
/* The header button steps aside while another "Request early access" button is on
   screen (hero, early-access section), so only one shows at a time. It collapses
   rather than just fading, so the menu links slide over instead of leaving a gap.
   js/header-cta.js adds and removes .is-tucked. */
.header-cta {
  max-width: 16rem; overflow: hidden;
  transition: opacity .2s ease, max-width .25s ease, padding .25s ease, margin .25s ease, visibility .25s;
}
.header-cta.is-tucked {
  opacity: 0; visibility: hidden; max-width: 0;
  padding-inline: 0; margin-left: -2rem; /* cancels the .nav gap it leaves behind */
}
@media (prefers-reduced-motion: reduce) { .header-cta { transition: none; } }
.label-short { display: none; }
@media (max-width: 860px) {
  .nav .nav-link { display: none; }        /* links fold away, the button stays */
  .site-header .wrap { min-height: 4.25rem; }
}
@media (min-width: 861px) { .nav a:not(.btn) { min-height: 44px; display: inline-flex; align-items: center; } }
@media (max-width: 380px) {
  .site-header .wrap { gap: .75rem; }
  .brand { gap: .45rem; }
  .brand span { font-size: 1.1rem; }
}
@media (max-width: 560px) {
  .label-long { display: none; }
  .label-short { display: inline; }
  .nav .btn { font-size: .88rem; padding: .62rem 1.05rem; }
}

/* ---------- hero ---------- */
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  padding-block: clamp(3rem, 7vw, 6rem);
}
.hero h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.1rem); line-height: 1.05;
  max-width: 15ch;
}
.hero .lede {
  margin-top: 1.5rem; font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted); max-width: 54ch;
}
.hero .actions {
  margin-top: 2.1rem; display: flex; flex-wrap: wrap;
  align-items: center; gap: 1.4rem;
}
.hero .fineprint { margin-top: 1.4rem; font-size: .92rem; color: var(--faint); }
.hero-art {
  background: var(--panel); border-radius: 20px; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
  aspect-ratio: 34 / 44;
}
.hero-art img { width: 100%; height: auto; display: block; }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  /* 300px is the size the illustration has always shown at on phones and tablets. */
  .hero-art { width: 300px; max-width: 100%; margin-inline: auto; order: 2; }
}

/* ---------- stat band ---------- */
.stats { background: var(--ink); color: var(--ground); }
.stats .wrap {
  padding-block: clamp(2.25rem, 4vw, 3.25rem);
  display: grid; grid-template-columns: 1fr; gap: 2rem;
}
/* Columns sized to their text and spread edge to edge, so the band is balanced
   instead of leaving the right side empty. */
@media (min-width: 761px) {
  .stats .wrap { grid-template-columns: repeat(3, minmax(0, max-content)); justify-content: space-between; }
}
.stat b {
  display: block; font-family: var(--serif);
  font-size: clamp(1.8rem, 2.9vw, 2.5rem); font-weight: 600; line-height: 1.1;
}
.stat span { display: block; margin-top: .5rem; font-size: .92rem; color: var(--grass); }
@media (max-width: 760px) { .stats .wrap { gap: 1.6rem; } }

/* ---------- generic section ---------- */
.section .wrap { padding-block: clamp(3.25rem, 6vw, 6rem); }
/* A section that directly follows another one: no top padding, so the gap is not doubled. */
.section--follows .wrap { padding-top: 0; }
.section h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.12; margin-top: 1.1rem; }
.section .intro { margin-top: 1.1rem; font-size: 1.08rem; color: var(--muted); max-width: 62ch; }

/* heritage: heading beside the prose */
.heritage .wrap { display: grid; grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); }
.heritage .prose p { font-size: clamp(1.02rem, 1.4vw, 1.12rem); line-height: 1.7; color: #4A4437; }
.heritage .prose p + p { margin-top: 1.25rem; }
@media (max-width: 900px) { .heritage .wrap { grid-template-columns: 1fr; gap: 1.75rem; } }

/* ---------- "What we are building" cards ---------- */
.cards { margin-top: 2.75rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: clamp(1.5rem, 2.5vw, 2.1rem);
  /* Warm-tinted shadow so the white cards sit above the sand background. */
  box-shadow: 0 1px 2px rgba(38, 34, 29, .05), 0 6px 18px -6px rgba(38, 34, 29, .10);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 4px rgba(38, 34, 29, .06), 0 18px 36px -12px rgba(38, 34, 29, .22);
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
.card h3 { font-size: 1.4rem; }
.card p { margin-top: .7rem; color: var(--muted); }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }

/* ---------- "In the lab" panel ---------- */
.lab .wrap { padding-block: 0; }
.lab .panel {
  background: var(--panel); border-radius: 20px;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 4vw, 4rem);
  /* Heading left, text right: the same two-column layout as "The name" above. */
  display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 5vw, 5rem); align-items: center;
}
@media (max-width: 900px) { .lab .panel { grid-template-columns: 1fr; gap: 1rem; } }
.lab h2 { font-size: clamp(1.7rem, 2.8vw, 2.25rem); }
.lab .panel > p { color: #4A4437; font-size: clamp(1.02rem, 1.4vw, 1.12rem); line-height: 1.7; }

/* ---------- early access + footer (one dark block) ---------- */
.foot { background: var(--ink); color: var(--ground); margin-top: clamp(3.25rem, 6vw, 6rem); }
.waitlist .wrap {
  padding-block: clamp(2.5rem, 4vw, 3.75rem);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 28rem);
  gap: clamp(2rem, 5vw, 5rem); align-items: start;
}
.waitlist h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.1; margin-top: 1.1rem; }
.waitlist .lede { margin-top: 1.25rem; font-size: 1.08rem; color: var(--muted-dark); max-width: 46ch; }
.consent { margin-top: .9rem; font-size: .88rem; color: #A09B8C; max-width: 28rem; }
@media (max-width: 900px) { .waitlist .wrap { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .waitlist-cta .btn { width: 100%; } }
/* Hairline between the early-access block and the footer, full screen width. */
.site-footer { border-top: 1px solid #3A352C; }

/* ---------- early-access pop-up (js/signup.js) ---------- */
.signup {
  width: min(30rem, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  border: none; border-radius: 20px; padding: 0;
  background: var(--ground); color: var(--ink);
  overscroll-behavior: contain;
  /* No position override: the browser's position:fixed keeps the pop-up in the
     viewport and is what the close button is pinned against. */
}
/* Tint plus blur: the page recedes without going dark, so the pop-up holds the eye. */
.signup::backdrop {
  background: rgba(38, 34, 29, .4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: backdrop-in .2s ease-out;
}
@keyframes backdrop-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .signup::backdrop { animation: none; } }
/* While the pop-up is open the page cannot scroll: close it or finish the form.
   scrollbar-gutter keeps the page from shifting sideways when the scrollbar disappears. */
html { scrollbar-gutter: stable; }
html:has(dialog.signup[open]) { overflow: hidden; }
.signup-body { padding: clamp(1.5rem, 5vw, 2.25rem); }
/* Right padding keeps the title clear of the close button pinned in the corner. */
.signup-head { padding-right: 2.5rem; }
.signup h2 { font-size: 1.75rem; line-height: 1.15; }
.signup .close {
  /* Same corner in the form and the confirmation, so it never shifts. */
  position: absolute; top: .75rem; right: .75rem; width: 44px; height: 44px;
  border: none; border-radius: 999px; background: transparent; color: var(--muted);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.signup .close:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.signup-intro { margin-top: .6rem; color: var(--muted); }
.signup form { margin-top: 1.5rem; display: grid; gap: 1.1rem; }
.signup label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .45rem; }
.signup input {
  width: 100%; height: 3.25rem; padding: 0 1.1rem;
  border: 1px solid var(--outline); border-radius: 12px; background: #fff;
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
}
.signup input:focus-visible { outline: 3px solid var(--brown); outline-offset: 1px; }
.signup .btn { width: 100%; margin-top: .3rem; }
.signup .btn[disabled] { opacity: .6; cursor: progress; }
/* Honeypot field for bots; kept out of view and out of the tab order. */
.signup .trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.signup .note { font-size: .85rem; color: var(--faint); }
.signup .status { font-size: .95rem; }
.signup .status:empty { display: none; }
.signup .status[data-kind="error"] { color: #8A2D1C; }

/* Success state: the form is swapped for a confirmation with a tick that draws itself.
   The tick is inline SVG in index.html because CSS cannot animate inside an <img>. */
.signup.is-done .signup-head h2, .signup.is-done .signup-intro, .signup.is-done form { display: none; }
.signup-done { text-align: center; padding: .25rem 0 .5rem; }
.signup-done h2 { margin-top: 1.25rem; outline: none; }
.signup-done p { margin: .6rem auto 0; max-width: 24rem; color: var(--muted); }
.signup-done .btn { margin-top: 1.6rem; min-width: 9rem; }
.tick { width: 4rem; height: 4rem; display: block; margin-inline: auto; overflow: visible; }
.tick circle { fill: var(--accent); transform-origin: center; animation: tick-pop .3s cubic-bezier(.2, .9, .3, 1.3) both; }
.tick path {
  fill: none; stroke: #FFFFFF; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 34; stroke-dashoffset: 34; animation: tick-draw .3s ease-out .2s forwards;
}
.signup-done h2, .signup-done p, .signup-done .btn { animation: done-rise .3s ease-out .3s both; }
@keyframes tick-pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes tick-draw { to { stroke-dashoffset: 0; } }
@keyframes done-rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .tick circle, .signup-done h2, .signup-done p, .signup-done .btn { animation: none; }
  .tick path { animation: none; stroke-dashoffset: 0; }
}
