/* FreshStart landing page — a first-year lab notebook that comes alive as you
   scroll. Plain CSS (no Tailwind). Tokens match assets/css/app.css. */

:root {
  --paper: #F3F5F9;
  --sheet: #FFFFFF;
  --ink: #101A3A;
  --ink-soft: #4E5672;
  --ink-faint: #8A90A6;
  --rule: #D9DEEA;
  --rule-strong: #B3BACC;
  --grid: rgba(76, 104, 170, .075);
  --ion: #3B2FD6;
  --ion-dark: #2A1FA6;
  --ion-wash: #ECEAFD;
  --flame: #F25C2A;
  --marker: #F6C83B;
  --marker-dark: #876400;
  --marker-wash: #FEF6D6;
  --correct: #178A55;
  --correct-wash: #E1F4EA;
  --display: "Unbounded", "Figtree", system-ui, sans-serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 74rem;
  --graph:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--graph); color: var(--ink); font: 17px/1.6 var(--sans); overflow-x: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--ion); text-underline-offset: 3px; }
a:hover { color: var(--ion-dark); }
:focus-visible { outline: 3px solid var(--ion); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 500; letter-spacing: -0.035em; }
p { margin: 0; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 640px) { .wrap { padding: 0 2rem; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.small { font-size: 15px; color: var(--ink-soft); }
[hidden] { display: none !important; }
@media (display-mode: standalone) { .hide-installed { display: none !important; } }
sub, sup { font-size: .72em; line-height: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .75rem 1.3rem; border-radius: 12px; font: 650 16px/1.2 var(--sans); text-decoration: none; border: 1.5px solid transparent; cursor: pointer; white-space: nowrap; transition: background-color .15s ease, border-color .15s ease, transform .1s ease; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--ion); color: #fff; box-shadow: inset 0 -3px 0 rgba(16, 26, 58, .3); }
.btn-primary:hover { background: var(--ion-dark); color: #fff; }
.btn-quiet { background: var(--sheet); color: var(--ink); border-color: var(--ink); }
.btn-quiet:hover { color: var(--ink); background: var(--paper); }
.btn-small { min-height: 40px; padding: .5rem .95rem; font-size: 15px; border-radius: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Top bar ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 30; transition: background-color .2s ease, box-shadow .2s ease; }
.topbar.is-scrolled { background: rgba(243, 245, 249, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--rule); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; }
.wordmark:hover { color: var(--ink); }
.wordmark span { font: 500 21px/1 var(--display); letter-spacing: -0.04em; }
.topbar nav { display: flex; align-items: center; gap: 1.1rem; }
.topbar nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 650; font-size: 15px; white-space: nowrap; }
.topbar nav a:not(.btn):hover { color: var(--ion); }
.only-wide { display: none; }
@media (min-width: 760px) { .only-wide { display: inline; } }
@media (max-width: 420px) { .wordmark span { font-size: 18px; } .topbar nav { gap: .7rem; } .topbar nav .signin { display: none; } }

/* ---------- The scroll story ----------
   The stage is sticky and as tall as the screen; the panels slide over it.
   The figure sits to the right on wide screens and in the top half on phones. */
.story { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; margin-bottom: -100vh; margin-bottom: -100svh; overflow: hidden; z-index: 0; pointer-events: none; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .9s ease; }
.has-3d .scene { opacity: 1; }
.still { position: absolute; width: min(70vw, 440px); right: 5vw; top: 50%; transform: translateY(-50%); }
.has-3d .still { display: none; }
@media (max-width: 899px) { .still { width: 58vw; right: 50%; top: 10vh; transform: translateX(50%); } }

/* Figure caption that follows the shape on screen, like "Fig. 2" in a practical book. */
.fig-caption { position: absolute; right: 2rem; bottom: 1.6rem; font-size: 14px; font-weight: 650; color: var(--ink-soft); display: flex; align-items: center; gap: .6rem; opacity: 0; transition: opacity .5s ease; }
.has-3d .fig-caption { opacity: 1; }
.fig-caption b { font: 500 13px/1 var(--display); color: var(--ink); padding: .32rem .5rem; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--sheet); }
@media (max-width: 899px) { .fig-caption { right: auto; left: 1.25rem; top: 4.6rem; bottom: auto; } }

.panel { position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 6rem 0 3rem; }
.panel .copy { max-width: 34rem; }
@media (max-width: 899px) {
  .panel { align-items: flex-end; padding-bottom: 2.5rem; }
}

.hero-course { display: inline-flex; align-items: center; gap: .55rem; font-weight: 650; color: var(--ink-soft); font-size: 15px; }
.hero-course i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--flame); flex: none; }
.hero h1 { margin-top: .9rem; font-size: clamp(36px, 4.9vw, 66px); line-height: 1.04; max-width: 13ch; }
.hero .lead { margin-top: 1.3rem; font-size: 18px; color: var(--ink); max-width: 34rem; }
.hero .courses { margin: 1.1rem 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.hero .courses li { font: 500 12.5px/1 var(--display); letter-spacing: -0.02em; padding: .42rem .55rem; border-radius: 7px; border: 1.5px solid var(--ink); background: var(--sheet); }
.hero .actions { margin-top: 1.75rem; }
.hero .small { margin-top: .9rem; }
.scroll-hint { margin-top: 2.4rem; display: flex; align-items: center; gap: .7rem; font-size: 14px; font-weight: 650; color: var(--ink-soft); }
.scroll-hint span { position: relative; width: 2.6rem; height: 2px; background: var(--ink); }
.scroll-hint span::after { content: ""; position: absolute; right: -5px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--marker); border: 2px solid var(--ink); }
@media (max-width: 899px) {
  .hero .copy { background: linear-gradient(to top, var(--paper) 82%, rgba(243, 245, 249, 0)); padding-top: 3rem; }
  .hero h1 { font-size: clamp(30px, 8.6vw, 46px); }
  .hero .lead { font-size: 17px; margin-top: 1rem; }
  .scroll-hint { display: none; }
}

.fig .card { background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1.5px solid var(--ink); border-radius: 18px; padding: 1.5rem 1.4rem 1.6rem; box-shadow: 6px 6px 0 rgba(16, 26, 58, .9); }
@media (min-width: 640px) { .fig .card { padding: 2rem 2rem 2.1rem; } }
.fig-label { font-size: 14px; font-weight: 650; color: var(--ink-soft); }
.fig-label b { color: var(--ink); }
.fig h2 { margin-top: .6rem; font-size: clamp(27px, 3.6vw, 40px); line-height: 1.08; }
.fig .card > p:not(.fig-label) { margin-top: .85rem; font-size: 17px; }
.fig ul { margin: .9rem 0 0; padding: 0; list-style: none; }
.fig li { position: relative; padding-left: 1.4rem; margin-top: .35rem; font-size: 16px; }
.fig li::before { content: ""; position: absolute; left: 0; top: .55em; width: .62rem; height: .62rem; border-radius: 50%; border: 2px solid var(--ion); }
/* A worked line, as it would be written in a notebook */
.working { margin-top: 1rem; padding: .8rem 1rem; border-left: 3px solid var(--marker); background: var(--marker-wash); border-radius: 0 10px 10px 0; font-size: 16px; line-height: 1.75; font-variant-numeric: tabular-nums; }
.working span { display: block; }

/* ---------- Sections after the story ---------- */
.section { position: relative; z-index: 2; background: var(--graph); padding: 5rem 0; }
.section-head { max-width: 42rem; }
.section-head h2 { font-size: clamp(28px, 4.2vw, 48px); line-height: 1.06; }
.section-head p { margin-top: 1rem; color: var(--ink-soft); font-size: 17px; }
.section-head p.small { font-size: 15px; }

/* ---------- The periodic table of Level 100 ----------
   Ported from 21st.dev's Container Scroll Animation (Aceternity): the table
   comes in tipped back 22 degrees and lands flat as you scroll, while the
   heading above it lifts away. Tiles are elements: course letters small,
   course number big, name, topic count, and a band in the discipline colour. */
.table3d { padding: 4rem 0 3rem; border-top: 1.5px solid var(--ink); overflow: hidden; }
.tilt { perspective: 1100px; padding-top: 1rem; }
.tilt-head { text-align: center; max-width: 46rem; margin: 0 auto; will-change: transform; }
.tilt-head h2 { font-size: clamp(30px, 5vw, 60px); line-height: 1.02; }
.tilt-head p { margin: 1rem auto 0; color: var(--ink-soft); max-width: 38rem; }
.tilt-card { margin: 2.6rem auto 0; max-width: 66rem; border: 1.5px solid var(--ink); border-radius: 26px; padding: .7rem; background: var(--ink); transform-origin: 50% 15%; will-change: transform;
  box-shadow: 0 9px 20px rgba(16, 26, 58, .2), 0 37px 37px rgba(16, 26, 58, .17), 0 84px 50px rgba(16, 26, 58, .1), 0 149px 60px rgba(16, 26, 58, .04); }
@media (min-width: 760px) { .tilt-card { padding: 1rem; border-radius: 32px; } }
.ptable { background: var(--graph); border-radius: 18px; padding: 1rem; }
@media (min-width: 760px) { .ptable { padding: 1.6rem; border-radius: 22px; } }
.p-row + .p-row { margin-top: 1.4rem; }
.p-row h3 { font-size: 14px; font-weight: 700; color: var(--ink-soft); margin-bottom: .6rem; display: flex; justify-content: space-between; gap: 1rem; }
.p-row h3 span { font-weight: 500; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .7rem; } }
.el { position: relative; display: flex; flex-direction: column; min-height: 9.6rem; padding: .7rem .75rem .65rem; background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 12px; overflow: hidden; }
.el::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--c, var(--ion)); }
.el-letters { margin-top: .25rem; font: 650 12px/1.2 var(--sans); color: var(--ink-soft); }
.el-num { font: 500 clamp(30px, 3.4vw, 40px)/1 var(--display); letter-spacing: -0.05em; color: var(--ink); }
.el-name { margin-top: .35rem; font-size: 13.5px; line-height: 1.3; font-weight: 600; }
.el-count { margin-top: auto; padding-top: .5rem; font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.el-count b { font-weight: 700; color: var(--ink); }
.el.is-later { background: rgba(255, 255, 255, .55); border-style: dashed; }
.el.is-later::before { opacity: .4; }
.el.is-later .el-num { color: var(--ink-soft); }
.el.is-stat { background: var(--ion); border-color: var(--ion); color: #fff; }
.el.is-stat::before { display: none; }
.el.is-stat .el-letters, .el.is-stat .el-count { color: #D8D4FF; }
.el.is-stat .el-num, .el.is-stat .el-count b { color: #fff; }
.p-legend { margin-top: 1.4rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.2rem; }
.p-legend p { font-size: 15px; max-width: 30rem; }
.p-legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.p-legend li { display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .65rem; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--sheet); font-size: 13.5px; font-weight: 650; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; flex: none; }
html:not(.motion) .tilt-card, html:not(.motion) .tilt-head { transform: none !important; }

/* ---------- Try the checklist ---------- */
.try { border-top: 1px solid var(--rule); }
.try-grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 900px) { .try-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.try .small { margin-top: 1rem; }
.try-card { background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 18px; padding: 1.4rem; box-shadow: 6px 6px 0 var(--ink); }
.try-head { display: flex; align-items: center; gap: 1.1rem; }
.try-ring { width: 96px; height: 96px; flex: none; }
.try-ring circle[data-try-arc] { transition: stroke-dashoffset .4s ease, stroke .3s ease; }
.try-topic { font: 500 22px/1.15 var(--display); letter-spacing: -0.03em; }
.try-meta { font-size: 14px; color: var(--ink-soft); }
.try-score { margin-top: .3rem; font-size: 15px; }
.try-score b { font: 500 20px/1 var(--display); }
.try-items { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: .5rem; }
.mark { width: 100%; display: flex; align-items: center; gap: .7rem; min-height: 48px; padding: .5rem .8rem .5rem .6rem; border-radius: 12px; border: 1.5px solid var(--rule); background: var(--sheet); font: 600 16px/1.3 var(--sans); color: var(--ink); text-align: left; cursor: pointer; }
.mark:hover { border-color: var(--rule-strong); }
.mark .box { position: relative; width: 1.45rem; height: 1.45rem; flex: none; border-radius: 7px; border: 2px solid var(--rule-strong); background: var(--sheet); }
.mark .name { flex: 1; }
.mark .share { font-size: 14px; font-weight: 500; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.mark[data-level="1"] { border-color: #EBD27A; background: var(--marker-wash); }
.mark[data-level="1"] .box { border-color: var(--marker-dark); background: linear-gradient(135deg, var(--marker) 50%, var(--sheet) 50%); }
.mark[data-level="2"] { border-color: #A5D6BC; background: var(--correct-wash); }
.mark[data-level="2"] .box { border-color: var(--correct); background: var(--correct); }
.mark[data-level="2"] .box::after { content: ""; position: absolute; left: .38rem; top: .1rem; width: .42rem; height: .78rem; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

/* ---------- More features ---------- */
.more { border-top: 1px solid var(--rule); }
.more-grid { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.5rem 2.5rem; }
@media (min-width: 760px) { .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.more-grid li { padding-top: 1rem; border-top: 2px solid var(--ink); }
.more-grid h3 { font: 700 19px/1.3 var(--sans); }
.more-grid p { margin-top: .4rem; color: var(--ink-soft); }

/* ---------- Install ---------- */
.install { border-top: 1px solid var(--rule); }
.install-grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 900px) { .install-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.install-state { margin-top: 1rem; font-weight: 600; }
.install-now { margin-top: 1.2rem; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.install-now span { font-size: 15px; color: var(--ink-soft); }
.laptop { font-size: 15px; }
.howto-box { background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 18px; padding: 1.25rem; }
.tabs { display: flex; gap: .4rem; padding: .3rem; background: var(--paper); border-radius: 12px; }
.tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; border: 0; border-radius: 9px; background: transparent; font: 650 15px/1 var(--sans); color: var(--ink-soft); cursor: pointer; }
.tabs button svg { width: 18px; height: 18px; }
.tabs button[aria-selected="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 26, 58, .14); }
.howto { padding: 1.1rem .4rem .3rem; }
.howto h3 { font: 700 18px/1.3 var(--sans); }
.howto ol { margin: .9rem 0 0; padding: 0; list-style: none; counter-reset: step; }
.howto li { counter-increment: step; position: relative; padding-left: 2.3rem; margin-top: .8rem; }
.howto li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--ink); color: #fff; font: 700 13px/1.6rem var(--sans); text-align: center; }
.howto .note { margin-top: 1rem; font-size: 15px; color: var(--ink-soft); }
.key { display: inline-flex; vertical-align: -5px; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 6px; border: 1px solid var(--rule); background: var(--paper); }
.key svg { width: 16px; height: 16px; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--rule); }
.faq-list { margin-top: 1.8rem; max-width: 46rem; border-top: 1.5px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.05rem 0; font-weight: 650; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.plus { position: relative; width: 14px; height: 14px; flex: none; }
.plus::before, .plus::after { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--ink); transition: transform .2s ease; }
.plus::after { transform: rotate(90deg); }
.faq details[open] .plus::after { transform: rotate(0); }
.faq details p { padding: 0 0 1.1rem; color: var(--ink-soft); max-width: 42rem; }

/* ---------- Last call and footer ---------- */
.last { border-top: 1px solid var(--rule); }
.last h2 { font-size: clamp(30px, 5vw, 56px); line-height: 1.04; max-width: 16ch; }
.last p { margin-top: .8rem; color: var(--ink-soft); }
.last .actions { margin-top: 1.5rem; }
.footer { position: relative; z-index: 2; background: var(--ink); color: #D3D7E6; padding: 2rem 0; font-size: 15px; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer a { color: #fff; }
.footer nav { display: flex; gap: 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 899px) { .hero-course { display: none; } }
