:root {
  --bg: #120f0d;
  --bg-elevated: rgba(36, 29, 24, 0.72);
  --bg-panel: rgba(29, 23, 19, 0.88);
  --bg-soft: rgba(56, 45, 36, 0.5);
  --text: #efe4ce;
  --text-muted: #c7b89d;
  --line: rgba(201, 173, 130, 0.22);
  --accent: #b6935f;
  --accent-strong: #d4b27a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --max-width: 1180px;
  --radius: 24px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Instrument Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(134, 107, 73, 0.2), transparent 34%),
    linear-gradient(180deg, #261e18 0%, #120f0d 45%, #0d0b0a 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02), transparent),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 36px,
      rgba(255, 255, 255, 0.015) 36px,
      rgba(255, 255, 255, 0.015) 37px
    );
  pointer-events: none;
}

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

img {
  max-width: 100%;
  display: block;
}

.page-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.site-header {
  position: sticky;
  top: 0.75rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 15, 13, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(212, 178, 122, 0.35);
  border-radius: 50%;
  color: var(--accent-strong);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong,
h1,
h2 {
  font-family: "Cormorant Garamond", serif;
}

.brand-text strong {
  font-size: 1.3rem;
  font-weight: 600;
}

.brand-text span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: var(--text-muted);
}

.site-nav a {
  position: relative;
  transition: color 180ms ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  width: 100%;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--accent-strong);
  transition: transform 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
}

body[data-page="home"] .site-nav a[href="/"],
body[data-page="essays"] .site-nav a[href="/essays/"],
body[data-page="timeline"] .site-nav a[href="/timeline/"],
body[data-page="archive"] .site-nav a[href="/archive/"],
body[data-page="about"] .site-nav a[href="/about/"] {
  color: var(--text);
}

body[data-page="home"] .site-nav a[href="/"]::after,
body[data-page="essays"] .site-nav a[href="/essays/"]::after,
body[data-page="timeline"] .site-nav a[href="/timeline/"]::after,
body[data-page="archive"] .site-nav a[href="/archive/"]::after,
body[data-page="about"] .site-nav a[href="/about/"]::after {
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 0.65rem 1rem;
  font: inherit;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 32%),
    var(--bg-panel);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  overflow: hidden;
}

.hero-copy {
  align-self: center;
}

.eyebrow,
.section-kicker,
.card-label {
  margin: 0 0 0.9rem;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(3.4rem, 8vw, 6.6rem);
  line-height: 0.92;
  font-weight: 600;
}

.hero-title {
  max-width: 9ch;
  font-size: clamp(2.8rem, 5.4vw, 4.8rem);
  line-height: 0.98;
}

.lede {
  max-width: 62ch;
  margin: 1.4rem 0 0;
  color: var(--text-muted);
  font-size: 1.06rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(212, 178, 122, 0.45);
}

.button-primary {
  background: linear-gradient(180deg, #c8a56f, #9d7946);
  color: #1a130d;
  border-color: transparent;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.03);
}

.hero-card,
.note-card {
  padding: 1.5rem;
  background:
    linear-gradient(180deg, rgba(212, 178, 122, 0.08), transparent 45%),
    var(--bg-elevated);
}

.shelf-list,
.roadmap-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.feature-grid,
.split-section {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.section-page {
  display: grid;
  gap: 1.5rem;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split-section {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
}

.feature,
.manifesto {
  padding: 1.6rem;
}

.feature h2,
.manifesto h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1;
  font-weight: 600;
}

.feature p,
.manifesto p {
  color: var(--text-muted);
  line-height: 1.8;
}

.text-link {
  display: inline-flex;
  margin-top: 1rem;
  color: var(--accent-strong);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 650ms ease,
    transform 650ms ease;
}

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

@media (max-width: 920px) {
  .site-header {
    border-radius: 28px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 0.5rem;
  }

  .site-nav[data-open="true"] {
    display: flex;
  }

  .hero,
  .feature-grid,
  .split-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--max-width));
    padding-top: 0.5rem;
  }

  .site-header {
    padding: 1rem;
  }

  .brand-text span {
    display: none;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.8rem, 15vw, 4.4rem);
  }

  .hero-title {
    font-size: clamp(2.5rem, 12vw, 3.6rem);
  }

  .hero,
  .feature,
  .manifesto,
  .hero-card,
  .note-card {
    padding: 1.2rem;
  }
}
