/* Arithmeticus Calculator — landing page
   Colours, radii and spacing come from the Arithmeticus design system (app theme). */

/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/roboto-latin-wght.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/roboto-greek-wght.woff2) format("woff2-variations");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/roboto-math-wght.woff2) format("woff2-variations");
  unicode-range: U+2016-2017, U+2034-2038, U+2070-2071, U+2074-208E, U+2100-2112, U+2190, U+2192, U+2194-21AE, U+21B0-21E5, U+21F4-2211, U+2213-2214, U+2216-22FF, U+2308-230B, U+27C0-27FF, U+2900-2AFF, U+1D400-1D7FF;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --primary: #f1a340;
  --on-primary: #1c1c1e;
  --primary-container: #fbe3c2;
  --on-primary-container: #a45f00;
  --secondary: #4f4585;
  --secondary-container: #e3dff3;
  --on-secondary-container: #4f4585;
  --background: #f6f7f9;
  --on-background: #1c1c1e;
  --surface: #ffffff;
  --on-surface: #1c1c1e;
  --surface-variant: #e9e9ee;
  --on-surface-variant: #8e8e93;
  --surface-bright: #ffffff;
  --accent-blue: #007aff;
  --accent-green: #34c759;
  --accent-red: #ff3b30;
  --accent-purple: #af52de;

  /* Web-only derivations of the tokens above */
  --text-muted: rgb(28 28 30 / 0.7);           /* on-background at 70%: 6.6:1 on background */
  --accent-text: var(--on-primary-container);  /* readable orange for large text on light grounds */
  --hairline: rgb(28 28 30 / 0.09);
  --card: rgb(233 233 238 / 0.5);              /* surface-variant at opacity-chip-fill */
  --grid-line: rgb(28 28 30 / 0.05);
  --nav-bg: rgb(246 247 249 / 0.78);
  --stage: #29292f;                            /* the brand stage, same in both themes */

  --font-sans: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-6: 6px; --radius-8: 8px; --radius-10: 10px; --radius-12: 12px;
  --radius-14: 14px; --radius-16: 16px; --radius-20: 20px;
  --space-4: 4px; --space-8: 8px; --space-12: 12px; --space-16: 16px; --space-24: 24px;
  --container: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --primary-container: #774608;
    --on-primary-container: #f1a340;
    --secondary: #998ec3;
    --secondary-container: #342d52;
    --on-secondary-container: #998ec3;
    --background: #121316;
    --on-background: #f2f2f7;
    --surface: #1c1e22;
    --on-surface: #f2f2f7;
    --surface-variant: #29292f;
    --on-surface-variant: #98989f;
    --surface-bright: #383c44;
    --text-muted: rgb(242 242 247 / 0.68);
    --accent-text: var(--primary);
    --hairline: rgb(242 242 247 / 0.08);
    --card: rgb(41 41 47 / 0.5);
    --grid-line: rgb(242 242 247 / 0.04);
    --nav-bg: rgb(18 19 22 / 0.72);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary-container: #774608;
  --on-primary-container: #f1a340;
  --secondary: #998ec3;
  --secondary-container: #342d52;
  --on-secondary-container: #998ec3;
  --background: #121316;
  --on-background: #f2f2f7;
  --surface: #1c1e22;
  --on-surface: #f2f2f7;
  --surface-variant: #29292f;
  --on-surface-variant: #98989f;
  --surface-bright: #383c44;
  --text-muted: rgb(242 242 247 / 0.68);
  --accent-text: var(--primary);
  --hairline: rgb(242 242 247 / 0.08);
  --card: rgb(41 41 47 / 0.5);
  --grid-line: rgb(242 242 247 / 0.04);
  --nav-bg: rgb(18 19 22 / 0.72);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--background);
  color: var(--on-background);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color .3s ease, color .3s ease;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
main, .footer { overflow-x: clip; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 400; letter-spacing: -0.015em; overflow-wrap: break-word; }
:lang(de) h2, :lang(de) h3, :lang(de) p, :lang(de) li { hyphens: auto; -webkit-hyphens: auto; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgb(241 163 64 / 0.35); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: var(--radius-10); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; }

.accent { color: var(--accent-text); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--secondary);
}
.section { padding: clamp(80px, 12vw, 140px) 0; position: relative; }
.section-head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 300; margin-top: 14px; }
.section-head p { margin-top: 18px; color: var(--text-muted); font-size: 1.1rem; max-width: 600px; }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head--center p { margin-left: auto; margin-right: auto; }

/* ---------- Math notation (inline, used in mockups and cards) ---------- */
.m { font-variant-numeric: lining-nums; white-space: nowrap; }
.op { color: var(--on-primary-container); padding: 0 .12em; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .82em; line-height: 1.15; margin: 0 .12em; }
.frac > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 .2em .05em; }
.frac > span:last-child { padding: .05em .2em 0; }
/* Radical drawn like the app's: flat bar, short stroke down, long stroke up into the overbar (sizes in em) */
.sqrt { position: relative; display: inline-block; padding-left: .51em; white-space: nowrap; }
.sqrt__sign { position: absolute; left: 0; top: 0; width: .52em; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: .075em; stroke-linejoin: round; }
.sqrt__sign path { vector-effect: non-scaling-stroke; }
.sqrt__rad { display: inline-block; border-top: .075em solid currentColor; padding: .1em .12em 0 .06em; line-height: 1.2; }
.int { display: inline-flex; align-items: center; margin-right: .15em; }
.int__sign { font-size: 1.45em; line-height: 1; font-weight: 300; }
.int__lims { display: inline-flex; flex-direction: column; justify-content: space-between; align-self: stretch; font-size: .58em; line-height: 1; margin-left: .05em; padding: .1em 0 0; }
.lim { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; }
.lim__sub { font-size: .6em; }
.exp-box { display: inline-block; width: .38em; height: .46em; margin-left: .06em; border: .08em solid currentColor; border-radius: .06em; vertical-align: .62em; }

.mat { display: inline-grid; grid-template-columns: repeat(2, auto); gap: 0 .7em; vertical-align: middle; padding: .1em .45em; border-inline: 1.5px solid currentColor; font-size: .82em; line-height: 1.25; text-align: center; }
.mat--paren { border-radius: 10px; }

/* ---------- Scroll progress + nav ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; transform-origin: 0 50%; transform: scaleX(0); background: var(--primary); }

.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background-color .3s ease, box-shadow .3s ease, backdrop-filter .3s; }
.nav.is-scrolled { background: var(--nav-bg); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); box-shadow: 0 1px 0 var(--hairline); }
.nav__inner { display: flex; align-items: center; gap: 16px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: 17px; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav__links { display: flex; gap: 4px; margin-left: 24px; }
.nav__links a { text-decoration: none; font-size: 15px; color: var(--text-muted); padding: 6px 12px; border-radius: var(--radius-10); transition: color .2s, background-color .2s; }
.nav__links a:hover { color: var(--on-background); background: var(--card); }
.nav__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-12);
  background: transparent; color: var(--on-background); cursor: pointer; text-decoration: none; transition: background-color .2s;
}
.icon-btn:hover { background: var(--card); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.lang { display: inline-flex; padding: 3px; border-radius: var(--radius-12); background: var(--card); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.lang a { text-decoration: none; padding: 5px 9px; border-radius: var(--radius-8); color: var(--text-muted); }
.lang a[aria-current="true"] { background: rgb(241 163 64 / 0.2); color: var(--accent-text); }
.theme-toggle .i-sun { display: none; }
:root[data-theme-resolved="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme-resolved="dark"] .theme-toggle .i-moon { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius-16); border: 0;
  font: inherit; font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .2s, box-shadow .2s;
}
.btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { box-shadow: 0 8px 28px -8px rgb(241 163 64 / 0.6); transform: translateY(-1px); }
.btn--tonal { background: var(--surface-variant); color: var(--on-surface); }
.btn--tonal:hover { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; border-radius: var(--radius-12); }

.store-row { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 10px 20px 10px 16px; border-radius: var(--radius-16);
  background: var(--surface); color: var(--on-surface); text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: transform .25s var(--ease-out), box-shadow .25s, background-color .25s;
}
.store-btn:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgb(241 163 64 / 0.5), 0 12px 30px -14px rgb(0 0 0 / 0.35); }
.store-btn svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.store-btn__text { display: flex; flex-direction: column; line-height: 1.15; }
.store-btn__text small { font-size: 12px; color: var(--text-muted); }
.store-btn__text strong { font-size: 17px; font-weight: 500; }
.store-btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.store-btn--primary .store-btn__text small { color: rgb(28 28 30 / 0.72); }
.store-btn--primary:hover { box-shadow: 0 12px 30px -10px rgb(241 163 64 / 0.65); }
/* Placeholder store links: remove data-soon from the <a> once the listing is live */
.store-btn[data-soon] { cursor: default; }
.store-btn[data-soon]:hover { transform: none; box-shadow: inset 0 0 0 1px var(--hairline); }
.store-btn[data-soon] svg, .store-btn[data-soon] .store-btn__text { opacity: .55; }
.soon-badge {
  position: absolute; top: -9px; right: -6px; padding: 2px 8px; border-radius: var(--radius-6);
  background: var(--secondary-container); color: var(--on-secondary-container);
  font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: 140px 0 80px; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 80%);
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 4.9rem); font-weight: 300; letter-spacing: -0.03em; line-height: 1.04; margin-top: 20px; }
.hero h1 strong { font-weight: 500; }
.hero__lead { margin-top: 24px; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-muted); max-width: 540px; }
.hero__ctas { margin-top: 36px; }
.hero__meta { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--text-muted); }
.hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero__meta span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.pill-tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--hairline); font-size: 14px; color: var(--text-muted); text-decoration: none;
}
.pill-tag b { background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.pill-tag:hover { color: var(--on-background); }

/* The graph sits behind the phone (inside .phone-wrap), so it never runs through the heading.
   Its ends fade out instead of stopping hard at the text column. */
.hero-graph {
  position: absolute; z-index: -1; left: 50%; top: 50%; width: min(760px, 150vw); max-width: none; transform: translate(-50%, -50%);
  opacity: .55; pointer-events: none;
  /* Fade in px: the left end of the graph sits roughly 70px (wide screens) to 150px (narrow
     two-column layout) past the text column, so the curve fades out right at the text's edge */
  -webkit-mask-image: linear-gradient(90deg, transparent 60px, #000 160px, #000 80%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 60px, #000 160px, #000 80%, transparent 100%);
}
@media (max-width: 1199px) {
  .hero-graph {
    -webkit-mask-image: linear-gradient(90deg, transparent 150px, #000 240px, #000 80%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 150px, #000 240px, #000 80%, transparent 100%);
  }
}
.hero-graph .axis { stroke: var(--hairline); stroke-width: 1.5; }
.hero-graph .curve { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.6s .3s var(--ease-out) forwards; }
.hero-graph circle { opacity: 0; animation: pop .5s var(--ease-out) forwards; }
.hero-graph .pt-zero { fill: var(--accent-red); }
.hero-graph .pt-max { fill: var(--accent-green); }
.hero-graph .pt-min { fill: var(--accent-blue); }
.hero-graph .pt-infl { fill: var(--accent-purple); }
.hero-graph circle:nth-of-type(1) { animation-delay: .7s; }
.hero-graph circle:nth-of-type(2) { animation-delay: 1.0s; }
.hero-graph circle:nth-of-type(3) { animation-delay: 1.3s; }
.hero-graph circle:nth-of-type(4) { animation-delay: 1.6s; }
.hero-graph circle:nth-of-type(5) { animation-delay: 1.9s; }
.hero-graph circle:nth-of-type(6) { animation-delay: 2.2s; }
.hero-graph circle:nth-of-type(7) { animation-delay: 2.5s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
.hero-graph circle { transform-box: fill-box; transform-origin: center; }

/* ---------- Phone mockup (live demo) ---------- */
.phone-wrap { position: relative; display: flex; justify-content: center; perspective: 1400px; }
.phone {
  --pad: 10px;
  position: relative; width: min(340px, 86vw); aspect-ratio: 9 / 19; padding: var(--pad);
  border-radius: 48px; background: #d4d4da;
  box-shadow: 0 0 0 1.5px #b6b6bd, 0 40px 80px -30px rgb(0 0 0 / 0.45), 0 18px 36px -18px rgb(0 0 0 / 0.3);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, -8deg)) rotateZ(var(--rz, 2deg));
  transition: transform .2s linear;
  will-change: transform;
}
:root[data-theme-resolved="dark"] .phone { background: #4a4b52; box-shadow: 0 0 0 1.5px #5d5e66, 0 40px 80px -30px rgb(0 0 0 / 0.8), 0 18px 36px -18px rgb(0 0 0 / 0.5); }
.phone__screen {
  position: relative; height: 100%; border-radius: 39px; overflow: hidden;
  background: var(--background); display: flex; flex-direction: column; padding: 34px 10px 12px;
  transition: background-color .3s;
}
.phone__screen::before { content: ""; position: absolute; top: 11px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #0c0c0e; }
.phone__status { position: absolute; top: 9px; left: 22px; right: 22px; display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--on-background); }
.phone__status i { display: inline-block; width: 22px; height: 9px; border-radius: 3px; box-shadow: inset 0 0 0 1.5px var(--on-background); position: relative; }
.phone__status i::after { content: ""; position: absolute; inset: 2px 6px 2px 2px; background: var(--on-background); border-radius: 1px; }

.calc-history { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; overflow: hidden; padding-bottom: 6px; }
.h-card { background: var(--card); border-radius: var(--radius-16); padding: 8px 12px; animation: hcard-in .5s var(--ease-out); }
.h-card__expr { font-size: 13px; color: var(--on-surface-variant); }
.h-card__res { text-align: right; font-size: 17px; color: var(--on-background); }
@keyframes hcard-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.calc-input { background: var(--card); border-radius: var(--radius-20); padding: 10px 14px 10px; box-shadow: inset 0 0 0 1px var(--hairline); }
.calc-expr { min-height: 54px; padding-top: 10px; font-size: 22px; color: var(--on-background); line-height: 1.5; }
.calc-expr .caret { display: inline-block; width: 1.5px; height: 1.1em; background: var(--primary); margin-left: 2px; animation: blink 1s steps(1) infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0; } }
.calc-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }
.answer-pills { display: flex; gap: 4px; }
.answer-pills span { font-size: 10px; padding: 3px 7px; border-radius: var(--radius-8); background: var(--card); color: var(--on-surface-variant); transition: background-color .25s, color .25s; }
.answer-pills span.is-on { background: rgb(241 163 64 / 0.2); color: var(--on-primary-container); font-weight: 700; }
.calc-result { font-size: 20px; color: var(--on-background); white-space: nowrap; transition: opacity .2s; }
.calc-result .eq { color: var(--on-primary-container); margin-right: 4px; }
.calc-result.is-pending { opacity: .35; }
.calc-result.is-new { animation: res-in .35s var(--ease-out); }
@keyframes res-in { from { opacity: .2; transform: translateY(4px); } }

.keypad-bar { display: flex; align-items: center; justify-content: space-between; margin: 10px 2px 8px; }
.chip { font-size: 9px; font-weight: 600; padding: 2px 6px; border-radius: var(--radius-6); background: var(--card); color: var(--on-surface-variant); }
.dots { display: flex; gap: 5px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--on-surface-variant); opacity: .5; }
.dots i.is-on { background: var(--primary); opacity: 1; }
.keypad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.key {
  aspect-ratio: 1.08; display: grid; place-items: center; border-radius: 14px;
  background: var(--surface-variant); color: var(--on-surface); font-size: 19px; font-weight: 500; user-select: none; white-space: nowrap;
  transition: transform .12s ease, filter .12s ease;
}
.key--op { background: var(--primary-container); color: var(--on-primary-container); font-weight: 700; }
.key--acc { background: var(--secondary-container); color: var(--on-secondary-container); font-weight: 700; font-size: 15px; }
.key--del { color: var(--accent-red); }
.key--del svg { width: 22px; height: 22px; fill: currentColor; }
.key--enter { grid-column: span 2; aspect-ratio: auto; background: var(--primary); color: var(--on-primary); font-size: 20px; }
.key.is-pressed { transform: scale(.9); filter: brightness(1.15); }

.float-card {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: var(--radius-16); background: var(--surface-bright); color: var(--on-surface);
  box-shadow: 0 0 0 1px var(--hairline), 0 18px 40px -16px rgb(0 0 0 / 0.35); font-size: 14px;
  will-change: transform;
}
.float-card b { font-weight: 600; }
.float-card .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.float-card--a { left: -6%; top: 18%; }
.float-card--b { right: -8%; bottom: 20%; }
.dot--green { background: var(--accent-green); }
.dot--orange { background: var(--primary); }

/* ---------- Formula marquee ---------- */
.marquee { padding: 28px 0; border-block: 1px solid var(--hairline); overflow: hidden; position: relative; }
.marquee__row { display: flex; gap: 14px; width: max-content; will-change: transform; }
.marquee__row + .marquee__row { margin-top: 14px; }
.marquee__item { font-size: clamp(16px, 2vw, 20px); line-height: 1.5; padding: 8px 18px; border-radius: var(--radius-16); background: var(--card); white-space: nowrap; display: inline-block; align-self: center; }
.marquee__item .res { margin-left: .3em; }
.marquee__item .res { color: var(--accent-text); }

/* ---------- Ease of use ---------- */
.easy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: step; }
.easy-card { position: relative; padding: 30px 28px 32px; border-radius: var(--radius-20); background: var(--card); box-shadow: inset 0 0 0 1px var(--hairline); overflow: hidden; }
.easy-card::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-14);
  background: var(--primary-container); color: var(--on-primary-container); font-weight: 700; font-size: 20px; margin-bottom: 22px;
}
.easy-card h3 { font-size: 1.3rem; font-weight: 500; }
.easy-card p { margin-top: 10px; color: var(--text-muted); }

/* ---------- Tour (sticky phone) ---------- */
.tour__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); }
.tour__stage { position: sticky; top: 90px; height: calc(100vh - 120px); max-height: 760px; display: flex; align-items: center; justify-content: center; }
/* The screenshots are full phone renders with a transparent background: no card, just the page's graph paper */
.stage-card { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.stage-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 50%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 55% at 50% 50%, #000 20%, transparent 75%);
}
.stage-card img {
  position: absolute; height: 88%; width: auto; max-width: 86%; object-fit: contain;
  opacity: 0; transform: translateY(40px) scale(.94); transition: opacity .6s var(--ease-out), transform .8s var(--ease-out);
  filter: drop-shadow(0 30px 40px rgb(0 0 0 / .28));
}
:root[data-theme-resolved="dark"] .stage-card img { filter: drop-shadow(0 30px 50px rgb(0 0 0 / .6)); }
.stage-card img.is-active { opacity: 1; transform: none; }
.stage-card img.is-prev { opacity: 0; transform: translateY(-40px) scale(.94); }
.stage-progress { position: absolute; z-index: 2; left: 50%; bottom: 0; transform: translateX(-50%); display: flex; gap: 6px; }
.stage-progress i { width: 6px; height: 6px; border-radius: 3px; background: var(--on-surface-variant); opacity: .5; transition: width .4s var(--ease-out), background-color .4s; }
.stage-progress i.is-on { width: 22px; background: var(--primary); opacity: 1; }

.tour__steps { display: flex; flex-direction: column; }
.tour-step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; opacity: .28; transition: opacity .5s ease; }
.tour-step.is-active { opacity: 1; }
.tour-step__num { font-size: 14px; font-weight: 600; color: var(--secondary); letter-spacing: .06em; }
.tour-step h3 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 300; margin-top: 10px; }
.tour-step p { margin-top: 16px; color: var(--text-muted); font-size: 1.08rem; max-width: 460px; }
.tour-step ul { margin: 20px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tour-step li { font-size: 14px; padding: 5px 12px; border-radius: var(--radius-10); background: var(--card); box-shadow: inset 0 0 0 1px var(--hairline); }
.tour-step__img { display: none; }

/* ---------- Feature bento ---------- */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: 16px; }
.feat {
  position: relative; padding: 26px 24px 28px; border-radius: var(--radius-20); background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hairline); overflow: hidden;
  transition: transform .35s var(--ease-out), box-shadow .35s, background-color .35s;
}
.feat:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgb(241 163 64 / .4), 0 20px 40px -24px rgb(0 0 0 / .35); }
.feat--wide { grid-column: span 2; }
.feat__key {
  display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 52px; padding: 0 12px; border-radius: var(--radius-16);
  font-size: 20px; font-weight: 700; margin-bottom: 20px; background: var(--surface-variant); color: var(--on-surface);
  transition: transform .35s var(--ease-out);
}
.feat:hover .feat__key { transform: scale(1.06) rotate(-3deg); }
.feat__key--op { background: var(--primary-container); color: var(--on-primary-container); }
.feat__key--acc { background: var(--secondary-container); color: var(--on-secondary-container); }
.feat__key--enter { background: var(--primary); color: var(--on-primary); }
.feat__key--icon { flex-direction: column; gap: 1px; padding: 0 10px; }
.feat__key--icon svg { width: 20px; height: 20px; fill: currentColor; }
.feat__key--icon small { font-size: 11px; line-height: 12px; font-weight: 600; }
.feat h3 { font-size: 1.15rem; font-weight: 500; }
.feat p { margin-top: 8px; color: var(--text-muted); font-size: 15.5px; line-height: 1.55; }
.feat__demo { margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-12); background: rgb(241 163 64 / 0.08); box-shadow: inset 0 0 0 1.5px rgb(241 163 64 / 0.6); font-size: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.feat__demo .res { color: var(--accent-text); font-weight: 500; }

/* ---------- Students ---------- */
.students { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.level { padding: clamp(26px, 4vw, 40px); border-radius: 28px; background: var(--card); box-shadow: inset 0 0 0 1px var(--hairline); }
.level--uni { background: var(--secondary-container); box-shadow: none; color: var(--on-surface); }
.level__tag { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--radius-8); background: var(--primary-container); color: var(--on-primary-container); }
.level--uni .level__tag { background: var(--secondary); color: var(--surface); }
.level h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 300; margin-top: 16px; }
.level ul { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 10px; }
.level li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-radius: var(--radius-14); background: var(--surface); font-size: 15.5px; }
.level li .m { color: var(--accent-text); font-size: 17px; }
.level--uni li .m { color: var(--secondary); }
.students__note { margin-top: 22px; font-size: 14.5px; color: var(--text-muted); text-align: center; }

/* ---------- Values / privacy ---------- */
.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.value { padding: 30px 28px; border-radius: var(--radius-20); background: var(--card); box-shadow: inset 0 0 0 1px var(--hairline); }
.value svg { width: 28px; height: 28px; fill: var(--accent-text); margin-bottom: 18px; }
.value h3 { font-size: 1.2rem; font-weight: 500; }
.value p { margin-top: 10px; color: var(--text-muted); font-size: 15.5px; }
.value a { color: var(--accent-text); text-underline-offset: 3px; }

/* ---------- Download ---------- */
.download { position: relative; border-radius: 36px; background: var(--stage); color: #f2f2f7; padding: clamp(40px, 7vw, 88px) clamp(24px, 6vw, 80px); overflow: hidden; }
.download::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgb(255 255 255 / .04) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .04) 1px, transparent 1px);
  background-size: 36px 36px;
}
.download > * { position: relative; }
.download__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 48px; align-items: center; }
.download h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 300; }
.download h2 .accent { color: var(--primary); }
.download p { margin-top: 16px; color: rgb(242 242 247 / .72); max-width: 520px; }
.download .store-row { margin-top: 32px; }
.download .store-btn { background: #383c44; color: #f2f2f7; box-shadow: none; }
.download .store-btn__text small { color: rgb(242 242 247 / .65); }
.download .store-btn--primary { background: var(--primary); color: var(--on-primary); }
.download .store-btn--primary .store-btn__text small { color: rgb(28 28 30 / .72); }
.download .store-btn[data-soon]:hover { box-shadow: none; }
.download .soon-badge { background: #342d52; color: #c9c1ea; }
.download__req { margin-top: 18px; font-size: 14px; color: rgb(242 242 247 / .6); }
.download__logo { justify-self: center; width: min(240px, 60vw); aspect-ratio: 1; border-radius: 56px; box-shadow: 0 40px 80px -30px rgb(0 0 0 / .7), 0 0 0 1px rgb(255 255 255 / .06); animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-12px) rotate(-2deg); } }

.kofi { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 26px clamp(24px, 4vw, 40px); border-radius: 28px; background: var(--card); box-shadow: inset 0 0 0 1px var(--hairline); }
.kofi h3 { font-size: 1.3rem; font-weight: 500; }
.kofi p { margin-top: 6px; color: var(--text-muted); font-size: 15.5px; max-width: 560px; }
.kofi .btn svg { width: 22px; height: 22px; }

/* ---------- Footer ---------- */
.footer { padding: 56px 0 40px; border-top: 1px solid var(--hairline); font-size: 14.5px; color: var(--text-muted); }
.footer__grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer__brand p { margin-top: 12px; max-width: 320px; }
.footer__cols { display: flex; gap: clamp(32px, 6vw, 72px); flex-wrap: wrap; }
.footer h4 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--on-background); }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--on-background); text-decoration: underline; text-underline-offset: 3px; }
.footer__bottom { margin-top: 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13.5px; }

/* ---------- Legal pages ---------- */
.legal { padding: 130px 0 40px; }
.legal .container { max-width: 780px; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 300; }
.legal h2 { font-size: 1.35rem; font-weight: 500; margin: 40px 0 10px; }
.legal h3 { font-size: 1.05rem; font-weight: 600; margin: 24px 0 6px; }
.legal p, .legal li { color: var(--text-muted); }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 20px; }
.legal a { color: var(--accent-text); text-underline-offset: 3px; }
.legal address { font-style: normal; color: var(--on-background); padding: 18px 22px; border-radius: var(--radius-16); background: var(--card); margin-top: 12px; }
.legal .lead { margin-top: 14px; font-size: 1.1rem; }
.todo { background: rgb(241 163 64 / 0.25); color: inherit; padding: 0 4px; border-radius: 4px; }

/* ---------- Reveal animations ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--d, 0s); }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal="left"] { transform: translateX(-40px); }
.js [data-reveal="right"] { transform: translateX(40px); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav__links { display: none; }
}
@media (max-width: 880px) {
  .hero { padding-top: 120px; min-height: 0; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__copy { text-align: center; }
  .hero__lead { margin-left: auto; margin-right: auto; }
  .hero .store-row, .hero__meta { justify-content: center; }
  .phone-wrap { margin-top: 24px; }
  /* Stacked layout: the graph runs behind the upper part of the phone and peeks out at the sides,
     so it never reaches the buttons above */
  .hero-graph { top: 38%; -webkit-mask-image: none; mask-image: none; }
  .float-card--a { left: 0; }
  .float-card--b { right: 0; }
  .easy-grid, .values { grid-template-columns: minmax(0, 1fr); }
  .students { grid-template-columns: minmax(0, 1fr); }
  .tour__grid { grid-template-columns: 1fr; }
  .tour__stage { display: none; }
  .tour-step { min-height: 0; opacity: 1; padding: 28px 0 44px; }
  .tour-step__img { display: grid; place-items: center; margin-top: 26px; }
  .tour-step__img img { width: 64%; max-width: 290px; filter: drop-shadow(0 24px 34px rgb(0 0 0 / .3)); }
  .download__grid { grid-template-columns: 1fr; }
  .download__logo { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .feat--wide { grid-column: auto; }
  .nav__cta { display: none; }
  .brand span { display: none; }
  .store-row { flex-direction: column; align-items: stretch; }
  .store-btn { justify-content: flex-start; }
  .float-card { font-size: 12.5px; padding: 8px 10px; }
  .level li { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .hero-graph .curve { stroke-dashoffset: 0; }
}
