/* ===== Reset & base ===== */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:root {
  --bg: #0b0e14;
  --bg-2: #10151f;
  --surface: #151b29;
  --surface-2: #1c2434;
  --line: #263247;
  --text: #e8edf5;
  --muted: #92a0b8;
  --accent: #ffb347;
  --accent-2: #ff6b3d;
  --accent-3: #ff5b8d;
  --green: #7ddb8a;
  --gold: #ffc857;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Menlo", "Consolas", monospace;
}
/* ===================== Local fonts (no CDN) ===================== */
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/PlayfairDisplay.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono.ttf") format("truetype");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

html { scroll-behavior: smooth; }
body {
  background: radial-gradient(1200px 800px at 20% -10%, #1c2233 0%, var(--bg) 60%) fixed;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #ffd28a; }

/* ===== Layout ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
header.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 20, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0;
  gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-size: 21px; letter-spacing: 1px;
  color: #fff; font-weight: 800;
  white-space: nowrap;
}
.brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-size: 20px;
  box-shadow: 0 4px 18px rgba(255, 179, 71, 0.35);
  flex-shrink: 0;
}
.nav-links {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  justify-content: center;
}
.nav-links a {
  color: var(--text);
  padding: 7px 10px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  letter-spacing: 0.2px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover { background: var(--surface); color: #fff; }
.nav-links a.active {
  background: var(--surface-2);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.lang-switch {
  display: flex; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  flex-shrink: 0;
}
.lang-switch button {
  background: transparent; border: 0;
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-mono);
}
.lang-switch button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #12100a;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 76vh;
  display: grid; place-items: center;
  overflow: hidden;
  text-align: center;
  padding: 80px 24px;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: url("../img/hero.jpg") center/cover no-repeat;
  filter: brightness(0.5) saturate(1.05);
  z-index: 0;
  /* smooth ken-burns on pure CSS, no extra bytes */
  animation: kenburns 28s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes kenburns {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.12) translate(1.2%, -1.2%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,14,20,0.35) 0%, rgba(11,14,20,0.88) 100%);
  z-index: 1;
}
.hero-bg {
  position: absolute; inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-bg video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg video { display: none; }
}
.hero-inner { position: relative; z-index: 2; max-width: 900px; }
.hero .eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 4px;
  color: var(--accent);
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid rgba(255, 179, 71, 0.4);
  border-radius: 999px;
  margin-bottom: 22px;
  background: rgba(11,14,20,0.4);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  margin: 0 0 18px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(180deg, #ffffff 0%, #e0c9a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: clamp(16px, 1.5vw, 20px);
  color: #d5dce8;
  max-width: 660px; margin: 0 auto 32px;
}
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  text-decoration: none;
  font-family: var(--font-body);
  color: #fff;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #12100a !important;
  box-shadow: 0 8px 24px rgba(255, 179, 71, 0.25);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(255, 179, 71, 0.4); }
.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border-color: var(--line);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ===== Sections ===== */
section.section { padding: 80px 0; }
section.section + section.section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 44px; max-width: 820px; }
.section-head .kicker {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 4px; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  margin: 0 0 12px;
  line-height: 1.12;
  letter-spacing: -0.5px;
}
.section-head p { color: var(--muted); max-width: 760px; margin: 0; }

/* ===== Dino tiles (home) ===== */
.dino-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.dino-tile {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.dino-tile:hover { transform: translateY(-4px); border-color: rgba(255,179,71,0.45); box-shadow: var(--shadow); }
.dino-tile .thumb {
  aspect-ratio: 4/3;
  background-size: cover; background-position: center;
  position: relative;
}
.dino-tile .thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(11,14,20,0.92));
}
.dino-tile .body { padding: 16px 20px 20px; position: relative; }
.dino-tile .body::before {
  content: "";
  position: absolute; top: -18px; left: 20px; right: 20px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,179,71,0.5), transparent);
}
.dino-tile h3 {
  margin: 0 0 5px;
  font-family: var(--font-display);
  font-size: 22px;
  color: #fff;
}
.dino-tile .epoch {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--green);
}
.dino-tile p { color: var(--muted); margin: 8px 0 0; font-size: 14px; }
.dino-tile .arrow {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: grid; place-items: center;
  color: #fff; font-size: 17px;
  border: 1px solid var(--line);
  z-index: 2;
}

/* ===== Long article ===== */
.article { max-width: 860px; }
.article h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 34px);
  margin: 56px 0 14px;
  line-height: 1.15;
  color: #fff;
}
.article h3 {
  font-family: var(--font-display);
  font-size: 21px;
  margin: 34px 0 10px;
  color: var(--gold);
}
.article p { color: #c8d2e0; margin: 0 0 18px; font-size: 16.5px; }
.article ul, .article ol { color: #c8d2e0; margin: 0 0 18px; padding-left: 24px; }
.article li { margin-bottom: 8px; }
.article figure { margin: 32px 0; }
.article figure img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  width: 100%;
}
.article figcaption {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--muted);
  margin-top: 10px; letter-spacing: 0.5px;
  text-align: center;
}
.article .pull {
  border-left: 3px solid var(--accent);
  background: rgba(255,179,71,0.06);
  padding: 18px 22px;
  border-radius: 0 12px 12px 0;
  margin: 28px 0;
  color: #e8dcc7;
  font-size: 17px;
}
.article .pull strong { color: var(--accent); }

/* ===== Page header (detail pages) ===== */
.page-header {
  padding: 70px 0 40px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(800px 300px at 50% 0%, rgba(255,179,71,0.08), transparent);
}
.page-header .container { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 40px; align-items: center; }
.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 14px; text-transform: uppercase;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 52px);
  margin: 0 0 8px;
  line-height: 1.08;
}
.page-header .latin {
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 1px;
  color: var(--green);
  margin-bottom: 14px;
  font-style: italic;
}
.page-header p.lead { color: #c2cbdb; max-width: 640px; margin: 0; font-size: 16.5px; }
.page-header .portrait {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  aspect-ratio: 4/3;
  background-size: cover; background-position: center;
}

/* ===== Fact chips ===== */
.fact-chips {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.fact-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
}
.fact-chip .k {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent);
  display: block; margin-bottom: 4px;
}
.fact-chip .v { font-size: 15px; font-weight: 600; color: #fff; }

/* ===== Article body on detail pages ===== */
.detail-body { max-width: 860px; }
.detail-body h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 30px);
  margin: 46px 0 12px;
  color: #fff;
}
.detail-body p { color: #c8d2e0; margin: 0 0 18px; font-size: 16.5px; }
.detail-body .portrait-inline {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16/9;
  background-size: cover; background-position: center;
  margin: 30px 0;
}

/* ===== Forms ===== */
.contact-form, .vote-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 640px;
}
.field { display: block; margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.field input, .field textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.15);
}
.field textarea { resize: vertical; min-height: 120px; }
.form-status {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(125, 219, 138, 0.1);
  border: 1px solid rgba(125, 219, 138, 0.3);
  color: var(--green);
  font-size: 14px;
  display: none;
}
.form-status.visible { display: block; }

/* ===== Vote page ===== */
.vote-options { display: grid; gap: 14px; margin-bottom: 28px; }
.vote-option {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
}
.vote-option:hover { border-color: rgba(255,179,71,0.4); }
.vote-option.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255,179,71,0.1), rgba(255,107,61,0.08));
}
.vote-option input { display: none; }
.vote-option .check {
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 2px solid var(--line);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.vote-option.selected .check {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}
.vote-option .check::after {
  content: "✓"; color: #12100a; font-weight: 800; font-size: 16px;
  opacity: 0; transition: opacity 0.15s;
}
.vote-option.selected .check::after { opacity: 1; }
.vote-option .icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.vote-option .label { font-size: 16px; font-weight: 600; color: #fff; }
.vote-option .desc { font-size: 13px; color: var(--muted); }

.vote-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 36px;
}
.count-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.count-card .icon { font-size: 26px; margin-bottom: 8px; }
.count-card .num {
  font-family: var(--font-display);
  font-size: 38px;
  color: #fff;
  line-height: 1;
}
.count-card .name {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}
.vote-meta {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12px; color: var(--muted);
  letter-spacing: 1px;
  text-align: center;
}

/* ===== Footer ===== */
footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 56px;
  margin-top: 60px;
  background: var(--bg-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.footer-grid p, .footer-grid a {
  color: var(--muted);
  font-size: 14px;
  display: block;
  margin-bottom: 8px;
}
.footer-grid a:hover { color: #fff; }
.copyright {
  text-align: center;
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

/* ===== Lightbox ===== */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(5, 8, 14, 0.94);
  z-index: 200;
  display: none;
  align-items: center; justify-content: center;
  cursor: zoom-out;
  padding: 24px;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 84vh;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
#lightbox .lb-caption {
  position: absolute; bottom: 18px; left: 0; right: 0;
  text-align: center; color: #cbd5e0;
  font-family: var(--font-mono); font-size: 13px;
  letter-spacing: 1px;
}

/* ===== Responsive ===== */
/* ===== Featured video ===== */
.video-feature video {
  width: 100%;
  aspect-ratio: 16/9;
  background: #060912;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: block;
  box-shadow: var(--shadow);
}
.video-controls {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 14px;
}
.video-controls .btn {
  flex: 1 1 auto;
  justify-content: center;
  padding: 10px 14px;
  font-size: 13px;
}


/* ===== Gallery (dino pages) ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.gallery-item {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.gallery-item figcaption {
  padding: 12px 16px 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
  flex: 1;
}
.gallery-item .gallery-dl {
  margin: 10px 16px 16px;
  align-self: flex-start;
}
.timeline-img {
  width: 100%;
  max-width: 980px;
  display: block;
  margin: 6px auto 0;
}
.article .fig-dl {
  text-align: center;
  margin-top: 12px;
}
.article .fig-dl .btn {
  padding: 9px 18px;
  font-size: 13px;
}

@media (max-width: 980px) {
  .page-header .container { grid-template-columns: 1fr; }
  .page-header .portrait { max-width: 520px; }
}
@media (max-width: 760px) {
  .nav { flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; justify-content: center; }
  .nav-links a { padding: 5px 7px; font-size: 12.5px; }
  .brand { font-size: 17px; }
  .brand .logo { width: 30px; height: 30px; font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  section.section { padding: 56px 0; }
  .article p { font-size: 15.5px; }
}
