@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=Outfit:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; height: 100%; }

/* --- THEMES --- */
:root {
  /* Default Theme (Home) */
  --accent: #38bdf8;
  --bg: #080c10;
  --surface: rgba(255,255,255,.03);
  --surface2: rgba(255,255,255,.05);
  --border: rgba(255,255,255,.07);
  --text: #e8edf2;
  --muted: #8b949e;
}

body[data-theme="mod1"] {
  --accent: #38bdf8; --accent2: #0ea5e9;
  --bg: #060a0e; --surface: #0d1318; --surface2: #141c24;
  --border: rgba(56,189,248,.12);
  --muted: #8094a8;
}

body[data-theme="mod2"] {
  --accent: #a78bfa; --accent2: #7c3aed;
  --bg: #08060e; --surface: #0f0d18; --surface2: #181525;
  --border: rgba(167,139,250,.12);
  --muted: #8b7faa;
}

body[data-theme="mod3"] {
  --accent: #34d399; --accent2: #059669;
  --bg: #060e09; --surface: #0c1610; --surface2: #111e15;
  --border: rgba(52,211,153,.12);
  --muted: #7a9e88;
}

body[data-theme="mod4"] {
  --accent: #fb923c; --accent2: #ea580c;
  --bg: #0e0800; --surface: #181008; --surface2: #221810;
  --border: rgba(251,146,60,.12);
  --muted: #9e8870;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* SPA View Logic */
.view {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.view.active {
  display: block;
}
.view.visible {
  opacity: 1;
}

/* --- HOME VIEW GLOBALS --- */
.view-home .home-bg::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.glow1 { position: fixed; top: -200px; left: -200px; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(56,189,248,.08) 0%, transparent 70%); pointer-events: none; }
.glow2 { position: fixed; bottom: -200px; right: -200px; width: 700px; height: 700px; border-radius: 50%; background: radial-gradient(circle, rgba(168,85,247,.07) 0%, transparent 70%); pointer-events: none; }

header { padding: 56px 48px 0; max-width: 1100px; margin: 0 auto; position: relative; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: .7rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--accent); margin-bottom: 20px; }
.eyebrow::before { content: ''; display: block; width: 28px; height: 1px; background: var(--accent); }
h1 { font-family: 'Cormorant Garamond', serif; font-size: clamp(2.8rem, 6vw, 5.5rem); font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
h1 em, h1 span { font-style: italic; color: var(--accent); }
/* Home specific h1 gradient override */
.view-home h1 em { background: linear-gradient(135deg, #38bdf8, #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.subtitle { margin-top: 18px; color: var(--muted); font-size: 1rem; font-weight: 300; max-width: 460px; line-height: 1.6; }

/* Progress indicator */
.progress-bar { display: flex; align-items: center; gap: 10px; margin-top: 28px; }
.progress-bar span { font-size: .75rem; color: var(--muted); }
.bar-track { flex: 1; max-width: 200px; height: 3px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #38bdf8, #818cf8); border-radius: 2px; transition: width 1s ease; }

/* Module grid (Home) */
.modules { padding: 52px 48px 80px; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.module-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 36px 32px; text-decoration: none; color: inherit; display: flex; flex-direction: column; position: relative; overflow: hidden; cursor: pointer; transition: border-color .25s, transform .25s, background .25s; animation: fadeUp .5s ease both; }
.module-card:nth-child(1) { animation-delay: .1s; } .module-card:nth-child(2) { animation-delay: .2s; }
.module-card:nth-child(3) { animation-delay: .3s; } .module-card:nth-child(4) { animation-delay: .4s; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

.module-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--card-accent); opacity: 0; transition: opacity .25s; }
.module-card:hover { transform: translateY(-4px); background: rgba(255,255,255,.05); }
.module-card:hover::before { opacity: 1; }

.card-num { font-family: 'Cormorant Garamond', serif; font-size: 3.5rem; font-weight: 700; line-height: 1; margin-bottom: 16px; color: var(--card-accent); opacity: .5; }
.card-icon-badge { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 20px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.module-card h2 { font-family: 'Cormorant Garamond', serif; font-size: 1.65rem; font-weight: 600; line-height: 1.2; margin-bottom: 10px; }
.module-card p { font-size: .83rem; color: var(--muted); line-height: 1.6; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.tag { font-size: .68rem; font-weight: 500; padding: 3px 10px; border-radius: 20px; border: 1px solid rgba(255,255,255,.1); color: var(--muted); }
.card-arrow { position: absolute; bottom: 28px; right: 28px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; font-size: .9rem; transition: background .2s, border-color .2s, transform .2s; color: var(--muted); }
.module-card:hover .card-arrow { background: var(--card-bg); border-color: var(--card-accent); color: var(--card-accent); transform: translate(2px, -2px); }

/* Home Module Card Colors */
.mod1 { --card-accent: #38bdf8; --card-bg: rgba(56,189,248,.1); }
.mod2 { --card-accent: #a78bfa; --card-bg: rgba(167,139,250,.1); }
.mod3 { --card-accent: #34d399; --card-bg: rgba(52,211,153,.1); }
.mod4 { --card-accent: #fb923c; --card-bg: rgba(251,146,60,.1); }

.mod1:hover { border-color: rgba(56,189,248,.3); }
.mod2:hover { border-color: rgba(167,139,250,.3); }
.mod3:hover { border-color: rgba(52,211,153,.3); }
.mod4:hover { border-color: rgba(251,146,60,.3); }
.footnote { text-align: center; padding: 0 48px 40px; font-size: .75rem; color: var(--muted); opacity: .5; }

/* --- MODULE LAYOUTS --- */
.topnav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 14px 40px; background: inherit; backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.back-btn { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--muted); font-size: .82rem; font-weight: 500; transition: color .2s; cursor: pointer; }
.back-btn:hover { color: var(--accent); }
.module-badge { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); padding: 4px 12px; border: 1px solid var(--border); border-radius: 20px; background: rgba(255,255,255,.04); }
.nav-steps { display: flex; gap: 4px; }
.nav-step { width: 28px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); cursor: pointer; transition: background .2s; }
.nav-step.active { background: var(--accent); }
.nav-step.done { background: rgba(255,255,255,.2); border: 1px solid var(--accent); }

.hero { padding: 70px 40px 60px; max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.hero-num { font-family: 'Cormorant Garamond', serif; font-size: 9rem; font-weight: 700; color: rgba(255,255,255,.03); line-height: 1; user-select: none; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.toc-item { font-size: .78rem; color: var(--muted); padding: 5px 14px; border: 1px solid var(--border); border-radius: 20px; cursor: pointer; transition: all .2s; }
.toc-item:hover { border-color: var(--accent); color: var(--accent); }

.slides-wrap { max-width: 900px; margin: 0 auto; padding: 0 40px 100px; }
.slide { min-height: 70vh; display: none; animation: slideIn .35s ease; }
.slide.active { display: block; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.sec-title { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; font-weight: 700; margin-bottom: 8px; }
.sec-sub { color: var(--muted); font-size: .9rem; margin-bottom: 36px; }
.divider { width: 40px; height: 2px; background: var(--accent); border-radius: 1px; margin-bottom: 28px; }

/* Grid systems & Cards */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px 20px; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card .c-label { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.card p { font-size: .85rem; color: var(--muted); line-height: 1.65; }
.card .c-icon { font-size: 1.6rem; margin-bottom: 12px; }

.highlight-card { background: rgba(255,255,255,.02); border: 1px solid var(--border); border-radius: 16px; padding: 28px; margin-bottom: 20px; }
.highlight-card p { font-size: 1rem; font-style: italic; line-height: 1.7; }
.highlight-card cite { display: block; margin-top: 10px; font-size: .78rem; color: var(--muted); font-style: normal; }

.def-item { border-left: 3px solid var(--accent); padding: 14px 18px 14px 20px; background: var(--surface); border-radius: 0 10px 10px 0; margin-bottom: 12px; }
.def-item h4 { font-size: .92rem; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.def-item p { font-size: .85rem; color: var(--muted); line-height: 1.6; }

.callout { display: flex; gap: 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.callout .ci { font-size: 1.2rem; flex-shrink: 0; }
.callout p { font-size: .85rem; color: var(--muted); line-height: 1.6; }
.callout strong { color: var(--text); }

.timeline { border-left: 2px solid rgba(255,255,255,.1); padding-left: 28px; }
.tl-item { position: relative; margin-bottom: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; transition: border-color .2s; }
.tl-item:hover { border-color: var(--accent); }
.tl-item::before { content: ''; position: absolute; left: -35px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); box-shadow: 0 0 0 3px rgba(255,255,255,.1); }
.tl-year { font-size: .72rem; font-weight: 700; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.tl-item h4 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.tl-item p { font-size: .85rem; color: var(--muted); line-height: 1.65; }
.tl-tag { display: inline-block; font-size: .68rem; font-weight: 600; padding: 2px 9px; border-radius: 10px; background: rgba(255,255,255,.05); color: var(--accent); margin-bottom: 8px; margin-right: 4px; border: 1px solid var(--border); }

.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: inherit; backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding: 16px 40px; display: flex; align-items: center; justify-content: space-between; z-index: 50; }
.slide-counter { font-size: .8rem; color: var(--muted); }
.nav-btns { display: flex; gap: 10px; }
.btn { padding: 10px 22px; border-radius: 8px; font-family: 'Outfit', sans-serif; font-size: .85rem; font-weight: 500; cursor: pointer; border: none; transition: all .2s; }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--bg); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.2); }

/* Extra specific components across modules */
.tags-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.law-box { background: rgba(255,255,255,.02); border: 1px solid var(--border); border-radius: 16px; padding: 28px 30px; margin-bottom: 22px; }
.law-box h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; margin-bottom: 14px; }
.law-box p { font-size: .87rem; color: var(--muted); line-height: 1.7; }

.acc-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.acc-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: none; border: none; color: var(--text); font-family: 'Outfit', sans-serif; font-size: .93rem; font-weight: 500; cursor: pointer; text-align: left; transition: background .15s; }
.acc-btn:hover { background: var(--surface2); }
.acc-btn .ch { font-size: .8rem; transition: transform .2s; color: var(--muted); }
.acc-btn.open .ch { transform: rotate(180deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.acc-body.open { max-height: 900px; }
.acc-inner { padding: 4px 20px 20px; font-size: .85rem; color: var(--muted); line-height: 1.7; }

.prog-row { margin-bottom: 14px; }
.prog-label { display: flex; justify-content: space-between; font-size: .8rem; margin-bottom: 6px; }
.prog-bar { height: 6px; background: rgba(255,255,255,.06); border-radius: 3px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width 1s ease; }

.ods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 28px; }
.ods-card { border-radius: 10px; padding: 12px 10px; text-align: center; border: 1px solid rgba(255,255,255,.07); transition: transform .2s; }
.ods-card:hover { transform: scale(1.04); }
.ods-card .num { font-size: 1.5rem; font-weight: 700; }
.ods-card p { font-size: .68rem; margin-top: 5px; line-height: 1.3; }

.fl { list-style: none; margin-bottom: 24px; }
.fl li { padding: 9px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; font-size: .85rem; display: flex; align-items: flex-start; gap: 10px; }
.fl li .li { flex-shrink: 0; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; flex: 1; min-width: 110px; text-align: center; }
.stat .snum { font-family: 'Cormorant Garamond', serif; font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat .slabel { font-size: .7rem; color: var(--muted); margin-top: 4px; }

.subsys, .level { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin-bottom: 14px; border-left: 4px solid var(--accent); }
.subsys h4, .level h4 { font-size: 1rem; font-weight: 600; margin-bottom: 10px; }
.subsys p, .level p { font-size: .85rem; color: var(--muted); line-height: 1.65; }

.reform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.reform-card { border-radius: 14px; padding: 24px 20px; text-align: center; border: 1px solid rgba(255,255,255,.07); }
.reform-card .r-icon { font-size: 2rem; margin-bottom: 12px; }
.reform-card h4 { font-size: .95rem; font-weight: 600; margin-bottom: 8px; }
.reform-card p { font-size: .78rem; color: var(--muted); line-height: 1.5; }

.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.q-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; transition: border-color .2s; }
.q-card:hover { border-color: var(--accent); }
.q-card .qicon { font-size: 1.4rem; margin-bottom: 8px; }
.q-card h4 { font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
.q-card p { font-size: .78rem; color: var(--muted); }

.completion { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 20px; padding: 36px; text-align: center; margin-top: 32px; }
.completion .big-icon { font-size: 3rem; margin-bottom: 16px; }
.completion h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.8rem; font-weight: 700; margin-bottom: 10px; }
.completion p { color: var(--muted); font-size: .9rem; margin-bottom: 22px; }
.completion a { cursor: pointer; display: inline-block; background: var(--accent); color: var(--bg); font-weight: 600; font-size: .9rem; padding: 12px 28px; border-radius: 10px; text-decoration: none; transition: filter .2s; }
.completion a:hover { filter: brightness(1.2); }

@media(max-width: 700px) {
  header { padding: 40px 24px 0; }
  .modules { padding: 36px 24px 60px; grid-template-columns: 1fr; }
  h1 { font-size: 2.4rem; }
  .hero { grid-template-columns: 1fr; padding: 40px 20px 30px; }
  .hero-num { display: none; }
  .slides-wrap { padding: 0 20px 100px; }
  .grid2, .grid3, .reform-grid { grid-template-columns: 1fr; }
  .topnav, .bottom-nav { padding: 12px 20px; }
  .ods-grid { grid-template-columns: repeat(3, 1fr); }
  .q-grid { grid-template-columns: 1fr 1fr; }
}
