:root {
  --bg-base: #022c22;
  --bg-surface: #064e3b;
  --text-main: #e0f2f1;
  --text-muted: rgba(224, 242, 241, 0.7);
  --accent: #ff6f59;
  --line-color: rgba(224, 242, 241, 0.15);
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-wrap: anywhere; hyphens: auto; }
body {
  margin: 0;
  padding: 0;
  font-family: Charter, Cambria, Georgia, serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
}

/* Typography */
h1, h2, h3, h4 { margin-top: 0; font-weight: normal; color: var(--text-main); }
h1 { font-size: 2.5rem; line-height: 1.2; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line-color); padding-bottom: 10px; }
h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1.5rem; max-width: 72ch; }
.small-caps { font-variant: small-caps; text-transform: lowercase; font-size: 1.1em; letter-spacing: 0.5px; }

/* Links & Buttons */
a { color: var(--accent); text-decoration: none; transition: opacity 0.3s; }
a:hover { opacity: 0.8; }
.btn {
  display: inline-block;
  border: 2px solid var(--accent);
  border-radius: 0; /* Square ends per spec */
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 12px 24px;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: bold;
  transition: all 0.3s var(--ease);
  text-align: center;
}
.btn:hover { background: var(--accent); color: var(--bg-base); }

/* Layout & Containers */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.reading-width { max-width: 72ch; margin: 0 auto; }
.section { padding: 60px 0; }

/* Header (Floating, Inset) */
.header-wrapper { padding: 20px; position: relative; } /* position relative allows scroll away */
.header-main {
  background-color: var(--bg-surface);
  border-radius: 20px;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.brand { font-size: 1.25rem; font-weight: bold; color: var(--text-main); }
.nav-desktop { display: flex; gap: 24px; }
.nav-desktop a { color: var(--text-main); font-weight: bold; }
.nav-desktop a.active { color: var(--accent); }
.nav-mobile-btn {
  display: none; background: none; border: none; color: var(--text-main);
  font-size: 1.5rem; cursor: pointer; padding: 5px;
}
.nav-mobile-menu {
  display: none; background: var(--bg-surface); position: absolute;
  top: 80px; left: 20px; right: 20px; border-radius: 20px;
  padding: 20px; z-index: 50; border: 1px solid var(--line-color);
}
.nav-mobile-menu.open { display: flex; flex-direction: column; gap: 15px; }

/* Hero Section */
.hero { position: relative; padding: 60px 0 100px; }
.hero-img-container { width: 100%; height: 500px; border-radius: 20px; overflow: hidden; position: relative; margin-bottom: 40px; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-fact-card {
  position: absolute; bottom: -40px; right: 40px;
  background: var(--bg-surface); padding: 30px; border-radius: 20px;
  max-width: 350px; border: 1px solid var(--line-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 5;
}
.fact-item { margin-bottom: 15px; }
.fact-item:last-child { margin-bottom: 0; }
.fact-val { font-size: 1.5rem; color: var(--accent); display: block; line-height: 1; margin-bottom: 4px; }
.fact-lbl { color: var(--text-muted); font-size: 0.9rem; }

/* Timeline Narrative Framework */
.timeline-container { position: relative; max-width: 800px; margin: 40px auto; padding-left: 50px; }
.timeline-container::before {
  content: ''; position: absolute; left: 19px; top: 10px; bottom: 0;
  width: 2px; background: var(--line-color);
}
.timeline-node { position: relative; margin-bottom: 80px; }
.timeline-node:last-child { margin-bottom: 0; }
.node-marker {
  position: absolute; left: -50px; top: 0; width: 40px; height: 40px;
  background: var(--bg-surface); border: 2px solid var(--accent);
  color: var(--text-main); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: sans-serif; font-weight: bold; font-size: 1rem;
  z-index: 2;
}

/* List Rows (No Cards rule) */
.list-row {
  display: flex; align-items: flex-start; padding: 25px 0;
  border-bottom: 1px solid var(--line-color);
}
.list-row:last-child { border-bottom: none; }
.list-icon { width: 32px; height: 32px; margin-right: 24px; flex-shrink: 0; }
.list-icon svg { width: 100%; height: 100%; fill: var(--accent); }
.list-content h4 { margin: 0 0 8px 0; font-size: 1.2rem; }
.list-content p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* Tools & Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-variant: small-caps; color: var(--text-muted); }
.form-control {
  width: 100%; padding: 12px; background: var(--bg-base); color: var(--text-main);
  border: 1px solid var(--line-color); border-radius: 20px; font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 120px; }
.tool-panel { background: var(--bg-surface); padding: 40px; border-radius: 20px; border: 1px solid var(--line-color); margin-top: 40px; }
.tool-output {
  margin-top: 20px; padding: 20px; background: var(--bg-base);
  border: 1px dashed var(--line-color); border-radius: 20px; display: none; white-space: pre-wrap; font-family: monospace;
}
.tool-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Images inside content */
.content-img { width: 100%; height: auto; border-radius: 20px; margin: 30px 0; object-fit: cover; }
.table-wrap { overflow-x: auto; margin: 30px 0; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 15px; border-bottom: 1px solid var(--line-color); }
th { color: var(--accent); font-weight: normal; font-variant: small-caps; }

/* Reveal Animation */
.reveal { opacity: 0; transform: translateY(20px); transition: all 0.8s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Footer */
.footer { background: var(--bg-surface); padding: 60px 20px 30px; margin-top: 80px; text-align: center; border-top: 1px solid var(--line-color); }
.footer-endcap { width: 10px; height: 10px; background: var(--accent); border-radius: 50%; margin: 0 auto 30px; }
.footer-nav { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; font-variant: small-caps; }
.footer-nav a { color: var(--text-muted); }
.footer-legal { font-size: 0.85rem; color: var(--text-muted); }
.footer-legal p { margin: 5px 0; max-width: 100%; }

/* Responsive */
@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .nav-mobile-btn { display: block; }
  .hero-fact-card { position: relative; bottom: auto; right: auto; margin-top: -60px; max-width: 100%; }
  .hero-img-container { height: 350px; }
  .timeline-container { padding-left: 30px; }
  .timeline-container::before { left: 9px; }
  .node-marker { left: -40px; width: 30px; height: 30px; font-size: 0.85rem; }
  .list-row { flex-direction: column; }
  .list-icon { margin-bottom: 15px; }
}

@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
