/* ==========================================================================
   THE BUILDING LIFE ACADEMY — DARK PREMIUM DESIGN SYSTEM
   ========================================================================== */

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

:root {
  /* Colors */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #161616;
  --bg-card: #1a1a1a;
  --border-subtle: #262626;
  --border-accent: #333333;

  --text-primary: #f0ede6;
  --text-secondary: #a8a39a;
  --text-muted: #6b6760;

  --gold: #c9a961;
  --gold-bright: #d4b773;
  --gold-dim: #8a7544;

  --accent-warm: #e8d9b0;

  /* Fonts */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --max-width: 1200px;
  --max-width-text: 760px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); }
h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--gold-bright);
}

.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-primary { color: var(--text-primary); }
.text-muted { color: var(--text-muted); }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--gold);
  margin-bottom: 1.5rem;
  display: block;
}

.serif { font-family: var(--font-serif); }
.italic { font-style: italic; }

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.container-text {
  max-width: var(--max-width-text);
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 6rem 0;
}

.divider {
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 2rem auto;
}

.divider-left {
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 1.5rem 0;
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.nav-logo span {
  color: var(--gold);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.5rem;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    transform: translateY(-200%);
    transition: transform 0.3s ease;
  }
  .nav-links.open {
    transform: translateY(0);
  }
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 2rem 6rem;
  background: radial-gradient(ellipse at center, rgba(201, 169, 97, 0.06) 0%, transparent 70%), var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(201, 169, 97, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 169, 97, 0.02) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
}

.hero-content {
  max-width: 960px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-weight: 300;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  font-style: italic;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 3rem;
  line-height: 1.5;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 1rem 2.25rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
}

.btn-primary {
  background: var(--gold);
  color: var(--bg-primary);
  border-color: var(--gold);
}

.btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: var(--bg-primary);
  transform: translateY(-2px);
}

.btn-secondary {
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

/* ===== SECTIONS ===== */
.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 4rem;
}

.section-header h2 {
  margin-bottom: 1.5rem;
}

.section-header p {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* Manifesto Block */
.manifesto-block {
  background: var(--bg-secondary);
  padding: 5rem 3rem;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  position: relative;
}

.manifesto-block p {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.manifesto-block p::before,
.manifesto-block p::after {
  content: '"';
  color: var(--gold);
  font-size: 2rem;
  font-weight: 400;
}

/* ===== LAW CHAIN ===== */
.law-chain {
  background: var(--bg-secondary);
  padding: 6rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.law-list {
  list-style: none;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.law-list li {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 300;
  color: var(--text-primary);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.law-list li:last-child {
  border-bottom: none;
  color: var(--gold);
  font-style: italic;
}

.law-list li:hover {
  color: var(--gold);
  letter-spacing: 0.02em;
}

/* ===== LAYERS GRID ===== */
.layers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.layer-card {
  background: var(--bg-card);
  padding: 3rem 2rem;
  border: 1px solid var(--border-subtle);
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.layer-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.layer-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-tertiary);
  transform: translateY(-4px);
}

.layer-card:hover::before {
  transform: scaleX(1);
}

.layer-number {
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--gold);
  font-weight: 300;
  margin-bottom: 1rem;
}

.layer-card h4 {
  font-family: var(--font-serif);
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.layer-card p {
  font-size: 0.9375rem;
  margin: 0;
}

/* ===== PARTS GRID (Encyclopedia) ===== */
.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.part-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 2.5rem 2rem;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: var(--text-primary);
}

.part-card:hover {
  border-color: var(--gold);
  background: var(--bg-tertiary);
  transform: translateY(-4px);
}

.part-card .part-number {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gold);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: block;
}

.part-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.part-card .part-subtitle {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.part-card .part-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* ===== CHAPTER LIST (within Part) ===== */
.chapter-list {
  list-style: none;
  margin-top: 1rem;
}

.chapter-list-item {
  border-bottom: 1px solid var(--border-subtle);
}

.chapter-list-item:last-child {
  border-bottom: none;
}

.chapter-list-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  color: var(--text-primary);
  transition: all 0.3s ease;
  gap: 2rem;
}

.chapter-list-item a:hover {
  color: var(--gold);
  padding-left: 1rem;
}

.chapter-list-item .ch-num {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gold);
  font-size: 0.875rem;
  min-width: 100px;
}

.chapter-list-item .ch-title {
  flex: 1;
  font-family: var(--font-serif);
  font-size: 1.25rem;
}

.chapter-list-item .ch-arrow {
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* ===== CHAPTER PAGE ===== */
.chapter-page {
  padding: 10rem 0 6rem;
}

.chapter-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 5rem;
}

.chapter-breadcrumb {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.chapter-breadcrumb a {
  color: var(--text-muted);
}

.chapter-breadcrumb a:hover {
  color: var(--gold);
}

.chapter-header h1 {
  margin-bottom: 1.5rem;
}

.chapter-main-idea {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.core-question {
  background: var(--bg-secondary);
  border-left: 3px solid var(--gold);
  padding: 2rem 2.5rem;
  margin: 3rem auto;
  max-width: var(--max-width-text);
}

.core-question .label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
  display: block;
}

.core-question .question {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Module list */
.modules-section {
  max-width: var(--max-width-text);
  margin: 0 auto;
}

.module {
  margin-bottom: 4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.module:last-child {
  border-bottom: none;
}

.module-number {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gold);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: block;
}

.module h3 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.module-question {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gold);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--gold-dim);
}

.module-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.module-content p {
  margin-bottom: 1.25rem;
}

.module-content strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* Chapter navigation */
.chapter-nav {
  max-width: var(--max-width-text);
  margin: 4rem auto 0;
  padding-top: 3rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.chapter-nav a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.chapter-nav a:hover {
  color: var(--gold);
}

/* ===== PATH CARDS ===== */
.path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.path-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 2.5rem 2rem;
  text-align: left;
  transition: all 0.3s ease;
  text-decoration: none;
  display: block;
  color: var(--text-primary);
}

.path-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
}

.path-icon {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-style: italic;
  color: var(--gold);
  margin-bottom: 1rem;
  display: block;
}

.path-card h4 {
  font-family: var(--font-serif);
  margin-bottom: 0.75rem;
}

.path-card p {
  font-size: 0.9375rem;
  margin: 0;
  color: var(--text-secondary);
}

/* ===== PHILOSOPHY / LONG-FORM PAGES ===== */
.long-form {
  padding: 10rem 0 6rem;
}

.long-form .container-text > * {
  margin-bottom: 1.5rem;
}

.long-form h1 {
  margin-bottom: 2rem;
  text-align: center;
}

.long-form h2 {
  margin-top: 4rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.long-form h3 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--gold);
}

.long-form p {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.long-form blockquote {
  border-left: 3px solid var(--gold);
  padding: 1rem 0 1rem 2rem;
  margin: 2rem 0;
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.5;
}

.long-form ul, .long-form ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.long-form li {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.long-form table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
}

.long-form th,
.long-form td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.long-form th {
  color: var(--gold);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8125rem;
}

.long-form td {
  color: var(--text-secondary);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-secondary);
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 320px;
}

.footer-col h5 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 1rem;
  font-weight: 500;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  section { padding: 4rem 0; }
  .hero { padding: 7rem 1.5rem 4rem; }
  .manifesto-block { padding: 3rem 1.5rem; }
  .manifesto-block p { font-size: 1.125rem; }
  .container, .container-text { padding: 0 1.5rem; }
}

/* ===== UTILITIES ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

::selection {
  background: var(--gold);
  color: var(--bg-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-accent);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dim);
}
