/* ============================================================
   THE GOOD LEARNER PROJECT - Global Stylesheet
   Calm, documentary, editorial. Paper + ink, one green accent.
   Colours and type chosen to match the series voice:
   humane, reflective, plain. No hype.
   ------------------------------------------------------------
   EDITING TIP: Colours, fonts and spacing all live here.
   To change a colour everywhere, edit its value in :root below.
   ============================================================ */

:root {
  /* Ink + paper */
  --ink:        #211f1b;
  --ink-soft:   #4c463c;
  --ink-faint:  #7a7264;
  --paper:      #faf7f1;
  --paper-2:    #f2ebdd;
  --paper-3:    #ece3d2;
  --line:       #e2d9c7;
  --white:      #ffffff;

  /* Green = growth (primary accent) */
  --green:      #2f6d54;
  --green-dark: #245842;
  --green-soft: #e6efe9;

  /* Ochre = warmth (secondary accent, used sparingly) */
  --ochre:      #b07a1e;
  --ochre-soft: #f6ecd6;

  --shadow-sm: 0 1px 3px rgba(33,31,27,0.06);
  --shadow-md: 0 6px 24px rgba(33,31,27,0.08);
  --shadow-lg: 0 16px 48px rgba(33,31,27,0.12);
  --radius:    10px;
  --radius-lg: 18px;
  --transition: 0.2s ease;
  --maxw: 1120px;

  /* Theme-stable bands (stay dark in both light and dark themes) */
  --band-bg:    #211f1b;
  --band-text:  #f2ece1;
  --footer-bg:  #211f1b;
  --footer-text:#cfc7b8;
  --footer-head:#faf7f1;
  --header-bg:  rgba(250,247,241,0.92);
  --modal-scrim: rgba(33,31,27,0.55);
}

/* ---------- DARK THEME ---------- */
html[data-theme="dark"] {
  --ink:        #f1ebdf;
  --ink-soft:   #cfc7b6;
  --ink-faint:  #9a9180;
  --paper:      #141310;
  --paper-2:    #201d15;
  --paper-3:    #2a261b;
  --line:       #37332a;
  --white:      #1d1b14;
  --green:      #6bb89a;
  --green-dark: #8ccbb0;
  --green-soft: #1e2c26;
  --ochre:      #d6a24a;
  --ochre-soft: #2c2517;
  --header-bg:  rgba(20,19,16,0.9);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.45);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.55);
}
html { transition: background-color var(--transition); }

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green-dark); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green); }
ul, ol { list-style: none; }

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4 {
  font-family: 'Fraunces', 'Georgia', serif;
  line-height: 1.18;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.55rem); }
h4 { font-size: 1.1rem; font-weight: 600; }
p  { margin-bottom: 1.1rem; max-width: 68ch; }
strong { font-weight: 600; }
.lead { font-size: 1.2rem; color: var(--ink-soft); }
.eyebrow {
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green);
}

/* ---------- LAYOUT ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section--sm { padding: 3rem 0; }
.section--paper2 { background: var(--paper-2); }
.section--ink { background: var(--band-bg); color: var(--band-text); }
.section--ink h1, .section--ink h2, .section--ink h3 { color: var(--band-text); }
.section--green { background: var(--green); color: #fff; }
.section--green h1, .section--green h2, .section--green h3 { color: #fff; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.grid { display: grid; gap: 1.6rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.center { text-align: center; }
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.6rem}.mt-4{margin-top:2.4rem}
.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.6rem}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.98rem;
  padding: 0.8rem 1.4rem; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer;
  transition: all var(--transition);
}
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--green); color: var(--green-dark); }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--light:hover { background: #fff; color: var(--green-dark); }

/* ---------- ENSŌ / LOGO ---------- */
.enso { display: inline-block; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: flex-start; height: 74px; gap: 1.2rem; }
.header-inner .brand { margin-right: auto; }
.header-inner .main-nav { order: 2; }
.header-inner .header-tools { order: 3; }
.brand { display: flex; align-items: center; gap: 0.65rem; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.brand .brand-name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.12rem; line-height: 1.05; }
.brand .brand-sub { display: block; font-family: 'Inter', sans-serif; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.main-nav { display: flex; align-items: center; gap: 1.6rem; }
.main-nav a { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 0.95rem; color: var(--ink-soft); }
.main-nav a:hover, .main-nav a.active { color: var(--green-dark); }
.main-nav a.active { font-weight: 600; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 0.4rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: var(--transition); }

/* ---------- HERO ---------- */
.hero { padding: 5.5rem 0 4.5rem; }
.hero .eyebrow { margin-bottom: 1rem; }
.hero h1 { max-width: 16ch; }
.hero .lead { margin-top: 1.4rem; max-width: 60ch; }
.hero-actions { margin-top: 2.2rem; display: flex; gap: 0.9rem; flex-wrap: wrap; }
.thesis {
  border-left: 3px solid var(--green);
  padding: 0.4rem 0 0.4rem 1.4rem;
  font-family: 'Fraunces', serif; font-style: italic;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem); line-height: 1.4;
  color: var(--ink); max-width: 32ch;
}

/* ---------- CARDS ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--ink); }
.card .ep-num { font-family: 'Fraunces', serif; font-size: 0.9rem; color: var(--green); font-weight: 600; }
.card h3 { margin: 0.3rem 0 0.5rem; }
.card p { font-size: 0.96rem; color: var(--ink-soft); margin-bottom: 0.8rem; }
.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.04em; padding: 0.22rem 0.6rem; border-radius: 999px;
  background: var(--green-soft); color: var(--green-dark);
}
.tag--ochre { background: var(--ochre-soft); color: #8a5c13; }
.read-more { font-weight: 600; font-size: 0.9rem; }

/* ---------- SIX KINDS OF HARD (home) ---------- */
.kinds { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.kind {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem;
}
.kind .num { font-family: 'Fraunces', serif; color: var(--ochre); font-weight: 600; }
.kind h4 { margin: 0.2rem 0 0.3rem; }
.kind p { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }

/* ---------- ARTICLE / POST ---------- */
.post-head { padding: 3.5rem 0 2rem; }
.post-meta { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; color: var(--ink-faint); font-size: 0.85rem; }
.post-body { font-size: 1.06rem; }
.post-body h2 { margin: 2.4rem 0 0.9rem; }
.post-body h3 { margin: 1.8rem 0 0.6rem; }
.post-body p { color: var(--ink-soft); }
.post-body strong { color: var(--ink); }
.pullquote {
  font-family: 'Fraunces', serif; font-style: italic;
  font-size: 1.35rem; line-height: 1.45; color: var(--ink);
  border-left: 3px solid var(--green); padding-left: 1.3rem;
  margin: 2rem 0; max-width: 40ch;
}

/* ---------- FRAMEWORK CARD ---------- */
.framework {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); margin: 1.6rem 0;
}
.framework-head { background: var(--band-bg); color: var(--band-text); padding: 1.1rem 1.4rem; }
.framework-head .eyebrow { color: #cdb98f; }
.framework-head h3 { color: var(--band-text); margin-top: 0.2rem; }
.framework-table { width: 100%; border-collapse: collapse; }
.framework-table th, .framework-table td { text-align: left; padding: 0.85rem 1.4rem; border-bottom: 1px solid var(--line); font-size: 0.95rem; vertical-align: top; }
.framework-table th { font-family: 'Inter',sans-serif; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); }
.framework-table tr:last-child td { border-bottom: 0; }
.framework-table td:first-child { font-weight: 600; color: var(--green-dark); white-space: nowrap; }
.framework-list { padding: 1.2rem 1.4rem; }
.framework-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); display: flex; gap: 0.7rem; }
.framework-list li:last-child { border-bottom: 0; }
.framework-list .n { font-family:'Fraunces',serif; color: var(--green); font-weight: 600; flex-shrink:0; }

/* ---------- PROMPT BLOCK ---------- */
.prompt {
  background: var(--paper-3); border: 1px solid var(--line);
  border-radius: var(--radius); margin: 1.4rem 0; overflow: hidden;
}
.prompt-bar { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1rem; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.prompt-bar span { font-size: 0.8rem; font-weight: 600; color: var(--ink-faint); letter-spacing: 0.04em; }
.copy-btn { font-family:'Inter',sans-serif; font-size: 0.8rem; font-weight: 600; background: var(--green); color: #fff; border: 0; padding: 0.4rem 0.85rem; border-radius: 999px; cursor: pointer; transition: var(--transition); }
.copy-btn:hover { background: var(--green-dark); }
.copy-btn.copied { background: var(--ochre); }
.prompt pre { margin: 0; padding: 1.1rem 1.2rem; overflow-x: auto; }
.prompt code { font-family: 'SFMono-Regular', ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.86rem; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }

/* ---------- CHECKLIST ---------- */
.checklist { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.6rem 1.7rem; box-shadow: var(--shadow-sm); }
.checklist li { position: relative; padding: 0.55rem 0 0.55rem 2.1rem; border-bottom: 1px dashed var(--line); color: var(--ink-soft); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.7rem;
  width: 18px; height: 18px; border: 2px solid var(--green); border-radius: 5px;
}
.behaviour {
  background: var(--green-soft); border-radius: var(--radius);
  padding: 1.2rem 1.4rem; border-left: 3px solid var(--green);
}
.behaviour .eyebrow { color: var(--green-dark); }

/* ---------- RESOURCE / DOWNLOAD ROWS ---------- */
.res-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.res-row:last-child { border-bottom: 0; }
.res-row .r-title { font-weight: 600; }
.res-row .r-sub { font-size: 0.9rem; color: var(--ink-faint); }

/* ---------- FORMS ---------- */
.form-field { margin-bottom: 1.1rem; }
.form-field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.35rem; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink);
  padding: 0.75rem 0.9rem; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--white); transition: border-color var(--transition);
}
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--green); }
.form-note { font-size: 0.85rem; color: var(--ink-faint); }

/* ---------- FOOTER ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding: 3.5rem 0 2rem; margin-top: 3rem; }
.site-footer h4 { color: var(--footer-head); margin-bottom: 0.8rem; font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-footer a { color: #cfc7b8; font-size: 0.92rem; }
.site-footer a:hover { color: #fff; }
.footer-links li { padding: 0.28rem 0; }
.footer-brand p { font-size: 0.95rem; color: #b7ae9e; max-width: 42ch; }
.footer-social { display: flex; gap: 0.7rem; margin-top: 1rem; }
.footer-social a { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border: 1px solid #4a4438; border-radius: 50%; }
.footer-social a:hover { border-color: var(--green); background: rgba(47,109,84,0.2); }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }
.footer-bottom { border-top: 1px solid #3a352c; margin-top: 2.4rem; padding-top: 1.4rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; font-size: 0.82rem; color: #948b7b; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
  .grid-2, .grid-3, .kinds, .footer-grid { grid-template-columns: 1fr; }
  .kinds { grid-template-columns: 1fr 1fr; }
  .main-nav {
    position: fixed; inset: 74px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1.5rem; display: none; box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 0.8rem 0; border-bottom: 1px solid var(--line); width: 100%; }
  .nav-toggle { display: block; }
}
@media (max-width: 520px) {
  .kinds { grid-template-columns: 1fr; }
  .section { padding: 3.5rem 0; }
}

/* ============================================================
   ADDED: theme toggle, download modal, pricing, support
   ============================================================ */

/* Header tools cluster */
.header-tools { display: flex; align-items: center; gap: 0.4rem; }
.theme-toggle {
  background: transparent; border: 1px solid var(--line); cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--green); color: var(--green-dark); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }

/* Author card mark (ensō) */
.author-mark { color: var(--ink); flex-shrink: 0; }
.author-mark svg { width: 60px; height: 60px; }

/* Fine print / small legal text */
.fineprint { font-size: 0.82rem; color: var(--ink-faint); line-height: 1.55; }
.fineprint p { max-width: none; margin-bottom: 0.7rem; }
.fineprint h2 { font-size: 1.05rem; margin: 1.2rem 0 0.4rem; color: var(--ink); }
.fineprint a { color: var(--green-dark); text-decoration: underline; }

/* Support / coffee call-out */
.support-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  background: var(--ochre-soft); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.5rem 1.7rem; flex-wrap: wrap;
}
.support-cta h3 { margin: 0; }
.support-cta p { margin: 0; max-width: 52ch; color: var(--ink-soft); }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.price-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.price-card--featured { border-color: var(--green); box-shadow: var(--shadow-md); }
.price-card h3 { margin: 0.2rem 0 0.4rem; }
.price-card p { font-size: 0.95rem; color: var(--ink-soft); flex-grow: 1; }
.price-card .btn { width: 100%; justify-content: center; }
.price { font-family: 'Fraunces', serif; font-size: 2.2rem; font-weight: 600; color: var(--ink); margin-bottom: 0.6rem; }
.price span { font-size: 0.85rem; font-family: 'Inter', sans-serif; color: var(--ink-faint); font-weight: 500; }

/* Download email-gate modal */
.modal-overlay {
  position: fixed; inset: 0; background: var(--modal-scrim);
  display: flex; align-items: center; justify-content: center; z-index: 2000;
  padding: 1.2rem;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  max-width: 460px; width: 100%; padding: 2rem 2rem 1.7rem; position: relative;
}
.modal h3 { margin: 0.2rem 0 0.5rem; }
.modal p { font-size: 0.95rem; color: var(--ink-soft); }
.modal .btn { width: 100%; justify-content: center; margin-top: 0.3rem; }
.modal-close {
  position: absolute; top: 0.7rem; right: 0.9rem; background: none; border: 0;
  font-size: 1.6rem; line-height: 1; color: var(--ink-faint); cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.dl-skip { display: block; text-align: center; margin-top: 0.9rem; font-size: 0.85rem; color: var(--ink-faint); }
.dl-skip:hover { color: var(--green-dark); }

@media (max-width: 860px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .support-cta { flex-direction: column; align-items: flex-start; }
}

/* FAQ accordion (uses native <details>) */
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); margin-bottom: 0.7rem; overflow: hidden; }
.faq-item summary {
  cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; color: var(--ink);
  list-style: none; position: relative; padding-right: 2.6rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; color: var(--green); font-weight: 400; line-height: 1;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item[open] summary { border-bottom: 1px solid var(--line); }
.faq-a { padding: 0.9rem 1.2rem 1.1rem; }
.faq-a p { margin: 0; color: var(--ink-soft); }
.faq-item summary:hover { color: var(--green-dark); }

/* PayPal hosted button container */
.paypal-btn { min-width: 220px; }
.paypal-btn > div { min-height: 45px; }
@media (max-width: 860px){ .paypal-btn { width: 100%; } }


/* ============================================================
   ADDED: sparing "aha" graphics (inline SVG, theme-aware)
   ============================================================ */
.glp-fig { margin: 2.4rem auto 0; max-width: 340px; text-align: center; color: var(--ink); }
.glp-fig--wide { max-width: 460px; }
.glp-fig svg { width: 100%; height: auto; overflow: visible; display: block; }
.glp-fig figcaption { font-size: 0.85rem; color: var(--ink-faint); margin-top: 0.7rem; line-height: 1.5; }
.g-stroke { stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.g-green { stroke: var(--green); }
.g-faint { stroke: var(--ink-faint); }
.g-dash { stroke-dasharray: 5 7; }
.g-fill-ink { fill: currentColor; }
.g-fill-green { fill: var(--green); }
.g-t { font-family: 'Inter', sans-serif; fill: var(--ink-soft); font-size: 13px; }
.g-t-sm { font-size: 11px; fill: var(--ink-faint); }
.g-t-green { fill: var(--green); font-weight: 600; }
.g-t-white { fill: #fff; }
.g-t-cap { text-transform: uppercase; letter-spacing: 1.5px; font-size: 11px; font-weight: 600; }
