/* Terrathink — site styles
   Tokens come from the brand: navy ink on cream paper, the leaf green of the logo's dot,
   Gloock for display, Barlow for reading. */

:root {
  --paper: #FFEDD5;
  --paper-deep: #F5DDBF;
  --ink: #1E3D51;
  --ink-soft: rgba(30, 61, 81, 0.78);
  --ink-line: rgba(30, 61, 81, 0.2);
  --night: #1E3D51;
  --night-deep: #172F3F;
  --cream-soft: rgba(255, 237, 213, 0.78);
  --cream-line: rgba(255, 237, 213, 0.45);
  --leaf: #3F8A4F;
  --error-on-night: #FFB3A1;
  --error-on-paper: #A3341C;

  --display: "Gloock", "Iowan Old Style", Georgia, serif;
  --text: "Barlow", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 72px);
  --radius-field: 14px;
  --radius-pill: 999px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 400; }

:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; }

.skip {
  position: absolute; left: var(--gutter); top: -100px;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius-pill);
  text-decoration: none; z-index: 10;
}
.skip:focus { top: 16px; }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--gutter);
}
.brand { display: inline-block; line-height: 0; }
.brand img { height: clamp(26px, 2.6vw, 34px); width: auto; }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px;
  border-radius: var(--radius-pill);
  font: 500 0.9375rem/1 var(--text);
  text-decoration: none; white-space: nowrap;
  background: var(--ink); color: var(--paper);
  transition: background-color .2s ease;
}
.pill:hover { background: #163246; }
.pill-short { display: none; }

/* Field Notes, Tools and For teachers sit beside the waitlist as quiet outlined buttons: same height
   and type as the pill but no fill, so the waitlist stays the strongest thing in the header. */
.site-header { position: relative; }
.site-nav { display: flex; align-items: center; gap: clamp(10px, 1.2vw, 16px); }
.nav-menu { display: flex; align-items: center; gap: clamp(10px, 1.2vw, 16px); }
.nav-link, .nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  border: 1px solid rgba(30, 61, 81, 0.38);
  border-radius: var(--radius-pill);
  font: 500 0.9375rem/1 var(--text);
  color: var(--ink);
  text-decoration: none; white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease;
}
.nav-link:hover, .nav-toggle:hover { border-color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--paper-deep); border-color: transparent; }

/* The Menu button only exists once the script has run (it adds .has-menu to the header). */
.nav-toggle { display: none; gap: 10px; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.nav-toggle-icon { position: relative; width: 16px; height: 10px; }
.nav-toggle-icon::before, .nav-toggle-icon::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; border-radius: 1px;
  background: currentColor; transition: transform .2s ease, top .2s ease;
}
.nav-toggle-icon::before { top: 1.5px; }
.nav-toggle-icon::after { top: 7px; }
.menu-open .nav-toggle { background: var(--paper-deep); border-color: transparent; }
.menu-open .nav-toggle-icon::before, .menu-open .nav-toggle-icon::after { top: 4.25px; }
.menu-open .nav-toggle-icon::before { transform: rotate(45deg); }
.menu-open .nav-toggle-icon::after { transform: rotate(-45deg); }

/* Phones and small tablets: the three links fold into a panel under the header. */
@media (max-width: 900px) {
  .site-nav { flex-wrap: wrap; justify-content: flex-end; }
  .nav-menu { flex-wrap: wrap; justify-content: flex-end; }
  .has-menu .site-nav { flex-wrap: nowrap; }
  .has-menu .nav-toggle { display: inline-flex; }
  .has-menu .nav-menu {
    position: absolute; z-index: 20; top: calc(100% - 4px); left: var(--gutter); right: var(--gutter);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 6px 22px;
    background: var(--paper);
    border: 1px solid var(--ink-line); border-radius: 18px;
    box-shadow: 0 26px 48px -26px rgba(23, 47, 63, 0.5);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  }
  .has-menu.menu-open .nav-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .18s ease, transform .18s ease; }
  .has-menu .nav-menu .nav-link {
    justify-content: flex-start; min-height: 62px; padding: 0 2px;
    border: 0; border-radius: 0; background: none;
    font: 400 1.5rem/1.1 var(--display);
  }
  .has-menu .nav-menu .nav-link + .nav-link { border-top: 1px solid var(--ink-line); }
  .has-menu .nav-menu .nav-link::after {
    content: "\2192"; margin-left: auto;
    font: 400 1.125rem/1 var(--text); color: var(--ink-soft);
    transition: transform .2s ease;
  }
  .has-menu .nav-menu .nav-link:hover::after { transform: translateX(3px); }
  .has-menu .nav-menu .nav-link[aria-current="page"]::before {
    content: ""; flex: none; width: 8px; height: 8px; margin-right: 12px; border-radius: 50%; background: var(--leaf);
  }
}
@media (prefers-reduced-motion: reduce) {
  .has-menu .nav-menu, .has-menu.menu-open .nav-menu, .nav-toggle-icon::before, .nav-toggle-icon::after { transition: none; }
}

/* ---------- hero ---------- */
.hero {
  padding: clamp(24px, 3.5vw, 56px) var(--gutter) clamp(36px, 4vw, 60px);
}
.hero h1 {
  font-size: clamp(2.6rem, 5.9vw, 6.6rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.hero h1 span { display: block; white-space: nowrap; }

/* The reel: the soil-to-leaf footage, edge to edge. */
.reel {
  position: relative;
  height: clamp(220px, 30vw, 560px);
  overflow: hidden;
  background: #0d0f0c;
}
.reel video {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
}
/* Never show the browser's own play button over the footage. */
.reel video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
.reel video::-webkit-media-controls { display: none !important; }
/* Low Power Mode stand-in: the same clip, animated as an image (see index.html). */
.reel-motion {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
}
.reel-motion[hidden] { display: none; }
/* Pause / play for the looping reel: a small glyph in the corner, not a badge on the footage. */
.reel-toggle {
  position: absolute;
  right: clamp(8px, 1.4vw, 16px); bottom: clamp(8px, 1.4vw, 16px);
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 6px;
  background: transparent;
  color: var(--paper);
  opacity: .7;
  cursor: pointer;
  transition: opacity .2s ease;
}
.reel-toggle:hover, .reel-toggle:focus-visible { opacity: 1; }
.reel-toggle:focus-visible { outline-color: var(--paper); outline-offset: 0; }
.reel-toggle svg { width: 14px; height: 14px; fill: currentColor; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.reel-toggle .i-play,
.reel-toggle[data-state="paused"] .i-pause { display: none; }
.reel-toggle[data-state="paused"] .i-play { display: block; }

/* Two centered lines bracket the story: what we're building, under the reel,
   and why it matters, just before the waitlist. */
.lead, .statement {
  text-align: center;
  font-family: var(--display);
  font-size: clamp(2rem, 3.6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.012em;
}
.lead span, .statement span { display: block; text-wrap: balance; }
.lead { padding: clamp(56px, 6vw, 96px) var(--gutter); }

/* ---------- why ---------- */
/* The story sits in its own deeper-tan panel, so its title never competes with the two statements. */
.why { padding: clamp(56px, 6.5vw, 104px) 0; background: var(--paper-deep); }

/* Title, reason and work read down the left, level with the photograph, which runs off the right edge. */
.why-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  column-gap: clamp(32px, 4.5vw, 72px);
  padding-left: var(--gutter);
}
.why-text { display: grid; align-content: start; }
.why-text h2 {
  margin-bottom: clamp(28px, 3vw, 44px);
  font-size: clamp(2.4rem, 4vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.why-col + .why-col { margin-top: clamp(36px, 4vw, 56px); }
.why-col h3 {
  margin-bottom: clamp(10px, 1vw, 16px);
  font-size: clamp(1.9rem, 2.7vw, 2.7rem);
  line-height: 1.06;
  letter-spacing: -0.008em;
}
.why-col p { max-width: 44ch; font-size: clamp(1.2rem, 1.42vw, 1.42rem); line-height: 1.56; }
.why-col p + p { margin-top: 0.85em; }

.why-photo { position: relative; min-height: 460px; margin: 0; }
.why-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
  border-radius: 18px 0 0 18px;
}

/* ---------- hardware ---------- */
/* The monitor as a pencil sketch on a sheet of paper, with the plain facts beside it. */
.hw {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 104px);
  align-items: center;
  padding: clamp(64px, 7vw, 112px) var(--gutter) 0;
}
.hw-sketch {
  margin: 0;
  padding: clamp(20px, 2.6vw, 36px) clamp(20px, 2.6vw, 36px) clamp(14px, 1.6vw, 20px);
  border-radius: 6px;
  background: #FFF9EF;
  box-shadow: 0 1px 0 rgba(30, 61, 81, 0.06), 0 22px 44px -28px rgba(30, 61, 81, 0.4);
}
.hw-sketch img { display: block; width: 100%; max-width: 440px; height: auto; margin: 0 auto; }
.hw-sketch figcaption { margin-top: 10px; font-size: 0.875rem; color: var(--ink-soft); }
.hw-body h2 { font-size: clamp(2.4rem, 4vw, 3.75rem); line-height: 1.02; letter-spacing: -0.01em; }
.hw-lede { margin-top: 20px; font-family: var(--display); font-size: clamp(1.5rem, 2.1vw, 2rem); line-height: 1.2; text-wrap: balance; }
.hw-body p:not(.hw-lede) { margin-top: 16px; max-width: 46ch; font-size: clamp(1.1rem, 1.3vw, 1.3rem); line-height: 1.56; }
.hw-facts { display: flex; flex-wrap: wrap; gap: 20px clamp(32px, 4.5vw, 64px); margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--ink); }
.hw-facts dt { font-size: 0.875rem; color: var(--ink-soft); }
.hw-facts dd { margin: 6px 0 0; font-family: var(--display); font-size: clamp(1.6rem, 2.4vw, 2.2rem); line-height: 1; }
.hw-cta {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; margin-top: 28px; padding: 0 24px;
  border-radius: var(--radius-pill); background: var(--ink); color: var(--paper); font-weight: 500; text-decoration: none;
  transition: background-color .2s ease;
}
.hw-cta::after { content: "\2193"; }
.hw-cta:hover { background: var(--night-deep); }

/* The closing line, back on the paper, leading straight into the waitlist. */
.statement { padding: clamp(64px, 7vw, 112px) var(--gutter); }

/* ---------- waitlist ---------- */
.waitlist {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 120px);
  align-items: end;
  padding: clamp(64px, 8vw, 120px) var(--gutter);
  background: var(--night);
  color: var(--paper);
}
.waitlist h2 { font-size: clamp(2.75rem, 5.4vw, 5rem); line-height: 1; letter-spacing: -0.015em; }
.waitlist .intro p { margin-top: 22px; max-width: 34ch; font-size: 1.1875rem; line-height: 1.55; color: var(--cream-soft); }
.waitlist :focus-visible { outline-color: var(--paper); }

.wl-root { min-height: 160px; }
.wl-fine { margin-top: 18px; max-width: 46ch; font-size: 0.875rem; line-height: 1.5; color: var(--cream-soft); }
.wl-fine a { color: var(--paper); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.wl-root:has(.wl-success) + .wl-fine { display: none; }
.wl-root:has(.wl-success) { min-height: 0; }
.wl-after { margin-top: 28px; }
.wl-after p { font-size: 1.0625rem; color: var(--cream-soft); }
.wl-after-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.wl-chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border-radius: var(--radius-pill); border: 1.5px solid var(--cream-line);
  background: transparent; color: var(--paper);
  font: 500 1rem/1 var(--text); text-decoration: none; cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.wl-chip:hover { border-color: var(--paper); background: rgba(255, 237, 213, 0.06); }
.wl-form { display: grid; gap: 22px; }
.wl-row { display: grid; gap: 10px; }
.wl-label { font-weight: 500; font-size: 0.9375rem; color: var(--paper); }
.wl-req { color: var(--cream-soft); }
.wl-input {
  width: 100%; min-height: 58px; padding: 0 20px;
  font: 400 1.125rem/1.2 var(--text); color: var(--paper);
  background: rgba(255, 237, 213, 0.06);
  border: 1.5px solid var(--cream-line);
  border-radius: var(--radius-field);
  transition: border-color .15s ease, background-color .15s ease;
}
textarea.wl-input { padding: 16px 20px; min-height: 120px; resize: vertical; }
.wl-input::placeholder { color: rgba(255, 237, 213, 0.7); }
.wl-input:hover { border-color: rgba(255, 237, 213, 0.7); }
.wl-input:focus { outline: none; border-color: var(--paper); background: rgba(255, 237, 213, 0.1); }
.wl-input:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.wl-input[aria-invalid="true"] { border-color: var(--error-on-night); }

.wl-row--check { gap: 6px; }
.wl-checklabel { display: flex; gap: 12px; align-items: flex-start; font-size: 1rem; cursor: pointer; }
.wl-check { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--paper); flex: none; }

.wl-desc { font-size: 0.9375rem; color: var(--cream-soft); }
.wl-error { min-height: 0; font-size: 0.9375rem; color: var(--error-on-night); }
.wl-error:empty { display: none; }
.wl-form-error { font-size: 0.9375rem; color: var(--error-on-night); }
.wl-form-error:empty { display: none; }
.wl-note { font-size: 0.9375rem; color: var(--cream-soft); font-style: italic; }

.wl-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.wl-submit, .wl-back {
  min-height: 56px; padding: 0 30px;
  border-radius: var(--radius-pill);
  font: 500 1.0625rem/1 var(--text);
  cursor: pointer;
  transition: background-color .2s ease, opacity .2s ease;
}
.wl-submit { background: var(--paper); color: var(--ink); border: 0; }
.wl-submit:hover { background: #fff6ea; }
.wl-submit[disabled] { opacity: .65; cursor: progress; }
.wl-back { background: transparent; color: var(--paper); border: 1.5px solid var(--cream-line); }

.wl-success p { font-family: var(--display); font-size: clamp(1.75rem, 2.6vw, 2.4rem); line-height: 1.15; }
.wl-success p + p { margin-top: .5em; }
.wl-success:focus { outline: none; }
.wl-closed { font-size: 1.1875rem; color: var(--cream-soft); }

.wl-skeleton { display: grid; gap: 14px; }
.wl-skeleton span { display: block; border-radius: var(--radius-field); background: rgba(255, 237, 213, 0.08); }
.wl-skeleton span:nth-child(1) { height: 18px; width: 64px; }
.wl-skeleton span:nth-child(2) { height: 58px; }
.wl-skeleton span:nth-child(3) { height: 56px; width: 200px; border-radius: var(--radius-pill); }

/* ---------- footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px;
  padding: 44px var(--gutter);
  background: var(--night-deep);
  color: var(--cream-soft);
  font-size: 0.9375rem;
}
.site-footer img { height: 26px; width: auto; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.footer-meta a { color: var(--paper); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.site-footer :focus-visible { outline-color: var(--paper); }

/* ---------- privacy policy ---------- */
.legal {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(20px, 3vw, 48px);
  padding: clamp(40px, 6vw, 88px) var(--gutter) clamp(80px, 10vw, 140px);
}
.legal header { grid-column: 1 / span 4; }
.legal h1 { font-size: clamp(2.6rem, 4.6vw, 4.25rem); line-height: 1.02; letter-spacing: -0.012em; }
.legal .updated { margin-top: 14px; font-size: 0.9375rem; color: var(--ink-soft); }
.legal-body { grid-column: 5 / span 7; max-width: 66ch; }
.legal-body > p:first-child { font-size: 1.1875rem; line-height: 1.6; }
.legal-body h2 { margin: 2.2em 0 .6em; font-size: 1.5rem; line-height: 1.25; }
.legal-body p, .legal-body li { color: var(--ink-soft); line-height: 1.7; }
.legal-body p + p { margin-top: .9em; }
.legal-body ul { margin: .7em 0 0; padding-left: 1.2em; }
.legal-body li + li { margin-top: .35em; }
.legal-body a { color: var(--ink); text-underline-offset: 3px; }
.legal-body strong { color: var(--ink); font-weight: 500; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .why { padding-bottom: 0; }
  .why-body { grid-template-columns: minmax(0, 1fr); padding-left: 0; }
  .why-photo { min-height: 0; margin-top: clamp(40px, 6vw, 56px); }
  .why-photo img { position: static; aspect-ratio: 16 / 9; border-radius: 0; }
  .why-text {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(28px, 4vw, 48px);
    padding: 0 var(--gutter);
  }
  .why-text h2 { grid-column: 1 / -1; }
  .why-col + .why-col { margin-top: 0; }
  .waitlist { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hw { grid-template-columns: minmax(0, 1fr); }
  /* Stacked: a smaller sketch, and the words centered under it (Nate, Nov 18). */
  .hw-sketch { width: 100%; max-width: 340px; margin-inline: auto; }
  .hw-sketch figcaption { text-align: center; text-wrap: balance; }
  .hw-body { text-align: center; }
  .hw-body h2, .hw-lede { text-wrap: balance; }
  .hw-body p:not(.hw-lede) { margin-inline: auto; }
  .hw-facts { justify-content: center; }
  .legal header { grid-column: 1 / -1; margin-bottom: 36px; }
  .legal-body { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .hw-sketch { max-width: 270px; }
  body { font-size: 1rem; }
  .hero h1 { font-size: clamp(2rem, 10.2vw, 2.9rem); }
  .site-header { padding-block: 16px; }
  .pill { min-height: 40px; padding: 0 16px; font-size: 0.875rem; }
  .site-header { gap: 14px; }
  .site-nav { gap: 12px; }
  .nav-link, .nav-toggle { min-height: 40px; padding: 0 16px; font-size: 0.875rem; }
  .why-photo img { aspect-ratio: 4 / 3; }
  .why-text { grid-template-columns: minmax(0, 1fr); }
  .why-col + .why-col { margin-top: 40px; }
  .wl-submit { width: 100%; }
  .site-footer { flex-direction: column; align-items: flex-start; }
  .footer-meta span { order: 1; flex-basis: 100%; }
}
@media (max-width: 440px) {
  .brand img { height: 22px; }
  .pill-long { display: none; }
  .pill-short { display: inline; }
  .site-header { gap: 12px; }
  .pill, .nav-link, .nav-toggle { padding: 0 14px; font-size: 0.8125rem; }
}
@media (max-width: 374px) {
  .brand img { height: 20px; }
}
/* The smallest phones keep the Menu icon and drop its word (screen readers still hear "Menu"). */
@media (max-width: 359px) {
  .brand img { height: 19px; }
  .nav-toggle { width: 40px; padding: 0; }
  .nav-toggle-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}