/* Codemere — design system
   Ground: cool slate-green paper. Ink: near-black blue. One accent: deep teal.
   Amber is reserved for the featured tier only. Mono for headings + code, Inter for body. */

:root {
  --bg: #eef1ef;
  --bg-2: #e3e8e5;
  --ink: #101820;
  --muted: #55606a;
  --line: #cfd6d2;
  --accent: #0f6e6b;
  --accent-soft: #d5e9e7;
  --accent-ink: #ffffff;
  --amber: #c98a1b;
  --amber-soft: #f4e6c8;
  --card: #ffffff;
  --code-bg: #101820;
  --code-ink: #dfe6e2;
  --code-dim: #6d7a86;
  --code-key: #7fd1cb;
  --code-str: #f0c987;
  --ok: #2f8f5b;
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.06), 0 8px 24px -12px rgba(16, 24, 32, 0.18);
  --radius: 6px;
  --radius-lg: 10px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1114;
    --bg-2: #15191d;
    --ink: #e8e4da;
    --muted: #9aa3ad;
    --line: #2a3038;
    --accent: #3fb3ae;
    --accent-soft: #163331;
    --accent-ink: #0b1413;
    --amber: #e0a93f;
    --amber-soft: #3a2c10;
    --card: #171a1f;
    --code-bg: #0a0c0f;
    --code-ink: #d9d4c8;
    --code-dim: #5e6873;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1114;
  --bg-2: #15191d;
  --ink: #e8e4da;
  --muted: #9aa3ad;
  --line: #2a3038;
  --accent: #3fb3ae;
  --accent-soft: #163331;
  --accent-ink: #0b1413;
  --amber: #e0a93f;
  --amber-soft: #3a2c10;
  --card: #171a1f;
  --code-bg: #0a0c0f;
  --code-ink: #d9d4c8;
  --code-dim: #5e6873;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 1.2rem + 3.4vw, 3.6rem); }
h2 { font-size: clamp(1.55rem, 1.1rem + 1.6vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; max-width: 68ch; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 56ch; }
code, kbd, pre { font-family: var(--font-mono); }
.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 500 0.95rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--ink); color: var(--bg); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-ghost { border-color: var(--line); }
.btn[aria-disabled="true"] {
  background: var(--bg-2); border-color: var(--line); color: var(--muted); cursor: not-allowed;
}
.btn[aria-disabled="true"]:hover { background: var(--bg-2); color: var(--muted); }
.btn-block { width: 100%; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-weight: 600; font-size: 1.1rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.brand-mark { width: 26px; height: 26px; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 0.75rem; }
.theme-toggle, .nav-toggle {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: transparent; color: var(--ink); cursor: pointer;
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--ink); }
.theme-toggle svg, .nav-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.nav-toggle { display: none; }
@media (max-width: 800px) {
  .nav-toggle { display: inline-grid; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { border-top: 1px solid var(--line); }
  .nav-links a { display: block; padding: 0.9rem 1.25rem; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 6vw, 6rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 2.5rem; }
.section-head p { color: var(--muted); }
.section-accent { background: var(--bg-2); }

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { margin-bottom: 1rem; }
.hero .lede { margin-bottom: 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.75rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 1.5rem; color: var(--muted); font-size: 0.92rem; padding: 0; margin: 0; list-style: none; }
.hero-facts strong { color: var(--ink); font-weight: 600; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }

/* ---------- Code window ---------- */
.code-window {
  background: var(--code-bg); color: var(--code-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.55;
}
.code-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--code-dim); font-size: 0.75rem;
}
.code-bar .dots { display: inline-flex; gap: 6px; margin-right: 0.35rem; }
.code-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); display: block; }
.code-window pre { margin: 0; padding: 0.9rem 1rem 1rem; overflow-x: auto; tab-size: 4; }
.code-window code { display: block; white-space: pre; }
.code-window .ln { display: inline-block; width: 2ch; margin-right: 1.2ch; color: var(--code-dim); text-align: right; user-select: none; }
.tok-k { color: var(--code-key); }
.tok-s { color: var(--code-str); }
.tok-c { color: var(--code-dim); }
.code-out { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 0.75rem 1rem; color: var(--code-dim); }
.code-out .ok { color: #7bd88f; }
.code-out .prompt { color: var(--code-ink); }
.code-typing { min-height: 13.5em; }
.cursor::after { content: "▍"; color: var(--code-key); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Syllabus (curriculum) ---------- */
.syllabus { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); counter-reset: mod; }
.module {
  display: grid; grid-template-columns: 4rem 1fr 1fr auto; gap: 1.25rem 2rem;
  padding: 1.5rem 0; border-bottom: 1px solid var(--line); align-items: start;
}
.module-no { font-family: var(--font-mono); font-weight: 600; font-size: 1.4rem; color: var(--accent); line-height: 1.1; }
.module h3 { margin: 0 0 0.35rem; }
.module-topics { margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.95rem; }
.module-topics li { padding-left: 1rem; position: relative; }
.module-topics li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.module-project { font-size: 0.95rem; color: var(--muted); }
.module-project strong { display: block; color: var(--ink); font-weight: 500; }
.module-meta { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); white-space: nowrap; text-align: right; }
@media (max-width: 880px) {
  .module { grid-template-columns: 3rem 1fr; }
  .module-project, .module-meta { grid-column: 2; text-align: left; }
}

/* ---------- Cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 880px) { .grid-3 { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--muted); margin: 0; }
.card-icon { width: 34px; height: 34px; color: var(--accent); margin-bottom: 1rem; }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; align-items: stretch; }
@media (max-width: 1000px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .pricing-grid { grid-template-columns: 1fr; } }
.tier {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.6rem 1.5rem 1.5rem;
}
.tier-featured { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.tier-badge {
  position: absolute; top: -0.8rem; left: 1.25rem;
  background: var(--amber); color: #1a1200;
  font: 500 0.78rem/1 var(--font-body);
  padding: 0.4rem 0.6rem; border-radius: 4px;
}
.tier h3 { margin-bottom: 0.15rem; }
.tier-sub { color: var(--muted); font-size: 0.92rem; margin: 0 0 1rem; min-height: 2.9em; }
.tier-price { font-family: var(--font-mono); font-weight: 600; font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 0.15rem; }
.tier-price small { font-size: 0.55em; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.tier-once { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.25rem; }
.tier-list { list-style: none; margin: 0 0 1.5rem; padding: 0; flex: 1; font-size: 0.95rem; }
.tier-list li { display: flex; gap: 0.6rem; padding: 0.3rem 0; }
.tier-list li::before { content: "✓"; color: var(--ok); font-weight: 600; flex: none; }
.tier-list li.no { color: var(--muted); }
.tier-list li.no::before { content: "–"; color: var(--line); }
.guarantee {
  margin-top: 2rem; padding: 1.25rem 1.5rem;
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
  display: flex; gap: 1rem; align-items: flex-start; max-width: 720px;
}
.guarantee svg { width: 28px; height: 28px; flex: none; color: var(--accent); }
.guarantee p { margin: 0; color: var(--muted); }
.guarantee strong { color: var(--ink); }

/* ---------- Instructor ---------- */
.instructor { display: grid; grid-template-columns: 200px 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 720px) { .instructor { grid-template-columns: 1fr; } }
.monogram {
  width: 200px; aspect-ratio: 1; border-radius: var(--radius-lg);
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 3.2rem; letter-spacing: -0.05em;
}
.instructor-meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 1rem; }

/* ---------- Testimonials ---------- */
.quote { margin: 0; }
.quote p { font-size: 1.05rem; margin-bottom: 1rem; color: var(--ink); }
.quote footer { font-size: 0.9rem; color: var(--muted); }
.quote footer strong { color: var(--ink); font-weight: 500; }

/* ---------- FAQ ---------- */
.faq-list { border-top: 1px solid var(--line); max-width: 760px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 1.1rem 2.25rem 1.1rem 0;
  font-weight: 500; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 1.3rem; color: var(--accent);
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p { color: var(--muted); padding-bottom: 1.1rem; margin: 0; }

/* ---------- CTA ---------- */
.section-cta { background: var(--ink); color: var(--bg); }
.section-cta h2, .section-cta p { color: inherit; }
.section-cta p { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.section-cta .btn-primary { background: var(--accent); border-color: var(--accent); }
.section-cta .btn-primary:hover { background: var(--bg); border-color: var(--bg); color: var(--ink); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 3rem 0 2rem; font-size: 0.92rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { font-size: 0.9rem; margin-bottom: 0.6rem; color: var(--ink); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 0.4rem; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer-legal { border-top: 1px solid var(--line); padding-top: 1.25rem; font-size: 0.85rem; }
.footer-legal p { margin: 0 0 0.35rem; max-width: none; }

/* ---------- Legal pages ---------- */
.legal { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.legal-inner { max-width: 72ch; }
.legal h1 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); }
.legal h2 { font-size: 1.25rem; margin-top: 2.2rem; }
.legal .updated { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: 0.4rem; }
.legal address { font-style: normal; }
