/* LabAn website. One stylesheet for every page. No scripts, no external requests. */

@font-face {
  font-family: "Lexend";
  src: url("/fonts/lexend-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #16201c;
  --ink-2: #45524c;
  --teal: #1d6b58;
  --teal-light: #53b9ab;
  --mint: #bfe9d9;
  --mist: #e6f1ee;
  --lilac: #dcd9f2;
  --paper: #f3f7f5;
  --line: #c9d6d0;
  --head: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }
body {
  margin: 0;
  font: 1.0625rem/1.6 var(--body);
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }

/* ---------- shared: links, headings, focus ---------- */
a { color: var(--teal); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}
h1, h2, h3 { font-family: var(--head); color: var(--ink); font-weight: 500; text-wrap: balance; }
h1 { font-size: 1.8rem; line-height: 1.25; margin: 1rem 0; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }

.skip {
  position: absolute; left: 0.5rem; top: -4rem;
  background: var(--ink); color: #fff; padding: 0.7rem 1rem; border-radius: 8px; z-index: 10;
}
.skip:focus { top: 0.5rem; }

/* ---------- shared: header and footer (all pages) ---------- */
header.site, main, footer.site { max-width: 720px; margin: 0 auto; padding: 0 1rem; }
header.site {
  padding-top: 1rem; padding-bottom: 0.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { height: 34px; width: auto; display: block; }
header.site nav { display: flex; }
header.site nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.6rem;
  font-family: var(--head); font-size: 0.95rem; font-weight: 500;
  color: var(--ink); text-decoration: none;
}
header.site nav a:hover { color: var(--teal); text-decoration: underline; }
main { padding-top: 1rem; padding-bottom: 2rem; }

footer.site {
  max-width: none; margin: 2rem 0 0;
  padding: 2rem max(1rem, calc((100% - 720px) / 2)) 2.5rem;
  background: var(--ink); color: #c9d6d0; font-size: 0.95rem;
}
footer.site { text-align: center; font-size: 0.85rem; }
footer.site p { margin: 0.5rem 0 0; }
footer.site a { color: #c9d6d0; text-decoration: none; }
footer.site a:hover { color: #fff; text-decoration: underline; }
footer.site a:focus-visible { outline-color: var(--teal-light); }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 1.4rem; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; }
.foot-legal { color: #a9bab2; }

/* ---------- shared: legal pages (privacy, terms, delete account, 404) ---------- */
body:not(.home) { background: linear-gradient(180deg, var(--mist) 0, var(--paper) 360px); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { border: 1px solid var(--line); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--mist); font-family: var(--head); font-weight: 500; }
mark.todo { background: #fff3a3; color: var(--ink); padding: 0 0.2em; }
.note { background: #fff; border-left: 4px solid var(--teal); border-radius: 0 12px 12px 0; padding: 0.6rem 1rem; }

/* ---------- home page ---------- */
.home header.site, .home .wrap { max-width: 1120px; padding-left: 1.25rem; padding-right: 1.25rem; }
.home header.site { margin: 0 auto; position: relative; z-index: 2; }
.home main { max-width: none; padding: 0; }
.home footer.site { padding-left: max(1.25rem, calc((100% - 1120px) / 2 + 1.25rem)); padding-right: max(1.25rem, calc((100% - 1120px) / 2 + 1.25rem)); margin-top: 0; }
.wrap { margin: 0 auto; }
.wrap-narrow { max-width: 780px; }

/* hero */
.hero {
  margin-top: -78px; padding: 78px 0 0;
  background: linear-gradient(160deg, var(--mint) 0%, var(--mist) 48%, var(--lilac) 100%);
  position: relative; overflow: hidden;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.hero::before {
  width: 520px; height: 520px; left: -200px; top: -160px;
  background: radial-gradient(circle, rgba(159, 225, 200, 0.7), rgba(159, 225, 200, 0) 70%);
}
.hero::after {
  width: 560px; height: 560px; right: -220px; bottom: -200px;
  background: radial-gradient(circle, rgba(201, 195, 242, 0.8), rgba(201, 195, 242, 0) 70%);
}
.hero-grid { position: relative; z-index: 1; display: grid; gap: 1.5rem; padding-top: 1.5rem; }
.eyebrow {
  margin: 0; font-family: var(--head); font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal);
}
.home h1 { font-size: clamp(2.5rem, 1.4rem + 3.6vw, 4.1rem); line-height: 1.05; margin: 0.6rem 0 1.1rem; letter-spacing: -0.03em; font-weight: 600; }
.lead { font-size: 1.15rem; margin: 0 0 1.5rem; color: var(--ink); max-width: 34rem; }

.play-soon {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-height: 56px; padding: 0.5rem 1.4rem 0.5rem 1.2rem;
  background: var(--ink); color: #fff; border-radius: 14px;
  border-left: 6px solid var(--teal-light);
}
.play-soon-label { font-size: 0.8rem; line-height: 1.2; color: #d4dfda; }
.play-soon-name { font-family: var(--head); font-size: 1.25rem; font-weight: 500; line-height: 1.25; }

.facts { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.facts li {
  background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px; padding: 0.3rem 0.9rem; font-family: var(--head); font-size: 0.9rem; color: var(--ink);
}

.hero-art { margin: 0; text-align: center; height: 430px; overflow: hidden; position: relative; }
.hero-phone-2 { display: none; }
.hero-art img { width: 250px; filter: drop-shadow(0 8px 12px rgba(22, 32, 28, 0.25)); }
.hero-art figcaption { display: none; }

/* sections */
.section { padding: 3.5rem 0; }
.section-head { max-width: 38rem; margin-bottom: 2rem; }
.section-head h2 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 0.6rem; letter-spacing: -0.01em; }
.section-head p { margin: 0; color: var(--ink-2); font-size: 1.1rem; }

/* features */
.feature { display: grid; gap: 1.25rem; margin-bottom: 3rem; }
.panel {
  border-radius: 28px; padding: 1.5rem 1rem 0; height: 340px; overflow: clip;
  display: flex; justify-content: center; align-items: flex-start;
  border: 1px solid rgba(22, 32, 28, 0.06);
}
.panel { position: relative; }
.panel::before {
  content: ""; position: absolute; left: 50%; top: 12%; width: min(78%, 360px); aspect-ratio: 1; margin-left: calc(min(78%, 360px) / -2);
  border-radius: 50%; background: rgba(255, 255, 255, 0.5); pointer-events: none;
}
.panel img { position: relative; width: 220px; filter: drop-shadow(0 18px 26px rgba(22, 32, 28, 0.22)); }
.panel-mint { background: linear-gradient(160deg, var(--mint), var(--mist)); }
.panel-lilac { background: linear-gradient(160deg, var(--lilac), var(--mist)); }
.panel-mist { background: linear-gradient(160deg, var(--mist), #cfe4dd); }
.panel-pair { gap: 0.75rem; }
.panel-pair img { width: calc(50% - 0.4rem); }
.panel-pair img + img { margin-top: 2.5rem; }
.feature-text h3 { font-size: 1.4rem; line-height: 1.25; margin: 0 0 0.6rem; }
.feature-text p { margin: 0 0 1rem; }

.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding: 0.3rem 0 0.3rem 1.7rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.72rem;
  width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--teal);
}

.promises {
  list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 1rem;
}
.promises li { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1.1rem 1.25rem; }
.promises h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.promises p { margin: 0; color: var(--ink-2); }
.caption-note { margin: 1.5rem 0 0; font-size: 0.9rem; color: var(--ink-2); }

/* subjects and weights */
.section-subjects { background: var(--mist); }
.weights { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; height: 20px; margin-bottom: 1.5rem; }
.weights span { border-radius: 6px; }
.weights .w2 { grid-column: span 2; }
.weights .w1 { grid-column: span 1; }
.weights .s1 { background: var(--teal); }
.weights .s2 { background: var(--ink); }
.subjects { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.subjects li {
  background: #fff; border-radius: 16px; padding: 0.8rem 1rem;
  display: flex; gap: 0.9rem; align-items: baseline; border: 1px solid rgba(22, 32, 28, 0.06);
}
.subjects li { position: relative; overflow: clip; padding-bottom: 1.05rem; }
.subjects li::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 5px;
  background: var(--teal-light); transform-origin: left center;
}
.subjects .sw20::after { transform: scaleX(1); }
.subjects .sw10::after { transform: scaleX(0.5); }
.pct { font-family: var(--head); font-weight: 600; color: var(--teal); min-width: 2.8rem; }

/* plans */
.plans { display: grid; gap: 1rem; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 1.5rem 1.4rem; }
.plan:nth-child(2) { background: linear-gradient(170deg, #fff, var(--mist)); }
.plan h3 { font-size: 1.5rem; margin: 0 0 0.4rem; }
.plan-for { margin: 0 0 1rem; color: var(--ink-2); }
.plan-dark { background: var(--ink); border-color: var(--ink); color: #f3f7f5; }
.plan-dark h3 { color: #fff; }
.plan-dark .plan-for { color: #c9d6d0; }
.plan-dark .ticks li::before { background: var(--teal-light); }
.plans-note { margin: 1.5rem 0 0; color: var(--ink-2); font-size: 1rem; }

/* faq */
.section-faq { background: linear-gradient(180deg, var(--paper), var(--mist)); }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 0.6rem; }
.faq summary {
  list-style: none; cursor: pointer; min-height: 56px; padding: 0.9rem 3rem 0.9rem 1.1rem;
  font-family: var(--head); font-weight: 500; position: relative; display: flex; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 1.2rem; top: 50%; width: 0.6rem; height: 0.6rem;
  border-right: 2px solid var(--teal); border-bottom: 2px solid var(--teal);
  transform: translateY(-70%) rotate(45deg);
}
.faq details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq details p { margin: 0; padding: 0 1.1rem 1.1rem; color: var(--ink-2); }

/* closing */
.closing { text-align: center; padding: 4rem 0; background: linear-gradient(160deg, var(--mint), var(--mist) 50%, var(--lilac)); }
.closing-mark { width: 64px; height: 64px; display: block; margin: 0 auto 0.5rem; }
.closing h2 { font-size: 1.8rem; margin: 0 0 0.5rem; }
.closing p { margin: 0 0 1.5rem; }
.closing .play-soon { text-align: left; }

/* ---------- wider screens ---------- */
@media (min-width: 760px) {
  header.site nav a { padding: 0 0.9rem; font-size: 1rem; }
  .brand img { height: 40px; }
  .hero { padding-top: 78px; }
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 2rem; padding-top: 3rem; padding-bottom: 3.5rem; }
  .hero-art { height: auto; overflow: visible; min-height: 640px; }
  .hero-art img { width: 300px; filter: drop-shadow(0 24px 34px rgba(22, 32, 28, 0.28)); }
  .hero-art .hero-phone { position: relative; z-index: 2; margin-left: auto; margin-right: 0; }
  .hero-art .hero-phone-2 {
    display: block; position: absolute; z-index: 1; left: -7%; top: 80px; width: 240px;
    transform: rotate(-7deg); filter: drop-shadow(0 18px 26px rgba(22, 32, 28, 0.2));
  }
  .hero-art figcaption { display: block; margin-top: 0.8rem; font-size: 0.85rem; color: var(--ink-2); }
  .section { padding: 5rem 0; }
  .section-head h2 { font-size: 2.2rem; }
  .feature { grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; margin-bottom: 4.5rem; }
  .feature:nth-of-type(even) .panel { order: 2; }
  .panel { height: 520px; padding: 2.75rem 1rem 0; }
  .panel img { width: 290px; }
  .panel-pair img { width: 235px; }
  .panel-pair img + img { margin-top: 4.5rem; }
  .feature-text h3 { font-size: 2.1rem; letter-spacing: -0.015em; }
  .feature-text > p { font-size: 1.15rem; }
  .promises { grid-template-columns: repeat(3, 1fr); }
  .subjects { grid-template-columns: 1fr 1fr; }
  .plans { grid-template-columns: repeat(3, 1fr); }
  .closing h2 { font-size: 2.4rem; }
}

/* ---------- motion ---------- */
/* All movement is CSS only, transform/opacity only, and sits inside no-preference.
   Entrance animations use fill-mode "backwards", so the page is complete if they do not run.
   Scroll-driven animations sit inside @supports; other browsers show the finished page. */
.progress { display: none; }
@media screen and (prefers-reduced-motion: no-preference) {
  :root { --ease: cubic-bezier(0.2, 0.7, 0.1, 1); }

  /* feedback */
  .play-soon, .faq summary::after, header.site nav a { transition: transform 0.2s ease, translate 0.2s ease, color 0.2s ease; }
  .faq summary::after { transition-duration: 0.3s; transition-timing-function: var(--ease); }
  .plan { transition: translate 0.3s var(--ease), box-shadow 0.3s var(--ease); }
  .faq details[open] p { animation: fade-down 0.35s var(--ease) both; }
  @media (hover: hover) {
    .plan:hover { translate: 0 -6px; box-shadow: 0 18px 30px -16px rgba(22, 32, 28, 0.35); }
    .facts li { transition: translate 0.2s ease; }
    .facts li:hover { translate: 0 -2px; }
  }

  /* hero entrance: text group first, then phones; about 0.9 s in total */
  .hero-text .eyebrow { animation: rise 0.6s var(--ease) backwards; }
  .hero-text h1 { animation: rise 0.8s var(--ease) 0.08s backwards; }
  .hero-text .lead { animation: rise 0.7s var(--ease) 0.2s backwards; }
  .hero-text .play-soon { animation: rise 0.7s var(--ease) 0.32s backwards; }
  .facts li { animation: rise 0.6s var(--ease) backwards; }
  .facts li:nth-child(1) { animation-delay: 0.42s; }
  .facts li:nth-child(2) { animation-delay: 0.48s; }
  .facts li:nth-child(3) { animation-delay: 0.54s; }
  .hero-art { animation: phone-in 1s var(--ease) 0.15s backwards; }
  .hero-phone { animation: float 7s ease-in-out 1.2s 4 alternate; }

  @keyframes rise { from { opacity: 0; transform: translateY(24px); } }
  @keyframes fade-down { from { opacity: 0; transform: translateY(-6px); } }
  @keyframes phone-in { from { opacity: 0; transform: translateY(72px) scale(0.94); } }
  @keyframes float { from { translate: 0 0; } to { translate: 0 -10px; } }

  @supports (animation-timeline: view()) {
    /* progress line at the top of the viewport */
    .progress {
      display: block; position: fixed; left: 0; top: 0; width: 100%; height: 3px; z-index: 20;
      background: var(--teal); transform-origin: left center; pointer-events: none;
      animation: grow-x linear both; animation-timeline: scroll(root);
    }
    @keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

    /* hero depth: second phone and colour washes drift at different speeds */
    .hero-phone-2 { animation: drift-up linear both; animation-timeline: scroll(root); animation-range: 0 900px; }
    .hero::before { animation: drift-down linear both; animation-timeline: scroll(root); animation-range: 0 900px; }
    .hero::after { animation: drift-up-small linear both; animation-timeline: scroll(root); animation-range: 0 900px; }
    @keyframes drift-up { to { translate: 0 -70px; } }
    @keyframes drift-down { to { translate: 40px 90px; } }
    @keyframes drift-up-small { to { translate: -40px -60px; } }

    /* feature screens settle into their panels; text follows */
    .panel img { animation: screen-in ease-out both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
    .panel::before { animation: disc-in ease-out both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
    .panel-pair img + img { animation-range: entry 15% entry 100%; }
    .feature-text > * { animation: rise-scroll ease-out both; animation-timeline: view(); animation-range: entry 10% entry 65%; }
    .feature-text > p { animation-range: entry 15% entry 70%; }
    .feature-text > ul { animation-range: entry 20% entry 75%; }
    @keyframes screen-in { from { opacity: 0; transform: translateY(70px) scale(0.93); } }
    @keyframes disc-in { from { scale: 0.55; opacity: 0; } }
    @keyframes rise-scroll { from { opacity: 0; transform: translateY(28px); } }

    /* promise cards, subjects, plans */
    .promises li, .plan, .subjects li, .section-head { animation: rise-scroll ease-out both; animation-timeline: view(); animation-range: entry 5% entry 60%; }
    .promises li:nth-child(2), .plan:nth-child(2) { animation-range: entry 12% entry 67%; }
    .promises li:nth-child(3), .plan:nth-child(3) { animation-range: entry 19% entry 74%; }

    /* subject weight bars fill as the section arrives */
    .weights span { transform-origin: left center; animation: fill-x ease-out both; animation-timeline: view(); animation-range: entry 20% entry 70%; }
    .weights span:nth-child(2) { animation-range: entry 25% entry 75%; }
    .weights span:nth-child(3) { animation-range: entry 30% entry 80%; }
    .weights span:nth-child(4) { animation-range: entry 35% entry 85%; }
    .weights span:nth-child(5) { animation-range: entry 40% entry 90%; }
    .weights span:nth-child(6) { animation-range: entry 45% entry 95%; }
    .subjects li::after { animation: fill-x ease-out both; animation-timeline: view(); animation-range: entry 30% entry 100%; }
    @keyframes fill-x { from { transform: scaleX(0); } }

    /* closing: the symbol turns up, then the text */
    .closing-mark { animation: mark-in ease-out both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .closing h2, .closing p, .closing .play-soon { animation: rise-scroll ease-out both; animation-timeline: view(); animation-range: entry 20% entry 100%; }
    @keyframes mark-in { from { opacity: 0; transform: scale(0.4) rotate(-25deg); } }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
