/* COSYlanguages · Cluster C Level A2 Monolingual Manual Style */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&family=Poppins:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --brand-900: #1e3a8a;
  --brand-700: #1d4ed8;
  --brand-100: #dbeafe;

  --ink: #111827;
  --ink-soft: #4b5563;
  --paper: #faf8f5;
  --panel: #ffffff;
  --line: #e5e7eb;

  --mint-bg: #dcfce7;
  --mint-line: #22c55e;
  --mint-ink: #14532d;

  --why-bg: #fef3c7;
  --why-line: #f59e0b;
  --why-ink: #78350f;

  --native-bg: #f3e8ff;
  --native-line: #a855f7;
  --native-ink: #581c87;

  --mistake-bg: #fef2f2;
  --mistake-line: #ef4444;
  --mistake-ink: #991b1b;

  --radius-m: 14px;
  --shadow-card: 0 2px 8px rgba(30,58,138,.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
}

.topbar {
  background: var(--brand-900);
  color: #fff;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar a {
  color: var(--brand-100);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.container {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 24px;
}

.page-head { margin-bottom: 30px; }
.eyebrow { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--brand-700); letter-spacing: 0.05em; }
h1 { font-family: 'Poppins', sans-serif; font-size: 32px; margin: 8px 0; color: var(--brand-900); }
p.subtitle { font-size: 18px; color: var(--ink-soft); margin: 0; }

.outcome-banner {
  background: var(--mint-bg);
  border-left: 4px solid var(--mint-line);
  padding: 16px 20px;
  border-radius: var(--radius-m);
  margin: 24px 0;
  font-weight: 600;
  color: var(--mint-ink);
}

.box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-card);
}
.box.why { background: var(--why-bg); border-color: var(--why-line); color: var(--why-ink); }
.box.native { background: var(--native-bg); border-color: var(--native-line); color: var(--native-ink); }
.box.mistake { background: var(--mistake-bg); border-color: var(--mistake-line); color: var(--mistake-ink); }
.box h3 { margin-top: 0; font-family: 'Poppins', sans-serif; }

.grammar-table, .vocab-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: var(--panel);
  border-radius: var(--radius-m);
  overflow: hidden;
}
.grammar-table th, .grammar-table td, .vocab-table th, .vocab-table td {
  padding: 12px 16px;
  border: 1px solid var(--line);
  text-align: left;
}
.grammar-table th, .vocab-table th { background: var(--brand-100); color: var(--brand-900); font-weight: 700; }

.quiz-panel {
  background: var(--panel);
  border: 2px solid var(--brand-700);
  border-radius: var(--radius-m);
  padding: 28px;
  margin: 40px 0;
}
.qitem { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.qitem:last-child { border-bottom: none; }
.qtext { font-weight: 700; margin-bottom: 12px; }
.qopts { display: flex; gap: 10px; flex-wrap: wrap; }
.qopt {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}
.qopt:hover { background: var(--brand-100); border-color: var(--brand-700); }
.qexplain { display: none; margin-top: 10px; font-size: 14px; color: var(--ink-soft); }

.pager { display: flex; justify-content: space-between; margin-top: 40px; }
.pager a { text-decoration: none; font-weight: 700; color: var(--brand-700); }

.parts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 30px; }
.part-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 24px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s;
}
.part-card:hover { transform: translateY(-4px); }
.part-card h2 { color: var(--brand-900); margin: 0 0 10px; font-size: 20px; }

.topic-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 24px; }
.topic-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s;
}
.topic-card:hover { border-color: var(--brand-700); }
.topic-card .ttl { font-weight: 700; font-size: 18px; color: var(--brand-900); }
.topic-card .sub { font-size: 14px; color: var(--ink-soft); }




/* 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"]) {
  --brand-100: color-mix(in srgb, #dbeafe 14%, #151a16);
  --ink: #e8f0e9;
  --ink-soft: #c8d8c9;
  --paper: #151a16;
  --panel: #1e241f;
  --line: color-mix(in srgb, #e5e7eb 42%, #151a16);
  --mint-bg: color-mix(in srgb, #dcfce7 16%, #151a16);
  --mint-line: color-mix(in srgb, #22c55e 42%, #151a16);
  --mint-ink: color-mix(in srgb, #14532d 45%, #ffffff);
  --why-bg: color-mix(in srgb, #fef3c7 16%, #151a16);
  --why-line: color-mix(in srgb, #f59e0b 42%, #151a16);
  --why-ink: color-mix(in srgb, #78350f 45%, #ffffff);
  --native-bg: color-mix(in srgb, #f3e8ff 16%, #151a16);
  --native-line: color-mix(in srgb, #a855f7 42%, #151a16);
  --native-ink: color-mix(in srgb, #581c87 45%, #ffffff);
  --mistake-bg: color-mix(in srgb, #fef2f2 16%, #151a16);
  --mistake-line: color-mix(in srgb, #ef4444 42%, #151a16);
  --mistake-ink: color-mix(in srgb, #991b1b 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 {
  --brand-100: color-mix(in srgb, #dbeafe 14%, #151a16);
  --ink: #e8f0e9;
  --ink-soft: #c8d8c9;
  --paper: #151a16;
  --panel: #1e241f;
  --line: color-mix(in srgb, #e5e7eb 42%, #151a16);
  --mint-bg: color-mix(in srgb, #dcfce7 16%, #151a16);
  --mint-line: color-mix(in srgb, #22c55e 42%, #151a16);
  --mint-ink: color-mix(in srgb, #14532d 45%, #ffffff);
  --why-bg: color-mix(in srgb, #fef3c7 16%, #151a16);
  --why-line: color-mix(in srgb, #f59e0b 42%, #151a16);
  --why-ink: color-mix(in srgb, #78350f 45%, #ffffff);
  --native-bg: color-mix(in srgb, #f3e8ff 16%, #151a16);
  --native-line: color-mix(in srgb, #a855f7 42%, #151a16);
  --native-ink: color-mix(in srgb, #581c87 45%, #ffffff);
  --mistake-bg: color-mix(in srgb, #fef2f2 16%, #151a16);
  --mistake-line: color-mix(in srgb, #ef4444 42%, #151a16);
  --mistake-ink: color-mix(in srgb, #991b1b 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;
}
