:root {
  --bg-1: #071a16;
  --bg-2: #0e2c24;
  --accent: #4de38a;
  --accent-2: #8fd3ff;
  --text: #e9f6ef;
  --muted: #a8c1b0;
  --card: rgba(10, 28, 25, 0.75);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
  --grid: rgba(255, 255, 255, 0.06);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 10% 10%, rgba(77, 227, 138, 0.08), transparent 30%),
    radial-gradient(circle at 70% 20%, rgba(143, 211, 255, 0.1), transparent 32%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
  color: var(--text);
  overflow-x: hidden;
  position: relative;
  letter-spacing: -0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 110px 58px, 110px 58px;
  opacity: 0.28;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }

p { margin: 0; color: var(--muted); line-height: 1.6; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 36px;
  padding: 84px clamp(18px, 4vw, 72px) 48px;
  position: relative;
  isolation: isolate;
  max-width: 1200px;
  margin: 0 auto;
  align-items: center;
  z-index: 1;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

.lede { margin: 16px 0 24px; max-width: 54ch; }

.text-glow {
  display: inline-block;
  margin-left: 8px;
  padding: 6px 10px;
  background: linear-gradient(120deg, rgba(77, 227, 138, 0.16), rgba(143, 211, 255, 0.2));
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 0 32px rgba(77, 227, 138, 0.28);
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
}

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 8px;
}

.btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border 0.2s ease;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #03241a;
  box-shadow: 0 12px 28px rgba(77, 227, 138, 0.4);
}

.btn:hover { transform: translateY(-2px) scale(1.01); box-shadow: var(--shadow), 0 0 22px rgba(77, 227, 138, 0.22); }

.hero__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
}

.control-panel {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  font-weight: 700;
}

.switch input { display: none; }

.slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  transition: background 0.2s ease;
  border: 1px solid var(--border);
}

.slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(77, 227, 138, 0.6);
}

.switch input:checked + .slider { background: rgba(77, 227, 138, 0.18); }
.switch input:checked + .slider::after { transform: translateX(18px); }

.hero__visual {
  position: relative;
  padding: 12px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(77, 227, 138, 0.08), rgba(143, 211, 255, 0.12));
}

.sheet-preview {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(6, 18, 15, 0.9), rgba(9, 31, 26, 0.85));
  overflow: hidden;
  box-shadow: var(--shadow);
}

.sheet-preview::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 12px;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 90px 48px, 90px 48px;
  opacity: 0.25;
  pointer-events: none;
}

.sheet-preview__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
  color: var(--muted);
}

.pill--accent { color: var(--text); background: rgba(77, 227, 138, 0.16); border-color: rgba(77, 227, 138, 0.4); }

.sheet-preview__formula {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--accent);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.sheet-preview__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 52px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.cell {
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
}

.cell--head {
  font-family: "JetBrains Mono", monospace;
  text-align: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.cell--accent { color: var(--text); background: rgba(77, 227, 138, 0.18); border-color: rgba(77, 227, 138, 0.5); }
.cell--note { font-style: italic; color: var(--accent-2); }

.sparkline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 14px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.sparkline span {
  display: block;
  width: 100%;
  height: 36px;
  background: linear-gradient(180deg, var(--accent), rgba(255, 255, 255, 0));
  border-radius: 8px;
  transform-origin: bottom;
}

.matrix {
  padding: 32px clamp(18px, 4vw, 72px) 64px;
}

.matrix__head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto 22px;
}

.matrix__note { max-width: 36ch; }

.matrix__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.sheet-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  min-height: 200px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  opacity: 0.88;
}

.sheet-card::before {
  content: attr(data-era);
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.18);
}

.sheet-card:hover { transform: translateY(-6px) scale(1.01); border-color: rgba(77, 227, 138, 0.7); box-shadow: var(--shadow), 0 0 24px rgba(77, 227, 138, 0.18); opacity: 1; }
.sheet-card.visible { opacity: 1; transform: translateY(0); }

.sheet-card__row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill--year { color: var(--accent-2); background: rgba(143, 211, 255, 0.12); border-color: rgba(143, 211, 255, 0.5); font-family: "JetBrains Mono", monospace; font-size: 12px; }

.sheet-card__meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.cell-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.cell-link::after { content: "↗"; font-size: 14px; transition: transform 0.2s ease; }
.sheet-card:hover .cell-link::after { transform: translateX(4px); }

.focus {
  padding: 10px clamp(18px, 4vw, 72px) 64px;
}

.focus__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.focus__card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.footer {
  padding: 20px clamp(18px, 4vw, 72px) 36px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
}

.footer__brand { font-weight: 700; letter-spacing: 0.04em; color: var(--accent); }
.footer__meta { display: flex; gap: 12px; flex-wrap: wrap; }

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.08) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: soft-light;
  opacity: 0.5;
  transition: opacity 0.25s ease;
  z-index: 0;
}

.stars {
  position: fixed;
  inset: 0;
  background: radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 70% 40%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255, 255, 255, 0.4), transparent);
  opacity: 0.3;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.2));
  transition: transform 0.2s ease;
  z-index: 0;
}

.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(600px 400px at 20% 30%, rgba(77, 227, 138, 0.18), transparent 50%),
    radial-gradient(500px 380px at 80% 20%, rgba(143, 211, 255, 0.12), transparent 40%),
    radial-gradient(800px 500px at 50% 90%, rgba(77, 227, 138, 0.08), transparent 40%);
  filter: blur(30px);
  opacity: 0.85;
  transition: transform 0.2s ease;
  z-index: 0;
}

.sheet-mode {
  position: relative;
}

.sheet-mode::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.3));
  mix-blend-mode: multiply;
  opacity: 0.45;
  transition: opacity 0.25s ease;
}

body.no-glow .sheet-card { box-shadow: none; border-color: var(--border); }
body.no-glow .sheet-preview { box-shadow: none; }
body.no-grid .scanlines { opacity: 0; }

.sheet-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 70px clamp(18px, 4vw, 72px) 26px;
  display: grid;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.sheet-hero h1 { font-size: clamp(32px, 4.4vw, 54px); }
.sheet-hero .pill { background: rgba(77, 227, 138, 0.16); border-color: rgba(77, 227, 138, 0.5); color: var(--text); }
.sheet-hero__meta { display: flex; gap: 10px; flex-wrap: wrap; }

.sheet-article {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px clamp(18px, 4vw, 72px) 70px;
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.sheet-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.sheet-section__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sheet-section__header h2 { font-size: clamp(22px, 3vw, 30px); }

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.sheet-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.sheet-block strong { color: var(--text); }

.sheet-table {
  display: grid;
  gap: 8px;
}

.sheet-table__row {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.sheet-table__label {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent-2);
  font-size: 13px;
}

.callout {
  border: 1px solid rgba(77, 227, 138, 0.4);
  background: rgba(77, 227, 138, 0.08);
  border-radius: 14px;
  padding: 14px;
  color: var(--text);
}

.taglist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.timeline-list li {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

.badge--accent { color: var(--accent); border-color: rgba(77, 227, 138, 0.6); }
.badge--note { color: var(--accent-2); border-color: rgba(143, 211, 255, 0.5); }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero, .matrix, .focus { padding-inline: 16px; }
  .matrix__head { flex-direction: column; align-items: flex-start; }
  .sheet-preview__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
