/* Inkloom website. Colours are the app's Lavender (light) and Dusk (dark) themes from src/styles.css, with two
   additions so text reaches WCAG AA: --ink (accent for links and small text) and --btn (button fill). */

@font-face { font-family: 'Literata'; src: url('fonts/literata-latin-wght-normal.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('fonts/literata-latin-wght-italic.woff2') format('woff2'); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree-latin-wght-normal.woff2') format('woff2'); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('fonts/caveat-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --bg: #f1eef8; --panel: #faf8fd; --well: #e8e3f3; --text: #2e2840; --muted: #696181; --faint: #9c94b5;
  --accent: #8f7bc8; --accent-soft: #e4ddf5; --line: #e2dcef; --warm: #e59a82; --rose: #c9737e; --shadow: #4a3f75;
  --ink: #675990; --btn: #675990; --on-btn: #ffffff;
  --paper: #fffdfb; --rule: #dcd6ec; --pen: #3a3170; --red: #d42f2f; --hi: #f5e27a;
  --shadow-k: 12%;

  --font-display: 'Literata', 'Sitka Heading', Georgia, serif;
  --font-body: 'Figtree', 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --font-hand: 'Caveat', 'Segoe Print', cursive;

  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
  --shadow-card: 0 8px 30px color-mix(in srgb, var(--shadow) var(--shadow-k), transparent);
  --shadow-lg: 0 18px 50px color-mix(in srgb, var(--shadow) calc(var(--shadow-k) * 1.5), transparent),
               0 2px 6px color-mix(in srgb, var(--shadow) var(--shadow-k), transparent);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

/* Dusk: used when the system is dark (unless the visitor picked light), or when they picked dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #2a2638; --panel: #352f48; --well: #302b41; --text: #ede7f6; --muted: #b5accf; --faint: #8a81a6;
    --accent: #c6b4f0; --accent-soft: #4a4263; --line: #413a57; --warm: #f2b8a2; --rose: #ee9aa6; --shadow: #000;
    --ink: #c6b4f0; --btn: #c6b4f0; --on-btn: #2a2638;
    --paper: #3a3350; --rule: #4b4463; --pen: #e4dcfb; --red: #ff8f87; --hi: #8a7a2e;
    --shadow-k: 34%;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #2a2638; --panel: #352f48; --well: #302b41; --text: #ede7f6; --muted: #b5accf; --faint: #8a81a6;
  --accent: #c6b4f0; --accent-soft: #4a4263; --line: #413a57; --warm: #f2b8a2; --rose: #ee9aa6; --shadow: #000;
  --ink: #c6b4f0; --btn: #c6b4f0; --on-btn: #2a2638;
  --paper: #3a3350; --rule: #4b4463; --pen: #e4dcfb; --red: #ff8f87; --hi: #8a7a2e;
  --shadow-k: 34%;
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text);
  /* Faint dotted paper, like Inkloom's dotted template. */
  background: var(--bg) radial-gradient(color-mix(in srgb, var(--faint) 30%, transparent) 1px, transparent 1.6px) 0 0 / 24px 24px;
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -.012em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.35rem, 5.4vw, 4.1rem); font-weight: 560; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); font-weight: 560; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
.muted { color: var(--muted); }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--panel); color: var(--text); padding: 10px 14px; border-radius: var(--r-md); box-shadow: var(--shadow-card); }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-head.scrolled { border-bottom-color: var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 1.3rem/1 var(--font-display); }
.brand svg { width: 32px; height: 32px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .97rem; padding: 8px 12px; border-radius: 999px; transition: color .15s, background-color .15s; }
.nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.head-actions { display: flex; align-items: center; gap: 8px; }
.theme-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background-color .15s, transform .15s var(--ease); }
.theme-btn:hover { background: var(--well); }
.theme-btn:active { transform: scale(.94); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
:root[data-mode='dark'] .theme-btn .sun { display: none; }
:root[data-mode='dark'] .theme-btn .moon { display: block; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; font: 600 1rem/1 var(--font-body); text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background-color .18s, transform .18s var(--ease), box-shadow .18s; }
.btn-primary { background: var(--btn); color: var(--on-btn); box-shadow: 0 6px 18px color-mix(in srgb, var(--btn) 30%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--btn) 88%, var(--text)); transform: translateY(-1px); }
.btn-primary:active { transform: scale(.97); }
.btn-quiet { background: transparent; color: var(--text); border-color: var(--line); }
.btn-quiet:hover { background: var(--panel); }
.btn[aria-disabled='true'] { cursor: default; color: var(--muted); background: transparent; border-style: dashed; border-color: var(--faint); transform: none; box-shadow: none; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .94rem; }

/* Hero */
.hero { position: relative; padding: clamp(32px, 5vw, 72px) 0 clamp(32px, 4vw, 56px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero-copy .lede { font-size: clamp(1.08rem, 1.5vw, 1.22rem); color: var(--muted); max-width: 32em; }
.hero h1 em { font-style: italic; font-weight: 500; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 18px; }
.fine { font-size: .93rem; color: var(--muted); margin: 0; }
.blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.blob-a { width: 420px; height: 420px; background: var(--accent-soft); right: 4%; top: 6%; }
.blob-b { width: 260px; height: 260px; background: color-mix(in srgb, var(--warm) 40%, var(--bg)); right: 32%; bottom: 0; opacity: .35; }

/* The app window mock-up used in the hero */
.app { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 10px; background: var(--well); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.app-side { background: var(--panel); border-radius: var(--r-lg); padding: 14px 10px; display: flex; flex-direction: column; gap: 6px; font-size: .8rem; }
.app-side .nb { display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 2px 6px 8px; }
.app-side .nb svg { width: 20px; height: 20px; }
.tab { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r-sm); color: var(--muted); }
.tab::before { content: ''; width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--accent)); flex: none; }
.tab.on { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.app-side .pages { margin: 8px 0 0; padding: 10px 6px 0; border-top: 1px solid var(--line); display: grid; gap: 7px; color: var(--muted); }
.app-side .pages span { display: block; height: 7px; border-radius: 4px; background: var(--well); }
.app-side .pages span:nth-child(2) { width: 75%; } .app-side .pages span:nth-child(3) { width: 85%; }
.sheet { position: relative; background-color: var(--paper); border-radius: var(--r-lg); overflow: hidden;
  background-image: repeating-linear-gradient(to bottom, transparent 0 39px, var(--rule) 39px 40px);
  background-position: 0 22px; }
.sheet::before { content: ''; position: absolute; left: 46px; top: 0; bottom: 0; width: 1.5px; background: color-mix(in srgb, var(--rose) 45%, transparent); }
.sheet svg { width: 100%; height: auto; position: relative; }
.toolbar { position: absolute; top: -18px; left: 50%; translate: -50% 0; display: flex; gap: 2px; padding: 5px; background: var(--panel); border-radius: 999px; box-shadow: var(--shadow-card); border: 1px solid var(--line); }
.toolbar i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.toolbar i.on { background: var(--accent-soft); color: var(--text); }
.toolbar svg { width: 16px; height: 16px; }

/* Handwriting inside drawn pages */
.sheet.plain { background-image: none; }
.sheet.plain::before { display: none; }
.rules path { fill: none; stroke: var(--rule); stroke-width: 1; }
.rules .margin { stroke: color-mix(in srgb, var(--rose) 45%, transparent); stroke-width: 1.5; }
.axis path { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; }
.axis-num text { font: 500 12px var(--font-body); fill: var(--muted); text-anchor: middle; }
.dot-pen { fill: var(--pen); }
.paper-fill { fill: var(--paper); }
.c-lav { --c: #8f7bc8; } .c-warm { --c: #e59a82; } .c-rose { --c: #c9737e; } .c-sage { --c: #7c9a6b; }
.binder .dot { background: var(--c); }
.hand { font-family: var(--font-hand); fill: var(--pen); }
.red { fill: var(--red); }
.stroke-pen { fill: none; stroke: var(--pen); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.stroke-red { fill: none; stroke: var(--red); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.stroke-acc { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hi { fill: var(--hi); opacity: .55; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .hi { mix-blend-mode: screen; opacity: .45; } }
:root[data-theme='dark'] .hi { mix-blend-mode: screen; opacity: .45; }

/* The one orchestrated moment: on load the ink underline draws, the highlighter swipes, Quillet marks in red. */
@media (prefers-reduced-motion: no-preference) {
  .js .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .5s var(--ease) var(--delay, 0s) both; }
  .js .swipe { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); animation: swipe .38s var(--ease) var(--delay, 0s) forwards; }
  .js .pop { opacity: 0; animation: pop .3s var(--ease) var(--delay, 0s) forwards; }
}
.d0 { --delay: .15s; } .d1 { --delay: .35s; } .d2 { --delay: .65s; } .d3 { --delay: .8s; }
/* Starts invisible: a round line end would otherwise show as a dot before the line draws. */
@keyframes draw { from { stroke-dashoffset: 1; opacity: 0; } 1% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes swipe { to { transform: scaleX(1); } }
@keyframes pop { to { opacity: 1; } }

/* Sections */
section { scroll-margin-top: 80px; }
.section { padding: clamp(48px, 6.5vw, 92px) 0; }
.section-head { max-width: 40rem; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.split.flip > :first-child { order: 2; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before { content: ''; position: absolute; left: 2px; top: .38em; width: 16px; height: 16px; background: var(--accent); -webkit-mask: var(--tick) center / contain no-repeat; mask: var(--tick) center / contain no-repeat; }
:root { --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.8c1.6 1.2 2.8 2.6 3.6 4.2C8 8.6 10.6 5.2 13.8 2.6' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ticks strong { font-weight: 650; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-card); }

/* Binder: notebooks, sections, pages */
.binder { display: grid; grid-template-columns: .9fr 1fr 1.2fr; overflow: hidden; font-size: .92rem; }
.binder > div { padding: 18px 14px; display: grid; align-content: start; gap: 4px; }
.binder > div + div { border-left: 1px solid var(--line); }
.binder .col-title { font-size: .8rem; color: var(--muted); font-weight: 600; padding: 0 8px 8px; }
.binder .row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); }
.binder .row.on { background: var(--accent-soft); font-weight: 600; }
.binder .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.binder .page { display: grid; gap: 1px; }
.binder .page small { color: var(--muted); font-size: .78rem; }
.binder > .search { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); grid-column: 1 / -1; color: var(--muted); font-size: .92rem; }
.search svg { width: 16px; height: 16px; flex: none; }
.search b { color: var(--text); font-weight: 600; }
.search .hit { margin-left: auto; font-size: .78rem; background: var(--accent-soft); color: var(--text); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }

/* Tools */
.tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 32px; padding: 0; list-style: none; }
.tools li { display: inline-flex; align-items: center; gap: 9px; padding: 9px 16px 9px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-weight: 550; font-size: .97rem; }
.tools li span { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; color: var(--ink); }
.tools svg { width: 16px; height: 16px; }
.papers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 2vw, 20px); margin: 0; max-width: 640px; }
.papers figure { margin: 0; }
.papers .p { aspect-ratio: 3 / 4; border-radius: var(--r-md); background-color: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.papers .lined { background-image: repeating-linear-gradient(to bottom, transparent 0 15px, var(--rule) 15px 16px); }
.papers .grid { background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 16px 16px; }
.papers .dotted { background-image: radial-gradient(var(--faint) 1.2px, transparent 1.4px); background-size: 16px 16px; }
.papers figcaption { font-size: .9rem; color: var(--muted); margin-top: 10px; text-align: center; }
.tool-notes { margin-top: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 40px; color: var(--muted); }
.tool-notes p { margin: 0; }
.tool-notes strong { color: var(--text); font-weight: 650; }

/* Science and computing worksheet */
.worksheet { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0; overflow: hidden; }
.worksheet > * { padding: clamp(18px, 2.4vw, 28px); }
.worksheet .graph { margin: 0; background: var(--paper); border-right: 1px solid var(--line); }
.worksheet .graph svg { width: 100%; height: auto; }
.worksheet figcaption { font-size: .92rem; color: var(--muted); margin-top: 10px; }
.worksheet .side { display: grid; gap: 22px; align-content: start; }
.worksheet h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 650; margin-bottom: 8px; }
.worksheet .side p { color: var(--muted); font-size: .95rem; margin: 0; }
.truth { border-collapse: collapse; font: 500 .9rem/1 var(--font-body); font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.truth th, .truth td { padding: 3px 12px; text-align: center; border-bottom: 1px solid var(--line); }
.truth th { font-weight: 650; color: var(--muted); }
.truth td:last-child, .truth th:last-child { border-left: 2px solid var(--line); font-weight: 700; color: var(--ink); }
.expr { font-family: var(--font-hand); font-size: 1.45rem; color: var(--pen); margin: 0 0 8px; }
.circuit svg { width: 100%; max-width: 280px; height: auto; margin-bottom: 8px; }

/* PDFs */
.pdf-stack { position: relative; max-width: 440px; margin-inline: auto; }
.pdf-stack .sheet2 { position: absolute; inset: 14px -14px -14px 14px; background: var(--well); border-radius: var(--r-lg); border: 1px solid var(--line); }
.pdf { position: relative; background: var(--paper); border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 22px 24px; }
.pdf .pdf-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--rule); padding-bottom: 8px; margin-bottom: 12px; }
.pdf .q { font-size: .88rem; margin: 0 0 4px; }
.pdf svg { width: 100%; height: auto; }
.pdf-badge { position: absolute; right: -10px; top: -12px; background: var(--btn); color: var(--on-btn); font-size: .76rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; rotate: 4deg; }

/* Quillet */
.quillet { --muted: color-mix(in srgb, var(--muted) 78%, var(--text)); background: var(--accent-soft); border-radius: clamp(24px, 4vw, 40px); padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 64px); position: relative; overflow: hidden; }
.quillet .split { align-items: start; }
.quillet h2 { max-width: 14em; }
.quillet .lede { font-size: 1.12rem; }
.chat { background: var(--panel); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 18px; display: grid; gap: 12px; font-size: .95rem; }
.chat-head { display: flex; align-items: center; gap: 10px; font-weight: 650; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.chat-head svg { width: 34px; height: 34px; }
.chat-head small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; }
.msg.me { justify-self: end; background: var(--btn); color: var(--on-btn); border-bottom-right-radius: 5px; }
.msg.q { background: var(--well); border-bottom-left-radius: 5px; }
.msg .mini { margin-top: 10px; background: var(--paper); border-radius: var(--r-md); border: 1px solid var(--line); overflow: hidden; }
.msg .mini svg { width: 100%; height: auto; }
.chat-input { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 8px 8px 16px; color: var(--muted); font-size: .9rem; }
.chat-input i { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; background: var(--btn); color: var(--on-btn); display: grid; place-items: center; }
.chat-input svg { width: 15px; height: 15px; }
.q-facts { margin-top: 28px; display: grid; gap: 6px; font-size: .97rem; }
.q-facts p { margin: 0; }

/* Sync & safety */
.safety { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px) clamp(24px, 4vw, 56px); margin: 0; }
.safety div { border-top: 2px solid var(--accent); padding-top: 16px; }
.safety dt { font: 600 1.15rem/1.25 var(--font-display); margin-bottom: 6px; }
.safety dd { margin: 0; color: var(--muted); }

/* Works with Fennly */
.pair { display: grid; grid-template-columns: auto 1fr auto; gap: clamp(20px, 4vw, 48px); align-items: center; padding: clamp(24px, 4vw, 44px); }
.pair .pets { display: flex; align-items: end; gap: 4px; }
.pair .pets svg { width: 84px; height: 84px; }
.pair h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.pair p { color: var(--muted); margin: 0; }

/* FAQ */
.faq { max-width: 46rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative; font: 600 1.12rem/1.35 var(--font-display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); translate: 0 -70%; rotate: 45deg; transition: rotate .2s var(--ease); }
.faq details[open] summary::after { rotate: 225deg; translate: 0 -20%; }
.faq details p { color: var(--muted); padding-right: 40px; }

/* Get it */
.get { text-align: center; display: grid; justify-items: center; gap: 4px; }
.get .pot { width: 120px; height: 120px; }
.get .pot .quill { transform-origin: 64px 54px; transition: rotate .6s var(--ease); }
.get .pot:hover .quill { rotate: -8deg; }
.get p { max-width: 34rem; color: var(--muted); }
.get .cta-row { justify-content: center; margin-top: 12px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); font-size: .94rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--text); }

/* Plain text pages (privacy, 404) */
.doc { max-width: 44rem; padding: clamp(40px, 6vw, 72px) 0 80px; }
.doc h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
.doc h2 { font-size: 1.45rem; margin-top: 2em; }
.doc li { margin-bottom: .4em; }
.draft-note { background: var(--accent-soft); border-radius: var(--r-lg); padding: 16px 20px; margin: 0 0 32px; }
.draft-note p { margin: 0; }

/* Narrower screens */
@media (max-width: 960px) {
  .nav { display: none; }
  .head-actions { margin-left: auto; }
  .hero .wrap, .split { grid-template-columns: minmax(0, 1fr); }
  .split.flip > :first-child { order: 0; }
  .worksheet { grid-template-columns: minmax(0, 1fr); }
  .worksheet .graph { border-right: 0; border-bottom: 1px solid var(--line); }
  .safety { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pair { grid-template-columns: minmax(0, 1fr); justify-items: start; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .app { grid-template-columns: minmax(0, 1fr); padding: 8px; }
  .app-side { display: none; }
  .toolbar i:nth-child(n+6) { display: none; }
  .binder { grid-template-columns: minmax(0, 1fr); }
  .binder > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .binder .notebooks { display: none; }
  .papers { gap: 8px; }
  .papers figcaption { font-size: .8rem; }
  .safety { grid-template-columns: minmax(0, 1fr); }
  .head-actions .btn { padding: 0 14px; }
  .pdf-badge { right: 8px; }
  .search .hit { display: none; }
}
@media (max-width: 420px) {
  .head-actions .btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Hand-made touches: doodles by the headings, margin notes on the pictures ---------- */
.doodle { display: block; width: 46px; height: 46px; margin: 0 0 10px -2px; color: var(--accent); }
.doodle path, .doodle circle { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.doodle .fill { fill: currentColor; stroke: none; }
.annot-wrap { position: relative; }
.annot { position: absolute; z-index: 2; font: 400 1.55rem/1.05 var(--font-hand); color: var(--ink); pointer-events: none; white-space: nowrap; }
.scribble { position: relative; white-space: nowrap; }
.scribble svg { position: absolute; left: -2%; bottom: -.18em; width: 104%; height: .32em; overflow: visible; }
.scribble path { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tape { position: absolute; z-index: 3; width: 92px; height: 24px; background: color-mix(in srgb, var(--warm) 55%, transparent); opacity: .75; rotate: -5deg;
  -webkit-mask: linear-gradient(90deg, transparent 0 3px, #000 3px calc(100% - 3px), transparent calc(100% - 3px)); mask: linear-gradient(90deg, transparent 0 3px, #000 3px calc(100% - 3px), transparent calc(100% - 3px)); }
@media (max-width: 960px) {
  .annot { display: none; }
}

/* Where the notes sit beside each picture (wide screens only) */
.n-binder { right: 0; top: -54px; }
.n-tools { right: 0; top: -58px; }
.n-pdf { right: 64px; top: -50px; }
.tape-pdf { left: 34%; top: -10px; }
.tape-pair { left: 40px; top: -12px; rotate: 4deg; }

/* ---------- Margin notes: the arrow is drawn by site.js from the note to what it points at ---------- */
.arrow-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; pointer-events: none; }
.arrow-layer svg { position: absolute; overflow: visible; max-width: none; }
.arrow-layer path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.annot.off { display: none; }
@media (prefers-reduced-motion: no-preference) {
  /* Notes write themselves in once they come into view, then their arrow draws. */
  .js .annot { clip-path: inset(-30% 101% -30% -4%); transition: clip-path .9s cubic-bezier(.4, .1, .3, 1); }
  .js .annot.w { clip-path: inset(-30% -4% -30% -4%); }
  .js .arrow-layer svg path { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset .45s var(--ease) .75s, opacity 0s .75s; }
  .js .arrow-layer svg.w path { stroke-dashoffset: 0; opacity: 1; }
  .js .arrow-layer svg.w path + path { transition-delay: 1.15s; }

  /* Companions: a blink now and then, and the plant or quill moving gently, as in the apps. */
  .eyes { transform-box: fill-box; transform-origin: center; animation: blink 6s infinite; }
  .plant { transform-origin: 60px 74px; animation: sway 4.6s ease-in-out infinite; }
  .quill { transform-origin: 62px 54px; animation: quill 5.2s ease-in-out infinite; }
}
@keyframes blink { 0%, 94%, 100% { scale: 1 1; } 96% { scale: 1 .12; } }
@keyframes sway { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
@keyframes quill { 0%, 100% { rotate: 0deg; } 50% { rotate: -6deg; } }

/* The light that follows the mouse (desktop only; site.js adds it). */
.follow { position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity .35s; will-change: transform; }
.follow.on { opacity: 1; }

/* Inkloom: the paper's dots glow a little around the pointer. */
.follow { width: 260px; height: 260px;
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 85%, transparent) 1.5px, transparent 2.1px); background-size: 24px 24px;
  -webkit-mask: radial-gradient(closest-side, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 100%); mask: radial-gradient(closest-side, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 100%); }

/* Mock-ups that answer the pointer */
.tools li { transition: background-color .18s, border-color .18s, translate .18s var(--ease); }
.tools li:hover { background: var(--accent-soft); border-color: transparent; translate: 0 -2px; }
.tools li span { transition: rotate .25s var(--ease); }
.tools li:hover span { rotate: -12deg; }
.toolbar i { transition: background-color .15s, color .15s; }
.toolbar i:hover { background: var(--well); color: var(--text); }
.binder .row { transition: background-color .15s; }
.binder .row:not(.on):hover { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.plate { stroke-width: 2.8; }
@media (prefers-reduced-motion: no-preference) {
  .js .chat[data-reveal]:not(.seen) .msg, .js .chat[data-reveal]:not(.seen) .chat-input { opacity: 0; translate: 0 8px; }
  .chat .msg, .chat .chat-input { transition: opacity .4s var(--ease), translate .4s var(--ease); }
  .chat .msg:nth-of-type(2) { transition-delay: .5s; } .chat .msg:nth-of-type(3) { transition-delay: 1.3s; }
  .chat .msg:nth-of-type(4) { transition-delay: 1.9s; } .chat .chat-input { transition-delay: 2.3s; }
}
