/* Mathelium app pages: the waitlist design system (mathelium.co.uk, public/index.html), light theme only.
   Tokens, sheet, buttons, form fields and footer are copied from the waitlist so the two sites look the same.
   Fonts come from /pub/fonts/fonts.css (self hosted); nothing here loads from a third party. */

:root{ color-scheme:light;
  --desk:#e9e4d8; --paper:#fbf9f3; --grid:rgba(31,111,209,.075); --ink:#1e2a47; --muted:#5b6478; --rule:#d9d2c2;
  --pen:#1f6fd1; --pen-ink:#ffffff; --mark:#d6336c; --tick:#2b8a3e; --shadow:0 1px 2px rgba(30,42,71,.08),0 12px 32px rgba(30,42,71,.10);
  --display:"Newsreader",Georgia,"Times New Roman",serif; --body:"Atkinson Hyperlegible",system-ui,-apple-system,"Segoe UI",sans-serif;
  --hand:"Kalam","Comic Sans MS","Bradley Hand",cursive; --mono:"IBM Plex Mono",ui-monospace,Menlo,Consolas,monospace;
  --ease:cubic-bezier(.2,.7,.2,1);
  /* Two accessibility adjustments that differ from the waitlist (VERIFY with the founder; design research section 6):
     the waitlist input border (--rule, 1.51:1 on white) fails WCAG 1.4.11 and the error pink (--mark, 4.38:1 on paper)
     fails 1.4.3 for small text. To restore the exact waitlist values set --field:var(--rule) and --error:var(--mark). */
  --field:#8f8a7a; --error:#c2255c;
}
*{box-sizing:border-box}
[hidden]{display:none !important}
html{scroll-behavior:smooth; -webkit-text-size-adjust:100%; text-size-adjust:100%}
body{background:var(--desk); color:var(--ink); font-family:var(--body); font-size:17px; line-height:1.6; margin:0; padding-inline:16px; padding-block:16px 40px; -webkit-font-smoothing:antialiased; overflow-x:hidden}
h1,h2,h3{font-family:var(--display); font-weight:600; line-height:1.1; text-wrap:balance; margin:0}
h1{font-size:clamp(38px,5.2vw,64px); letter-spacing:-.015em}
h2{font-size:clamp(30px,4vw,46px); letter-spacing:-.01em}
h3{font-size:24px}
p{margin:0}
a{color:var(--pen)}
.hand{font-family:var(--hand); color:var(--pen); font-weight:400}
.eyebrow{font-family:var(--mono); font-size:12.5px; letter-spacing:.12em; text-transform:uppercase; color:var(--muted)}
.lede{font-size:19px; color:var(--muted); max-width:46ch}
.lede b{color:var(--ink)}
.small{font-size:13.5px; color:var(--muted)}
.vh{position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0}

/* skip link: visible only when focused */
.skip{position:absolute; left:24px; top:-60px; z-index:60; background:var(--pen); color:var(--pen-ink); padding:10px 16px; border-radius:6px; font-weight:700; text-decoration:none}
.skip:focus{top:20px; outline:3px solid var(--mark); outline-offset:2px}

/* the sheet of graph paper on the desk */
.sheet{position:relative; max-width:1180px; margin:0 auto; background-color:var(--paper);
  background-image:linear-gradient(var(--grid) 1px,transparent 1px),linear-gradient(90deg,var(--grid) 1px,transparent 1px); background-size:24px 24px;
  border-radius:6px; box-shadow:var(--shadow); padding-inline:clamp(18px,5vw,72px); padding-block:0 64px; min-height:calc(100svh - 120px)}

/* top bar */
.top{position:relative; z-index:20; display:flex; align-items:center; justify-content:space-between; gap:16px; padding-block:16px; border-bottom:1px solid transparent}
.brand{font-family:var(--display); font-size:26px; font-weight:600; display:flex; align-items:baseline; gap:10px; text-decoration:none; color:var(--ink)}
.brand .hand{font-size:18px}
.brand:focus-visible{outline:3px solid var(--mark); outline-offset:4px; border-radius:4px}
.top nav{display:flex; align-items:center; gap:22px; font-size:15px}

/* buttons (verbatim from the waitlist) */
.btn{font:inherit; font-weight:700; font-size:16px; padding:13px 20px; border-radius:6px; border:0; background:var(--pen); color:var(--pen-ink); cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:10px; transition:transform .2s var(--ease), box-shadow .2s, filter .2s}
.btn:hover{filter:brightness(1.06); transform:translateY(-1px); box-shadow:0 8px 20px color-mix(in srgb,var(--pen) 28%,transparent)}
.btn:focus-visible{outline:3px solid var(--mark); outline-offset:2px}
.btn[disabled]{opacity:.6; cursor:default; transform:none; box-shadow:none}
.btn.sm{padding:9px 14px; font-size:14.5px}
.btn .arr{font-family:var(--hand); font-size:20px; line-height:1}
.btn.ghost{background:transparent; color:var(--ink); border:1.5px solid var(--rule)}
.btn.wide{width:100%; justify-content:center}

/* faint maths notes in the margins */
.doodles{position:absolute; inset:0; pointer-events:none; overflow:hidden; border-radius:6px}
.doodles span{position:absolute; font-family:var(--hand); color:var(--pen); opacity:.16; white-space:nowrap}
.doodles .d1{left:2.5%; top:118px; font-size:40px}
.doodles .d2{right:4%; top:470px; font-size:34px}
.doodles .d3{left:5%; top:560px; font-size:46px}
.doodles .d4{right:6%; top:720px; font-size:32px}
.doodles .d5{left:2%; top:930px; font-size:36px}
.doodles .d6{right:3%; top:1080px; font-size:34px}

/* the welcome: headline on the left, the robot and its question on the right */
.welcome{position:relative; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.05fr); gap:clamp(24px,4vw,64px); align-items:center; min-height:calc(100svh - 250px); padding-block:32px 48px}
.welcome > *{min-width:0}
.welcome h1{margin-top:16px}
.welcome .lede{margin-top:22px}
.welcome .copy > *{animation:rise .7s var(--ease) both}
.welcome .copy > :nth-child(2){animation-delay:.07s}
.welcome .copy > :nth-child(3){animation-delay:.14s}
@keyframes rise{from{opacity:0; transform:translateY(.4em)}}
.under{position:relative; white-space:nowrap}
.under svg{position:absolute; left:-2%; bottom:-.12em; width:104%; height:.36em; overflow:visible}
.under path{stroke:var(--mark); stroke-width:4; fill:none; stroke-linecap:round; stroke-dasharray:420; stroke-dashoffset:0; animation:draw 1.1s var(--ease) .6s both}
@keyframes draw{from{stroke-dashoffset:420}}

.stage{display:grid; grid-template-columns:auto minmax(0,1fr); grid-template-areas:"nib bubble" "nib choice"; gap:18px 20px; align-items:end; justify-content:center}
.stage .nib-home{grid-area:nib; width:clamp(150px,15vw,200px); aspect-ratio:120/150; align-self:center}
.bubble{grid-area:bubble; position:relative; background:#fff; border:2px solid var(--pen); border-radius:18px 22px 16px 20px; padding:16px 20px; max-width:22ch;
  font-family:var(--hand); color:var(--pen); font-size:clamp(22px,2.3vw,28px); line-height:1.25; animation:pop .35s var(--ease) 1.1s both}
.bubble::after{content:""; position:absolute; left:-11px; bottom:26px; width:18px; height:18px; background:#fff; border-left:2px solid var(--pen); border-bottom:2px solid var(--pen); transform:rotate(45deg); border-radius:0 0 0 4px}
.bubble p{margin:0}
@keyframes pop{from{opacity:0; transform:translateY(16px) scale(.98)}}
.choice{grid-area:choice; display:flex; gap:12px; flex-wrap:wrap; align-self:start; animation:pop .35s var(--ease) 1.3s both}
.choice .btn{min-width:112px; justify-content:center}
.choice.chosen .btn{opacity:0; transform:translateY(6px); pointer-events:none; transition:opacity .4s var(--ease), transform .4s var(--ease)}

/* the auth pages: one narrow column in the middle of the sheet */
.auth{position:relative; max-width:480px; margin:0 auto; padding-block:28px 8px}
.auth-head{position:relative}
.auth-head h1{font-size:clamp(32px,4vw,46px); margin-top:10px}
.auth-head .lede{margin-top:12px; font-size:18px}
.auth h2{font-size:24px}
.auth main > section,.auth > section{margin-top:26px}
.auth .addr{font-family:var(--mono); color:var(--ink)}
.auth section p{margin-top:8px; color:var(--muted)}
.notice{margin-top:18px; padding:12px 16px; border:2px solid var(--pen); border-radius:10px 14px 9px 12px; background:#fff}
.alt{margin-top:22px; font-size:15px; color:var(--muted); display:grid; gap:6px}

/* forms (the waitlist dialog's fields) */
.form{display:grid; gap:16px; margin-top:24px}
.f{display:grid; gap:6px}
.f label,.f legend,.lbl{font-weight:700; font-size:14.5px}
.f input,.copy-row input{font:inherit; font-size:17px; padding:12px 14px; border:1.5px solid var(--field); border-radius:6px; background:#fff; color:var(--ink); width:100%; min-width:0}
.f input:focus,.copy-row input:focus{outline:none; border-color:var(--pen); box-shadow:0 0 0 3px color-mix(in srgb,var(--pen) 22%,transparent)}
.f input[aria-invalid=true]{border-color:var(--error)}
.f .err{font-size:13.5px; color:var(--error)}
.f .err:empty{display:none}
.hint{font-size:14px; color:var(--muted)}
fieldset.f{border:0; padding:0; margin:0; min-width:0}
fieldset.f legend{padding:0; margin-bottom:6px}
.dob{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.5fr); gap:12px; max-width:340px}
.dob .f label{font-weight:400; font-size:14.5px}
.pw{position:relative}
.pw input{padding-right:78px}
.pw .show{position:absolute; right:6px; top:50%; transform:translateY(-50%); min-height:36px; min-width:60px; padding:6px 10px; border:0; border-radius:6px; background:transparent; color:var(--pen); font:inherit; font-size:14.5px; font-weight:700; cursor:pointer}
.pw .show:hover{background:color-mix(in srgb,var(--pen) 8%,transparent)}
.pw .show:focus-visible{outline:3px solid var(--mark); outline-offset:0}
.f label.consent{display:grid; grid-template-columns:22px 1fr; gap:10px; align-items:start; font-weight:400; font-size:15px; color:var(--ink)}
.consent input{width:18px; height:18px; margin-top:3px; accent-color:var(--pen)}
.consent input:focus-visible{outline:3px solid var(--mark); outline-offset:2px}
.msg{font-size:15px; min-height:1.4em; color:var(--error)}
.msg:empty{min-height:0}
.turnstile{min-height:65px}
.done{display:grid; gap:12px; margin-top:24px}
.done h2{font-size:30px}
.done p{color:var(--muted)}
.done .tickbig path{stroke:var(--tick); stroke-width:5; fill:none; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:80; stroke-dashoffset:0; animation:tick .7s var(--ease) .15s both}
@keyframes tick{from{stroke-dashoffset:80}}
.done:focus{outline:none}

/* Continue with Google: Google's light theme, pill shape (developers.google.com/identity/branding-guidelines):
   fill #FFFFFF, 1px #747775 stroke inside, text #1F1F1F, 12px before the G, 10px after it, 12px after the text.
   Google Sans is not self hosted yet, so the label falls back to Roboto or Arial (VERIFY). */
.gsi{display:flex; align-items:center; justify-content:center; gap:10px; width:100%; height:40px; padding:0 12px; border-radius:20px; background:#FFFFFF; border:1px solid #747775; color:#1F1F1F;
  font-family:"Google Sans",Roboto,Arial,sans-serif; font-weight:500; font-size:14px; line-height:20px; text-decoration:none; white-space:nowrap; margin-top:24px}
.gsi:hover{box-shadow:0 1px 3px rgba(60,64,67,.3)}
.gsi:focus-visible{outline:3px solid var(--mark); outline-offset:2px}
.gsi-g{display:block; width:20px; height:20px; flex:none}
.gsi-m{mask-type:alpha}
.gsi-conic{height:100%; width:100%; opacity:1; background:conic-gradient(from 90deg,rgba(255, 70, 65, 1) 0deg,rgba(255, 70, 65, 1) 4.14555deg,rgba(49, 134, 255, 1) 39.154deg,rgba(49, 134, 255, 1) 72.0044deg,rgba(0, 165, 183, 1) 96.7463deg,rgba(14, 188, 95, 1) 120.897deg,rgba(14, 188, 95, 1) 154.722deg,rgba(108, 196, 0, 1) 179.136deg,rgba(255, 204, 0, 1) 203.588deg,rgba(255, 211, 20, 1) 226.915deg,rgba(255, 204, 0, 1) 251.688deg,rgba(255, 106, 43, 1) 273.129deg,rgba(253, 70, 65, 1) 289.305deg,rgba(255, 70, 65, 1) 359.593deg,rgba(255, 70, 65, 1) 360deg)}
.or{display:flex; align-items:center; gap:14px; margin-top:22px; font-family:var(--hand); color:var(--muted); font-size:18px}
.or::before,.or::after{content:""; flex:1; height:1px; background:var(--rule)}

/* inside Instagram, TikTok and similar apps Google blocks sign in, so we explain how to open a real browser */
.inapp{margin-top:24px; padding:16px 18px; border:2px solid var(--pen); border-radius:10px 14px 9px 12px; background:#fff; display:grid; gap:10px}
.inapp h2{font-size:21px}
.inapp ol{margin:0; padding-left:22px; display:grid; gap:4px; color:var(--ink); font-size:15.5px}
.copy-row{display:flex; gap:8px; flex-wrap:wrap}
.copy-row input{flex:1 1 180px; font-size:15px; padding:9px 12px}
.copy-msg{font-size:14px; color:var(--tick)}
.copy-msg:empty{display:none}

/* the robot when it idles beside a form: a corner of the screen on wide screens, beside the heading on phones */
.nib-idle{position:fixed; right:clamp(12px,3vw,36px); bottom:clamp(12px,3vw,36px); width:92px; aspect-ratio:120/150; z-index:30; pointer-events:none}
.nib-home svg,.nib-idle svg{display:block; width:100%; height:100%; overflow:visible}

/* footer: legal links, business details */
.foot{max-width:1180px; margin:22px auto 0; font-size:13.5px; color:var(--muted); display:grid; gap:6px}
.foot nav{display:flex; gap:6px 18px; flex-wrap:wrap}
.foot a{color:var(--ink)}
.foot a:focus-visible,.alt a:focus-visible,.small a:focus-visible,.consent a:focus-visible,.auth a:focus-visible{outline:3px solid var(--mark); outline-offset:2px; border-radius:2px}
.foot .addr{font-family:var(--mono); color:var(--ink)}

@media (max-width:860px){
  .brand .hand{display:none}
  .doodles{display:none}
  .welcome{grid-template-columns:minmax(0,1fr); min-height:auto; padding-top:16px; gap:28px}
  .stage{grid-template-columns:auto minmax(0,1fr); grid-template-areas:"bubble bubble" "nib choice"; gap:14px 16px; justify-content:stretch}
  .stage .nib-home{width:118px; align-self:start}
  .bubble{max-width:none; font-size:22px}
  .bubble::after{left:46px; bottom:-11px; transform:rotate(-45deg)}
  .choice{flex-direction:column; align-self:center}
  .choice .btn{width:100%}
  .auth{padding-top:16px}
  .auth-head{padding-right:76px}
  .nib-idle{position:absolute; right:0; top:2px; bottom:auto; width:62px}
}
@media (max-width:379.98px){
  .auth-head{padding-right:0}
  .nib-idle{display:none}
}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{transition:none !important; animation:none !important}
}
