/* ============================================================
   Shamir George — dark editorial design system
   Fraunces (display) + Inter (text) + shader-forward, gold on deep teal
   ============================================================ */

:root {
    --bg:        #0c1f1d;   /* page canvas — deep teal-black */
    --bg-2:      #102a27;   /* raised dark panel */
    --bg-3:      #16413b;   /* card / elevated */
    --paper:     #f6f1e6;   /* warm reading surface */
    --paper-ink: #16302e;   /* text on paper */
    --gold:      #d8b15a;
    --gold-2:    #ecc878;
    --gold-dark: #b08a36;
    --teal-2:    #3a7a72;
    --text:      #e9f1ee;   /* light text on dark */
    --text-dim:  #9fb6b0;
    --line:      rgba(216,177,90,0.16);
    --line-2:    rgba(233,241,238,0.10);
    --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: 'Spline Sans Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
    --shadow: 0 18px 50px rgba(0,0,0,0.45);
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.30);
    --radius: 16px;
    --maxw: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: var(--gold); color: #20180a; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }

body {
    font-family: var(--sans);
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* faint fixed shader-ish grain over the whole canvas for depth */
body::before {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(60% 50% at 80% -5%, rgba(58,122,114,0.30), transparent 60%),
        radial-gradient(50% 45% at 0% 100%, rgba(216,177,90,0.07), transparent 55%);
}

.skip-link { position: absolute; top: -52px; left: 0; background: var(--gold); color: #20180a; padding: 10px 16px; z-index: 100; text-decoration: none; border-radius: 0 0 10px 0; font-weight: 600; }
.skip-link:focus { top: 0; }

/* ---------- Header / Nav ---------- */
header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(12,31,29,0.72);
    backdrop-filter: saturate(150%) blur(14px);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
    border-bottom: 1px solid var(--line-2);
    transition: box-shadow 0.3s, background 0.3s;
}
header.scrolled { box-shadow: 0 8px 30px rgba(0,0,0,0.35); background: rgba(10,24,22,0.9); }
nav { max-width: var(--maxw); margin: 0 auto; padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--gold); }
.nav-links { display: flex; gap: 0.2rem; list-style: none; flex-wrap: wrap; align-items: center; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-weight: 500; font-size: 0.94rem; padding: 0.5rem 0.85rem; border-radius: 9px; position: relative; transition: color 0.2s; }
.nav-links a::after { content: ''; position: absolute; left: 0.85rem; right: 0.85rem; bottom: 0.34rem; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text); outline: none; }
.nav-links a:hover::after, .nav-links a:focus-visible::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--gold-2); }
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a.nav-cta { background: var(--gold); color: #20180a; font-weight: 600; }
.nav-links a.nav-cta::after { display: none; }
.nav-links a.nav-cta:hover { background: var(--gold-2); color: #20180a; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 1.5rem; }
section { scroll-margin-top: 84px; }
.section-pad { padding: 5.5rem 0; }
.panel { background: var(--bg-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }

.eyebrow { display: inline-block; font-family: var(--mono); font-size: 0.76rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--text); line-height: 1.08; letter-spacing: -0.02em; font-weight: 600; }
h1 { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 700; }
h2 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); margin-bottom: 0.5rem; }
h4 { font-size: 1.1rem; }
p { font-size: clamp(1rem, 1.4vw, 1.12rem); color: var(--text); }
.lead { color: var(--text-dim); max-width: 62ch; font-size: clamp(1.08rem, 2vw, 1.3rem); }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }
a { color: var(--gold-2); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--sans); font-weight: 600; font-size: 1rem; padding: 0.9rem 1.7rem; border-radius: 999px; text-decoration: none; cursor: pointer; border: 1.5px solid transparent; transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s, border-color 0.2s; }
.btn-primary { background: var(--gold); color: #20180a; box-shadow: 0 8px 26px rgba(216,177,90,0.32); position: relative; overflow: hidden; }
.btn-primary::after { content: ''; position: absolute; top: 0; left: -130%; width: 55%; height: 100%; background: linear-gradient(120deg, transparent, rgba(255,255,255,0.45), transparent); transform: skewX(-20deg); transition: left 0.6s ease; }
.btn-primary:hover::after { left: 150%; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--gold-2); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text); border-color: rgba(233,241,238,0.28); }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--gold); color: var(--gold-2); background: rgba(216,177,90,0.06); outline: none; }

/* ---------- Hero (shader) ---------- */
.hero, .page-hero { position: relative; overflow: hidden; isolation: isolate; }
.hero::before, .page-hero::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background: radial-gradient(120% 130% at 78% -10%, #1d4a44 0%, #0f2c29 52%, #0a1c1a 100%);
}
#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; opacity: 0.42; mix-blend-mode: screen; }
.hero::after, .page-hero::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, transparent 55%, rgba(10,28,26,0.65) 100%); }
.hero-inner { position: relative; z-index: 3; max-width: var(--maxw); margin: 0 auto; padding: 7rem 1.5rem 5rem; }
.hero h1 { max-width: 18ch; margin-bottom: 1.5rem; }
.hero h1 em, .page-hero h1 em { font-style: italic; color: var(--gold-2); }
.hero .lead { color: rgba(233,241,238,0.86); max-width: 58ch; margin-bottom: 2.4rem; }
.btn-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }

/* availability chip */
.avail-chip { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); background: rgba(255,255,255,0.05); border: 1px solid var(--line); padding: 0.42rem 0.95rem; border-radius: 999px; margin-bottom: 1.4rem; }
.avail-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 0 0 rgba(236,200,120,0.6); animation: pulse-dot 2.2s infinite; }
@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 rgba(236,200,120,0.55); } 70% { box-shadow: 0 0 0 9px rgba(236,200,120,0); } 100% { box-shadow: 0 0 0 0 rgba(236,200,120,0); } }
@media (prefers-reduced-motion: reduce) { .avail-chip .dot { animation: none; } }

.page-hero-inner { position: relative; z-index: 3; max-width: var(--maxw); margin: 0 auto; padding: 5rem 1.5rem 4rem; }
.page-hero h1 { max-width: 22ch; }
.page-hero .lead { color: rgba(233,241,238,0.82); margin-top: 1.1rem; }

.crumbs { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; color: rgba(233,241,238,0.55); margin-bottom: 1.3rem; }
.crumbs a { color: rgba(233,241,238,0.78); text-decoration: none; }
.crumbs a:hover { color: var(--gold-2); }

/* ---------- Stats ---------- */
.stat-row { display: flex; gap: clamp(1.5rem, 5vw, 4.5rem); flex-wrap: wrap; position: relative; z-index: 3; max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 4rem; }
.stat .num { font-family: var(--serif); font-size: clamp(2.2rem, 4.5vw, 3.2rem); font-weight: 700; color: var(--gold-2); line-height: 1; }
.stat .label { font-size: 0.9rem; color: rgba(233,241,238,0.62); margin-top: 0.45rem; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }

.card {
    background: linear-gradient(180deg, var(--bg-3), #123430);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.85rem; box-shadow: var(--shadow-soft);
    transition: transform 0.22s ease, box-shadow 0.3s, border-color 0.2s;
    position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease; z-index: 2; }
.card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 50%), rgba(216,177,90,0.12), transparent 45%); opacity: 0; transition: opacity 0.35s ease; pointer-events: none; z-index: 0; }
.card > * { position: relative; z-index: 1; }
.card:hover::after { opacity: 1; }
.card.is-interactive:hover, .card.is-interactive:focus-within { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(216,177,90,0.4); }
.card.is-interactive:hover::before, .card.is-interactive:focus-within::before { transform: scaleX(1); }
.card h3 { color: var(--text); font-size: 1.22rem; margin-bottom: 0.5rem; }
.card p { font-size: 0.98rem; color: var(--text-dim); flex-grow: 1; }

.icon-box { width: 52px; height: 52px; border-radius: 13px; background: radial-gradient(120% 120% at 30% 20%, rgba(216,177,90,0.22), rgba(216,177,90,0.08)); border: 1px solid var(--line); display: grid; place-items: center; margin-bottom: 1.15rem; color: var(--gold-2); }
.icon-box svg { width: 27px; height: 27px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pill { display: inline-block; background: rgba(216,177,90,0.12); color: var(--gold-2); padding: 0.3rem 0.85rem; border-radius: 999px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.9rem; align-self: flex-start; border: 1px solid var(--line); }
.pill-gold { background: rgba(216,177,90,0.18); color: var(--gold-2); }

.text-link { color: var(--gold-2); text-decoration: none; font-weight: 600; font-size: 0.95rem; display: inline-flex; align-items: center; gap: 0.35rem; transition: gap 0.2s; margin-top: 1.1rem; }
.text-link:hover, .text-link:focus-visible { gap: 0.6rem; outline: none; }

.tag-list { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.85rem 0 0; }
.tag { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); background: rgba(233,241,238,0.05); border: 1px solid var(--line-2); padding: 0.25rem 0.65rem; border-radius: 999px; }

.feature-list { list-style: none; }
.feature-list li { position: relative; padding-left: 1.9rem; margin-bottom: 0.85rem; color: var(--text); }
.feature-list li::before { content: '✓'; position: absolute; left: 0; top: 0.1rem; color: var(--gold-2); font-weight: 700; background: rgba(216,177,90,0.14); width: 1.35rem; height: 1.35rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; }

/* ---------- Paper reading surface (articles, course prose) ---------- */
.paper {
    background: linear-gradient(180deg, #123430, #0e2825);
    color: var(--text); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: clamp(1.8rem, 5vw, 4rem);
}
.paper h1, .paper h2, .paper h3, .paper h4 { color: var(--text); }
.paper p, .paper li { color: #d3e2dd; }
.paper .lead { color: var(--text-dim); }
.paper a { color: var(--gold-2); }
.prose p { margin-bottom: 1.3rem; font-size: 1.12rem; }
.prose p, .prose li { max-width: 66ch; }
.prose h2 { margin-top: 2.6rem; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.prose h3 { margin-top: 1.9rem; }
.prose ul, .prose ol { margin: 0 0 1.3rem 1.3rem; }
.prose li { margin-bottom: 0.55rem; }
.prose h2 { scroll-margin-top: 90px; }
.prose blockquote { border-left: 3px solid var(--gold); padding: 0.4rem 0 0.4rem 1.4rem; margin: 1.6rem 0; font-family: var(--serif); font-size: 1.35rem; font-style: italic; color: var(--gold-2); }
.prose .lead { font-size: 1.3rem; line-height: 1.6; margin-bottom: 1.8rem; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.96rem; }
.tbl th, .tbl td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line-2); }
.tbl thead th { background: rgba(216,177,90,0.10); color: var(--gold-2); font-family: var(--mono); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.tbl tbody tr:hover { background: rgba(233,241,238,0.03); }

/* ---------- Course filter ---------- */
.course-filter, .article-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.6rem 0; }
.filter-chip { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.05em; padding: 0.5rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-dim); cursor: pointer; transition: all 0.2s; }
.filter-chip:hover { color: var(--text); border-color: var(--gold); }
.filter-chip.active { background: var(--gold); color: #20180a; border-color: var(--gold); font-weight: 600; }

/* ---- Article search box ---- */
.article-search { position: relative; display: flex; align-items: center; gap: 0.6rem; margin: 1.8rem 0 0.4rem; max-width: 560px; }
.article-search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--text-dim); stroke-width: 2; stroke-linecap: round; position: absolute; left: 1rem; pointer-events: none; }
.article-search input { width: 100%; padding: 0.85rem 1rem 0.85rem 2.7rem; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.02); color: var(--text); font: inherit; font-size: 0.98rem; transition: border-color 0.2s, box-shadow 0.2s; }
.article-search input::placeholder { color: var(--text-dim); }
.article-search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216,177,90,0.16); }
#art-search-count { font-family: var(--mono); font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; flex: none; }
.art-no-results { color: var(--text-dim); margin: 1.2rem 0; font-size: 0.98rem; }

/* ---- Share row ---- */
.share-row { display: flex; align-items: center; gap: 0.55rem; margin-top: 1.4rem; flex-wrap: wrap; }
.share-label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); margin-right: 0.15rem; }
.share-btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.7rem; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.02); color: var(--text-dim); cursor: pointer; font: inherit; font-size: 0.82rem; text-decoration: none; transition: all 0.2s; }
.share-btn svg { width: 17px; height: 17px; flex: none; }
.share-li svg, .share-x svg { fill: currentColor; }
.share-copy svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share-btn:hover { color: var(--text); border-color: var(--gold); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(216,177,90,0.18); }
.share-copy.copied { color: #20180a; background: var(--gold); border-color: var(--gold); }

/* ---------- Accordion (expandable sections) ---------- */
.accordion { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.accordion details { border-bottom: 1px solid var(--line-2); }
.accordion details:last-child { border-bottom: none; }
.accordion summary { list-style: none; cursor: pointer; padding: 1.15rem 1.4rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-weight: 600; color: var(--text); transition: background 0.2s; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { background: rgba(216,177,90,0.06); }
.accordion summary .ac-meta { font-family: var(--mono); font-size: 0.74rem; color: var(--text-dim); font-weight: 400; }
.accordion summary::after { content: '+'; font-family: var(--serif); font-size: 1.5rem; color: var(--gold); line-height: 1; transition: transform 0.25s ease; }
.accordion details[open] summary::after { transform: rotate(45deg); }
.accordion .ac-body { padding: 0 1.4rem 1.3rem; color: var(--text-dim); }
.accordion .ac-body p { color: var(--text-dim); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1.15rem; }
.field label { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea { font-family: var(--sans); font-size: 1rem; padding: 0.75rem 0.95rem; border: 1.5px solid var(--line-2); border-radius: 11px; background: rgba(255,255,255,0.04); color: var(--text); transition: border-color 0.2s, box-shadow 0.2s; }
.field input::placeholder { color: rgba(233,241,238,0.4); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216,177,90,0.2); }
.field select option { color: #16302e; }
.field .hint { font-size: 0.83rem; color: var(--text-dim); }
.inline-form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 220px; }

.signup { background: linear-gradient(135deg, #16413b, #0f2c29); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(2rem, 5vw, 3rem); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.signup .eyebrow { color: var(--gold); }

/* ---------- Calculator ---------- */
.calc-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
.calc-panel { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-soft); }
.result-panel { background: linear-gradient(150deg, #1d4a44, #0f2c29); border: 1px solid rgba(216,177,90,0.3); color: #fff; border-radius: var(--radius); padding: 2rem; position: sticky; top: 94px; box-shadow: var(--shadow); }
.result-figure { font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 3.6rem); font-weight: 700; color: var(--gold-2); line-height: 1.05; margin: 0.5rem 0; }
.result-sub { color: rgba(233,241,238,0.72); font-size: 0.95rem; }
.result-breakdown { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.result-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; font-size: 0.95rem; color: rgba(233,241,238,0.85); }
.result-row span:last-child { font-weight: 600; color: #fff; }
.radio-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.radio-chip input { position: absolute; opacity: 0; }
.radio-chip label { display: block; padding: 0.55rem 0.95rem; border: 1.5px solid var(--line-2); border-radius: 999px; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; color: var(--text); }
.radio-chip input:checked + label { background: var(--gold); color: #20180a; border-color: var(--gold); font-weight: 600; }
.radio-chip input:focus-visible + label { box-shadow: 0 0 0 3px rgba(216,177,90,0.3); }
.source-note { font-family: var(--sans); font-size: 0.85rem; color: var(--text-dim); background: rgba(216,177,90,0.06); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 10px; padding: 0.95rem 1.15rem; margin-top: 1.5rem; }
.disclaimer { font-size: 0.8rem; color: var(--text-dim); margin-top: 1rem; font-style: italic; }

/* ---------- Portrait ---------- */
.portrait-frame { position: relative; }
.portrait-frame img { width: 100%; height: auto; border-radius: var(--radius); display: block; box-shadow: var(--shadow); }
.portrait-frame::before { content: ''; position: absolute; inset: -14px -14px 14px 14px; border: 1.5px solid var(--gold); border-radius: var(--radius); z-index: -1; }

/* ---------- Article card ---------- */
.article-card { background: linear-gradient(180deg, var(--bg-3), #123430); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); transition: transform 0.22s ease, box-shadow 0.3s, border-color 0.2s; text-decoration: none; display: flex; flex-direction: column; }
.article-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(216,177,90,0.4); }
.article-thumb { aspect-ratio: 16/9; position: relative; overflow: hidden; background: radial-gradient(130% 120% at 70% 0%, #1d4a44, #0c2320); display: grid; place-items: center; }
.article-thumb::before { content: ''; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='225'%3E%3Cg fill='none' stroke='%23d8b15a' stroke-opacity='0.14'%3E%3Ccircle cx='340' cy='30' r='34'/%3E%3Ccircle cx='340' cy='30' r='70'/%3E%3Ccircle cx='340' cy='30' r='108'/%3E%3Ccircle cx='340' cy='30' r='148'/%3E%3C/g%3E%3C/svg%3E"); background-size: cover; }
.article-thumb .kw { position: relative; z-index: 1; font-family: var(--serif); font-size: 2.1rem; font-weight: 700; color: rgba(236,200,120,0.92); padding: 1rem; text-align: center; letter-spacing: -0.02em; }
.article-card .ac-content { padding: 1.6rem; display: flex; flex-direction: column; flex-grow: 1; }
.article-card h3 { color: var(--text); }
.article-card p { color: var(--text-dim); font-size: 0.96rem; flex-grow: 1; }
.article-meta { font-family: var(--mono); font-size: 0.74rem; color: var(--text-dim); letter-spacing: 0.05em; margin-top: 1rem; }

/* featured article (magazine lead) */
.featured-article { display: grid; grid-template-columns: 1.05fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: linear-gradient(180deg, var(--bg-3), #123430); margin-bottom: 2.5rem; text-decoration: none; box-shadow: var(--shadow-soft); transition: transform 0.22s ease, box-shadow 0.3s, border-color 0.2s; }
.featured-article:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(216,177,90,0.4); }
.featured-article .fa-thumb { background: radial-gradient(130% 120% at 70% 0%, #1d4a44, #0c2320); display: grid; place-items: center; min-height: 280px; padding: 2rem; position: relative; }
.featured-article .fa-thumb::after { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E"); opacity: 0.4; mix-blend-mode: soft-light; }
.featured-article .fa-thumb .kw { font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 700; color: rgba(236,200,120,0.92); text-align: center; position: relative; z-index: 1; letter-spacing: -0.02em; }
.featured-article .fa-body { padding: clamp(1.8rem, 4vw, 2.8rem); display: flex; flex-direction: column; justify-content: center; }
.featured-article .fa-body h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0.3rem 0 0.6rem; }
@media (max-width: 760px) { .featured-article { grid-template-columns: 1fr; } }

/* funnel CTA box inside articles */
.cta-box { background: linear-gradient(135deg, #16413b, #0f2c29); border: 1px solid rgba(216,177,90,0.3); border-radius: var(--radius); padding: 1.8rem 2rem; margin: 2.5rem 0; color: var(--text); }
.cta-box h3 { color: var(--text); margin-bottom: 0.4rem; }
.cta-box p { color: var(--text-dim); margin-bottom: 1.1rem; }

/* ---------- Footer ---------- */
footer { background: #0a1816; border-top: 1px solid var(--line-2); padding: 4.5rem 0 2rem; }
.footer-content { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 2.5rem; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2.5rem; }
.footer-brand { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text); }
.footer-brand span { color: var(--gold); }
.footer-tag { color: var(--text-dim); font-size: 0.95rem; max-width: 34ch; }
.footer-section h4 { color: var(--gold); margin-bottom: 1rem; font-family: var(--mono); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 0.65rem; }
.footer-section a { color: var(--text-dim); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
.footer-section a:hover, .footer-section a:focus-visible { color: var(--gold-2); outline: none; }
.footer-bottom { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1.5rem 0; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-family: var(--mono); font-size: 0.78rem; color: var(--text-dim); }

/* ---------- Detail layout ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 3rem; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

/* ---------- Film-grain overlay ---------- */
.grain-overlay { position: fixed; inset: 0; z-index: 200; pointer-events: none; opacity: 0.035; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); background-size: 200px 200px; }

/* ---------- Scroll progress bar ---------- */
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width 0.1s linear; }

/* ---------- Mobile hamburger ---------- */
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero grain texture ---------- */
.hero::after, .page-hero::after {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E"),
        linear-gradient(180deg, transparent 52%, rgba(10,28,26,0.7) 100%);
    background-size: 160px 160px, cover;
    opacity: 0.5;
    mix-blend-mode: soft-light;
}
.hero-inner, .page-hero-inner, .stat-row { mix-blend-mode: normal; }

/* ---------- Credential strip ---------- */
.cred-strip { border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: rgba(0,0,0,0.18); }
.cred-strip .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: center; justify-content: center; padding-top: 1.3rem; padding-bottom: 1.3rem; }
.cred-item { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); display: flex; align-items: center; gap: 0.5rem; }
.cred-item b { color: var(--gold-2); font-weight: 500; }

/* ---------- Article TOC ---------- */
.toc { background: rgba(216,177,90,0.07); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 10px; padding: 1.2rem 1.4rem; margin: 0 0 2.2rem; }
.toc .toc-title { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.6rem; }
.toc ol { margin: 0 0 0 1.1rem; padding: 0; }
.toc li { margin-bottom: 0.4rem; }
.toc a { color: var(--text); text-decoration: none; font-size: 0.96rem; }
.toc a:hover { color: var(--gold-2); text-decoration: underline; }

/* ---------- Back to top ---------- */
.to-top { position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 55; width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: #20180a; border: none; cursor: pointer; font-size: 1.3rem; box-shadow: var(--shadow-soft); opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.2s; display: grid; place-items: center; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px); background: var(--gold-2); }

@media (max-width: 920px) {
    .nav-toggle { display: flex; }
    .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: rgba(10,24,22,0.97); backdrop-filter: blur(14px); padding: 0.6rem 1rem 1rem; border-bottom: 1px solid var(--line-2); gap: 0.1rem; }
    header.nav-open .nav-links { display: flex; }
    .nav-links a { padding: 0.7rem 0.6rem; font-size: 1rem; }
    .nav-links a.nav-cta { margin-top: 0.5rem; text-align: center; }
}
@media (min-width: 921px) and (max-width: 1080px) {
    .nav-links a { padding: 0.5rem 0.6rem; font-size: 0.9rem; }
    .brand { font-size: 1.3rem; }
}

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- Study Hub ---------- */
.page-hero-lecture .page-hero-inner { padding: 3.2rem 1.5rem 2.6rem; }
.learn-layout { display: grid; grid-template-columns: 270px 1fr; gap: 2.5rem; align-items: start; }
.learn-sidebar { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.learn-sidebar .ls-head { display: flex; flex-direction: column; gap: 0.2rem; padding: 0 0.4rem 0.8rem; border-bottom: 1px solid var(--line-2); margin-bottom: 0.6rem; }
.learn-sidebar .ls-head a { font-family: var(--serif); font-weight: 600; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.learn-sidebar .ls-head span { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); }
.ls-list { list-style: none; margin: 0; counter-reset: none; }
.ls-list li { margin: 0; }
.ls-list a { display: flex; gap: 0.6rem; align-items: baseline; padding: 0.5rem 0.5rem; border-radius: 8px; color: var(--text-dim); text-decoration: none; font-size: 0.9rem; line-height: 1.35; transition: background 0.2s, color 0.2s; }
.ls-list a:hover { background: rgba(216,177,90,0.07); color: var(--text); }
.ls-list .ls-n { font-family: var(--mono); font-size: 0.72rem; color: var(--gold); flex-shrink: 0; }
.ls-list li.active a { background: rgba(216,177,90,0.13); color: var(--text); }
.ls-group { border-bottom: 1px solid var(--line-2); }
.ls-group:last-child { border-bottom: none; }
.ls-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.4rem; padding: 0.7rem 0.5rem; font-weight: 600; font-size: 0.84rem; color: var(--text); }
.ls-group > summary::-webkit-details-marker { display: none; }
.ls-group > summary::before { content: '▸'; color: var(--gold); font-size: 0.75rem; transition: transform 0.2s; }
.ls-group[open] > summary::before { transform: rotate(90deg); }
.ls-group > summary:hover { color: var(--gold-2); }
.ls-group .ls-count { font-family: var(--mono); font-size: 0.68rem; color: var(--text-dim); font-weight: 400; margin-left: auto; }
.ls-group .ls-list { padding: 0 0 0.5rem 0.3rem; }

.module-block { margin-bottom: 2.6rem; }
.module-head { display: flex; align-items: baseline; gap: 0.85rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 0.7rem; }
.module-head .module-num { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.module-head h3 { color: var(--text); margin: 0; }
.module-head .module-count { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); margin-left: auto; }
.learn-main { min-width: 0; }
.learn-main > section { margin-bottom: 3rem; }

.diagram-card { margin: 0 0 3rem; background: linear-gradient(180deg, #123430, #0e2825); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.diagram-card figcaption { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); padding: 1rem 1.3rem 0.9rem; }
.diagram-card .mermaid { display: block; text-align: center; padding: 1.6rem; margin: 0 1.1rem 1.1rem; background: #f7f4ec; border-radius: 12px; overflow-x: auto; min-height: 240px; }
.diagram-card .mermaid svg { height: auto; }

.flashcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.flashcard { perspective: 1200px; background: none; border: none; padding: 0; height: 170px; cursor: pointer; font: inherit; text-align: left; }
.flashcard .fc-inner { display: block; position: relative; width: 100%; height: 100%; transition: transform 0.5s; transform-style: preserve-3d; }
.fc-term, .fc-def, .fc-tag, .fc-hint { display: block; }
.flashcard.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: var(--radius); border: 1px solid var(--line); padding: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; overflow: hidden; }
.fc-front { background: linear-gradient(180deg, var(--bg-3), #123430); justify-content: center; }
.fc-back { background: linear-gradient(180deg, #2a2415, #1d4a44); transform: rotateY(180deg); justify-content: flex-start; }
.fc-tag { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.fc-term { font-family: var(--serif); font-size: 1.18rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.fc-def { font-size: 0.9rem; color: #d3e2dd; line-height: 1.5; overflow-y: auto; }
.fc-hint { margin-top: auto; font-size: 0.72rem; color: var(--text-dim); }

.takeaways-list { list-style: none; margin: 0; }
.takeaways-list li { position: relative; padding-left: 1.9rem; margin-bottom: 0.9rem; color: var(--text); line-height: 1.6; }
.takeaways-list li::before { content: '✓'; position: absolute; left: 0; top: 0.15rem; color: var(--gold-2); font-weight: 700; background: rgba(216,177,90,0.14); width: 1.35rem; height: 1.35rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; }

.lecture-capture { background: linear-gradient(135deg, #16413b, #0f2c29); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; }
.lecture-capture h3 { color: var(--text); margin-bottom: 0.4rem; }
.lecture-capture p { color: var(--text-dim); margin-bottom: 1.1rem; }

.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; margin-top: 1.4rem; }
.promo-card { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.3s, border-color 0.2s; }
.promo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(216,177,90,0.4); }
.promo-card .pc-thumb { aspect-ratio: 1200/630; width: 100%; object-fit: cover; display: block; background: #102a27; }
.promo-card .pc-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; flex-grow: 1; }
.promo-card h4 { color: var(--text); font-size: 1rem; line-height: 1.3; }
.promo-card .pc-price { display: flex; align-items: baseline; gap: 0.5rem; margin-top: auto; }
.promo-card .pc-now { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--gold-2); }
.promo-card .pc-old { font-size: 0.85rem; color: var(--text-dim); text-decoration: line-through; }
.promo-card .pc-badge { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: #1c1500; background: var(--gold); padding: 0.15rem 0.5rem; border-radius: 999px; align-self: flex-start; }
.promo-card .pc-cta { margin-top: 0.5rem; font-weight: 600; color: var(--gold-2); font-size: 0.9rem; }

.lecture-nav { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line-2); padding-top: 1.5rem; margin-top: 1rem; }
.lecture-nav a { color: var(--gold-2); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.lecture-nav a:hover { text-decoration: underline; }
.lecture-nav .ln-next { margin-left: auto; text-align: right; }

@media (max-width: 860px) {
    .learn-layout { grid-template-columns: 1fr; }
    .learn-sidebar { position: static; max-height: none; order: 2; margin-top: 2rem; }
    .learn-main { order: 1; }
}

/* ---------- Print (clean PDF / paper output) ---------- */
@media print {
    header, footer, .progress-bar, .to-top, .grain-overlay, #heroCanvas, .signup, .nav-toggle, .course-filter, .btn { display: none !important; }
    body { background: #fff !important; color: #111 !important; }
    body::before, body::after { display: none !important; }
    .hero::before, .hero::after, .page-hero::before, .page-hero::after { display: none !important; }
    .hero, .page-hero, .panel, .section-pad { background: #fff !important; padding: 1rem 0 !important; }
    h1, h2, h3, h4, p, li, .lead, .eyebrow, .crumbs, .result-sub, .result-row, .stat .label { color: #111 !important; }
    .eyebrow, .result-figure, .stat .num { color: #7a5e16 !important; }
    .card, .calc-panel, .result-panel, .paper, .accordion { background: #fff !important; border: 1px solid #ccc !important; box-shadow: none !important; color: #111 !important; }
    .card::after, .card::before { display: none !important; }
    .accordion details { open: true; }
    .accordion .ac-body { display: block !important; color: #111 !important; }
    a { color: #111 !important; }
    .source-note { background: #f6f6f0 !important; color: #333 !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) { .calc-layout { grid-template-columns: 1fr; } .result-panel { position: static; } .footer-content { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
    nav { padding: 0.7rem 1.1rem; flex-wrap: wrap; gap: 0.4rem; }
    .nav-links { gap: 0; }
    .nav-links a { padding: 0.4rem 0.55rem; font-size: 0.84rem; }
    .section-pad { padding: 3.8rem 0; }
    .hero-inner { padding: 5rem 1.5rem 3.5rem; }
    .footer-content { grid-template-columns: 1fr; gap: 2rem; }
    .btn { width: 100%; justify-content: center; }
    .about-grid { grid-template-columns: 1fr !important; }
}
