/* ── Reset & Tokens ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0d0d0d;
  --surface:  #141414;
  --surface2: #1c1c1c;
  --gold:     #c9a96e;
  --gold-lt:  #e2c99a;
  --white:    #f5f3ef;
  --muted:    #7a7672;
  --radius:   4px;
  --ease:     cubic-bezier(.22,.68,0,1.2);
  --font:     'Georgia', 'Times New Roman', serif;
  --sans:     'Helvetica Neue', Arial, sans-serif;
  --nav-h:    64px;
  --content-w: 720px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font);
  line-height: 1.7;
  overflow-x: hidden;
}

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

/* ── Utility ────────────────────────────────────────────────── */
.container {
  width: min(1100px, 92vw);
  margin-inline: auto;
}

.section-label {
  font-family: var(--sans);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .75rem;
}

/* ── Fade-in ────────────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.fade-in.visible { opacity: 1; transform: none; }

/* ── Navbar ─────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: transparent;
  transition: background .4s, backdrop-filter .4s;
}
#navbar.scrolled {
  background: rgba(13,13,13,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201,169,110,.15);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: min(1200px, 94vw);
  margin-inline: auto;
}
.nav-logo {
  font-family: var(--sans);
  font-size: .85rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.nav-back {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--muted);
  transition: color .2s;
}
.nav-back:hover { color: var(--gold); }

/* ── Hero ───────────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 56vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(160deg, #0d0d0d 40%, #1a1208 100%);
  overflow: hidden;
}
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 70% 30%, rgba(201,169,110,.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(201,169,110,.05) 0%, transparent 60%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 2rem;
}
.hero-eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.2rem;
}
#hero h1 {
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: .02em;
  color: var(--white);
  margin-bottom: 1rem;
}
.hero-sub {
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .16em;
  color: var(--muted);
}
.hero-scroll-hint {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
}
.hero-scroll-hint span {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: .5; transform: scaleY(1); }
  50%       { opacity: 1;  transform: scaleY(1.1); }
}

/* ── Articles list (index) ──────────────────────────────────── */
#articles {
  padding: 6rem 0 8rem;
}
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(201,169,110,.1);
  border: 1px solid rgba(201,169,110,.1);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1.5rem;
}
.article-card {
  display: grid;
  grid-template-columns: 3rem 1fr 2rem;
  align-items: center;
  gap: 1.8rem;
  padding: 2.2rem 2rem;
  background: var(--surface2);
  text-decoration: none;
  transition: background .25s, border-color .25s;
  cursor: pointer;
}
.article-card:hover {
  background: #222;
}
.article-card:hover .card-arrow {
  color: var(--gold);
  transform: translateX(4px);
}
.card-index {
  font-family: var(--sans);
  font-size: .62rem;
  letter-spacing: .18em;
  color: var(--gold);
  align-self: start;
  padding-top: .25rem;
}
.card-body { min-width: 0; }
.card-body h2 {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: .3rem;
  line-height: 1.3;
}
.card-date {
  display: block;
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .08em;
  color: var(--gold);
  margin-bottom: .55rem;
}
.card-excerpt {
  font-size: .88rem;
  color: rgba(245,243,239,.6);
  line-height: 1.6;
}
.card-arrow {
  font-size: 1rem;
  color: var(--muted);
  transition: color .2s, transform .2s;
  align-self: center;
  justify-self: end;
}

.empty-state {
  padding: 3rem 2rem;
  background: var(--surface2);
  font-family: var(--sans);
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
}
.empty-state code {
  font-family: 'Courier New', monospace;
  background: rgba(201,169,110,.1);
  color: var(--gold-lt);
  padding: .1em .4em;
  border-radius: 2px;
}

/* ── Article page ───────────────────────────────────────────── */
#article {
  padding-top: calc(var(--nav-h) + 4rem);
  padding-bottom: 8rem;
}
.article-header {
  margin-bottom: 4rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(201,169,110,.15);
}
.article-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: .9rem;
  max-width: var(--content-w);
}
.article-date {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--gold);
}

/* ── Article body — styled markdown ─────────────────────────── */
.article-body {
  max-width: var(--content-w);
}
.article-body > * + * { margin-top: 1.5rem; }

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  font-weight: 400;
  color: var(--white);
  line-height: 1.25;
  margin-top: 2.8rem;
  margin-bottom: .5rem;
}
.article-body h1 { font-size: 1.9rem; }
.article-body h2 {
  font-size: 1.45rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid rgba(201,169,110,.15);
}
.article-body h3 { font-size: 1.15rem; color: var(--gold-lt); }
.article-body h4 {
  font-size: .9rem;
  font-family: var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
}

.article-body p {
  font-size: 1.05rem;
  color: rgba(245,243,239,.85);
  line-height: 1.8;
}

.article-body a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(201,169,110,.4);
  transition: color .2s, text-decoration-color .2s;
}
.article-body a:hover {
  color: var(--gold-lt);
  text-decoration-color: rgba(201,169,110,.9);
}

.article-body ul,
.article-body ol {
  padding-left: 1.6rem;
  color: rgba(245,243,239,.82);
  font-size: 1.02rem;
}
.article-body li + li { margin-top: .4rem; }

.article-body blockquote {
  border-left: 2px solid var(--gold);
  margin-left: 0;
  padding: .6rem 0 .6rem 1.6rem;
  color: rgba(245,243,239,.65);
  font-style: italic;
}

.article-body code {
  font-family: 'Courier New', monospace;
  font-size: .88em;
  background: rgba(201,169,110,.08);
  color: var(--gold-lt);
  padding: .15em .45em;
  border-radius: 3px;
}

.article-body pre {
  background: var(--surface2);
  border: 1px solid rgba(201,169,110,.12);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-x: auto;
  margin-top: 1.5rem;
}
.article-body pre code {
  background: none;
  padding: 0;
  color: rgba(245,243,239,.85);
  font-size: .85rem;
  line-height: 1.65;
}

.article-body hr {
  border: none;
  border-top: 1px solid rgba(201,169,110,.18);
  margin: 3rem 0;
}

.article-body img {
  max-width: 100%;
  border-radius: var(--radius);
  display: block;
  margin-inline: auto;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: .85rem;
}
.article-body th {
  text-align: left;
  padding: .6rem 1rem;
  border-bottom: 1px solid rgba(201,169,110,.3);
  color: var(--gold);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .7rem;
}
.article-body td {
  padding: .6rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: rgba(245,243,239,.75);
}

/* ── Footer ─────────────────────────────────────────────────── */
#footer {
  padding: 1.8rem 0;
  border-top: 1px solid rgba(201,169,110,.12);
  background: var(--bg);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-logo {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
}
.footer-copy {
  font-family: var(--sans);
  font-size: .68rem;
  color: var(--muted);
}
.footer-back {
  font-family: var(--sans);
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .06em;
  transition: color .2s;
}
.footer-back:hover { color: var(--gold); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  .article-card {
    grid-template-columns: 2.2rem 1fr 1.5rem;
    gap: 1rem;
    padding: 1.6rem 1.2rem;
  }
  .card-body h2 { font-size: 1.1rem; }
  .article-body pre { padding: 1rem; }
}
@media (max-width: 480px) {
  .article-card { grid-template-columns: 1fr; gap: .5rem; }
  .card-index, .card-arrow { display: none; }
}
