/* Knowlu site base: fonts, reset, the shared pieces every section uses (wordmark, buttons, the waitlist form and
   what it shows after joining, nav, footer), and the building-on-scroll rules. Every color comes from tokens.css. */

@font-face { font-family: "PT Serif Caption"; src: url("../fonts/PT_Serif-Caption-Web-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Zilla Slab"; src: url("../fonts/ZillaSlab-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Zilla Slab"; src: url("../fonts/ZillaSlab-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Zilla Slab"; src: url("../fonts/ZillaSlab-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Albert Sans"; src: url("../fonts/AlbertSans-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

/* ---------- reset and running text ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + var(--safe-t) + 16px); scroll-padding-bottom: 20px; scrollbar-color: var(--field-line) var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; overflow-x: clip; background: var(--bg); color: var(--ink); font: 400 var(--t-body)/1.55 var(--serif); -webkit-font-smoothing: antialiased; caret-color: var(--accent); }
::selection { background: var(--red); color: var(--cream); }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; }
p { text-wrap: pretty; }
h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; }
h2 { font-size: var(--t-h2); line-height: 1.04; letter-spacing: -.016em; }
h3 { font-size: var(--t-h3); line-height: 1.12; letter-spacing: -.01em; }
button, input { font: inherit; }
[hidden] { display: none !important; }

/* links: an underline in the red that comes in on hover */
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 4px; transition: color var(--fast) var(--ease), text-decoration-color var(--fast) var(--ease); }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r); }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; background: var(--ink); color: var(--bg); display: flex; align-items: center; min-height: 44px; padding: 0 16px; font: 600 var(--t-small)/1 var(--sans); text-decoration: none; border-radius: var(--r); }
.skip:focus { top: calc(12px + var(--safe-t)); }

/* ---------- the wordmark: "lu" in cream on the red tile ----------
   Round 1, note 10: Quinn's pick of four versions (the even frame with cream letters).
   PT Serif Caption: ascent 1.039, descent .286. The l's stem tops out at .750em and the u dips .010em under the
   baseline; the l's ink starts .034em into its space and the u's ends .028em before the end of its own; the w's last
   serif reaches .011em past the w. The tile leaves .085em of red on all four sides of "lu" and stands .045em clear
   of the w. Its line-height places the top edge (top above the baseline = 1.039em + (line-height - 1.325em) / 2)
   and its height places the bottom edge. The whole word is 3.96em wide (css/hero.css sizes the big one from that). */
.wm { display: inline-block; font: 400 30px/1 var(--display); color: var(--ink); text-decoration: none; }
.wm-k { display: inline-block; }
.wm b { display: inline-block; font-weight: inherit; color: var(--wm-lu); background: var(--red); line-height: .917em; height: .92em; margin-left: .056em; padding: 0 .057em 0 .051em; vertical-align: baseline; transition: background-color var(--fast) var(--ease); }
a.wm { transition: transform var(--fast) var(--ease); }
a.wm:hover, a.wm:focus-visible { transform: translateY(-1px); }
a.wm:active { transform: translateY(1px); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 17px/1 var(--sans); color: var(--btn-fg); background: var(--btn-bg);
  border: 0; border-radius: var(--r); padding: 0 26px; height: 56px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover, .btn:focus-visible { background: var(--red-deep); text-decoration: none; }
.btn:active { background: var(--red-deep); transform: translateY(1px); }
.btn:disabled { opacity: .72; cursor: progress; transform: none; }
.btn.small { height: 44px; padding: 0 18px; font-size: 16px; }

/* the theme switch and other quiet outline buttons */
.theme {
  min-height: 44px; padding: 0 16px; font: 500 var(--t-small)/1 var(--sans); color: var(--ink-2);
  background: none; border: 1px solid var(--field-line); border-radius: var(--r); cursor: pointer;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.theme:hover, .theme:focus-visible { color: var(--ink); border-color: var(--ink); }
.theme:active { transform: translateY(1px); }

/* a text button that reads as a link */
.nx-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  font: 600 var(--t-small)/1.2 var(--sans); color: var(--ink); background: none; border: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: var(--field-line);
  transition: color var(--fast) var(--ease), text-decoration-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.nx-link:hover, .nx-link:focus-visible { color: var(--accent); text-decoration-color: currentColor; }
.nx-link:active { transform: translateY(1px); }

/* ---------- the waitlist form ---------- */
.wl { width: min(100%, 520px); display: grid; gap: 12px; align-content: start; --wd-1: var(--ink); --wd-2: var(--ink-2); --wd-rule: var(--accent); }
.wl-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  background: var(--field); border: 1px solid var(--field-line); border-radius: var(--r);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.wl-row:hover { border-color: var(--ink-3); }
.wl-row:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.wl input { font: 400 18px/1 var(--sans); color: var(--ink); background: transparent; border: 0; border-radius: var(--r) 0 0 var(--r); padding: 0 18px; height: 56px; min-width: 0; outline: none; }
.wl input::placeholder { color: var(--ink-3); opacity: 1; }
.wl .wl-row .btn { border-radius: 0 1px 1px 0; }
.wl .wl-row .btn:focus-visible { outline-offset: -5px; outline-color: var(--btn-fg); }
.wl-msg { font: 400 var(--t-small)/1.45 var(--sans); color: var(--ink-3); }
.wl-count { font: 400 var(--t-small)/1.45 var(--sans); color: var(--ink-2); }
.wl.err .wl-row { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.wl.err .wl-msg { color: var(--error); }

/* after the link is sent: the row gives way to the sentence, a short note, the invite link and the way back */
.wl.ok { min-height: var(--wl-h, auto); }
.wl.ok .wl-row, .wl.ok .wl-msg { display: none; }
.wl-done { display: grid; gap: 18px; justify-items: start; outline: none; }
.wl-done:focus, .wl-done:focus-visible { outline: none; }
.wl-done b { font-weight: 600; color: var(--wd-1); overflow-wrap: anywhere; }
.wd-line { width: 100%; padding-top: 14px; border-top: 2px solid var(--wd-rule); font: 400 21px/1.4 var(--serif); color: var(--wd-1); }
.wd-note { max-width: 32em; }
.wd-note p { font: 400 19px/1.5 var(--serif); color: var(--wd-2); }
.wd-note .wd-sign { margin-top: 10px; font: 400 32px/1 var(--display); color: var(--wd-1); }
.wd-inv { width: 100%; }
.wd-inv-l { margin: 0 0 10px; font: 500 var(--t-small)/1.45 var(--sans); color: var(--wd-1); }
.wd-x { margin-top: -6px; }
@media (prefers-reduced-motion: no-preference) {
  .wl.ok .wl-done { animation: wd-in var(--med) var(--ease) both; }
  @keyframes wd-in { from { opacity: 0; transform: translateY(8px); } }
}

/* the invite link: a read-only field with Copy (and Share where the phone has a share sheet) */
.nx-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: column; grid-auto-columns: auto;
  background: var(--field); border: 1px solid var(--field-line); border-radius: var(--r);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.nx-row:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.nx-row input { font: 400 17px/1 var(--sans); color: var(--ink); background: transparent; border: 0; padding: 0 14px; height: 50px; min-width: 0; outline: none; text-overflow: ellipsis; }
.nx-row .btn { height: 50px; padding: 0 18px; font-size: 16px; border-radius: 0; }
.nx-row .btn:last-child { border-radius: 0 1px 1px 0; }
.nx-row .btn + .btn { box-shadow: inset 1px 0 0 var(--btn-fg); }
.nx-row .btn:focus-visible { outline-offset: -5px; outline-color: var(--btn-fg); }
.nx-row .btn.is-done { background: var(--red-deep); }

/* ---------- nav: solid by default; clear while the big wordmark is in view (site.js) ----------
   A phone: the wordmark, Menu and Apply. Menu opens the section links in a panel under the bar (site.js); with
   scripts off there is no Menu and the footer carries the links. From 740px the links sit in the bar beside Apply,
   and from 1180px in its middle. The bar clears the status bar when the page runs under it (--safe-t). */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 10; padding-top: var(--safe-t); background: var(--bg); border-bottom: 1px solid var(--line); transition: background-color var(--med) var(--ease), border-color var(--med) var(--ease); }
.nav-in { max-width: var(--page); margin: 0 auto; height: var(--nav-h); padding-inline: var(--gut); display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px; }
.nav nav { display: none; }
.nav nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  color: var(--ink-2); text-decoration: underline; text-decoration-color: transparent; font: 500 16px/1 var(--sans);
}
.nav nav a:hover, .nav nav a:focus-visible { color: var(--ink); text-decoration-color: var(--accent); }
.nav nav a:active { transform: translateY(1px); }
.nav .btn { justify-self: end; }
.nav-wm { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; transition: opacity var(--med) var(--ease), visibility var(--med), transform var(--fast) var(--ease); }
.nav.over { background: transparent; border-color: transparent; }
.nav.over .nav-wm { opacity: 0; visibility: hidden; }
/* on the narrowest phones Apply drops "for the pilot" so the three fit */
.nav-x { display: none; }

/* Menu: a word set like the links, underlined in the red while its panel is open */
.nav-menu {
  display: none; align-items: center; min-height: 44px; min-width: 44px; margin: 0; padding: 0 10px;
  font: 500 15px/1 var(--sans); color: var(--ink-2); background: none; border: 0; border-radius: var(--r); cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: transparent;
  transition: color var(--fast) var(--ease), text-decoration-color var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.js .nav-menu { display: inline-flex; }
.nav-menu:focus-visible, .nav-menu[aria-expanded="true"] { color: var(--ink); text-decoration-color: var(--accent); }
.nav-menu:active { transform: translateY(1px); }
@media (hover: hover) { .nav-menu:hover { color: var(--ink); text-decoration-color: var(--accent); } }

/* the open panel: the links as ruled rows under the bar, at the gutter, the bar solid above them. It exists only
   below the width where the links sit in the bar, so it is written for that range alone. */
@media (max-width: 739.98px) {
  .nav.is-open { background: var(--bg); border-color: var(--line); }
  .nav.is-open .nav-wm { opacity: 1; visibility: visible; }
  .js .nav.is-open nav {
    display: grid; position: absolute; top: 100%; left: 0; right: 0;
    padding: 0 var(--gut) 10px; background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    box-shadow: 0 28px 40px -30px color-mix(in srgb, var(--shadow) 45%, transparent);
  }
  .js .nav.is-open nav a { min-height: 56px; padding: 0; font-size: 18px; color: var(--ink); border-bottom: 1px solid var(--line-2); }
  .js .nav.is-open nav a:last-child { border-bottom: 0; }
}
@media (max-width: 739.98px) and (prefers-reduced-motion: no-preference) {
  .js .nav.is-open nav { transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease); }
  @starting-style { .js .nav.is-open nav { opacity: 0; transform: translateY(-6px); } }
}

@media (min-width: 360px) {
  .nav-x { display: inline; }
}
@media (min-width: 740px) {
  .nav-in { gap: 24px; }
  .nav nav { display: flex; gap: 8px; }
  .js .nav-menu { display: none; }
}
@media (min-width: 1180px) {
  .nav-in { grid-template-columns: 1fr auto 1fr; }
}

/* ---------- footer ---------- */
.ft { margin-top: var(--sec); border-top: 1px solid var(--line); }
.ft-in {
  max-width: var(--page); margin: 0 auto; padding: clamp(56px, 6vw, 88px) var(--gut) clamp(48px, 6vw, 88px);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px clamp(32px, 6vw, 104px); align-items: start;
}
.ft-brand .wm { display: inline-flex; align-items: center; min-height: 44px; font-size: clamp(40px, 3.4vw, 52px); }
.ft-tag { margin-top: 8px; font: 400 clamp(19px, 1.5vw, 22px)/1.3 var(--serif); color: var(--ink-2); }
.ft-when { margin-top: 28px; font: 400 var(--t-small)/1.5 var(--sans); color: var(--ink-3); max-width: 26em; }
.ft-nav { display: grid; grid-template-columns: repeat(2, max-content); column-gap: clamp(40px, 6vw, 96px); row-gap: 4px; justify-items: start; }
.ft-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font: 500 17px/1.2 var(--sans); color: var(--ink); text-decoration: underline; text-decoration-color: transparent;
}
.ft-nav a:hover, .ft-nav a:focus-visible { text-decoration-color: var(--accent); }
.ft-nav a:active { transform: translateY(1px); }
.ft-base { max-width: var(--page); margin: 0 auto; padding: 0 var(--gut) calc(36px + var(--safe-b)); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.ft-base::before { content: ""; flex: 0 0 100%; height: 1px; background: var(--line-2); margin-bottom: 8px; }
.ft-base p { font: 400 14px/1.45 var(--sans); color: var(--ink-3); }
.ft-base .ft-review { flex: 1 1 26em; }
.ft-base .theme { margin-left: auto; }

/* a note marking text that is still a draft (the founder letter) */
.draft-note { display: inline-block; margin-top: 18px; padding: 6px 10px; font: 400 14px/1.4 var(--sans); color: var(--ink-3); border: 1px dashed var(--field-line); border-radius: var(--r); }

/* ---------- building on scroll ----------
   site.js adds .is-in once an element with data-build is about 30% in view, and fires kl:in on it. The plain rule
   lifts the element itself into place. data-build="parts" leaves the element still, for sections that move their own
   children (write those as .js [data-build]:not(.is-in) ...). With scripts off everything shows as it is. */
[data-build] { transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease); }
.js [data-build]:not([data-build="parts"]):not(.is-in) { opacity: 0; transform: translateY(28px); }
[data-build="parts"] { transition: none; }

/* ---------- smaller screens ---------- */
@media (max-width: 899.98px) {
  .ft-in { grid-template-columns: 1fr; gap: 36px; }
  .ft-base .ft-review { flex-basis: 100%; order: 2; }
  .ft-base .theme { order: 1; }
}
@media (max-width: 520px) {
  :root { --nav-h: 64px; }
  .wm { font-size: 27px; }
  .btn.small { padding: 0 14px; font-size: 15px; }
  .wl-row { grid-template-columns: 1fr; gap: 8px; border: 0; background: none; }
  .wl-row:hover { border-color: transparent; }
  .wl-row:focus-within, .wl.err .wl-row { box-shadow: none; }
  .wl input { background: var(--field); border: 1px solid var(--field-line); border-radius: var(--r); }
  .wl input:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
  .wl.err input { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
  .wl .wl-row .btn { width: 100%; border-radius: var(--r); }
  .wd-line { font-size: 20px; }
  .wd-note p { font-size: 18px; }
  .nx-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row; }
  .nx-row input { grid-column: 1 / -1; border-bottom: 1px solid var(--field-line); }
  .nx-row .btn, .nx-row .btn:last-child { border-radius: 0; }
  .nx-row:has([data-ref-share][hidden]) [data-ref-copy] { grid-column: 1 / -1; }
}

/* ---------- small portrait: what we leave out ----------
   A phone held upright (below 740px) shows less, step by step, hidden with CSS only so the markup, the tablet and the
   desktop are unchanged; a phone on its side still shows everything. Each section file has its own block. Here: the
   room between sections, a third less (--sec from 56px to 40px, the footer's top from 56px), so the page reads as one
   scroll. */
@media (max-width: 739.98px) and (orientation: portrait) {
  :root { --sec: 40px; }
  .ft-in { padding-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .theme, .nx-link, a, a.wm, .wl-row, .nx-row, .nav, .nav-wm, .nav-menu, [data-build] { transition: none; }
  .js [data-build]:not([data-build="parts"]):not(.is-in) { opacity: 1; transform: none; }
}
