:root {
  --paper: #f7f4ee;
  --paper-2: #f1ece3;
  --ink: #1f2a2d;
  --ink-2: #43514f;      /* secondary text, AA on paper */
  --muted: #5f655c;      /* tertiary / captions, AA on paper */
  --teal: #1f7383;       /* the one accent: interaction + signature */
  --teal-dark: #134c57;
  --copper: #b0562e;     /* mirrors the app's own secondary; used only in the signature */
  --deep: #10322f;       /* solid dark section */
  --rule: #ddd6c9;       /* hairlines */
  --rule-soft: #e7e1d6;
  --field: #fffdf9;
  --ok: #1b7d55;
  --error: #b23b4b;
  --measure: 34rem;
  --edge: clamp(1.25rem, 5vw, 3rem);
  --max: 1120px;

  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

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

img, video { max-width: 100%; display: block; }

/* anchor targets clear the sticky header */
section[id] { scroll-margin-top: 5.5rem; }

/* ---------- Type scale ---------- */
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.15rem, 1.4rem + 3.4vw, 3.2rem); font-weight: 700; line-height: 1.05; }
h2 { font-size: clamp(1.55rem, 1.1rem + 1.9vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.4rem); }
p  { margin: 0; }
em { font-style: italic; }

a { color: var(--teal-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--teal); }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  padding: 0.72em 1.25em;
  border-radius: 8px;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn--quiet:hover { background: transparent; color: var(--ink); border-color: var(--ink); }

/* ---------- Header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.top__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a:not(.btn) {
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:not(.btn):hover { color: var(--ink); }
@media (max-width: 700px) {
  .nav-links a:not(.btn) { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.25rem, 5vw, 4.5rem) var(--edge) clamp(1.75rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 1.75rem; }
}

.hero h1 { max-width: 16ch; }
.lede {
  margin: 1.15rem 0 0;
  max-width: var(--measure);
  font-size: 1.12rem;
  color: var(--ink-2);
}
.hero-actions {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}
.hint {
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- iPhone frame (built from scratch, thin titanium bezel) ---------- */
.stage { display: flex; justify-content: center; }

.device {
  position: relative;
  width: clamp(212px, 24vw, 268px);
  aspect-ratio: 1179 / 2556;
  border-radius: 13.4% / 6.18%;          /* true iPhone corner radius */
  padding: 0.65%;                        /* ~80% thinner, near-edge-to-edge bezel */
  background:
    linear-gradient(150deg, #42474b 0%, #2b2f32 22%, #121619 55%, #2b2f32 82%, #3c4145 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 34px 60px -30px rgba(12, 26, 26, 0.5),
    0 14px 28px -18px rgba(12, 26, 26, 0.4);
  isolation: isolate;
}
/* power (right) + volume (left): flush hairlines, no protrusion */
.device::before,
.device::after {
  content: "";
  position: absolute;
  width: 1px;
  height: 14%;
  background: linear-gradient(90deg, rgba(0,0,0,0.55), rgba(92,98,102,0.45));
  z-index: 0;
}
.device::before { right: 0; top: 28%; }
.device::after  { left: 0;  top: 20%; height: 18%;
  background: linear-gradient(270deg, rgba(0,0,0,0.55), rgba(92,98,102,0.45)); }

.device__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12.9% / 5.9%;              /* follows the frame curve at this bezel */
  overflow: hidden;
  background: #0b0e10;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55);
}
.device__screen img,
.device__screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
/* Dynamic Island: real proportions, sits in the screen's top band */
.device__island {
  position: absolute;
  top: 1.6%;
  left: 50%;
  transform: translateX(-50%);
  width: 33%;
  height: 4.4%;
  background: #05070a;
  border-radius: 999px;
  z-index: 3;
}

/* ---------- Signature: the masked-token line ---------- */
.motif {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.25rem) var(--edge);
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.token-strip { display: block; flex-shrink: 0; width: 164px; height: 26px; overflow: visible; }
.token-strip .tok { fill: var(--teal); }
.token-strip .tok.copper { fill: var(--copper); }
.token-strip .tok.mask { fill: url(#mask-hatch); }
.motif span { font-size: 0.94rem; color: var(--ink-2); }

/* ---------- Section eyebrow ---------- */
.eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
}
.how__lead .eyebrow { color: var(--teal); }
.audience .eyebrow { color: #8fd3da; }

/* ---------- How it works (two real screens) ---------- */
.how {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--edge) clamp(2.5rem, 5vw, 4rem);
}
.how__lead { max-width: 34ch; margin-bottom: clamp(2.25rem, 4vw, 3.25rem); }
.how__lead p { margin-top: 0.85rem; color: var(--ink-2); max-width: var(--measure); }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(2.5rem, 5vw, 3.75rem) 0;
}
.row + .row { border-top: 1px solid var(--rule-soft); }
.row__text h3 { margin-bottom: 0.7rem; }
.row__text p { color: var(--ink-2); max-width: 34ch; }
.row__media { display: flex; justify-content: center; }
.row--flip .row__text { order: 2; }
.row--flip .row__media { order: 1; }
@media (max-width: 820px) {
  .row, .row--flip { grid-template-columns: 1fr; gap: 1.75rem; }
  .row__text, .row--flip .row__text { order: 2; }
  .row__media, .row--flip .row__media { order: 1; justify-content: flex-start; }
}

/* ---------- Curriculum (ordered, no per-row rules) ---------- */
.curriculum {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--edge);
}
.curriculum__head { max-width: 34ch; margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.curriculum__head .eyebrow { margin-bottom: 1rem; }
.curriculum__head p { margin-top: 0.85rem; color: var(--ink-2); }
.topics {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: clamp(2rem, 6vw, 4.5rem);
}
@media (max-width: 620px) { .topics { columns: 1; } }
.topics li {
  break-inside: avoid;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.5rem 0;
}
.topics .n {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 1.5rem;
}
.topics .t { font-size: 1.06rem; font-weight: 500; color: var(--ink); }

/* ---------- Audience (solid dark, full-bleed) ---------- */
.audience { background: var(--deep); color: #eaf3f1; }
.audience__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3.25rem, 7vw, 5.25rem) var(--edge);
}
.audience .eyebrow { margin-bottom: 1rem; }
.audience h2 { color: #f3f8f6; max-width: 20ch; }
.audience__inner > p {
  margin-top: 1.05rem;
  max-width: var(--measure);
  color: rgba(234, 243, 241, 0.82);
  font-size: 1.08rem;
}
.marks {
  margin-top: clamp(2.25rem, 4vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid rgba(234, 243, 241, 0.18);
}
.marks > div { flex: 1 1 auto; min-width: 9rem; padding: 1.2rem 1.5rem 0 0; }
.marks > div + div { padding-left: 1.5rem; border-left: 1px solid rgba(234, 243, 241, 0.18); }
.marks dt { font-size: 1.1rem; font-weight: 600; color: #f3f8f6; }
.marks dd { margin: 0.3rem 0 0; font-size: 0.9rem; color: rgba(234, 243, 241, 0.66); }
@media (max-width: 620px) {
  .marks > div { flex-basis: 100%; padding: 1.05rem 0 0; }
  .marks > div + div { border-left: none; }
}

/* ---------- Contact ---------- */
.contact {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--edge);
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 760px) { .contact { grid-template-columns: 1fr; gap: 2rem; } }
.contact__copy .eyebrow { margin-bottom: 1rem; }
.contact__copy p { margin-top: 0.85rem; color: var(--ink-2); max-width: 32ch; }
.contact__copy .muted { font-size: 0.95rem; color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 1.1rem; }
.form label { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.9rem; font-weight: 500; color: var(--ink-2); }
.form input,
.form textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--field);
}
.form input:focus,
.form textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31, 115, 131, 0.14); }
.form textarea { resize: vertical; }
.form .btn { align-self: flex-start; }
.hp { position: absolute !important; left: -9999px !important; width: 0 !important; height: 0 !important; opacity: 0 !important; }
.form-status { margin: 0; min-height: 1.2em; font-size: 0.92rem; font-weight: 500; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--error); }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--rule); }
.foot__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.6rem var(--edge) 2.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.foot__inner nav { display: flex; gap: 1.5rem; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ---------- Scroll reveals (reduced-motion safe) ---------- */
.reveal.is-in { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1); }
.js .reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* gentle lift for the hero device, nothing busy */
@keyframes device-rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
.stage .device { animation: device-rise 0.7s cubic-bezier(0.16,1,0.3,1) both; }
@media (prefers-reduced-motion: reduce) {
  .stage .device { animation: none; }
}
