/* ============================================================
   COMPONENTS — All page-specific component styles
   Migrated from inline CSS, using design tokens throughout.
   ============================================================ */

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 96px 40px 0; /* 48px nav + 48px spacing */
}

.hero-header {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeUp 0.7s ease both;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: hsl(var(--ink-4));
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4.5vw, 50px);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-title em {
  font-style: italic;
  font-weight: 300;
}

.hero-lead {
  font-size: 17px;
  color: hsl(var(--ink-3));
  font-weight: var(--weight-light, 300);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}


/* ===== ANIMATED STAGE ===== */
.stage-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 620px;
  animation: fadeUp 0.7s ease 0.12s both;
}

.stage-box {
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 400px;
  position: relative;
  border-radius: calc(var(--radius) * 2);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 3px hsl(var(--foreground) / 0.02),
              0 8px 40px hsl(var(--foreground) / 0.04);
  overflow: visible;
}

/* Business boundary */
.biz {
  position: absolute;
  border: 2px dashed hsl(var(--ink-4));
  border-radius: 14px;
  transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.biz.ai-border {
  border-color: var(--ai);
  border-style: dashed;
  box-shadow: inset 0 0 40px hsla(293, 79%, 49%, 0.03);
}

[data-mode="dark"] .biz.ai-border {
  box-shadow: inset 0 0 40px hsla(293, 79%, 49%, 0.08);
}

.biz-label {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: hsl(var(--ink-5));
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.6s ease, color 0.6s ease;
}

.biz-label.highlight {
  color: var(--ai);
}

/* Bubbles */
.bubble {
  position: absolute;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.bubble-name {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1;
  transition: font-size 0.9s cubic-bezier(0.4, 0, 0.2, 1), color 0.6s ease;
}

.bubble-role {
  font-family: var(--font-mono);
  line-height: 1;
  margin-top: 3px;
  transition: font-size 0.9s cubic-bezier(0.4, 0, 0.2, 1), color 0.6s ease, opacity 0.6s ease;
}

.b-human {
  background: var(--human-bg-strong);
  border: 1.8px solid var(--human);
}

.b-human .bubble-name { color: var(--human); font-size: 14px; }
.b-human .bubble-role { color: var(--human); font-size: 9px; }

.b-ai {
  border: 1.8px solid var(--ai);
  transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1), background 0.6s ease, border-style 0.3s ease;
}

.b-ai .bubble-name { color: var(--ai); font-size: 14px; }
.b-ai .bubble-role { color: var(--ai); font-size: 9px; }

.b-ai.model-style {
  background: var(--model-bg);
  border-style: dashed;
}

.b-ai.agent-style {
  background: var(--ai-bg-strong);
  border-style: solid;
}

.b-human.gov-style {
  background: var(--gov-bg-strong);
  border-color: var(--gov);
}

.b-human.gov-style .bubble-name { color: var(--gov); }
.b-human.gov-style .bubble-role { color: var(--gov); }

/* Flow arrows */
.flow-line {
  position: absolute;
  height: 2px;
  background: var(--flow);
  border-radius: 1px;
  transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
  pointer-events: none;
}

.flow-line::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -3px;
  width: 0;
  height: 0;
  border-left: 5px solid var(--flow);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

/* External world tag pills */
.ext-tags {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
  pointer-events: none;
}

.ext-tags.left  { align-items: flex-start; }
.ext-tags.right { align-items: flex-end; }

.ext-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: hsl(var(--ink-4));
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  padding: 3px 9px;
  white-space: nowrap;
  line-height: 1;
}

/* Relationship lines */
.rel-line {
  position: absolute;
  height: 0;
  width: 0;
  border: none;
  transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
  pointer-events: none;
  transform-origin: 0 0;
}

.rel-line.solid {
  background: var(--iface);
  height: 2px;
}

.rel-line.dashed {
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--ai) 0, var(--ai) 5px, transparent 5px, transparent 10px);
}

.rel-line.gov-dash {
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--gov) 0, var(--gov) 5px, transparent 5px, transparent 10px);
}

.rel-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3px;
  transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
  pointer-events: none;
  white-space: nowrap;
}

/* Stage annotation */
.stage-note {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  font-style: italic;
  color: hsl(var(--ink-3));
  text-align: center;
  min-height: 22px;
  margin-top: 16px;
  transition: opacity 0.5s ease;
  pointer-events: none;
}


/* ===== TIMELINE ===== */
.hero-nav {
  width: 100%;
  max-width: 620px;
  padding: 24px 0 44px;
  animation: fadeUp 0.7s ease 0.25s both;
}

.timeline {
  display: flex;
  gap: 0;
}

.tl-step {
  flex: 1;
  cursor: pointer;
  padding: 0 4px;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
  transition: opacity 0.2s;
}

.tl-step:hover { opacity: 1 !important; }

.tl-bar {
  height: 3px;
  background: hsl(var(--border-light));
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}

.tl-fill {
  height: 100%;
  width: 0%;
  background: hsl(var(--ink-3));
  border-radius: 2px;
  transition: width 0.05s linear;
}

.tl-step.active .tl-fill { background: hsl(var(--foreground)); }
.tl-step.done .tl-fill   { width: 100% !important; background: hsl(var(--ink-4)); }

.tl-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: hsl(var(--ink-5));
  transition: color 0.3s;
}

.tl-step.active .tl-num { color: hsl(var(--ink-2)); font-weight: 500; }

.tl-name {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  color: hsl(var(--ink-5));
  margin-top: 1px;
  transition: color 0.3s, font-weight 0.3s;
}

.tl-step.active .tl-name { color: hsl(var(--ink-2)); font-weight: 500; }

.hero-scroll {
  padding-bottom: 20px;
  animation: fadeUp 0.7s ease 0.4s both;
}

.hero-scroll a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: hsl(var(--ink-5));
  text-decoration: none;
  transition: color 0.2s;
}

.hero-scroll a:hover { color: hsl(var(--ink-3)); }


/* ===== CONTENT ===== */
.content {
  max-width: 920px;
  margin: 0 auto;
  padding: 80px 40px 120px;
}

.section { margin-bottom: 64px; }

/* Uses .overline utility — only margin differs */
.section-label {
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 4px;
}

.section-desc {
  font-size: 15px;
  color: hsl(var(--ink-3));
  font-weight: var(--weight-light, 300);
  margin-bottom: 28px;
  max-width: 620px;
  line-height: 1.65;
}


/* ===== ENTITIES ===== */
.entities {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entity-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.entity {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 22px 24px;
}

.entity-icon {
  width: 40px;
  height: 40px;
  border-radius: calc(var(--radius) * 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.entity-icon.human    { background: var(--human-bg); color: var(--human); }
.entity-icon.model    { background: var(--model-bg); color: var(--ai); }
.entity-icon.agent    { background: var(--ai-bg); color: var(--ai); }
.entity-icon.business { background: hsl(var(--foreground) / 0.04); color: hsl(var(--foreground)); }

.entity-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.entity-def {
  font-size: 14px;
  color: hsl(var(--ink-3));
  font-weight: var(--weight-light, 300);
  line-height: 1.5;
}

.entity-traits {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entity-trait {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: calc(var(--radius) * 0.4);
  background: hsl(var(--background));
  color: hsl(var(--ink-4));
  border: 1px solid hsl(var(--border-light));
}

/* Trait tooltip wrapper */
.entity-trait {
  position: relative;
  cursor: default;
}

.entity-trait:hover {
  background: var(--human-bg);
  border-color: var(--human);
  color: hsl(var(--ink-2));
}

.entity-icon.model + div .entity-trait:hover,
.entity-icon.agent + div .entity-trait:hover {
  background: var(--ai-bg);
  border-color: var(--ai);
}

/* Tooltip */
.entity-trait::after {
  content: attr(data-def);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 280px;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  color: hsl(var(--foreground));
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 0.6);
  box-shadow: 0 4px 12px hsl(var(--foreground) / 0.08);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 50;
  white-space: normal;
  text-transform: none;
}

/* Arrow */
.entity-trait::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: hsl(var(--border));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 51;
}

.entity-trait:hover::after,
.entity-trait:hover::before,
.entity-trait.trait-active::after,
.entity-trait.trait-active::before {
  opacity: 1;
}


/* ===== INTERFACES GRID ===== */
.iface-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: hsl(var(--border));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.iface-cell {
  background: hsl(var(--card));
  padding: 18px;
}

.iface-type {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--iface);
  margin-bottom: 4px;
}

.iface-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 3px;
}

.iface-def {
  font-size: 13px;
  color: hsl(var(--ink-4));
  font-weight: var(--weight-light, 300);
  line-height: 1.45;
}


/* ===== MODES (class cards) ===== */
.modes {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mode {
  border: 1px solid hsl(var(--border));
  border-bottom: none;
  background: hsl(var(--card));
  scroll-margin-top: 24px;
}

.mode:first-child { border-radius: calc(var(--radius) * 1.2) calc(var(--radius) * 1.2) 0 0; }
.mode:last-child  { border-bottom: 1px solid hsl(var(--border)); border-radius: 0 0 calc(var(--radius) * 1.2) calc(var(--radius) * 1.2); }

.mode-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.mode-text {
  padding: 28px 30px;
  border-right: 1px solid hsl(var(--border-light));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mode-tier {
  margin-bottom: 2px;
}

.mode-name {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 500;
  margin-bottom: 1px;
  line-height: 1.2;
}

.mode-aka {
  font-family: var(--font-mono);
  font-size: 11px;
  color: hsl(var(--ink-4));
  margin-bottom: 10px;
}

.mode-desc {
  font-size: 14px;
  color: hsl(var(--ink-3));
  font-weight: var(--weight-light, 300);
  line-height: 1.6;
}

.mode-test {
  font-size: 13px;
  color: hsl(var(--ink-4));
  font-weight: var(--weight-light, 300);
  margin-top: 10px;
  font-style: italic;
  line-height: 1.5;
  border-top: 1px solid hsl(var(--border-light));
  padding-top: 10px;
}

.mode-test strong {
  font-weight: 500;
  color: hsl(var(--ink-3));
  font-style: normal;
}

.mode-diagram {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  background: hsl(var(--diagram-bg));
}

.diagram-svg {
  width: 100%;
  max-width: 380px;
  height: auto;
}

.mode-footer {
  border-top: 1px solid hsl(var(--border-light));
  padding: 12px 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  background: hsl(var(--diagram-bg));
  font-size: 12px;
}

.mf {
  display: flex;
  align-items: center;
  gap: 5px;
  color: hsl(var(--ink-3));
}

.mf-d {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.mf-t {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3px;
  color: hsl(var(--ink-4));
  text-transform: uppercase;
}

.mf-new  { color: var(--ai); font-weight: 600; }
.mf-gone { text-decoration: line-through; color: hsl(var(--ink-5)); }


/* ===== CALLOUTS ===== */
.callout {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 26px 28px;
}

.callout + .callout { margin-top: 12px; }

.callout-title {
  margin-bottom: 12px;
}

.callout-line {
  font-size: 15px;
  color: hsl(var(--ink-2));
  font-weight: var(--weight-light, 300);
  line-height: 1.7;
  margin-bottom: 4px;
}

.callout-line em    { font-style: italic; color: hsl(var(--ink-3)); }
.callout-line strong { font-weight: 500; }

.callout-divider {
  margin: 12px 0;
  padding-top: 12px;
  border-top: 1px solid hsl(var(--border-light));
}


/* ===== INSIGHT ===== */
.insight {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 28px;
}

.insight-text {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: var(--weight-light, 300);
  line-height: 1.65;
  color: hsl(var(--ink-2));
  font-style: italic;
}

.insight-text strong {
  font-weight: 500;
  font-style: normal;
  color: hsl(var(--foreground));
}


/* ===== GLOSSARY ===== */


/* ===== ATTRIBUTION ===== */
.attribution {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid hsl(var(--border));
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: hsl(var(--ink-5));
}


/* ===== SITE NAV ===== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 48px;
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border) / 0.5);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: hsl(var(--foreground));
}

.nav-brand-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-brand-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: hsl(var(--foreground));
}

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

.nav-link {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  padding: 6px 12px;
  border-radius: calc(var(--radius) * 0.6);
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--accent));
}

.nav-link.active {
  color: hsl(var(--foreground));
  font-weight: 500;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Theme buttons (in nav) */
.theme-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) * 0.6);
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  transition: background 0.15s, color 0.15s;
}

.theme-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.theme-btn svg {
  width: 16px;
  height: 16px;
}

/* Show/hide sun vs moon based on mode */
[data-mode="light"] .icon-moon { display: none; }
[data-mode="dark"]  .icon-sun  { display: none; }

/* Palette swatch */
.palette-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid hsl(var(--border));
  transition: border-color 0.15s;
}

.theme-btn:hover .palette-swatch {
  border-color: hsl(var(--muted-foreground));
}

[data-palette="warm"]   .palette-swatch { background: #d4a574; }
[data-palette="cool"]   .palette-swatch { background: #7b9bb8; }
[data-palette="forest"] .palette-swatch { background: #7baa8e; }

/* Palette tooltip */
.palette-label {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: hsl(var(--ink-4));
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 0.5);
  padding: 4px 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.nav-controls:hover .palette-label {
  opacity: 1;
}


/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero { padding: 48px 18px 0; }
  .hero-header { margin-bottom: 12px; }
  .stage-box { aspect-ratio: 4 / 3; max-height: 320px; }
  .hero-nav { padding: 16px 0 32px; }
  .tl-name { font-size: 10px; }
  .content { padding: 48px 18px 80px; }
  .mode-top { grid-template-columns: 1fr; }
  .mode-text { border-right: none; border-bottom: 1px solid hsl(var(--border-light)); }
  .entity-row { grid-template-columns: 1fr; }
  .iface-grid { grid-template-columns: 1fr; }

  .site-nav { padding: 0 12px; }
  .nav-brand-name { display: none; }
  .nav-links { gap: 0; }
  .nav-link { font-size: 12px; padding: 6px 8px; }

  /* Tooltips: anchor to left edge on mobile to prevent clipping */
  .entity-trait::after {
    left: 0;
    transform: none;
    max-width: 240px;
  }
  .entity-trait::before {
    left: 12px;
    transform: none;
  }
}
