/* COSYlanguages Communication & Speech Manual Assets */
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,600;0,700;0,800;0,900;1,600&family=Poppins:wght@600;700;800&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --teal-900: var(--accent-900, #0c3f38);
  --teal-800: var(--accent-800, #0f5c50);
  --teal-700: var(--accent-700, #157c6c);
  --teal-600: var(--accent-600, #1c9483);
  --teal-500: var(--accent-500, #25a894);
  --teal-100: var(--accent-100, #e4f4f0);
  --teal-050: var(--accent-050, #f2faf8);

  --ink: #132321;
  --ink-soft: #3c5450;
  --paper: #faf8f3;
  --panel: #ffffff;
  --line: #e6e2d8;

  --note-bg: #eaf6f1;
  --note-line: #1c9483;
  --note-ink: #0f5c50;

  --trick-bg: #fef8e7;
  --trick-line: #e6b822;
  --trick-ink: #7a5b0c;

  --mistake-bg: #fdf0f0;
  --mistake-line: #e55353;
  --mistake-ink: #9c1c1c;

  --confusable-bg: #f0f4fe;
  --confusable-line: #3562e0;
  --confusable-ink: #1e3a8a;

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --shadow-card: 0 2px 4px rgba(19,35,33,.03), 0 10px 28px -8px rgba(19,35,33,.12);
  --shadow-hover: 0 4px 8px rgba(19,35,33,.05), 0 16px 36px -8px rgba(19,35,33,.20);

  --font-display: 'Nunito', 'Poppins', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); line-height: 1.65; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 980px; margin: 0 auto; padding: 0 24px; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 50; background: var(--teal-900);
  color: #eafaf5; border-bottom: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #eafaf5; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; background: var(--panel, #fff);
  color: var(--teal-900); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 16px;
}
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: .2px; }
.brand-name em { font-style: italic; font-weight: 600; opacity: .88; }

.topbar-nav { display: flex; gap: 6px; flex-wrap: wrap; overflow-x: auto; max-width: 72%; padding: 2px 0; }
.topbar-nav a {
  color: #cdece4; text-decoration: none; font-size: 13px; font-weight: 700;
  padding: 6px 11px; border-radius: 99px; transition: all .15s ease;
  white-space: nowrap;
}
.topbar-nav a:hover, .topbar-nav a.active { background: rgba(255,255,255,.16); color: #fff; }

/* Hero */
.hero { background: var(--teal-900); color: #eafaf5; padding: 64px 0 56px; position: relative; overflow: hidden; }
.hero-kicker { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: #8fd6c4; font-weight: 600; }
.hero h1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(34px, 6vw, 54px); margin: 14px 0 12px; letter-spacing: -.01em; line-height: 1.18; }
.hero p.lead { max-width: 600px; color: #cdeee5; font-size: 18px; line-height: 1.6; }

/* Header & Search */
.page-head { padding: 36px 0 20px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--teal-700);
  background: var(--teal-100); padding: 6px 14px; border-radius: 99px; margin-bottom: 14px;
}
.page-head h1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(28px, 5vw, 42px); margin: 0 0 8px; color: var(--ink); }
.page-head .subtitle { font-style: italic; color: var(--ink-soft); font-size: 18px; margin: 0; }
.rule { border: none; border-top: 2px solid var(--ink); margin: 20px 0 0; opacity: .85; }

.search-bar { margin: 24px 0 10px; position: relative; max-width: 540px; }
.search-input {
  width: 100%; font-family: var(--font-body); font-size: 15px; padding: 12px 18px 12px 42px;
  border: 1.5px solid var(--line); border-radius: var(--radius-m); background: var(--panel);
  box-shadow: var(--shadow-card);
}
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; opacity: .5; }

/* Grid Cards */
.parts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin: 32px 0 12px; }
.part-card {
  display: block; text-decoration: none; color: var(--ink); background: var(--panel); border-radius: var(--radius-l);
  padding: 24px; border: 1px solid var(--line); box-shadow: var(--shadow-card); position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.part-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--teal-600); }
.part-card .pnum { font-family: var(--font-mono); font-size: 12px; color: var(--teal-700); font-weight: 700; }
.part-card h2 { font-family: var(--font-display); font-weight: 800; font-size: 22px; margin: 6px 0 8px; }
.part-card p { margin: 0 0 16px; color: var(--ink-soft); font-size: 15px; }
.part-card .topics-count { font-family: var(--font-mono); font-size: 12px; color: var(--teal-700); background: var(--teal-100); padding: 4px 12px; border-radius: 99px; font-weight: 700; }
.part-card .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; }

/* Callouts */
.box { border-radius: var(--radius-m); padding: 20px 22px; margin: 22px 0; border: 1px solid transparent; }
.box h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 16px; font-weight: 800; }
.box p { margin: 0; font-size: 15.5px; }
.box.note { background: var(--note-bg); border-color: #b8e2d4; color: var(--note-ink); }
.box.trick { background: var(--trick-bg); border-color: #eddca0; color: var(--trick-ink); }
.box.connect { background: #f0ecfc; border-color: #d8cefa; color: #432888; }
.box.connect a { color: #432888; font-weight: 700; text-decoration: underline; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 24px 0; border-radius: var(--radius-m); box-shadow: var(--shadow-card); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 15px; }
thead th { background: var(--ink); color: #fff; text-align: left; padding: 12px 16px; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; }
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:nth-child(even) { background: var(--teal-050); }

/* Pager & Footer */
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 44px 0 12px; flex-wrap: wrap; }
.pager a {
  flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 20px;
  text-decoration: none; color: var(--ink); background: var(--panel); box-shadow: var(--shadow-card);
  transition: transform .15s, border-color .15s;
}
.pager a:hover { transform: translateY(-2px); border-color: var(--teal-600); }
.pager a .dir { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--teal-700); text-transform: uppercase; font-weight: 700; }
.pager a .ttl { display: block; font-family: var(--font-display); font-weight: 800; font-size: 16.5px; margin-top: 4px; }
.pager a.next { text-align: right; }

footer.site { background: var(--ink); color: #c9d8d4; padding: 36px 0; margin-top: 64px; font-size: 14px; }
footer.site a { color: #eafaf5; }
footer.site .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }




/* Dark theme: the palette above is light-only, so the same role
   tokens are re-derived over a dark base when the OS prefers dark
   or an explicit theme is set. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --teal-100: color-mix(in srgb, #e4f4f0 14%, #151a16);
  --teal-050: color-mix(in srgb, #f2faf8 14%, #151a16);
  --ink: #e8f0e9;
  --ink-soft: #c8d8c9;
  --paper: #151a16;
  --panel: #1e241f;
  --line: color-mix(in srgb, #e6e2d8 42%, #151a16);
  --note-bg: color-mix(in srgb, #eaf6f1 16%, #151a16);
  --note-line: color-mix(in srgb, #1c9483 42%, #151a16);
  --note-ink: color-mix(in srgb, #0f5c50 45%, #ffffff);
  --trick-bg: color-mix(in srgb, #fef8e7 16%, #151a16);
  --trick-line: color-mix(in srgb, #e6b822 42%, #151a16);
  --trick-ink: color-mix(in srgb, #7a5b0c 45%, #ffffff);
  --mistake-bg: color-mix(in srgb, #fdf0f0 16%, #151a16);
  --mistake-line: color-mix(in srgb, #e55353 42%, #151a16);
  --mistake-ink: color-mix(in srgb, #9c1c1c 45%, #ffffff);
  --confusable-bg: color-mix(in srgb, #f0f4fe 16%, #151a16);
  --confusable-line: color-mix(in srgb, #3562e0 42%, #151a16);
  --confusable-ink: color-mix(in srgb, #1e3a8a 45%, #ffffff);
  /* table headers paint --ink as a fill, which turns light in dark mode */
  --thead-fill: color-mix(in srgb, var(--ink) 16%, #151a16);
  }
  :root:not([data-theme="light"]) thead th {
    background: var(--thead-fill) !important; color: var(--ink) !important;
  }
}
html[data-theme="dark"], body.theme-dark {
  --teal-100: color-mix(in srgb, #e4f4f0 14%, #151a16);
  --teal-050: color-mix(in srgb, #f2faf8 14%, #151a16);
  --ink: #e8f0e9;
  --ink-soft: #c8d8c9;
  --paper: #151a16;
  --panel: #1e241f;
  --line: color-mix(in srgb, #e6e2d8 42%, #151a16);
  --note-bg: color-mix(in srgb, #eaf6f1 16%, #151a16);
  --note-line: color-mix(in srgb, #1c9483 42%, #151a16);
  --note-ink: color-mix(in srgb, #0f5c50 45%, #ffffff);
  --trick-bg: color-mix(in srgb, #fef8e7 16%, #151a16);
  --trick-line: color-mix(in srgb, #e6b822 42%, #151a16);
  --trick-ink: color-mix(in srgb, #7a5b0c 45%, #ffffff);
  --mistake-bg: color-mix(in srgb, #fdf0f0 16%, #151a16);
  --mistake-line: color-mix(in srgb, #e55353 42%, #151a16);
  --mistake-ink: color-mix(in srgb, #9c1c1c 45%, #ffffff);
  --confusable-bg: color-mix(in srgb, #f0f4fe 16%, #151a16);
  --confusable-line: color-mix(in srgb, #3562e0 42%, #151a16);
  --confusable-ink: color-mix(in srgb, #1e3a8a 45%, #ffffff);
  /* table headers paint --ink as a fill, which turns light in dark mode */
  --thead-fill: color-mix(in srgb, var(--ink) 16%, #151a16);
}
html[data-theme="dark"] thead th, body.theme-dark thead th {
  background: var(--thead-fill) !important; color: var(--ink) !important;
}
