/* Monochrome only, in light and dark. Serif titles (New York on Apple), system sans for text. No italics. */
:root {
  --ink: #000;
  --paper: #fff;
  --font: -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* ui-serif is New York in Safari. Other browsers fall back to Georgia. */
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --wrap: 1080px;
  --pad: clamp(20px, 5vw, 48px);
  --section: clamp(72px, 11vw, 140px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #fff;
  --paper: #000;
  color-scheme: dark;
}
/* No JavaScript: still follow the system setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { --ink: #fff; --paper: #000; color-scheme: dark; }
}

*, *::before, *::after { box-sizing: border-box; font-style: normal; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
a:focus-visible, button:focus-visible, .track:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Type */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 7.5vw, 5.5rem); line-height: 1.04; }
h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.08; }
h3 { font-size: clamp(1.5rem, 2.8vw, 2.2rem); line-height: 1.15; letter-spacing: -0.01em; }
/* Wordmark sits inline in the headline. The SVG's baseline is ~24% above its bottom edge,
   so it is dropped by that amount to line up with the surrounding text. */
.wordmark {
  display: inline-block;
  height: 0.92em;
  width: auto;
  vertical-align: -0.22em;
  filter: brightness(0); /* the file is #0F0F0F; this makes it match the pure black headline */
}
:root[data-theme="dark"] .wordmark { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .wordmark { filter: brightness(0) invert(1); }
}
.sub { font-size: clamp(1.1rem, 1.7vw, 1.3rem); max-width: 36ch; margin: 1.4rem auto 0; }
.small { font-size: 0.85rem; margin-top: 0.9rem; }
.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad);
  background: var(--paper);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 8px 24px -16px color-mix(in srgb, var(--ink) 30%, transparent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand img { border-radius: 22%; }
/* Wordmark in the nav: same colour handling as the headline one. */
.brand .brand__word {
  height: 22px;
  width: auto;
  border-radius: 0;
  filter: brightness(0);
}
:root[data-theme="dark"] .brand .brand__word { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .brand .brand__word { filter: brightness(0) invert(1); }
}
.nav__actions { display: flex; align-items: center; gap: 10px; }

/* Round icon buttons: theme toggle and carousel arrows */
.theme-toggle, .arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.25s, color 0.25s, opacity 0.25s, transform 0.3s var(--ease);
}
.arrow:active:not(:disabled) { transform: scale(0.92); }
.theme-toggle:hover, .arrow:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.arrow:disabled { opacity: 0.3; cursor: default; }

/* Light / dark switch, in the footer: a small pill with a sliding knob. */
.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  width: 72px;
  height: 36px;
  padding: 3px;
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--ink) 22%, transparent);
  background: transparent;
}
.theme-toggle:hover { background: transparent; color: var(--ink); }
.theme-toggle::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 5px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.5s var(--ease);
}
:root[data-theme="dark"] .theme-toggle::before { transform: translateX(32px); }
.theme-toggle svg {
  position: relative;
  flex: none;
  width: 32px;
  height: 28px;
  padding: 6px 8px;
  opacity: 0.5;
  transition: color 0.4s ease, opacity 0.4s ease, transform 0.5s var(--ease);
}
.theme-toggle .icon-sun { color: var(--paper); opacity: 1; }
:root[data-theme="dark"] .theme-toggle .icon-sun { color: var(--ink); opacity: 0.5; }
:root[data-theme="dark"] .theme-toggle .icon-moon { color: var(--paper); opacity: 1; }
.theme-toggle:active::before { transform: scale(0.9); }
:root[data-theme="dark"] .theme-toggle:active::before { transform: translateX(32px) scale(0.9); }
.footer__end { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }

/* Button */
.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.85em 1.6em;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.25s, color 0.25s, transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:hover { background: var(--paper); color: var(--ink); transform: translateY(-2px); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--ink) 45%, transparent); }
.btn:active { transform: translateY(0) scale(0.97); box-shadow: none; }
.btn--small { padding: 0.45em 1.1em; font-size: 0.9rem; }
/* App Store buttons carry the Apple logo, which follows the button's text colour. */
.btn--store { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; }
.btn__apple { flex: none; width: 0.95em; height: 1.15em; fill: currentColor; margin-top: -0.12em; }

/* Shared section frame */
.hero, .intro, .stories, .how, .fit, .pair, .closing {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: var(--section) var(--pad);
}

/* Hero + closing */
.hero, .closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero { padding-top: clamp(48px, 8vw, 96px); }
.hero__icon { width: 120px; height: 120px; border-radius: 22%; margin-bottom: 2rem; }
/* Soft shadow under the hero icon. A faint glow in dark mode, where a dark shadow would vanish. */
.hero .hero__icon { box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08); }
:root[data-theme="dark"] .hero .hero__icon { box-shadow: 0 18px 44px -12px rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.06); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .hero .hero__icon { box-shadow: 0 18px 44px -12px rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.06); }
}
.hero .btn, .closing .btn { margin-top: 2.2rem; }

/* Intro */
.intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
}
.intro__text { display: grid; gap: 1.2rem; font-size: clamp(1.1rem, 1.7vw, 1.3rem); align-content: center; }

/* Stories: one row of cards that scrolls sideways and snaps */
.stories__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.stories__nav { display: flex; gap: 10px; }
.track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pad);
  /* Let cards run to the screen edge while staying aligned with the content. */
  margin-inline: calc(-1 * var(--pad));
  padding: 4px var(--pad) 20px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.track::-webkit-scrollbar { display: none; }
.card {
  flex: 0 0 clamp(260px, 31%, 330px);
  scroll-snap-align: start;
}
.card .photo { margin-bottom: 1.2rem; }
.card .eyebrow { margin-bottom: 0.6rem; }
.card h3 { font-size: 1.45rem; line-height: 1.2; }
.card p:not(.eyebrow) { margin-top: 0.6rem; font-size: 1rem; }

/* Photos are shown in full color. */
.photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 24px;
  background: color-mix(in srgb, var(--ink) 6%, var(--paper));
  transform: translateZ(0); /* keeps the rounded clip smooth while the image scales */
}
.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}
@media (hover: hover) {
  .card:hover .photo img { transform: scale(1.05); }
}
/* Until the real photo exists, show the shot brief instead of a broken image. */
.photo.is-missing { border: 1px solid var(--ink); }
.photo.is-missing img { display: none; }
.photo.is-missing::after {
  content: attr(data-brief);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
  font-size: 0.95rem;
}

/* How it works */
.how {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: clamp(32px, 8vw, 120px);
}
.how__copy p { margin-top: 1.4rem; font-size: 1.15rem; max-width: 42ch; }

/* Pair: works alongside other ways of learning */
.pair { text-align: center; }
.pair__lede { font-size: clamp(1.1rem, 1.7vw, 1.3rem); max-width: 40ch; margin: 1.4rem auto 0; }
/* App tiles. Wraps and centres, so add as many as you like. */
.apps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 3vw, 36px) clamp(16px, 2.4vw, 28px);
  max-width: 880px;
  margin: clamp(36px, 5vw, 56px) auto 0;
}
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: clamp(92px, 14vw, 120px);
}
/* Placeholder: a rounded square with the app's first letter.
   Drop an <img> inside and it covers the letter. */
.app__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 22.5%;
  background: color-mix(in srgb, var(--ink) 7%, var(--paper));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.app__icon::before {
  content: attr(data-initial);
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  opacity: 0.35;
}
.app__icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Hairline edge over the icon, so white icons (like italki) don't vanish into the page. */
.app__icon:has(img)::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
}
.app__name { font-size: 0.9rem; font-weight: 600; text-align: center; line-height: 1.25; }
@media (hover: hover) {
  .app:hover .app__icon {
    transform: translateY(-6px) scale(1.04);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent), 0 14px 28px -10px color-mix(in srgb, var(--ink) 35%, transparent);
  }
}

/* Phone frame around a screen recording. Always black, outlined so it reads on a black page. */
.phone {
  width: min(300px, 78vw);
  aspect-ratio: 9 / 19.5;
  padding: 10px;
  border: 1px solid var(--ink);
  border-radius: 48px;
  background: #000;
}
.phone video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 38px;
  background: #000;
}

/* Fit: half-circle level gauge, A1 to B2 highlighted */
.fit { text-align: center; }
.fit__lede { font-size: clamp(1.1rem, 1.7vw, 1.3rem); max-width: 40ch; margin: 1.4rem auto 0; }
.gauge { max-width: 720px; margin: clamp(40px, 6vw, 64px) auto 0; }
.gauge__svg { display: block; width: 100%; height: auto; overflow: visible; }
.gauge__track {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-dasharray: 2 8;
  stroke-linecap: round;
}
.gauge__range {
  fill: none;
  stroke: var(--ink);
  stroke-width: 34;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.gauge__ticks line { stroke: var(--ink); stroke-width: 2; }
/* Boundaries inside Rusty's range cut through the thick arc. */
.gauge__ticks line.cut { stroke: var(--paper); stroke-width: 4; }
.gauge__labels text {
  fill: var(--ink);
  opacity: 0.4;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
}
.gauge__labels text.in { opacity: 1; font-size: 22px; }
.gauge__center text { fill: var(--ink); text-anchor: middle; }
.gauge__big { font-family: var(--serif); font-weight: 600; font-size: 76px; letter-spacing: -0.02em; }
.gauge__small {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.gauge__notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 48px;
  margin-top: clamp(32px, 5vw, 48px);
  padding-top: 24px;
  border-top: 1px solid var(--ink);
  text-align: left;
  font-size: 1rem;
}
.gauge__notes p:last-child { text-align: right; }
.gauge__notes strong { display: block; font-weight: 600; }

/* Animation: only when JS can trigger it, so the gauge is never stuck empty. */
@media (prefers-reduced-motion: no-preference) {
  .js .gauge__range { stroke-dashoffset: 1; }
  .js .gauge__labels text.in,
  .js .gauge__center { opacity: 0; }
  .js .gauge__center { transform: translateY(12px); }

  .js .gauge.is-visible .gauge__range {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.6s cubic-bezier(0.65, 0, 0.35, 1) 0.2s;
  }
  .js .gauge.is-visible .gauge__labels text.in {
    opacity: 1;
    transition: opacity 0.4s ease calc(0.45s + var(--i) * 0.35s);
  }
  .js .gauge.is-visible .gauge__center {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease 1.5s, transform 0.6s ease 1.5s;
  }
}

/* Motion. Hidden states only apply when JS is on, and never with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  /* Page load: hero builds in, one piece after another. */
  @keyframes rise {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes pop {
    from { opacity: 0; transform: translateY(20px) scale(0.86); }
    to { opacity: 1; transform: none; }
  }
  .nav { animation: fade-down 0.8s var(--ease) backwards; }
  @keyframes fade-down {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: none; }
  }
  .hero > .hero__icon { animation: pop 1s var(--ease) 0.1s backwards; }
  .hero > h1 { animation: rise 1s var(--ease) 0.25s backwards; }
  .hero > .sub { animation: rise 1s var(--ease) 0.4s backwards; }
  .hero > .btn { animation: rise 1s var(--ease) 0.55s backwards; }
  .hero > .small { animation: rise 1s var(--ease) 0.65s backwards; }
  .legal__head > * { animation: rise 1s var(--ease) backwards; }
  .legal__head > :nth-child(2) { animation-delay: 0.12s; }
  .legal__head > :nth-child(3) { animation-delay: 0.24s; }

  /* Scroll reveal. Single elements use .reveal, groups use [data-stagger]. */
  .js .reveal,
  .js [data-stagger] > * {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.9s var(--ease), transform 1s var(--ease);
    transition-delay: calc(var(--i, 0) * 110ms);
  }
  .js .reveal--scale { transform: translateY(32px) scale(0.94); }
  .js .btn.reveal {
    transition: opacity 0.9s var(--ease), transform 1s var(--ease), background 0.25s, color 0.25s, box-shadow 0.3s var(--ease);
    transition-delay: calc(var(--i, 0) * 110ms), calc(var(--i, 0) * 110ms), 0s, 0s, 0s;
  }
  .js .reveal.is-in,
  .js [data-stagger].is-in > * {
    opacity: 1;
    transform: none;
  }
  /* script.js drops .reveal once the animation ends, so hover effects respond instantly. */

  /* Gauge footnotes follow the arc. */
  .js .gauge__notes { opacity: 0; transform: translateY(16px); }
  .js .gauge.is-visible .gauge__notes {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s ease 2s, transform 0.8s var(--ease) 2s;
  }

  /* Smooth light/dark switch. The class is added for a moment by script.js. */
  .theme-fade, .theme-fade *, .theme-fade *::before, .theme-fade *::after {
    transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease, fill 0.45s ease, stroke 0.45s ease, box-shadow 0.45s ease !important;
  }
}

/* Footer */
.footer {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 32px var(--pad) 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  justify-content: space-between;
  font-size: 0.9rem;
}
.footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Legal pages (privacy, terms) */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) var(--pad) var(--section);
}
.legal__head { margin-bottom: clamp(40px, 6vw, 64px); }
.legal__head h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.legal__meta { margin-top: 1rem; font-size: 0.9rem; opacity: 0.6; }
.legal__lede { margin-top: 1.4rem; font-size: clamp(1.1rem, 1.7vw, 1.3rem); max-width: 44ch; }

.legal h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 1.2rem; }
.legal a { text-underline-offset: 3px; }

/* At a glance: small cards */
.glance {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: clamp(40px, 6vw, 64px);
}
.glance li {
  padding: 22px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--ink) 6%, var(--paper));
  transition: transform 0.45s var(--ease), background 0.3s;
}
@media (hover: hover) {
  .glance li:hover { transform: translateY(-4px); background: color-mix(in srgb, var(--ink) 9%, var(--paper)); }
}
.glance h3 { font-size: 1.15rem; line-height: 1.25; letter-spacing: -0.005em; }
.glance p { margin-top: 0.5rem; font-size: 0.95rem; line-height: 1.5; opacity: 0.75; }

/* We do / we don't */
.dodont {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: clamp(48px, 7vw, 80px);
}
.dodont > div {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}
.dodont h3 { font-size: 1.15rem; margin-bottom: 0.9rem; }
.dodont li { position: relative; padding-left: 1.7em; font-size: 0.95rem; line-height: 1.45; }
.dodont li + li { margin-top: 0.7rem; }
.dodont li::before { position: absolute; left: 0; font-weight: 700; }
.dodont .yes li::before { content: "\2713"; }
.dodont .no li::before { content: "\2715"; opacity: 0.6; }

/* The full text: numbered sections */
.legal__full { counter-reset: sec; }
.legal__full > section { counter-increment: sec; margin-top: clamp(28px, 4vw, 40px); }
.legal__full h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 1.3rem;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}
.legal__full h3::before {
  content: counter(sec);
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  transform: translateY(-2px);
}
.legal__full p, .legal__full li {
  padding-left: 38px;
  font-size: 1.02rem;
  line-height: 1.65;
  opacity: 0.82;
}
.legal__full p + p, .legal__full p + ul, .legal__full ul + p { margin-top: 0.8rem; }
.legal__full ul { list-style: disc; padding-left: 0; }
.legal__full li { margin-left: 1.2em; padding-left: 18px; }
.legal__full li + li { margin-top: 0.45rem; }
.legal__full strong { font-weight: 600; opacity: 1; }
.legal__note {
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 24px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  font-size: 0.95rem;
}

/* Mobile */
@media (max-width: 760px) {
  .intro, .how, .gauge__notes { grid-template-columns: 1fr; }
  .gauge__notes p:last-child { text-align: left; }
  .how .phone { justify-self: center; }
  .card { flex-basis: 78%; }
  .stories__nav { display: none; } /* swipe instead */
  .footer { flex-direction: column; align-items: flex-start; }
  .glance, .dodont { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .theme-toggle, .theme-toggle::before, .theme-toggle svg, .arrow, .app__icon, .photo img { transition: none; }
  .btn:hover, .app:hover .app__icon, .card:hover .photo img { transform: none; }
}
