/* Shared foundation: tokens, buttons, toasts, motion. */
:root {
  --ink: #17241f;
  --ink-2: #2a3a33;
  --muted: #56635c;
  --line: #d9d4c8;
  --line-2: #e8e4da;
  --paper: #f6f4ee;
  --white: #ffffff;
  --stone: #ece8df;
  --sand: #e0d9cb;
  --sage: #c9d1c4;
  --sage-2: #a9b5a6;
  --kelp: #17241f;
  --kelp-2: #1f3029;
  --accent: #2f6b62;
  --accent-ink: #ffffff;
  --accent-soft: #dde9e4;
  --apricot: #e39a3b;
  --apricot-ink: #8f5410;
  --bronze: #8a7556;
  --ok: #2a6f47;
  --ok-soft: #e3f1e7;
  --warn: #8a5e0e;
  --warn-soft: #fbf0d6;
  --info: #2c5f8a;
  --info-soft: #e1ecf6;
  --danger: #a33a2a;
  --danger-soft: #f8e3df;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23, 36, 31, .06), 0 8px 24px rgba(23, 36, 31, .08);
  --shadow-lg: 0 2px 4px rgba(23, 36, 31, .06), 0 24px 60px rgba(23, 36, 31, .18);
  --bar-h: 0px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.55; font-size: 16px; -webkit-font-smoothing: antialiased; padding-top: var(--bar-h); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.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; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 300; }
.skip:focus { top: 8px; }
body.has-dialog { overflow: hidden; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 600; font-size: 15px; line-height: 1.1; cursor: pointer; text-decoration: none; transition: transform .18s var(--ease), background .18s, border-color .18s, box-shadow .18s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; box-shadow: 0 6px 18px rgba(21, 24, 31, .2); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { background: #245850; box-shadow: 0 6px 18px rgba(47, 107, 98, .3); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--white); border-color: var(--ink); }
.btn.light { background: #fff; color: var(--ink); }
.btn.light:hover { background: var(--stone); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { padding: 8px 14px; font-size: 13.5px; }
.btn.xs { padding: 6px 11px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn .arrow { transition: transform .18s var(--ease); display: inline-block; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Dialogs ---------- */
.dlg-backdrop { position: fixed; inset: 0; z-index: 400; background: rgba(21, 24, 31, .45); display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .2s; backdrop-filter: blur(3px); }
.dlg-backdrop.is-in { opacity: 1; }
.dlg { background: #fff; color: var(--ink); width: min(100%, 760px); max-height: calc(100vh - 40px); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateY(12px) scale(.985); transition: transform .22s var(--ease); overflow: hidden; }
.dlg.sm { width: min(100%, 460px); }
.dlg.lg { width: min(100%, 980px); }
.dlg.xl { width: min(100%, 1180px); }
.dlg-backdrop.is-in .dlg { transform: none; }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 14px; border-bottom: 1px solid var(--line-2); }
.dlg-title { font-size: 20px; font-weight: 700; }
.dlg-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.dlg-x { background: var(--stone); border: 0; width: 36px; height: 36px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; flex: 0 0 auto; }
.dlg-x:hover { background: var(--sand); }
.dlg-body { padding: 20px 24px; overflow: auto; }
.dlg-body p:last-child { margin-bottom: 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
@media (max-width: 600px) { .dlg-backdrop { padding: 0; align-items: end; } .dlg { max-height: 94vh; border-radius: 18px 18px 0 0; } }

/* ---------- Toasts ---------- */
.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 500; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--ink); color: #fff; padding: 12px 12px 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); transform: translateY(12px); opacity: 0; transition: transform .25s var(--ease), opacity .25s; font-size: 14px; }
.toast.is-in { transform: none; opacity: 1; }
.toast-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: 0 0 auto; }
.toast-ok .toast-dot { background: #6cc48a; }
.toast-body a { color: #fff; font-weight: 700; }
.toast-x { background: transparent; border: 0; color: #fff; opacity: .7; font-size: 18px; cursor: pointer; line-height: 1; padding: 0 2px; margin-left: auto; }

/* ---------- Status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; background: var(--stone); color: var(--ink-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.list .ico.issue { background: var(--danger-soft); color: var(--danger); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.plain::before { display: none; }
.sample-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted); border: 1px dashed var(--line); padding: 4px 9px; border-radius: 6px; background: rgba(255, 255, 255, .6); }

/* ---------- Motion ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal="2"] { transition-delay: .12s; }
[data-reveal="3"] { transition-delay: .24s; }
[data-reveal="4"] { transition-delay: .36s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

