:root {
  --bg-canvas: #102d25;
  --bg-surface: #1b3e32;
  --bg-surface-hover: #245243;
  --text-primary: #e0f2f1;
  --text-muted: #9ec5be;
  --accent-primary: #ff6f59;
  --accent-secondary: #d4a359;
  --border-subtle: #2f5e4e;
  --shadow-hard: 4px 4px 0px #091a15;
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 20px;
}

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

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.7;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  overflow-wrap: anywhere;
  hyphens: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-top: 2rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

p { margin-bottom: 1.15rem; }

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover, a:focus-visible {
  color: var(--text-primary);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.prose {
  max-width: 70ch;
  margin: 0 auto;
}

/* Header Capsule in Normal Flow */
.site-header {
  position: relative;
  padding: 1.25rem 1.25rem 0.5rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.header-capsule {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background-color: var(--accent-primary);
  color: #102d25;
  border-radius: 10px;
  font-weight: 900;
  font-size: 1.05rem;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  list-style: none;
}

.desktop-nav a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
}

.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] {
  background-color: var(--bg-canvas);
  color: var(--accent-primary);
}

.menu-toggle {
  display: none;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  width: 42px;
  height: 42px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-menu {
  display: none;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-top: 0.65rem;
  padding: 1rem 1.25rem;
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.mobile-menu a {
  display: block;
  padding: 0.6rem 0.85rem;
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
}

/* Hero Section */
.hero-wrap {
  margin: 1.25rem 0 2.5rem;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 440px;
}

.hero-media {
  position: relative;
  min-height: 300px;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-panel {
  padding: 2.25rem;
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.1rem;
  border-left: 1px solid var(--border-subtle);
}

.fact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.fact-item {
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.fact-item strong {
  color: var(--accent-primary);
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Buttons */
.btn {
  display: inline-block;
  background-color: var(--accent-primary);
  color: #102d25;
  font-weight: 800;
  text-decoration: none;
  padding: 0.8rem 1.45rem;
  border-radius: var(--radius);
  border: 2px solid #091a15;
  box-shadow: var(--shadow-hard);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  font-size: 0.98rem;
  text-align: center;
  align-self: flex-start;
}

.btn:hover,
.btn:focus-visible {
  transform: translate(4px, 4px);
  box-shadow: 0px 0px 0px #091a15;
  color: #102d25;
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.btn-secondary {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  color: var(--accent-primary);
}

/* Badges */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-canvas);
}

.badge-evidence { color: #6ee7b7; border-color: #2f7a5e; }
.badge-literary { color: #fcd34d; border-color: #7c6223; }
.badge-later { color: #fca5a5; border-color: #7f3939; }

/* Bento Grid System */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0 3rem;
}

.bento-tile {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }

.tile-img-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.1rem;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-canvas);
}

.tile-img-wrap.ratio-4-3 {
  aspect-ratio: 4 / 3;
}

.tile-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Comparison Pair & Inscription Annotations */
.comparison-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
}

.comp-box {
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.inscription-card {
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin: 1.25rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
}

.inscription-card .translit {
  color: var(--accent-primary);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-surface);
  text-align: left;
  font-size: 0.92rem;
}

th, td {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background-color: var(--bg-canvas);
  font-weight: 800;
}

/* Forms */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
}

.form-output {
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1.25rem;
  white-space: pre-wrap;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-kinetic), transform 0.6s var(--ease-kinetic);
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-meta {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.86rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .hero-wrap { grid-template-columns: 1fr; }
  .hero-panel { border-left: none; border-top: 1px solid var(--border-subtle); }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 6; }
}

@media (max-width: 768px) {
  .desktop-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .comparison-pair { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .header-capsule { padding: 0.7rem 1rem; }
  .bento-tile { padding: 1.25rem; }
  .mobile-menu ul { grid-template-columns: 1fr; }
}

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