/* site.css — shared design system for the FL Number Practice site.
   Mobile-first. Scales up at 720px (tablet) and 1100px (desktop). */

:root {
  /* Surfaces */
  --paper:        #F1ECE0;
  --paper-raised: #FAF6EC;
  --paper-sunk:   #E8E1D2;
  /* Ink */
  --ink:          #15110A;
  --ink-soft:     rgba(21, 17, 10, 0.62);
  --ink-faint:    rgba(21, 17, 10, 0.28);
  --hair:         rgba(21, 17, 10, 0.14);
  /* Accents */
  --signal-red:   #D63A2F;
  --ok-green:     #2E6B3E;
  --error-red:    #A02A1F;
  --highlight:    #F2C94C;

  /* Type */
  --ui-font:    "Space Grotesk", "Inter", system-ui, sans-serif;
  --num-font:   "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  --serif-font: "Instrument Serif", Georgia, serif;

  /* Sizes (mobile defaults; bumped at desktop) */
  --pad-page: 22px;
  --pad-card: 20px;
  --r-card:   18px;
  --r-pill:   999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 16px;
}
body { min-height: 100vh; }

a { color: inherit; }
img { max-width: 100%; display: block; }

/* ── Eyebrow / small caps ── */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow.red { color: var(--signal-red); }

/* ── Type scale ── */
.serif-h1 {
  font-family: var(--serif-font);
  font-weight: 400;
  font-size: clamp(40px, 8vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
}
.serif-h2 {
  font-family: var(--serif-font);
  font-weight: 400;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
}
.serif-h3 {
  font-family: var(--serif-font);
  font-weight: 400;
  font-size: clamp(22px, 3.6vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}
.lede {
  font-family: var(--serif-font);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.4;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0;
}
.prose { font-size: 16px; line-height: 1.6; color: var(--ink); }
.prose p { margin: 0 0 1em; }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.prose a { color: var(--signal-red); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ── Page layout ── */
.site-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--pad-page);
}

/* ── Header / top nav ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 0.5px solid var(--hair);
}
.site-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--signal-red); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--num-font); font-weight: 800; font-size: 15px;
  letter-spacing: -0.04em;
}
.brand .name {
  font-family: var(--serif-font); font-weight: 400;
  font-size: 19px; letter-spacing: -0.01em;
}
.nav-links {
  display: none;
  gap: 6px;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: var(--ink-soft);
}
.nav-links a:hover { background: var(--paper-sunk); color: var(--ink); }
.nav-links a.active { background: var(--ink); color: var(--paper); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--paper);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: transparent; border: 0; cursor: pointer;
}

/* ── Footer ── */
.site-footer {
  border-top: 0.5px solid var(--hair);
  margin-top: 80px;
  padding: 40px 0 60px;
  color: var(--ink-soft);
  font-size: 13px;
}
.footer-row {
  display: flex; flex-direction: column; gap: 24px;
  align-items: flex-start;
}
.footer-cols {
  display: grid; gap: 20px 36px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.footer-col h4 {
  font-family: var(--ui-font);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-soft);
  margin: 0 0 10px;
}
.footer-col a {
  display: block; padding: 4px 0;
  color: var(--ink); text-decoration: none;
}
.footer-col a:hover { color: var(--signal-red); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 14px;
  font-family: var(--ui-font); font-size: 15px; font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none; cursor: pointer; border: 0;
  transition: transform 0.06s ease;
}
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-accent  { background: var(--signal-red); color: #fff; }
.btn-ghost   {
  background: transparent; color: var(--ink);
  border: 1px solid var(--hair);
}

/* ── Cards ── */
.card {
  background: var(--paper-raised);
  border: 0.5px solid var(--hair);
  border-radius: var(--r-card);
  padding: var(--pad-card);
}

/* ── Table (cheat-sheet) ── */
.num-table {
  width: 100%; border-collapse: collapse;
  font-size: 16px;
  background: var(--paper-raised);
  border-radius: 14px; overflow: hidden;
  border: 0.5px solid var(--hair);
}
.num-table th,
.num-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--hair);
  vertical-align: baseline;
}
.num-table tr:last-child td { border-bottom: 0; }
.num-table th {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper-sunk);
}
.num-table .num {
  font-family: var(--num-font);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  width: 5em;
  white-space: nowrap;
}
.num-table .word {
  color: var(--ink);
}
.num-table .word.irreg { color: var(--signal-red); font-weight: 600; }
.num-table tr.dim td { color: var(--ink-soft); }

/* ── Layout shells ── */
.with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

/* ── Sticky language rail (cheat sheet page) ── */
.lang-rail {
  background: var(--paper-raised);
  border: 0.5px solid var(--hair);
  border-radius: var(--r-card);
  padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.lang-rail a {
  text-decoration: none;
  color: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14.5px;
}
.lang-rail a .native {
  color: var(--ink-soft); font-size: 12.5px;
}
.lang-rail a:hover { background: var(--paper-sunk); }
.lang-rail a.active {
  background: var(--ink); color: var(--paper);
}
.lang-rail a.active .native { color: rgba(241,236,224,0.6); }
.lang-rail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 4px;
}

/* ── Tags ── */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--paper-sunk); color: var(--ink-soft);
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.tag.red {
  background: color-mix(in srgb, var(--signal-red) 12%, transparent);
  color: var(--signal-red);
}
.tag.dot::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}

/* ── Callout (info / exception / tip) ── */
.callout {
  display: flex; gap: 14px;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--signal-red) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--signal-red) 25%, transparent);
  border-radius: 14px;
  margin: 16px 0;
}
.callout .icon {
  flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--signal-red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif-font); font-size: 20px;
  margin-top: 1px;
}
.callout .body {
  font-size: 15px; line-height: 1.5;
}
.callout .body strong { font-weight: 700; }
.callout.muted {
  background: var(--paper-sunk);
  border-color: var(--hair);
}
.callout.muted .icon { background: var(--ink); color: var(--paper); }

/* ── Hero number (for the cheat-sheet header) ── */
.hero-num {
  font-family: var(--num-font);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.85;
  font-size: clamp(96px, 18vw, 220px);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.hero-num .red { color: var(--signal-red); }

/* ── Card-layout grid (for variation B) ── */
.num-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.num-card {
  background: var(--paper-raised);
  border: 0.5px solid var(--hair);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.num-card .num {
  font-family: var(--num-font);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.num-card .word {
  font-family: var(--serif-font);
  font-size: 17px;
  color: var(--ink);
  line-height: 1.2;
  margin-top: 2px;
}
.num-card.irreg {
  background: color-mix(in srgb, var(--signal-red) 8%, var(--paper-raised));
  border-color: color-mix(in srgb, var(--signal-red) 30%, transparent);
}
.num-card.irreg .num,
.num-card.irreg .word { color: var(--signal-red); }
.num-card .note {
  font-size: 11px; color: var(--ink-soft); margin-top: 4px;
  letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600;
}

/* ── In-page TOC (mobile: top scrollable; desktop: side) ── */
.toc {
  display: flex; gap: 6px;
  overflow-x: auto;
  padding: 4px 0 10px;
  margin: 0 calc(var(--pad-page) * -1);
  padding-left: var(--pad-page); padding-right: var(--pad-page);
  scrollbar-width: none;
}
.toc::-webkit-scrollbar { display: none; }
.toc a {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--paper-sunk);
  color: var(--ink);
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.toc a.current { background: var(--ink); color: var(--paper); }

/* ─────────────────────────────────────── */
/* Tablet ≥ 720                            */
/* ─────────────────────────────────────── */
@media (min-width: 720px) {
  :root {
    --pad-page: 36px;
    --pad-card: 28px;
    --r-card: 22px;
  }
  .site-header-row { height: 72px; }
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .footer-row { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 60px; }
  .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 40px; }
  .num-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ─────────────────────────────────────── */
/* Desktop ≥ 1100                          */
/* ─────────────────────────────────────── */
@media (min-width: 1100px) {
  :root {
    --pad-page: 48px;
  }
  .with-sidebar {
    grid-template-columns: 260px 1fr;
    gap: 56px;
  }
  .lang-rail-sticky {
    position: sticky; top: 96px;
  }
  .num-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Light keyboard-focus states */
:focus-visible {
  outline: 2px solid var(--signal-red);
  outline-offset: 3px;
  border-radius: 6px;
}
