/* ============================================================
   The Notebook kit (#600; first built for the landing, #577)
   graph paper · black ink · highlighter yellow · hard shadows

   What the landing and the public pages share: the tokens and the page itself (body.lp-body), the
   type, the buttons, the top bar and its log-in menu, the footer, and the one focus outline, with
   their motion, print and responsive rules. The landing's own sections are in
   static/landing/notebook.css, which loads after this file; the public pages load this file and
   static/css/notebook/public.css. Split out of notebook.css without changing a rule: the landing
   renders the same, pixel for pixel, at 360, 768, 1024 and 1366px.

   Light only: HomeView sets page_theme='light' and logged-out visitors get no toggle (DESIGN.md TH4).

   Every rule is scoped under body.lp-body, which only templates/landing/home.html and the public
   layout (templates/components/notebook/public_base.html) set, so nothing here reaches another page
   and base.html's kit classes don't reach in. The mock's .btn is .nb-btn here: base.html's .btn adds
   a focus ring and a press-scale this design doesn't want.

   Colour rules, measured by core/test_public_contrast.py:
   - Text uses only the ink tokens: --ink, --ink-soft, --muted, --red-ink and the
     four --*-ink subject colours (4.5:1 or better on every light surface), or
     --paper / --foot-* on the ink surfaces. The bright --red, --math, --sci, --ss
     and --ela are for fills, borders and shadows only: green and amber measure
     3.1:1 and 2.1:1 as text.
   - One focus outline for everything: 3px solid --red, which clears 3:1 on every
     surface here, the ink ones included.

   Motion: every loop is defined inside prefers-reduced-motion: no-preference (the landing's are in
   its own file), DESIGN.md M1/M5.
   ============================================================ */


/* The tokens: the landing and the public pages (body.lp-body), and the signed-in pages behind the
   app-wide switch (body.nb-app, static/css/notebook/app.css, #601), which also gives them a night set. */
:is(.lp-body,.nb-app){
  --paper:#FDFBF3;
  --paper-deep:#F4F1E6;
  --card:#FFFFFF;
  --plan:#FFFDF0;
  --ink:#141414;
  --ink-soft:#4A463C;
  --muted:#5F5B4E;
  --gridline:rgba(20,20,20,.055);
  --hl:#FFE70A;
  --red:#DD3E3A;
  --red-ink:#B0231F;
  --check-t:#FDEECB;

  --math:#2B5FE3;  --math-t:#DCE7FB;  --math-ink:#1D4ED8;
  --sci:#0FA958;   --sci-t:#DCF3E4;   --sci-ink:#0A6B37;
  --ss:#F5A300;    --ss-t:#FFF1C2;    --ss-ink:#8A5B00;
  --ela:#9333EA;   --ela-t:#EFE2FB;   --ela-ink:#7E22CE;

  --foot-text:#D8D4C8;
  --foot-mid:#9C988A;
  --foot-rule:#2E2C25;

  --display:'Archivo Black', 'Space Grotesk', system-ui, sans-serif;
  --body:'Space Grotesk', system-ui, -apple-system, sans-serif;
  --hand:'Caveat', cursive;

  --bw:2.5px;
  --press:6px 6px 0 var(--ink);
  --press-lg:10px 10px 0 var(--ink);
  --ease:cubic-bezier(.22,1,.36,1);
}
/* The landing's page itself. --nav-h is the Notebook bar's height here; base.html sets its own for
   the app's bars (chat.html's full-height shell subtracts it), so it is not one of the shared tokens. */
.lp-body{
  --nav-h:74px;

  font-family:var(--body);
  color:var(--ink);
  background-color:var(--paper);
  background-image:
    linear-gradient(var(--gridline) 1px, transparent 1px),
    linear-gradient(90deg, var(--gridline) 1px, transparent 1px);
  background-size:34px 34px;
  line-height:1.6;font-size:16.5px;overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}
/* base.html makes <body> a viewport-tall flex column (h-full flex flex-col). Here it grows with the
   page instead: a sticky nav only sticks inside its parent's height, and the footer would otherwise
   be squeezed to fit the viewport. */
html body.lp-body{height:auto;min-height:100%}
.lp-body .nb-nav,.lp-body .nb-foot{flex-shrink:0}
/* `hidden` must win over the display a class gives a control (.hero-pause is a grid, .chat-ctl a
   flex row), or a control notebook.js hides stays drawn but does nothing. */
.lp-body [hidden]{display:none!important}
.lp-body ::selection{background:var(--hl);color:var(--ink)}
.lp-body [id]{scroll-margin-top:calc(var(--nav-h) + 14px)}
.lp-body #lp,.lp-body .nb-nav,.lp-body .nb-foot{position:relative;z-index:1}
.lp-body .wrap{width:min(1160px,90%);margin-inline:auto}
.lp-body .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}

/* skip link: first thing a keyboard reaches */
.lp-body .nb-skip{position:absolute;left:12px;top:-60px;z-index:200;background:var(--hl);color:var(--ink);font-weight:700;padding:.7rem 1.1rem;border:var(--bw) solid var(--ink);border-radius:10px}
.lp-body .nb-skip:focus{top:12px}

/* ---------- type ---------- */
.lp-body h1,.lp-body h2,.lp-body h3,.lp-body .h1,.lp-body .stat-num,.lp-body .logo-word,.lp-body .price-tag{font-family:var(--display);font-weight:400;line-height:1.06;letter-spacing:.005em;text-transform:uppercase;color:var(--ink)}

/* ---------- buttons: pressable ink blocks ---------- */
.lp-body .nb-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-height:44px;
  font-family:var(--body);font-weight:700;font-size:1rem;line-height:1.2;
  padding:.8rem 1.5rem;border:var(--bw) solid var(--ink);border-radius:12px;
  cursor:pointer;background:var(--card);color:var(--ink);
  box-shadow:5px 5px 0 var(--ink);
  transition:transform .18s var(--ease),box-shadow .18s var(--ease),background .18s,color .18s;
  white-space:nowrap;
}
.lp-body .nb-btn:hover{transform:translate(-2px,-2px);box-shadow:8px 8px 0 var(--ink)}
.lp-body .nb-btn:active{transform:translate(3px,3px);box-shadow:1px 1px 0 var(--ink)}
.lp-body .nb-btn-sm{padding:.5rem 1rem}
.lp-body .nb-btn-lg{padding:.95rem 1.8rem;font-size:1.05rem}
.lp-body .nb-btn-block{width:100%}
.lp-body .nb-btn-hl{background:var(--hl)}
.lp-body .nb-btn-ink{background:var(--ink);color:var(--paper)}
.lp-body .nb-btn-ink:hover{background:var(--red-ink)}
.lp-body .nb-btn-paper{background:var(--paper)}
.lp-body .nb-btn .arr{font-weight:700;transition:transform .25s var(--ease)}
.lp-body .nb-btn:hover .arr{transform:translateX(4px)}

/* ---------- navbar ---------- */
.lp-body .nb-nav{position:sticky;top:0;z-index:100;background:var(--paper);border-bottom:var(--bw) solid var(--ink);transition:box-shadow .25s}
.lp-body .nb-nav.scrolled{box-shadow:0 6px 0 rgba(20,20,20,.08)}
.lp-body .nav-inner{display:flex;align-items:center;gap:1.5rem;height:var(--nav-h)}
.lp-body .logo{display:inline-flex;align-items:center;min-height:44px}
.lp-body .logo-word{font-size:1.45rem;position:relative;padding:0 .15em;z-index:0;white-space:nowrap}
.lp-body .logo-word::after{content:"";position:absolute;left:0;right:0;bottom:.02em;height:.42em;background:var(--hl);z-index:-1}
.lp-body .logo-word em{font-style:normal;font-size:.72em;color:var(--ink-soft)}
.lp-body .nav-links{display:flex;gap:.15rem;margin-inline:auto}
.lp-body .nav-link{display:inline-flex;align-items:center;min-height:44px;padding:.5rem .8rem;font-weight:600;font-size:1rem;color:var(--ink-soft);border:2px solid transparent;border-radius:10px;transition:all .18s;white-space:nowrap}
.lp-body .nav-link:hover{color:var(--ink);border-color:var(--ink);background:var(--card);box-shadow:3px 3px 0 var(--ink)}
.lp-body .nav-link.active,.lp-body .nav-link[aria-current="true"]{color:var(--ink);background:var(--hl);border-color:var(--ink)}
.lp-body .nav-actions{display:flex;align-items:center;gap:.6rem}
.lp-body .nav-mobile-only{display:none}
.lp-body .nav-link.nav-cta{background:var(--hl);color:var(--ink)}
.lp-body .nav-burger{display:none;flex-direction:column;justify-content:center;align-items:center;gap:5px;width:46px;height:46px;background:var(--card);border:var(--bw) solid var(--ink);border-radius:10px;cursor:pointer;box-shadow:3px 3px 0 var(--ink)}
.lp-body .nav-burger span{width:20px;height:2.5px;background:var(--ink);transition:transform .25s,opacity .25s}
.lp-body .nav-burger[aria-expanded="true"] span:nth-child(1){transform:translateY(7.5px) rotate(45deg)}
.lp-body .nav-burger[aria-expanded="true"] span:nth-child(2){opacity:0}
.lp-body .nav-burger[aria-expanded="true"] span:nth-child(3){transform:translateY(-7.5px) rotate(-45deg)}

/* log-in menu: a <details>, so it opens without JS */
.lp-body .login{position:relative}
.lp-body .login summary{list-style:none}
.lp-body .login summary::-webkit-details-marker{display:none}
.lp-body .login-menu{position:absolute;right:0;top:calc(100% + 10px);z-index:120;min-width:13rem;display:grid;gap:.4rem;padding:.6rem;background:var(--card);border:var(--bw) solid var(--ink);border-radius:12px;box-shadow:5px 5px 0 var(--ink)}
.lp-body .login-menu a{display:flex;flex-direction:column;justify-content:center;min-height:44px;padding:.5rem .8rem;border:2px solid transparent;border-radius:9px;font-weight:700}
.lp-body .login-menu a:hover{border-color:var(--ink);background:var(--hl)}
.lp-body .login-menu small{display:block;font-weight:600;color:var(--muted);font-size:.875rem}

/* ---------- footer: blackboard ---------- */
.lp-body .nb-foot{background:var(--ink);color:var(--foot-text);padding:4.5rem 0 0;overflow:hidden;margin-top:0}
.lp-body .footer-grid{display:grid;grid-template-columns:1.6fr 1fr 1fr 1fr;gap:2.4rem;padding-bottom:3rem;position:relative;z-index:1}
.lp-body .nb-foot .logo-word{color:var(--paper)}
.lp-body .nb-foot .logo-word::after{opacity:.35}
.lp-body .nb-foot .logo-word em{color:var(--foot-mid)}
.lp-body .f-brand p{margin:1.1rem 0 1.4rem;font-size:.95rem;line-height:1.65;color:var(--foot-mid)}
.lp-body .f-col h2{font-family:var(--display);color:var(--paper);font-size:.95rem;letter-spacing:.05em;margin-bottom:1.1rem}
.lp-body .f-col a{display:flex;align-items:center;min-height:44px;font-size:1rem;color:var(--foot-text);text-decoration:underline;text-decoration-color:transparent;text-underline-offset:4px;transition:color .2s,text-decoration-color .2s}
.lp-body .f-col a:hover{color:var(--hl);text-decoration-color:currentColor}
.lp-body .footer-base{display:flex;justify-content:space-between;flex-wrap:wrap;gap:.6rem;position:relative;z-index:1;border-top:2px solid var(--foot-rule);padding:1.4rem 0 1.6rem;font-size:.9rem;color:var(--foot-mid)}
.lp-body .f-badges{font-weight:700}
.lp-body .footer-word{font-family:var(--display);font-size:min(12rem,13.5vw);line-height:.78;text-align:center;color:transparent;-webkit-text-stroke:2px var(--foot-rule);text-transform:uppercase;transform:translateY(12%);user-select:none;white-space:nowrap}

/* ---------- focus: one outline, 3:1 or better on every surface ---------- */
.lp-body :is(a, button, summary):focus-visible{outline:3px solid var(--red);outline-offset:3px;border-radius:6px}

/* ---------- motion: smooth in-page scrolling, only for visitors who allow it ---------- */
@media (prefers-reduced-motion:no-preference){
  html:has(.lp-body){scroll-behavior:smooth}
}

@media (prefers-reduced-motion:reduce){
  .lp-body *,.lp-body *::before,.lp-body *::after{transition-duration:.01ms!important}
}

/* print: the bar is not pinned, and has no burger on paper */
@media print{
  .lp-body .nb-nav{position:static}
  .lp-body .nav-burger{display:none}
}

/* print again: the bar's 1240px rule (#593) comes later and shows the burger; this one weighs more */
@media print{
  .lp-body .nb-nav .nav-burger{display:none}
}

/* ---------- responsive ---------- */
@media (max-width:1080px){
  .lp-body .footer-grid{grid-template-columns:1fr 1fr 1fr;gap:2rem}
  .lp-body .f-brand{grid-column:1/-1}
}
/* The bar needs about 1090px for its six links, Log in and Start now on one row (#593): below
   1240px the links fold into the burger, and Log in and Start now stay in the bar. */
@media (max-width:1240px){
  .lp-body .nav-links{position:absolute;top:100%;left:0;right:0;flex-direction:column;gap:.4rem;padding:1rem 5%;background:var(--paper);border-bottom:var(--bw) solid var(--ink);display:none}
  .lp-body .nav-links.open{display:flex}
  .lp-body .nav-link{display:flex;padding:.7rem 1rem;border-color:var(--ink);background:var(--card);box-shadow:3px 3px 0 var(--ink)}
  .lp-body .nav-link.nav-mobile-only{display:none}   /* the bar still has Log in and Start now */
  .lp-body .nav-burger{display:flex}
  .lp-body .nav-actions{margin-left:auto}
}
@media (max-width:860px){
  .lp-body .nav-link.nav-mobile-only{display:flex}
  .lp-body .nav-actions .nb-btn-hl{display:none}
}
/* The logo doesn't wrap (#593), so on the narrowest phones it shrinks instead: at 320px with a
   classic scrollbar the full-size one pushed the burger off screen. */
@media (max-width:380px){
  .lp-body .nb-nav .logo-word{font-size:1.2rem}
}
@media (max-width:640px){
  .lp-body{font-size:16px}
  .lp-body .nav-actions .login{display:none}
  .lp-body .footer-grid{grid-template-columns:1fr 1fr}
}
