/* kennerific.space — shared design tokens and primitives
 * Hallmark · theme: studied-DNA (source: https://dialed.gg/) · paper oklch(100% 0 0) / dark oklch(14.5% 0.003 100)
 * font: Geist (single family) · neutrals tinted 0.003 @ hue 100 · studied: yes · DNA-source: url
 * The older token names below (--bg, --fg, --muted, …) are kept as aliases so every app keeps working.
 */

/* Geist, served from this site (SIL OFL 1.1, see assets/fonts/OFL.txt). One variable file per subset covers every weight. */
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;

  /* Surfaces + text */
  --color-paper:       oklch(100% 0 0);
  --color-paper-2:     oklch(97.5% 0.002 100);
  --color-rule:        oklch(91% 0.003 100);
  --color-rule-strong: oklch(83% 0.003 100);
  --color-ink:         oklch(15.5% 0.003 100);
  --color-muted:       oklch(50% 0.003 100);
  --color-faint:       oklch(54% 0.003 100);

  /* Primary pill on the page (inverts per mode) */
  --color-pill:     oklch(19% 0.003 100);
  --color-pill-ink: oklch(100% 0 0);

  /* Hub cards: the same in both modes */
  --color-card-top:      oklch(17% 0.003 100);
  --color-card-bottom:   oklch(27% 0.005 100);
  --color-card-flat:     oklch(20% 0.003 100);
  --color-card-ink:      oklch(100% 0 0);
  --color-card-muted:    oklch(100% 0 0 / 0.72);
  --color-card-pill:     oklch(100% 0 0);
  --color-card-pill-ink: oklch(15.5% 0.003 100);
  --color-card-scrim:    oklch(100% 0 0 / 0.1);

  /* One colour per item — the only chroma in the system */
  --color-tile-1: oklch(64% 0.21 15);   /* red-pink */
  --color-tile-2: oklch(77% 0.16 70);   /* orange */
  --color-tile-3: oklch(76% 0.13 190);  /* teal */
  --color-tile-4: oklch(62% 0.24 350);  /* magenta */
  --color-tile-5: oklch(55% 0.20 285);  /* violet */
  --color-tile-6: oklch(72% 0.19 150);  /* green */
  --color-tile-7: oklch(84% 0.16 90);   /* yellow */
  --color-tile-ink:      oklch(100% 0 0);          /* on tiles 1, 4, 5 */
  --color-tile-ink-dark: oklch(18% 0.003 100);     /* on light tiles 2, 3, 6, 7 */

  --color-focus: oklch(58% 0.19 255);

  /* Card edge: a heavy warm shadow lifts dark tiles off white */
  --color-shadow-near: oklch(20% 0.01 90 / 0.08);
  --color-shadow-mid:  oklch(20% 0.01 90 / 0);
  --color-shadow-far:  oklch(20% 0.01 90 / 0.62);
  --color-edge-line:   oklch(100% 0 0 / 0);
  --shadow-card:
    0 0 0 1px var(--color-edge-line),
    0 3px 6px 0 var(--color-shadow-near),
    0 16px 32px 0 var(--color-shadow-mid),
    0 56px 104px -18px var(--color-shadow-far);

  /* Puzzle colours (Connections, Mini) */
  --good: #2f7d4f;
  --bad: #b3413a;
  --c-yellow: #f1d77a;
  --c-green: #a8c686;
  --c-blue: #a9c3e8;
  --c-purple: #bca6dc;

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  --weight-regular: 400;
  --weight-medium:  500;
  --text-3xs: 0.6875rem;
  --text-2xs: 0.78125rem;
  --text-xs:  0.8125rem;
  --text-sm:  0.875rem;
  --text-md:  1rem;
  --text-lg:  1.375rem;
  --text-xl:  1.625rem;
  --text-2xl: 2.375rem;
  --leading-tight: 1.1;
  --leading-body:  1.45;
  --tracking-display: -0.04em;
  --tracking-body:    -0.02em;

  /* Space — 4pt scale */
  --space-3xs: 0.125rem;
  --space-2xs: 0.25rem;
  --space-xs:  0.5rem;
  --space-sm:  0.75rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Shape */
  --radius-card-lead: 30px;
  --radius-card:      24px;
  --radius-tile:      12px;
  --radius-pill:      999px;
  --rule-fine:        1px;

  /* Motion */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:     cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;
  --dur-long:  420ms;
  --dur-theme: 560ms;

  /* Older names, kept for the apps */
  --bg: var(--color-paper);
  --surface: var(--color-paper-2);
  --fg: var(--color-ink);
  --muted: var(--color-muted);
  --line: var(--color-rule);
  --line-strong: var(--color-rule-strong);
  --accent: var(--color-pill);
  --accent-fg: var(--color-pill-ink);
  --radius: 10px;
  --radius-sm: 6px;
  --font: var(--font-sans);
  --mono: var(--font-mono);
}

/* Dark: the system setting applies until a visitor picks; a pick sets data-theme on <html>. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-paper:       oklch(14.5% 0.003 100);
    --color-paper-2:     oklch(18.5% 0.003 100);
    --color-rule:        oklch(26% 0.003 100);
    --color-rule-strong: oklch(34% 0.003 100);
    --color-ink:         oklch(96.5% 0.002 100);
    --color-muted:       oklch(70% 0.003 100);
    --color-faint:       oklch(60% 0.003 100); /* 4.5:1 on paper */
    --color-pill:        oklch(96.5% 0.002 100);
    --color-pill-ink:    oklch(15.5% 0.003 100);
    --color-focus:       oklch(72% 0.15 255);
    --color-shadow-near: oklch(0% 0 0 / 0.35);
    --color-shadow-mid:  oklch(0% 0 0 / 0.4);
    --color-shadow-far:  oklch(0% 0 0 / 0.5);
    --color-edge-line:   oklch(100% 0 0 / 0.08);
    --good: #5fbf85;
    --bad: #e2706a;
    --c-yellow: #c9ad4c;
    --c-green: #7f9f5f;
    --c-blue: #7d98c2;
    --c-purple: #9580b8;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-paper:       oklch(14.5% 0.003 100);
  --color-paper-2:     oklch(18.5% 0.003 100);
  --color-rule:        oklch(26% 0.003 100);
  --color-rule-strong: oklch(34% 0.003 100);
  --color-ink:         oklch(96.5% 0.002 100);
  --color-muted:       oklch(70% 0.003 100);
  --color-faint:       oklch(60% 0.003 100); /* 4.5:1 on paper */
  --color-pill:        oklch(96.5% 0.002 100);
  --color-pill-ink:    oklch(15.5% 0.003 100);
  --color-focus:       oklch(72% 0.15 255);
  --color-shadow-near: oklch(0% 0 0 / 0.35);
  --color-shadow-mid:  oklch(0% 0 0 / 0.4);
  --color-shadow-far:  oklch(0% 0 0 / 0.5);
  --color-edge-line:   oklch(100% 0 0 / 0.08);
  --good: #5fbf85;
  --bad: #e2706a;
  --c-yellow: #c9ad4c;
  --c-green: #7f9f5f;
  --c-blue: #7d98c2;
  --c-purple: #9580b8;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition:
    background-color var(--dur-theme) var(--ease-in-out),
    color var(--dur-theme) var(--ease-in-out);
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--fg); color: var(--bg); }

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* Top bar used by every app */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px;
}
.bar a.home {
  text-decoration: none; font-weight: 500; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; /* comfortable touch target */
}
.bar a.home span { color: var(--muted); font-weight: 400; transition: transform .2s; display: inline-block; }
.bar a.home:hover span { transform: translateX(-3px); }
.bar .meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
/* Phones: a bar with puzzle controls has no room for the site name, so the home link shows just the arrow. */
@media (max-width: 440px) {
  .bar:has(.row) a.home { font-size: 0; }
  .bar:has(.row) a.home span { font-size: 18px; }
  .bar .row { flex-wrap: nowrap; }
}

h1.title {
  font-size: clamp(28px, 6vw, 40px); line-height: 1.1; letter-spacing: -0.04em;
  font-weight: 500; margin: 24px 0 6px;
}
p.lede { color: var(--muted); margin: 0 0 32px; }

/* Buttons */
.btn {
  appearance: none; border: 1px solid var(--line-strong); background: transparent;
  border-radius: 999px; padding: 9px 18px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background .15s, border-color .15s, opacity .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--fg); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .35; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { opacity: .88; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.center { justify-content: center; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 84px; transform: translate(-50%, -8px);
  background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer.foot {
  margin-top: auto; padding: 48px 0 32px; color: var(--muted); font-size: 13px;
}

:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

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

/* Hidden visually, still read by screen readers and reachable by keyboard */
.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;
}

/* About / Privacy / Contact links at the foot of every page */
.site-foot { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; }
.site-foot a { color: var(--muted); text-decoration: none; padding-block: 6px; }
.site-foot a:hover, .site-foot a[aria-current="page"] { color: var(--fg); }
.site-foot .site-foot__note { flex-basis: 100%; }

/* Long-form text: About, Privacy */
.prose { max-width: 62ch; }
.prose h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin: 36px 0 8px; }
.prose p, .prose li { color: var(--fg); line-height: 1.6; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 1.2em; }
.prose li + li { margin-top: 6px; }
.prose a { text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.prose a:hover { text-decoration-color: currentColor; }
.prose .small { color: var(--muted); font-size: 13px; margin-top: 24px; }

/* 404 */
.notfound { padding-block: 24px 16px; }
.notfound__code { margin: 24px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.notfound .title { margin-top: 8px; }
.notfound__links { list-style: none; padding: 0; margin: -12px 0 32px; display: flex; flex-wrap: wrap; gap: 8px; }
.notfound__links a {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; font-size: 14px;
}
.notfound__links a:hover { border-color: var(--fg); }
a.btn { display: inline-block; text-decoration: none; }
