@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

/* ==========================================================================
   DESIGN SYSTEM & VARIABLES ("Bordeaux Editorial")
   ========================================================================== */
:root {
  /* Colors */
  --bg-color: #fcfaf6;          /* Warm cream/paper background */
  --text-primary: #1c1c1c;      /* Deep editorial charcoal */
  --text-secondary: #5a5550;    /* Muted charcoal-stone for body copy */
  --color-bordeaux: #6b1d2f;    /* Elegant wine/bordeaux */
  --color-purple: #3a1a3b;      /* Sophisticated deep purple */
  --color-pink: #e0b0b8;        /* Muted vintage pink for details/borders */
  --color-border: #e8e2d5;      /* Crisp sandstone line color */
  --color-border-subtle: #f0ebe0;

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Spacing (Scale-based) */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.15s ease-out;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-color);
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Presets */
h1, h2, h3, h4, .serif-font {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
}

p {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ==========================================================================
   LAYOUT STRUCTURE (Editorial Swiss Grid)
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Thin horizontal & vertical grid lines */
.border-top { border-top: 1px solid var(--color-border); }
.border-bottom { border-bottom: 1px solid var(--color-border); }
.border-left { border-left: 1px solid var(--color-border); }
.border-right { border-right: 1px solid var(--color-border); }

/* Master Grid Layout */
.editorial-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-md);
}

/* Centered content block */
.editorial-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-sm) 0;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.main-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background-color: rgba(252, 250, 246, 0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-bordeaux);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-md);
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-xs) 0;
  position: relative;
}

/* Hover Micro-interaction: Thin expanding line */
.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--color-bordeaux);
  transition: var(--transition-smooth);
}

.nav-links a:hover::after,
.nav-links li.active a::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--color-bordeaux);
}

/* Hamburger mobile menu button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 16px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text-primary);
  transition: var(--transition-fast);
}

/* ==========================================================================
   LANDING PAGE STYLES (index.html)
   ========================================================================== */
.hero-section {
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-bordeaux);
  margin-bottom: var(--space-sm);
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.hero-intro {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.15rem;
  color: var(--text-secondary);
}

/* The Metaphor Section */
.metaphor-block {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.metaphor-quote {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-style: italic;
  font-weight: 400;
  color: var(--color-purple);
  line-height: 1.3;
  margin-bottom: var(--space-md);
}

.metaphor-attribution {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Achievements Section Grid */
.home-achievements-title {
  font-size: 2rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
  text-align: left;
  letter-spacing: -0.01em;
}

.editorial-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

/* Sharp, editorial grid cards - NO bubble card styling */
.editorial-card {
  border: 1px solid var(--color-border);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 380px;
  background-color: transparent;
  transition: var(--transition-smooth);
}

.editorial-card:hover {
  border-color: var(--color-bordeaux);
  background-color: #f9f6f0;
}

.card-num {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--color-pink);
  font-style: italic;
}

.card-title {
  font-size: 1.75rem;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
  flex-grow: 1;
  margin-top: var(--space-xs);
}

.card-action {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-bordeaux);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-md);
}

.card-action span {
  transition: var(--transition-fast);
}

.editorial-card:hover .card-action span {
  transform: translateX(4px);
}

/* ==========================================================================
   INDIVIDUAL FEATURE PAGES STYLES
   ========================================================================== */
.page-title-section {
  padding: var(--space-lg) 0 var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.page-category {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-bordeaux);
  margin-bottom: var(--space-xs);
}

.page-title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Standard Editorial Content Layout */
.editorial-content-layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: var(--space-xl);
  padding: var(--space-lg) 0;
}

.editorial-body {
  font-size: 1.1rem;
  line-height: 1.7;
}

.editorial-body h3 {
  font-size: 1.75rem;
  margin: var(--space-md) 0 var(--space-sm);
  color: var(--color-purple);
}

.editorial-sidebar {
  border-left: 1px solid var(--color-border);
  padding-left: var(--space-md);
}

.sidebar-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-bordeaux);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.sidebar-item {
  margin-bottom: var(--space-md);
}

.sidebar-item-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-item-val {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   ACHIEVEMENT-SPECIFIC LAYOUTS
   ========================================================================== */

/* Ledgers & Timelines */
.ledger-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.ledger-date {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--color-bordeaux);
}

.ledger-content h4 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

/* AI Timeline */
.timeline {
  position: relative;
  padding-left: var(--space-md);
  margin: var(--space-md) 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: var(--color-border);
}

.timeline-event {
  position: relative;
  margin-bottom: var(--space-md);
}

.timeline-event::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-md) - 3.5px);
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-bordeaux);
}

/* Flowchart Blocks (Knowledge Base) */
.flowchart {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.flowchart-step {
  border: 1px solid var(--color-border);
  padding: var(--space-sm) var(--space-md);
  position: relative;
}

.flowchart-step::after {
  content: '↓';
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  color: var(--color-pink);
}

.flowchart-step:last-child::after {
  content: '';
}

/* ==========================================================================
   DASHBOARD COUNTERS PAGE STYLES (counters.html)
   ========================================================================== */
.counters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  margin: var(--space-lg) 0;
}

.counter-column {
  border: 1px solid var(--color-border);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.counter-num {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--color-bordeaux);
  margin-bottom: var(--space-xs);
}

.counter-label {
  font-family: var(--font-sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.9rem;
  color: var(--color-purple);
  margin-bottom: var(--space-md);
}

.counter-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 380px;
}

/* Expandable list item transitions */
.expand-trigger {
  margin-top: var(--space-md);
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--color-purple);
  border-bottom: 1px solid var(--color-purple);
  padding-bottom: 2px;
  transition: var(--transition-fast);
}

.expand-trigger:hover {
  color: var(--color-bordeaux);
  border-color: var(--color-bordeaux);
}

.expandable-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  margin-top: var(--space-md);
  text-align: left;
  border-top: 1px solid var(--color-border-subtle);
}

.expandable-panel.active {
  max-height: 500px; /* Big enough to fit contents */
  padding-top: var(--space-md);
}

.panel-list {
  list-style: none;
}

.panel-list li {
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 0.9rem;
}

/* ==========================================================================
   SELF-CONFIDENCE MOUNTAIN PAGE (confidence.html)
   ========================================================================== */
.mountain-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-xl);
  padding: var(--space-lg) 0;
  align-items: start;
}

.mountain-visual-box {
  border: 1px solid var(--color-border);
  background-color: #f9f6f0;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mountain-svg-wrapper {
  width: 100%;
  max-width: 650px;
  height: auto;
  aspect-ratio: 4 / 3;
}

.mountain-controls {
  width: 100%;
  margin-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.control-group {
  margin-bottom: var(--space-md);
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}

.control-label-row .label-val {
  color: var(--color-bordeaux);
}

/* Custom Styled Range Sliders */
.editorial-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 2px;
  background: var(--color-border);
  outline: none;
  margin: var(--space-xs) 0;
}

.editorial-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-bordeaux);
  cursor: pointer;
  transition: var(--transition-fast);
}

.editorial-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: var(--color-purple);
}

.editorial-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-bordeaux);
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.editorial-slider::-moz-range-thumb:hover {
  transform: scale(1.25);
  background: var(--color-purple);
}

/* Mountain Sidebar Commentary */
.commentary-box {
  background-color: var(--color-purple);
  color: #ffffff;
  padding: var(--space-md);
  border-top: 5px solid var(--color-pink);
  transition: var(--transition-smooth);
}

.commentary-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-pink);
  margin-bottom: var(--space-xs);
  font-weight: 600;
}

.commentary-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.commentary-text {
  font-size: 0.95rem;
  color: #e0d5e0;
  line-height: 1.6;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.main-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-md) 0 var(--space-lg);
  margin-top: var(--space-xl);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-content {
  display: flex;
  justify-content: space-between;
}

.footer-meta {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Media Queries)
   ========================================================================== */
@media screen and (max-width: 1024px) {
  .editorial-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .mountain-container,
  .editorial-content-layout {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .editorial-sidebar {
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding-left: 0;
    padding-top: var(--space-md);
  }
}

@media screen and (max-width: 768px) {
  :root {
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
  }

  .nav-links {
    display: none; /* We'll handle active toggle in JS if necessary, or collapse nicely */
  }

  .nav-toggle {
    display: flex;
  }

  .editorial-cards {
    grid-template-columns: 1fr;
  }

  .editorial-card {
    height: auto;
    min-height: 300px;
  }

  .counters-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}
