/* ------------------------------------------------------------------
   LingoSheets — print-first bilingual classroom tools
   ------------------------------------------------------------------ */

:root {
  --paper: #fbf6ec;
  --paper-2: #f4ecdc;
  --card: #fffdf8;
  --ink: #17202a;
  --ink-2: #46433d;
  --muted: #6f6a60;
  --line: #e6dccb;
  --line-strong: #d6c9b2;
  --accent: #ff5a36;
  --accent-ink: #cf3f1e;
  --accent-soft: #ffe3d8;
  --teal: #0f766e;
  --teal-ink: #0b5a54;
  --teal-soft: #d9efec;
  --yellow: #f5c542;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 30px rgba(23, 32, 42, 0.07);
  --shadow-lg: 0 24px 60px rgba(23, 32, 42, 0.12);
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--teal-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1.02; margin: 0 0 20px; }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); line-height: 1.12; margin: 0 0 14px; }
h3 { font-size: 1.22rem; line-height: 1.3; margin: 0 0 8px; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow, .narrow { max-width: 780px; }
.center { text-align: center; }
.center-actions { justify-content: center; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.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; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 200; }
.skip:focus { left: 8px; color: #fff; }

/* ---------------- header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 246, 236, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.brand-mark { display: inline-flex; }
.brand-name { font-family: var(--display); font-size: 1.32rem; font-weight: 600; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; font-weight: 550; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------------- 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-family: var(--sans);
  font-size: 0.96rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(255, 90, 54, 0.28); }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: #fff; }
.btn-sm { padding: 9px 16px; font-size: 0.88rem; }
.btn-lg { padding: 15px 26px; font-size: 1.02rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.text-link { color: var(--teal-ink); font-weight: 650; text-decoration: none; border-bottom: 2px solid var(--teal-soft); }
.text-link:hover { border-bottom-color: var(--accent); }

/* ---------------- hero ---------------- */

.hero { padding: 76px 0 64px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  right: -180px;
  top: -160px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 197, 66, 0.35), rgba(245, 197, 66, 0) 70%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; position: relative; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.13em; font-size: 0.74rem; font-weight: 700; color: var(--teal-ink); margin: 0 0 16px; }
.hero h1 em {
  font-style: normal;
  color: var(--teal);
  background: linear-gradient(transparent 60%, rgba(245, 197, 66, 0.55) 60%, rgba(245, 197, 66, 0.55) 94%, transparent 94%);
}
.lead { font-size: 1.18rem; line-height: 1.55; color: var(--ink-2); max-width: 34em; }
.meta-line { font-size: 0.8rem; color: var(--muted); margin: 16px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 18px; }
.hero-trust { font-size: 0.86rem; color: var(--muted); margin: 0; }

.hero-visual { display: flex; justify-content: center; }
.sheet-stack { position: relative; width: 100%; max-width: 440px; }
.sheet-card { border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.sheet-back { position: absolute; inset: 14px -14px -14px 14px; transform: rotate(3.2deg); background: var(--teal-soft); border-color: transparent; }
.sheet-front { position: relative; padding: 22px; transform: rotate(-1.4deg); }
.mock-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mock-title { font-family: var(--display); font-size: 0.95rem; font-weight: 600; }
.mock-line { flex: 1; height: 1px; background: var(--line-strong); }
.mock-grid .ws-grid { font-size: 0.62rem; }
.mock-grid .ws-grid td { width: 1.55em; height: 1.55em; font-size: 0.62rem; }
.mock-bank { margin-top: 12px; font-size: 0.72rem; color: var(--muted); text-align: center; letter-spacing: 0.02em; }

/* ---------------- sections ---------------- */

.section { padding: 88px 0; }
.section-tint { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-sub { color: var(--ink-2); margin: 0; }
.page-head { padding: 64px 0 48px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 253, 248, 0.7), rgba(251, 246, 236, 0)); }
.page-head .lead { margin-bottom: 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card img { width: 100%; height: auto; border-radius: 10px; display: block; }
figure.card { margin: 0; }
figcaption { margin-top: 8px; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); color: var(--ink); }

.maker-card .maker-emoji { font-size: 1.9rem; line-height: 1; margin-bottom: 10px; display: block; }
.maker-card h3 { margin: 0; }
.maker-card p { color: var(--ink-2); font-size: 0.95rem; margin: 0; }
.card-link { margin-top: auto; padding-top: 16px; font-weight: 650; font-size: 0.9rem; color: var(--accent-ink); }

.theme-card { align-items: flex-start; padding: 20px; }
.theme-emoji { font-size: 1.9rem; line-height: 1; }
.theme-name { font-family: var(--display); font-size: 1.1rem; font-weight: 600; }
.theme-meta { font-size: 0.82rem; color: var(--muted); }

.feature { padding: 28px; }
.feature-icon { font-size: 1.6rem; display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: 14px; background: var(--teal-soft); margin-bottom: 14px; }
.feature p { color: var(--ink-2); font-size: 0.97rem; margin: 0; }

.inline-links { margin: 20px 0 8px; font-size: 0.9rem; color: var(--muted); }
.inline-links a { color: var(--teal-ink); font-weight: 650; text-decoration: none; }
.inline-links a:hover { text-decoration: underline; }

.email-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 8px; }
.email-form label { font-weight: 650; font-size: 0.9rem; }
.email-form input[type="email"] { flex: 1 1 260px; padding: 12px 16px; border: 1.5px solid var(--line-strong); border-radius: 999px; font-family: var(--sans); font-size: 1rem; }
.email-form input[type="email"]:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 0.92rem; font-weight: 550; transition: border-color 0.15s ease, transform 0.15s ease; }
.chip:hover { border-color: var(--teal); color: var(--ink); transform: translateY(-1px); }

.lang-card { align-items: flex-start; }
.lang-flag { font-size: 1.7rem; line-height: 1; }
.lang-name { font-family: var(--display); font-size: 1.15rem; font-weight: 600; }

.cta-band { background: var(--ink); color: var(--paper); }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 253, 248, 0.72); margin: 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.cta-inner > div { max-width: 640px; }

/* ---------------- faq ---------------- */

.faq-list { display: grid; gap: 10px; }
.faq { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 20px; }
.faq summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; line-height: 1; }
.faq[open] summary::after { content: "–"; }
.faq p { margin: 12px 0 0; color: var(--ink-2); font-size: 0.96rem; }

/* ---------------- crumbs / notes ---------------- */

.crumbs { display: flex; gap: 8px; font-size: 0.82rem; color: var(--muted); margin-bottom: 18px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.note-box { margin-top: 40px; background: var(--teal-soft); border: 1px solid rgba(15, 118, 110, 0.18); border-radius: var(--radius); padding: 26px 28px; }
.note-box h2 { font-size: 1.3rem; }
.note-box p:last-child { margin-bottom: 0; }

.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.check-list li { position: relative; padding-left: 26px; color: var(--ink-2); }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--teal); font-weight: 700; }
.check-list.big li { font-size: 1.02rem; }
.steps { padding-left: 22px; display: grid; gap: 12px; color: var(--ink-2); }
.steps li::marker { color: var(--accent); font-weight: 700; }

.prose { font-size: 1.03rem; }
.prose h2 { margin-top: 40px; font-size: 1.6rem; }
.prose h3 { margin-top: 26px; }
.prose ul, .prose ol { padding-left: 22px; color: var(--ink-2); }
.prose li { margin-bottom: 8px; }
.prose blockquote { border-left: 4px solid var(--yellow); margin: 24px 0; padding: 4px 0 4px 20px; color: var(--ink-2); font-style: italic; }

/* ---------------- makers ---------------- */

.maker-head-grid { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 40px; align-items: end; }
.maker-head .lead { margin-bottom: 0; }
.maker-section { padding-top: 40px; }
.maker-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 32px; align-items: start; }

.controls {
  position: sticky;
  top: 92px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  gap: 16px;
}
.controls-title { font-family: var(--display); font-size: 1.1rem; font-weight: 600; margin: 0; }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.control { display: grid; gap: 6px; }
.control label, .control .label { font-size: 0.82rem; font-weight: 650; color: var(--ink-2); }
.control .hint { font-weight: 400; color: var(--muted); }
.control select, .control input[type="text"], .control input[type="number"], .control textarea, .input {
  width: 100%;
  padding: 10px 12px;
  padding-right: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink);
  text-overflow: ellipsis;
}
.control textarea { resize: vertical; min-height: 70px; }
.control select:focus, .control input:focus, .control textarea:focus, .input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.check { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--teal); }
.checks { display: flex; flex-wrap: wrap; gap: 14px; }
.control-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.control-actions .btn { flex: 1 1 auto; padding: 11px 14px; font-size: 0.88rem; }
.controls-note { font-size: 0.76rem; color: var(--muted); margin: 0; }

.preview { min-width: 0; }
.preview-toolbar { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.preview-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; color: var(--muted); }
.preview-hint { font-size: 0.78rem; color: var(--muted); }

.sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  min-height: 560px;
  overflow-x: auto;
}
.sheet-head { border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 22px; }
.sheet-title { font-family: var(--display); font-size: 1.5rem; font-weight: 600; margin: 0 0 4px; }
.sheet-sub { font-size: 0.84rem; color: var(--muted); margin: 0; }
.name-line { display: flex; gap: 24px; font-size: 0.78rem; color: var(--muted); margin-top: 10px; }
.name-line span { display: inline-flex; gap: 6px; align-items: baseline; }
.name-line i { display: inline-block; width: 130px; border-bottom: 1px solid var(--line-strong); height: 1em; font-style: normal; }

.ws-grid { border-collapse: collapse; margin: 0 auto; font-family: var(--mono); font-weight: 600; color: var(--ink); }
.ws-grid td { width: 1.9em; height: 1.9em; text-align: center; vertical-align: middle; font-size: 1rem; border: 1px solid rgba(230, 220, 203, 0.55); }
.word-bank { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.86rem; color: var(--ink-2); }
.bank-word strong { color: var(--ink); }
.bank-word em { color: var(--muted); font-style: normal; }
.answer-page { margin-top: 40px; padding-top: 24px; border-top: 2px dashed var(--line-strong); }

.flash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.flash-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.flash-card { border: 1.5px dashed var(--line-strong); border-radius: 12px; min-height: 138px; padding: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; break-inside: avoid; }
.flash-pic { font-size: 2rem; line-height: 1; }
.flash-word { font-family: var(--display); font-size: 1.2rem; font-weight: 600; line-height: 1.1; }
.flash-trans { font-size: 0.8rem; color: var(--muted); }
.flash-py { font-size: 0.76rem; color: var(--teal-ink); }

.trace-rows { display: grid; gap: 18px; }
.trace-row { border-bottom: 1px dashed var(--line-strong); padding-bottom: 8px; }
.trace-line { display: flex; flex-wrap: wrap; gap: 26px; align-items: baseline; }
.trace-model { font-family: "Comic Sans MS", "Chalkboard SE", "Segoe Print", var(--sans); color: var(--ink); }
.trace-faint { font-family: "Comic Sans MS", "Chalkboard SE", "Segoe Print", var(--sans); color: #cfc8bb; }
.hanzi-grid { display: grid; grid-template-columns: repeat(8, 1fr); border: 1px solid var(--ink-2); width: min(100%, 640px); margin: 0 auto; }
.hanzi-cell { position: relative; aspect-ratio: 1; border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #cfc8bb; }
.hanzi-cell::before, .hanzi-cell::after { content: ""; position: absolute; background: repeating-linear-gradient(to right, var(--line-strong) 0 4px, transparent 4px 8px); }
.hanzi-cell::before { left: 50%; top: 0; bottom: 0; width: 1px; background: none; border-left: 1px dashed var(--line-strong); }
.hanzi-cell::after { top: 50%; left: 0; right: 0; height: 1px; background: none; border-top: 1px dashed var(--line-strong); }
.hanzi-cell span { position: relative; z-index: 1; }

.bingo-card { border: 1.5px solid var(--ink-2); border-radius: 10px; padding: 14px; margin-bottom: 22px; break-inside: avoid; }
.bingo-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 0.8rem; color: var(--muted); }
.bingo-title { font-family: var(--display); font-size: 1.05rem; color: var(--ink); }
.bingo-grid { display: grid; gap: 4px; }
.bingo-cell { border: 1px solid var(--line-strong); border-radius: 6px; min-height: 58px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 0.86rem; padding: 4px; line-height: 1.15; }
.bingo-cell.free { background: var(--teal-soft); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--teal-ink); }
.caller-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 18px; font-size: 0.82rem; margin-top: 12px; }
.caller-list li { list-style: none; }
.caller-list ol { margin: 0; padding: 0; }

.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.match-col { display: grid; gap: 14px; }
.match-item { display: flex; align-items: center; gap: 10px; font-size: 1rem; }
.match-item .num { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); width: 1.6em; }
.match-item .pic { font-size: 1.2rem; }
.match-key { margin-top: 22px; font-size: 0.85rem; color: var(--muted); }

.math-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 34px; }
.math-problem { font-family: var(--mono); font-size: 1.15rem; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.math-problem .ans { color: var(--muted); }
.answer-key { margin-top: 24px; font-size: 0.82rem; color: var(--ink-2); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 24px; }

.filter-row { margin-top: 22px; max-width: 420px; }
.empty { margin-top: 24px; color: var(--muted); }

/* ---------------- generated sheet internals ---------------- */

.flash-page { break-after: page; margin-bottom: 30px; }
.flash-page:last-child { break-after: auto; margin-bottom: 0; }
.trace-row p { margin: 0 0 6px; }
.trace-es { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin-left: 16px; align-self: center; }
.trace-row .hanzi-grid { margin-top: 6px; }
.hanzi-grid { width: min(100%, 680px); }
.hanzi-cell { font-size: 2.1rem; }
.caller-list ol { margin: 0; padding: 0; }
.match-col .match-item:last-child { margin-bottom: 0; }
.math-problem + .math-problem { margin-top: 12px; }
.answer-page h3, .answer-page .sheet-sub { margin-bottom: 12px; }

/* ---------------- theme page ---------------- */

.theme-title-row { display: flex; gap: 20px; align-items: flex-start; }
.theme-emoji-xl { font-size: 3.4rem; line-height: 1; }
.theme-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 40px; align-items: start; }
.word-panel h2, .sample-panel h2 { font-size: 1.35rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
.word-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.word-table th, .word-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.word-table th { position: sticky; top: 0; background: var(--paper-2); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.word-table tr:last-child td { border-bottom: 0; }
.word-table td.pic { font-size: 1.1rem; }
.word-table td.zh { font-size: 1.05rem; }
.word-table td.py { color: var(--teal-ink); font-size: 0.88rem; }
.data-table { font-size: 0.86rem; }
.sample-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: sticky; top: 92px; }
.sample-panel .ws-grid td { width: 1.55em; height: 1.55em; font-size: 0.72rem; }
.sheet-bank { font-size: 0.78rem; color: var(--muted); margin: 14px 0 16px; }

/* ---------------- footer ---------------- */

.site-footer { background: var(--ink); color: rgba(255, 253, 248, 0.78); padding: 56px 0 26px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand p { margin: 0 0 10px; }
.footer-logo { font-family: var(--display); font-size: 1.35rem; color: #fff; }
.footer-head { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255, 253, 248, 0.5); font-weight: 700; margin: 0 0 12px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-links a { color: rgba(255, 253, 248, 0.82); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.site-footer .muted { color: rgba(255, 253, 248, 0.6); }
.site-footer .small { font-size: 0.78rem; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 44px; padding-top: 20px; border-top: 1px solid rgba(255, 253, 248, 0.14); font-size: 0.78rem; color: rgba(255, 253, 248, 0.55); }
.footer-bottom p { margin: 0; }

/* ---------------- responsive ---------------- */

@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .sheet-stack { max-width: 380px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .maker-head-grid { grid-template-columns: 1fr; gap: 20px; align-items: start; }
  .maker-layout { grid-template-columns: 1fr; }
  .controls { position: static; }
  .theme-layout { grid-template-columns: 1fr; }
  .sample-panel { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .header-inner { height: 64px; gap: 14px; }
  .nav { display: none; }
  .header-inner .btn { margin-left: auto; }
  .hero { padding: 48px 0 44px; }
  .section { padding: 60px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .sheet { padding: 22px; }
  .sheet-stack { max-width: 320px; }
  .theme-title-row { gap: 12px; }
  .theme-emoji-xl { font-size: 2.4rem; }
  .math-grid { grid-template-columns: repeat(2, 1fr); }
  .caller-list { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 6px; }
  .flash-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .header-inner { gap: 10px; }
  .brand-name { font-size: 1.12rem; }
  .header-inner .btn { padding: 8px 13px; font-size: 0.82rem; }
  .theme-title-row { flex-direction: column; gap: 6px; }
  .hero h1 { font-size: 2.3rem; }
}

.print-only { display: none; }

/* ---------------- print ---------------- */

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  html, body { background: #fff !important; color: #000; font-size: 12pt; }
  .site-header, .site-footer, .no-print, .skip, .preview-toolbar, .crumbs, .hero-actions, .faq-list, .cta-band { display: none !important; }
  main { padding: 0 !important; }
  .section, .maker-section { padding: 0 !important; }
  .wrap { max-width: none; padding: 0; }
  .maker-layout { display: block; }
  .sheet { border: 0 !important; box-shadow: none !important; padding: 0 !important; min-height: 0; border-radius: 0; }
  .page-head, .section-tint, .note-box, .sample-panel { display: none !important; }
  a { color: inherit !important; text-decoration: none !important; }
  .answer-page { break-before: page; }
  .flash-page { break-after: page; }
  .flash-card, .bingo-card, .trace-row { break-inside: avoid; }
  .ws-grid td { border: 1px solid #bbb; }
  .print-only { display: block !important; }
}
