/* paperboat — shared foundations: tokens, type, controls. */

/* Latin subsets, weights 400-700 (scripts/subset-fonts.sh). Fraunces is preloaded for the hero;
   the italics and Caveat load only when text uses them. */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/fraunces.woff2?v=ca10e3ed6b) format('woff2'); 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+2190-2193, U+2212, U+2215, U+2713, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 400 700; font-display: swap; src: url(/fonts/fraunces-italic.woff2?v=ca10e3ed6b) format('woff2'); 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+2190-2193, U+2212, U+2215, U+2713, U+FEFF, U+FFFD; }
@font-face { font-family: 'Work Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/worksans.woff2?v=ca10e3ed6b) format('woff2'); 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+2190-2193, U+2212, U+2215, U+2713, U+FEFF, U+FFFD; }
@font-face { font-family: 'Work Sans'; font-style: italic; font-weight: 400 700; font-display: swap; src: url(/fonts/worksans-italic.woff2?v=ca10e3ed6b) format('woff2'); 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+2190-2193, U+2212, U+2215, U+2713, U+FEFF, U+FFFD; }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/caveat.woff2?v=ca10e3ed6b) format('woff2'); 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+2190-2193, U+2212, U+2215, U+2713, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --paper: #fbf7ef;
  --paper-2: #f6f0e4;
  --paper-3: #ede4d3;
  --card: #fffdf9;
  --card-2: #fbf8f2;
  --ink: #23263a;
  --ink-2: #4a4e63;
  --ink-3: #606377;
  --ink-4: #a3a4af;
  --line: rgba(35, 38, 58, 0.11);
  --line-2: rgba(35, 38, 58, 0.2);
  --sea: #2c6a9a;
  --sea-2: #3f86bf;
  --sea-wash: #e5eff7;
  --coral: #b5411e; /* white text on it: 5.6:1 (WCAG AA) */
  --coral-2: #9a3618;
  --coral-wash: #fbe7de;
  --ochre: #c48a1f;
  --ochre-wash: #f8edd3;
  --sap: #4f7a2e;
  --sap-wash: #e7efdb;
  --rose: #c0506a;
  --rose-wash: #f8e3e7;
  --violet: #6b4f9e;
  --violet-wash: #ece6f6;
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--sea-2);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(35, 38, 58, 0.06);
  --shadow: 0 1px 2px rgba(35, 38, 58, 0.05), 0 10px 28px -14px rgba(35, 38, 58, 0.22);
  --shadow-lg: 0 2px 6px rgba(35, 38, 58, 0.05), 0 30px 70px -28px rgba(35, 38, 58, 0.34);
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Work Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', 'Bradley Hand', cursive;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --paper-tex: url(/art/paper.webp?v=ca10e3ed6b);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #15161c;
  --paper-2: #1a1c24;
  --paper-3: #23252f;
  --card: #1d1f28;
  --card-2: #22242e;
  --ink: #ede8dd;
  --ink-2: #c3beb3;
  --ink-3: #94918b;
  --ink-4: #6a6964;
  --line: rgba(237, 232, 221, 0.1);
  --line-2: rgba(237, 232, 221, 0.18);
  --sea: #86b9e0;
  --sea-2: #6aa6d6;
  --sea-wash: #1e2a36;
  --coral: #ef7b53;
  --coral-2: #f5916d;
  --coral-wash: #3a231b;
  --ochre: #e2b35a;
  --ochre-wash: #332a19;
  --sap: #9cc276;
  --sap-wash: #222c1b;
  --rose: #e07f96;
  --rose-wash: #35202a;
  --violet: #a994d6;
  --violet-wash: #272135;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.3), 0 30px 70px -28px rgba(0, 0, 0, 0.8);
  --paper-tex: url(/art/paper-dark.webp?v=ca10e3ed6b);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
body { overflow-x: clip; }
body {
  margin: 0;
  font: 400 17px/1.6 var(--font-body);
  color: var(--ink);
  background: var(--paper) var(--paper-tex) repeat;
  background-size: 512px 512px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; }
svg { display: inline-block; vertical-align: middle; flex: none; }
img { height: auto; }
a { color: var(--sea); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--coral); }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 0.5em; color: var(--ink); font-optical-sizing: auto; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5.6rem); line-height: 1.0; letter-spacing: -0.025em; }
h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); }
h3 { font-size: 1.45rem; letter-spacing: -0.01em; }
h4 { font-size: 1.15rem; }
em, .italic { font-style: italic; }
strong { font-weight: 600; }
small { font-size: 0.86em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
::selection { background: color-mix(in srgb, var(--sea-2) 30%, transparent); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-xs); }
code, kbd { font-family: var(--font-mono); font-size: 0.88em; }
kbd { padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--card); color: var(--ink-2); }
code { background: var(--paper-3); padding: 0.1em 0.35em; border-radius: 5px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

.hand { font-family: var(--font-hand); font-weight: 600; letter-spacing: 0.01em; }
.eyebrow { font-family: var(--font-hand); font-size: 1.65rem; line-height: 1; color: var(--coral); display: inline-block; transform: rotate(-2deg); margin-bottom: 0.6rem; font-weight: 600; }
.muted { color: var(--ink-3); }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-2); line-height: 1.55; }

/* --------------------------------------------------------------- buttons --- */
.btn {
  --b-bg: var(--card); --b-fg: var(--ink); --b-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 44px; padding: 0.6em 1.15em; border-radius: 999px;
  font: 600 0.98rem/1.1 var(--font-body); letter-spacing: 0.005em;
  color: var(--b-fg); background: var(--b-bg); border: 1px solid var(--b-line);
  text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s, color .2s, border-color .2s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { color: var(--b-fg); transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--ink-3); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn[disabled], .btn.is-busy { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn.is-busy { cursor: progress; }
.btn-primary { --b-bg: var(--coral); --b-fg: #fff; --b-line: transparent; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 18px -8px color-mix(in srgb, var(--coral) 70%, transparent); }
.btn-primary:hover { --b-bg: var(--coral-2); border-color: transparent; color: #fff; }
:root[data-theme='dark'] .btn-primary { --b-fg: #1a1210; }
:root[data-theme='dark'] .btn-primary:hover { color: #1a1210; }
.btn-ink { --b-bg: var(--ink); --b-fg: var(--paper); --b-line: transparent; }
.btn-ink:hover { --b-fg: var(--paper); border-color: transparent; }
.btn-ghost { --b-bg: transparent; --b-line: transparent; box-shadow: none; }
.btn-ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); box-shadow: none; transform: none; border-color: transparent; }
.btn-danger { --b-fg: var(--coral); }
.btn-lg { min-height: 54px; padding: 0.8em 1.5em; font-size: 1.06rem; }
.btn-sm { min-height: 34px; padding: 0.35em 0.85em; font-size: 0.88rem; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.link-arrow { font-weight: 600; text-decoration: none; display: inline-flex; gap: .35em; align-items: center; }
.link-arrow::after { content: '→'; transition: transform .2s var(--ease); }
.link-arrow:hover::after { transform: translateX(3px); }

/* ----------------------------------------------------------------- forms --- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.field .help { font-size: 0.85rem; color: var(--ink-3); line-height: 1.45; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--sea-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sea-2) 22%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2374778a' stroke-width='1.6'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--coral); }
.form-error { color: var(--coral-2); background: var(--coral-wash); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.94rem; margin-bottom: 14px; }
:root[data-theme='dark'] .form-error { color: var(--coral); }
.form-note { color: var(--sap); background: var(--sap-wash); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.94rem; margin-bottom: 14px; }

/* ----------------------------------------------------------------- paint --- */
/* Watercolours are rendered as transmittance on white, so multiply lays them
   straight onto the page's paper. In dark mode they sit on a sheet of paper. */
.paint { position: relative; margin: 0; }
.paint img { mix-blend-mode: multiply; width: 100%; }
:root[data-theme='dark'] .paint.sheet {
  isolation: isolate;
  background: #f4efe4 url(/art/paper.webp?v=ca10e3ed6b);
  background-size: 512px;
  -webkit-mask: url(/art/deckle.png?v=ca10e3ed6b) center / 100% 100% no-repeat;
  mask: url(/art/deckle.png?v=ca10e3ed6b) center / 100% 100% no-repeat;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.45));
  padding: 3%;
}
:root[data-theme='dark'] .paint.sheet img { filter: saturate(1.05); }
:root[data-theme='dark'] .paint.decor img { opacity: 0; }
.paint .night-art { display: none; }
:root[data-theme='dark'] .paint.has-night .day-art { display: none; }
:root[data-theme='dark'] .paint.has-night .night-art { display: block; mix-blend-mode: normal; opacity: 1; }

/* ------------------------------------------------------------ platform ico --- */
.pi { flex: none; }
.chip-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; flex: none; }
.chip-icon svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------- utilities --- */
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.wrap-narrow { width: min(760px, 100% - 40px); margin-inline: auto; }
.stack > * + * { margin-top: var(--stack, 1rem); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.center { text-align: center; }
.badge { display: inline-flex; align-items: center; gap: 6px; font: 600 0.74rem/1 var(--font-body); letter-spacing: .04em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; background: var(--paper-3); color: var(--ink-2); }
.badge-sea { background: var(--sea-wash); color: var(--sea); }
.badge-coral { background: var(--coral-wash); color: var(--coral); }
.badge-sap { background: var(--sap-wash); color: var(--sap); }
.badge-ochre { background: var(--ochre-wash); color: var(--ochre); }
.badge-rose { background: var(--rose-wash); color: var(--rose); }
.badge-violet { background: var(--violet-wash); color: var(--violet); }
/* Light mode: badge text dark enough to read on its wash (4.5:1). */
:root:not([data-theme='dark']) .badge-sap { color: #476e29; }
:root:not([data-theme='dark']) .badge-ochre { color: #85570a; }
:root:not([data-theme='dark']) .badge-rose { color: #9a4055; }

.theme-toggle { color: var(--ink-2); }
.theme-toggle .moon { display: none; }
:root[data-theme='dark'] .theme-toggle .sun { display: none; }
:root[data-theme='dark'] .theme-toggle .moon { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* near-black brand chips need a hint of an edge on dark paper */
:root[data-theme='dark'] .chip-icon[style*="#0f1419"],
:root[data-theme='dark'] .chip-icon[style*="#101010"],
:root[data-theme='dark'] .chip-icon[style*="#000000"],
:root[data-theme='dark'] .chip-icon[style*="rgb(15, 20, 25)"],
:root[data-theme='dark'] .chip-icon[style*="rgb(16, 16, 16)"],
:root[data-theme='dark'] .chip-icon[style*="rgb(0, 0, 0)"] { box-shadow: 0 0 0 1px rgba(255, 255, 255, .28); }
