/* ================================================================
   TCF Write — style.css
   Standalone design system. No dependency on any other project.
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Palette — light ── */
  --white:        #ffffff;
  --paper:        #f7f7f5;
  --paper-soft:   #eef0ee;
  --line:         #dde1de;
  --ink:          #16201c;
  --ink-soft:     #3a453f;
  --ink-muted:    #6b756f;
  --ink-ghost:    #9aa39d;
  --maple:        #d5262f;
  --maple-soft:   #ef4b52;
  --spruce:       #1f5c4d;
  --spruce-soft:  #2c8069;
  --lake:         #245e8c;
  --amber:        #b8790f;

  /* ── Semantic tokens ── */
  --bg:           var(--paper);
  --bg-panel:     var(--white);
  --bg-input:     #fbfbfa;
  --bg-raised:    var(--white);
  --border:       var(--line);
  --text:         var(--ink);
  --text-soft:    var(--ink-soft);
  --text-muted:   var(--ink-muted);
  --text-ghost:   var(--ink-ghost);
  --accent:       var(--maple);
  --accent-soft:  var(--maple-soft);
  --link:         var(--lake);
  --success:      var(--spruce);
  --success-soft: var(--spruce-soft);
  --warning:      var(--amber);
  --on-accent:    #ffffff;
  --shadow-sm:    0 1px 3px rgba(22,32,28,.07);
  --shadow-md:    0 6px 20px rgba(22,32,28,.10);
  --shadow-lg:    0 12px 36px rgba(22,32,28,.16);

  /* ── Typography ── */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  /* ── Spacing ── */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* ── Radii / motion ── */
  --r-sm: 6px; --r-md: 10px; --r-lg: 18px;
  --ease: cubic-bezier(.4,0,.2,1);
  --fast: 120ms var(--ease);
  --mid:  240ms var(--ease);
  --slow: 400ms var(--ease);
}

:root[data-theme="dark"] {
  --bg:           #10151b;
  --bg-panel:     #161c23;
  --bg-input:     #1b222a;
  --bg-raised:    #1c232b;
  --border:       #2b333c;
  --text:         #eef1ef;
  --text-soft:    #cdd3d0;
  --text-muted:   #93a09a;
  --text-ghost:   #5e6a64;
  --accent:       #ef5b58;
  --accent-soft:  #ff7b76;
  --link:         #5ea1d8;
  --success:      #52b58c;
  --success-soft: #6fcaa2;
  --warning:      #e0a94a;
  --on-accent:    #10151b;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.35);
  --shadow-md:    0 6px 20px rgba(0,0,0,.4);
  --shadow-lg:    0 16px 40px rgba(0,0,0,.5);
}

/* Light mode is the default regardless of system preference — dark mode
   only activates via the explicit data-theme="dark" attribute (see
   initTheme() in app.js / site.js), which is the sole source of truth. */

/* ── Reset / base ── */
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg); color: var(--text);
  line-height: 1.6; min-height: 100vh;
  display: flex; flex-direction: column;
  transition: background-color var(--slow), color var(--slow);
}
a { color: var(--link); text-decoration: none; transition: color var(--fast); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
button:disabled { cursor: not-allowed; opacity: .45; }
input, select, textarea { font-family: inherit; border: none; outline: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
.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; }
.hidden { display: none !important; }
::selection { background: rgba(213,38,47,.18); color: var(--text); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ================================================================
   Header
   ================================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-panel) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: var(--sp-3) var(--sp-5);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
}
.brand { display: flex; align-items: center; }
.logo-img { height: 42px; width: auto; display: block; }
.logo-img-dark { display: none; }
:root[data-theme="dark"] .logo-img-light { display: none; }
:root[data-theme="dark"] .logo-img-dark { display: block; }

.main-nav { display: flex; align-items: center; gap: var(--sp-5); }
.main-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui); font-size: .84rem; font-weight: 500;
  color: var(--text-soft); white-space: nowrap;
}
.main-nav a svg { flex-shrink: 0; opacity: .8; }
.main-nav a:hover { color: var(--accent); }
.main-nav a:hover svg { opacity: 1; }

.header-actions { display: flex; align-items: center; gap: var(--sp-3); }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-panel);
  display: flex; align-items: center; justify-content: center; color: var(--text-soft);
  transition: all var(--fast);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle {
  display: none; width: 36px; height: 36px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--bg-panel);
  align-items: center; justify-content: center; color: var(--text);
}

/* ================================================================
   Hero
   ================================================================ */
.hero {
  max-width: 780px; margin: 0 auto; text-align: center;
  padding: var(--sp-7) var(--sp-5) var(--sp-5);
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui); font-size: .68rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding: 5px 12px; border-radius: 99px; margin-bottom: var(--sp-4);
}
.hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.7rem, 4.4vw, 2.6rem); line-height: 1.18;
  color: var(--text); margin-bottom: var(--sp-4);
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p { font-size: 1rem; color: var(--text-muted); line-height: 1.7; }
.hero-cta { display: flex; gap: var(--sp-3); justify-content: center; margin-top: var(--sp-5); flex-wrap: wrap; }

/* ================================================================
   Buttons
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-ui); font-size: .82rem; font-weight: 600;
  padding: 10px 20px; border-radius: var(--r-sm);
  transition: all var(--fast); border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--accent-soft); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: var(--bg-panel); color: var(--text-soft); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: none; color: var(--text-muted); padding: 8px 12px; }
.btn-ghost:hover { color: var(--accent); }
.btn-danger:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-sm { font-size: .74rem; padding: 7px 14px; }
.btn-block { width: 100%; justify-content: center; }

/* ================================================================
   Main shell
   ================================================================ */
.app-main {
  flex: 1; max-width: 900px; margin: 0 auto; width: 100%;
  padding: 0 var(--sp-5) var(--sp-8);
  display: flex; flex-direction: column; gap: var(--sp-5);
}
.page-main {
  flex: 1; max-width: 760px; margin: 0 auto; width: 100%;
  padding: var(--sp-7) var(--sp-5) var(--sp-8);
}

/* ================================================================
   Exam bar (timer + mode)
   ================================================================ */
.exam-panel {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap; box-shadow: var(--shadow-sm);
}
.exam-timer { display: flex; align-items: center; gap: var(--sp-3); }
.exam-timer-clock {
  font-family: var(--font-mono); font-size: 1.7rem; font-weight: 500;
  color: var(--text); letter-spacing: .02em; min-width: 88px;
}
.exam-timer-clock.warn { color: var(--warning); }
.exam-timer-clock.danger { color: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.exam-timer-label { font-family: var(--font-ui); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-ghost); }

.exam-phases { display: flex; gap: 6px; }
.exam-phase-chip {
  font-family: var(--font-ui); font-size: .68rem; font-weight: 600;
  padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border);
  color: var(--text-ghost); background: var(--bg);
}
.exam-phase-chip.current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.exam-phase-chip.done { color: var(--success); border-color: var(--success); }

.exam-controls { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.real-mode-toggle { display: flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-size: .76rem; color: var(--text-soft); cursor: pointer; }
.switch { position: relative; width: 38px; height: 21px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track {
  position: absolute; inset: 0; background: var(--border); border-radius: 99px;
  transition: background var(--fast);
}
.switch-track::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  background: var(--white); border-radius: 50%; transition: transform var(--fast); box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::before { transform: translateX(17px); }
.lock-note {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-ui); font-size: .72rem; color: var(--accent);
}

/* ================================================================
   Task selector
   ================================================================ */
.section-label {
  font-family: var(--font-ui); font-size: .68rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-ghost);
  margin-bottom: var(--sp-3);
}
.task-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.task-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: var(--sp-4); background: var(--bg-panel); border: 1.5px solid var(--border);
  border-radius: var(--r-md); cursor: pointer; transition: all var(--fast); width: 100%;
}
.task-card:hover { border-color: var(--accent); }
.task-card.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg-panel)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.task-card-num { font-family: var(--font-ui); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-ghost); }
.task-card.active .task-card-num { color: var(--accent); }
.task-card-name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--text); }
.task-card-meta { font-family: var(--font-mono); font-size: .64rem; color: var(--text-muted); }

/* ================================================================
   Prompt panel
   ================================================================ */
.prompt-panel {
  background: var(--bg-panel); border: 1px solid var(--border); border-top: 3px solid var(--accent);
  border-radius: var(--r-md); padding: var(--sp-5); box-shadow: var(--shadow-sm);
}
.prompt-panel-head { display: flex; align-items: flex-start; margin-bottom: var(--sp-4); }
.prompt-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-family: var(--font-ui); font-size: .62rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 99px; background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border);
}
.badge-accent { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

.prompt-label { font-family: var(--font-ui); font-size: .64rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-ghost); margin-bottom: 8px; }
.prompt-text { font-family: var(--font-body); font-size: 1.02rem; line-height: 1.75; color: var(--text); }
.prompt-subject { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; color: var(--text); margin-bottom: var(--sp-4); line-height: 1.5; }

.prompt-docs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.prompt-doc { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); }
.prompt-doc-label { font-family: var(--font-ui); font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.prompt-doc-text { font-family: var(--font-body); font-size: .87rem; line-height: 1.65; color: var(--text-muted); }

.prompt-structure { background: color-mix(in srgb, var(--accent) 5%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); }
.prompt-structure-label { font-family: var(--font-ui); font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.prompt-structure ul { list-style: none; font-family: var(--font-ui); font-size: .74rem; color: var(--text-muted); line-height: 1.7; }

.prompt-panel-foot { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); flex-wrap: wrap; padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.empty-hint { font-family: var(--font-ui); font-size: .82rem; color: var(--text-muted); text-align: center; padding: var(--sp-4) 0; }

/* Ad placeholders — filled at runtime by assets/js/ads.js. Collapse to
   nothing when empty (no active slot for this page) so no gap/border shows. */
.ad-wrap:empty { display: none; }
.ad-wrap-filled { display: flex; justify-content: center; margin: var(--sp-5) 0; overflow: hidden; }

/* ================================================================
   Accent toolbar
   ================================================================ */
.accent-toolbar {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  padding: 0 0 var(--sp-1);
}
.accent-label {
  font-family: var(--font-ui); font-size: .64rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-ghost); flex-shrink: 0;
}
.accent-buttons { display: flex; gap: 4px; flex-wrap: wrap; }
.accent-btn {
  font-family: var(--font-body); font-size: .92rem; font-weight: 500;
  color: var(--text-soft); width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg-input); transition: all var(--fast);
  user-select: none; -webkit-user-select: none;
}
.accent-btn:hover { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.accent-btn:active, .accent-btn.accent-active {
  transform: translateY(0) scale(.92); box-shadow: none;
  background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: var(--accent); color: var(--accent);
}
.majuscule-toggle {
  font-family: var(--font-ui); font-size: .64rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; padding: 0 10px; height: 30px;
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg-input); color: var(--text-muted);
  cursor: pointer; transition: all var(--fast); flex-shrink: 0;
  margin-left: 8px;
}
.majuscule-toggle:hover { border-color: var(--accent); color: var(--accent); }
.majuscule-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ================================================================
   Editors
   ================================================================ */
.editor-group { display: flex; flex-direction: column; gap: var(--sp-4); }
.editor-block { display: flex; flex-direction: column; gap: var(--sp-2); }
.editor-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.editor-block-title { font-family: var(--font-ui); font-size: .74rem; font-weight: 600; color: var(--text-soft); }
.editor-block-target { font-family: var(--font-mono); font-size: .68rem; color: var(--text-ghost); }

.main-editor {
  width: 100%; min-height: 340px; padding: var(--sp-4);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.75;
  color: var(--text); background: var(--bg-input);
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  resize: vertical; box-shadow: var(--shadow-sm);
  transition: border-color var(--fast), box-shadow var(--fast);
}
.main-editor.editor-sm { min-height: 170px; }
.main-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.main-editor::placeholder { color: var(--text-ghost); }
.main-editor:disabled { opacity: .6; }

.range-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 500;
  padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--text-muted);
}
.range-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.range-pill.below   { color: var(--text-muted); }
.range-pill.in-range{ color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); background: color-mix(in srgb, var(--success) 8%, transparent); }
.range-pill.above   { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, transparent); background: color-mix(in srgb, var(--warning) 8%, transparent); }

/* ================================================================
   Stats bar
   ================================================================ */
.stats-bar {
  display: flex; gap: var(--sp-5); flex-wrap: wrap; align-items: center; justify-content: center;
  padding: var(--sp-2) var(--sp-4);
}
.stats-item { display: flex; align-items: baseline; gap: 6px; }
.stats-val { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 500; color: var(--text); transition: color var(--fast); }
.stats-val.active { color: var(--accent); }
.stats-label { font-family: var(--font-ui); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-ghost); }
.stats-sep { width: 1px; height: 22px; background: var(--border); }

/* ================================================================
   Actions row
   ================================================================ */
.tool-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; justify-content: center; }

/* ================================================================
   SEO / content sections
   ================================================================ */
.content-section { max-width: 780px; margin: 0 auto; width: 100%; padding: var(--sp-7) var(--sp-5); }
.content-section + .content-section { border-top: 1px solid var(--border); }
.content-section h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; color: var(--text); margin-bottom: var(--sp-4); line-height: 1.3; }
.content-section h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--text); margin: var(--sp-4) 0 var(--sp-2); }
.content-section p { font-size: .96rem; color: var(--text-soft); line-height: 1.8; margin-bottom: var(--sp-3); }
.content-section ul, .content-section ol { padding-left: var(--sp-5); margin-bottom: var(--sp-3); }
.content-section li { font-size: .94rem; color: var(--text-soft); line-height: 1.8; margin-bottom: var(--sp-2); }
.content-section li strong { color: var(--text); }
.content-section a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); }

.faq-item { border-bottom: 1px solid var(--border); padding: var(--sp-4) 0; }
.faq-item summary {
  font-family: var(--font-ui); font-weight: 600; font-size: .96rem; color: var(--text);
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.3rem; color: var(--accent); flex-shrink: 0; transition: transform var(--fast); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: var(--sp-3); margin-bottom: 0; color: var(--text-muted); }

/* ================================================================
   Toast
   ================================================================ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper);
  font-family: var(--font-ui); font-size: .82rem; font-weight: 500;
  padding: 10px 22px; border-radius: 99px; opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; z-index: 9999; white-space: nowrap; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
:root[data-theme="dark"] .toast { background: var(--paper); color: var(--ink); }

/* ================================================================
   Footer
   ================================================================ */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-panel); margin-top: var(--sp-7); }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: var(--sp-6) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-5); flex-wrap: wrap; }
.footer-brand p { font-size: .82rem; color: var(--text-muted); max-width: 320px; margin-top: 6px; line-height: 1.6; }
.footer-links { display: flex; gap: var(--sp-6); flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-col-title { font-family: var(--font-ui); font-size: .64rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-ghost); margin-bottom: 4px; }
.footer-col a { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-size: .82rem; color: var(--text-muted); }
.footer-col a svg { flex-shrink: 0; opacity: .7; }
.footer-col a:hover { color: var(--accent); }
.footer-col a:hover svg { opacity: 1; }
.footer-bottom { display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; padding-top: var(--sp-4); border-top: 1px solid var(--border); font-family: var(--font-ui); font-size: .74rem; color: var(--text-ghost); }

/* ================================================================
   Static pages (contact / privacy / terms)
   ================================================================ */
.static-page h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--text); margin-bottom: var(--sp-3); }
.static-page .lede { font-size: 1rem; color: var(--text-muted); margin-bottom: var(--sp-6); line-height: 1.7; }
.static-page h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--text); margin: var(--sp-6) 0 var(--sp-3); }
.static-page p { font-size: .95rem; color: var(--text-soft); line-height: 1.8; margin-bottom: var(--sp-3); }
.static-page ul { padding-left: var(--sp-5); margin-bottom: var(--sp-3); }
.static-page li { font-size: .93rem; color: var(--text-soft); line-height: 1.8; margin-bottom: var(--sp-2); }

/* ================================================================
   404 page
   ================================================================ */
.not-found { max-width: 560px; margin: 0 auto; text-align: center; padding: var(--sp-8) 0; }
.not-found-code {
  display: block; font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(4rem, 16vw, 7rem); line-height: 1; letter-spacing: -.02em;
  color: var(--border); margin-bottom: var(--sp-3);
}
.not-found .hero-eyebrow { margin-bottom: var(--sp-4); }
.not-found h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.4rem, 3.5vw, 2rem); color: var(--text);
  line-height: 1.3; margin-bottom: var(--sp-4);
}
.not-found p { font-size: .95rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 0; }

.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); }
.form-field label { font-family: var(--font-ui); font-size: .78rem; font-weight: 600; color: var(--text-soft); }
.form-field input, .form-field textarea {
  padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg-input); color: var(--text); font-size: .92rem;
  transition: border-color var(--fast);
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--accent); }
.form-field textarea { resize: vertical; min-height: 140px; font-family: var(--font-body); }
.form-note { font-size: .8rem; color: var(--text-ghost); margin-top: var(--sp-3); }
.contact-methods { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-6); }
.contact-methods a { font-family: var(--font-ui); font-size: .92rem; font-weight: 600; }

/* ================================================================
   Blog — listing + article
   ================================================================ */
.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-family: var(--font-ui); font-size: .76rem; color: var(--text-ghost); margin-bottom: var(--sp-5);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span[aria-current] { color: var(--text-soft); }

.blog-hero { max-width: 700px; margin: 0 auto var(--sp-6); text-align: center; }
.blog-hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 4.2vw, 2.4rem); color: var(--text); margin-bottom: var(--sp-3); }
.blog-hero p { font-size: .96rem; color: var(--text-muted); line-height: 1.7; }

.blog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }

.pagination { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); margin-top: var(--sp-6); flex-wrap: wrap; }
.pagination .btn[aria-disabled] { opacity: .4; pointer-events: none; }
.pagination-status { font-family: var(--font-mono); font-size: .78rem; color: var(--text-muted); }

.blog-card {
  display: flex; flex-direction: column; gap: var(--sp-2);
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-4); transition: all var(--fast);
}
.blog-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.blog-card-tag {
  align-self: flex-start; font-family: var(--font-ui); font-size: .6rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  padding: 3px 10px; border-radius: 99px;
}
.blog-card-title { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; color: var(--text); line-height: 1.4; }
.blog-card:hover .blog-card-title { color: var(--accent); }
.blog-card-excerpt { font-size: .87rem; color: var(--text-muted); line-height: 1.65; flex: 1; }
.blog-card-meta { font-family: var(--font-mono); font-size: .68rem; color: var(--text-ghost); margin-top: var(--sp-1); }

/* ── Generated cover (CSS + inline SVG, no image files) ── */
.blog-cover {
  position: relative; overflow: hidden; aspect-ratio: 16 / 9;
  border-radius: calc(var(--r-md) - 1px) calc(var(--r-md) - 1px) 0 0;
  margin: calc(var(--sp-4) * -1) calc(var(--sp-4) * -1) var(--sp-3);
  background: linear-gradient(135deg, var(--accent) 0%, var(--link) 100%);
  display: flex; align-items: center; justify-content: center;
}
.blog-cover::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.07) 0 2px, transparent 2px 26px);
}
.blog-cover::after {
  content: ''; position: absolute; width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.08); top: -70px; right: -50px; pointer-events: none;
}
.blog-cover-icon { position: relative; z-index: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,.18)); width: 30%; height: auto; display: block; }
.blog-cover-badge {
  position: absolute; z-index: 1; bottom: var(--sp-3); left: var(--sp-3);
  font-family: var(--font-ui); font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: rgba(0,0,0,.3); backdrop-filter: blur(4px);
  padding: 4px 10px; border-radius: 99px; border: 1px solid rgba(255,255,255,.35);
}
.blog-cover-hero { aspect-ratio: 21 / 9; margin: 0 0 var(--sp-5); border-radius: var(--r-md); }

.article-header { max-width: 720px; margin: 0 auto var(--sp-6); }
.article-header .blog-card-tag { margin-bottom: var(--sp-3); }
.article-header h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 4.2vw, 2.3rem); color: var(--text); line-height: 1.28; margin-bottom: var(--sp-3); }
.article-meta { display: flex; gap: var(--sp-3); flex-wrap: wrap; font-family: var(--font-mono); font-size: .74rem; color: var(--text-ghost); }
.article-lede { font-size: 1.02rem; color: var(--text-muted); line-height: 1.75; margin-top: var(--sp-4); }

.article-body { max-width: 720px; margin: 0 auto; }
.article-body h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; color: var(--text); margin: var(--sp-6) 0 var(--sp-3); line-height: 1.35; }
.article-body h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; color: var(--text); margin: var(--sp-5) 0 var(--sp-2); }
.article-body p { font-size: .96rem; color: var(--text-soft); line-height: 1.85; margin-bottom: var(--sp-3); }
.article-body ul, .article-body ol { padding-left: var(--sp-5); margin-bottom: var(--sp-4); }
.article-body li { font-size: .94rem; color: var(--text-soft); line-height: 1.8; margin-bottom: var(--sp-2); }
.article-body li strong { color: var(--text); }
.article-body a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); }
.article-body blockquote {
  border-left: 3px solid var(--accent); padding: var(--sp-2) var(--sp-4); margin: var(--sp-4) 0;
  font-style: italic; color: var(--text-muted); background: var(--bg-panel); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.article-body table { width: 100%; border-collapse: collapse; margin-bottom: var(--sp-4); font-size: .88rem; }
.article-body th, .article-body td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text-soft); }
.article-body th { font-family: var(--font-ui); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-ghost); }

.article-cta {
  max-width: 720px; margin: var(--sp-6) auto; background: var(--bg-panel);
  border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--r-md);
  padding: var(--sp-5); text-align: center;
}
.article-cta h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--text); margin-bottom: var(--sp-2); }
.article-cta p { font-size: .9rem; color: var(--text-muted); margin-bottom: var(--sp-4); }

.related-articles { max-width: 720px; margin: var(--sp-7) auto 0; padding-top: var(--sp-5); border-top: 1px solid var(--border); }
.related-articles h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--text); margin-bottom: var(--sp-4); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }

/* ── Share buttons ── */
.share-bar-top {
  max-width: 720px; margin: var(--sp-4) auto; display: flex; align-items: center;
  gap: var(--sp-3); flex-wrap: wrap;
}
.share-bar-top .share-label {
  font-family: var(--font-ui); font-size: .68rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-ghost);
}
.share-buttons { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.share-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-ui); font-size: .76rem; font-weight: 600; color: var(--text-soft);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 7px 13px;
  background: var(--bg-panel); transition: all var(--fast);
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg-panel)); }
.share-btn svg { flex-shrink: 0; }
.share-btn--icon { padding: 8px; }
.share-section {
  max-width: 720px; margin: var(--sp-6) auto; text-align: center;
  padding-top: var(--sp-5); border-top: 1px solid var(--border);
}
.share-cta { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; color: var(--text); margin-bottom: 3px; }
.share-cta-sub { font-size: .88rem; color: var(--text-muted); margin-bottom: var(--sp-4); }
.share-section .share-buttons { justify-content: center; }

/* ── From the blog (random preview) ── */
.from-blog-section { max-width: 900px; margin: 0 auto; width: 100%; padding: var(--sp-6) var(--sp-5); }
.from-blog-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.from-blog-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--text); }
.from-blog-head a { font-family: var(--font-ui); font-size: .76rem; color: var(--text-ghost); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.from-blog-head a:hover { color: var(--accent); }
.from-blog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .prompt-docs { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .task-cards { grid-template-columns: 1fr; }
  .exam-panel { flex-direction: column; align-items: stretch; }
  .exam-controls { justify-content: space-between; }
  .tool-actions { flex-wrap: nowrap; }
  .tool-actions .btn { flex: 1; }
  .btn-label { display: none; }
  .footer-links { gap: var(--sp-5); }
  .blog-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .from-blog-grid { grid-template-columns: 1fr; }
}

/* Mobile nav drawer */
.mobile-nav {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(6px);
  flex-direction: column; padding: var(--sp-6) var(--sp-5);
}
.mobile-nav.open { display: flex; }
.mobile-nav-head { display: flex; justify-content: flex-end; margin-bottom: var(--sp-6); }
.mobile-nav a {
  display: flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-display); font-size: 1.4rem; color: var(--text);
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--border);
}
.mobile-nav a svg { flex-shrink: 0; color: var(--accent); }
