:root {
  --ink: #1d2823;
  --muted: #5d6963;
  --forest: #24342d;
  --forest-2: #34483e;
  --cream: #f4efe5;
  --paper: #fffdf8;
  --sand: #d9c7a6;
  --rust: #8a3d2f;
  --line: rgba(29, 40, 35, 0.14);
  --shadow: 0 24px 60px rgba(29, 40, 35, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --content: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 5%, rgba(217, 199, 166, .28), transparent 30rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  padding: .8rem 1rem;
  color: var(--paper);
  background: var(--forest);
  border-radius: 999px;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.site-header.is-scrolled {
  background: rgba(244, 239, 229, .9);
  backdrop-filter: blur(16px);
  border-color: var(--line);
  box-shadow: 0 8px 24px rgba(29, 40, 35, .05);
}
.nav-shell {
  width: min(calc(100% - 2rem), var(--content));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--forest);
  color: var(--cream);
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1.35rem;
}
.nav-links { display: flex; align-items: center; gap: .3rem; }
.nav-links a {
  text-decoration: none;
  padding: .65rem .9rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 650;
  font-size: .95rem;
}
.nav-links a:hover, .nav-links a:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, .62);
  outline: none;
}

main { overflow: clip; }
.hero {
  min-height: min(820px, calc(100vh - 76px));
  display: grid;
  align-items: center;
  padding: clamp(4rem, 9vw, 8rem) 0 5rem;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  width: min(42vw, 560px);
  aspect-ratio: 1;
  border: 1px solid rgba(36, 52, 45, .14);
  border-radius: 50%;
  right: -14vw;
  top: 4rem;
  box-shadow: 0 0 0 55px rgba(255,255,255,.15), 0 0 0 110px rgba(255,255,255,.08);
  pointer-events: none;
}
.hero-grid {
  width: min(calc(100% - 2rem), var(--content));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: clamp(2.4rem, 6vw, 6rem);
  align-items: center;
  position: relative;
  z-index: 1;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin: 0 0 1.2rem;
  color: var(--rust);
  text-transform: uppercase;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .18em;
}
.eyebrow::before { content: ""; width: 34px; height: 2px; background: currentColor; }
h1, h2, h3 { line-height: 1.08; margin-top: 0; }
h1 {
  margin-bottom: 1.5rem;
  max-width: 820px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 7.6vw, 7rem);
  font-weight: 500;
  letter-spacing: -.055em;
}
h1 em { color: var(--rust); font-weight: 500; }
.hero-intro {
  max-width: 680px;
  font-size: clamp(1.05rem, 1.7vw, 1.27rem);
  color: var(--muted);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.btn {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .78rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
  font: inherit;
}
.btn-primary { color: var(--paper); background: var(--forest); }
.btn-primary:hover { background: var(--forest-2); transform: translateY(-1px); }
.btn-secondary { border-color: var(--line); background: rgba(255,255,255,.48); }
.btn-secondary:hover { background: var(--paper); }

.hero-art {
  position: relative;
  min-height: 480px;
}
.photo-frame {
  position: absolute;
  inset: 1.8rem 0 0 2.4rem;
  border-radius: 44% 44% 18px 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #d7d4ce;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.08); }
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20,30,25,.24), transparent 48%);
}
.year-chip {
  position: absolute;
  left: 0;
  bottom: 2.3rem;
  z-index: 2;
  width: 148px;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  color: var(--cream);
  background: var(--rust);
  box-shadow: 0 18px 44px rgba(138, 61, 47, .25);
}
.year-chip strong { display: block; font-family: Georgia, serif; font-size: 2.35rem; line-height: 1; }
.year-chip span { display: block; margin-top: .35rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; }
.handwritten {
  position: absolute;
  right: -1.2rem;
  top: 0;
  width: 240px;
  padding: 1rem 1.2rem;
  transform: rotate(3deg);
  background: var(--paper);
  box-shadow: 0 14px 36px rgba(29,40,35,.12);
  border: 1px solid rgba(29,40,35,.08);
}
.handwritten img { width: 100%; height: auto; }

.section { padding: clamp(5rem, 9vw, 9rem) 0; }
.section-shell { width: min(calc(100% - 2rem), var(--content)); margin: 0 auto; }
.section-heading { max-width: 760px; margin-bottom: 3rem; }
.section-heading h2 {
  margin-bottom: 1rem;
  font-family: Georgia, serif;
  font-size: clamp(2.35rem, 5vw, 4.4rem);
  font-weight: 500;
  letter-spacing: -.04em;
}
.section-heading p { color: var(--muted); font-size: 1.08rem; }

.origin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.fact-card {
  min-height: 230px;
  padding: 1.7rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,253,248,.68);
}
.fact-card:nth-child(2) { background: var(--forest); color: var(--cream); }
.fact-card:nth-child(2) p { color: rgba(244,239,229,.73); }
.fact-number { font-family: Georgia, serif; font-size: 3.1rem; line-height: 1; color: var(--rust); }
.fact-card:nth-child(2) .fact-number { color: var(--sand); }
.fact-card h3 { margin: 1.3rem 0 .55rem; font-size: 1.25rem; }
.fact-card p { margin: 0; color: var(--muted); }

.history-section { background: var(--forest); color: var(--cream); }
.history-grid {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: center;
}
.history-copy p { color: rgba(244,239,229,.76); font-size: 1.08rem; }
.history-copy blockquote {
  margin: 2rem 0;
  padding: 1.3rem 0 1.3rem 1.5rem;
  border-left: 3px solid var(--sand);
  font-family: Georgia, serif;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.35;
}
.history-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #d8d5cf;
  box-shadow: 0 32px 80px rgba(0,0,0,.28);
}
.history-image button { all: unset; cursor: zoom-in; display: block; width: 100%; }
.history-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.image-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  font-size: .9rem;
  color: rgba(244,239,229,.72);
  background: rgba(0,0,0,.16);
}
.image-meta a { color: var(--cream); text-underline-offset: 4px; }

.etymology-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.word-card {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  padding: clamp(1.7rem, 4vw, 3rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--paper);
}
.word-card::after {
  content: attr(data-letter);
  position: absolute;
  right: -1rem;
  bottom: -4.2rem;
  color: rgba(36,52,45,.05);
  font-family: Georgia, serif;
  font-size: 18rem;
  line-height: 1;
}
.word-part { color: var(--rust); font-family: Georgia, serif; font-size: clamp(3rem, 7vw, 6rem); }
.word-card p { max-width: 470px; color: var(--muted); font-size: 1.1rem; position: relative; z-index: 1; }

.conclusion-card {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.5rem);
  border-radius: var(--radius-lg);
  background: var(--sand);
}
.conclusion-card::after {
  content: "";
  position: absolute;
  width: 320px;
  aspect-ratio: 1;
  right: -80px;
  top: -100px;
  border: 1px solid rgba(29,40,35,.18);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255,255,255,.13), 0 0 0 84px rgba(255,255,255,.08);
}
.conclusion-card h2 { max-width: 850px; margin-bottom: 1.2rem; font-family: Georgia, serif; font-size: clamp(2.2rem, 5vw, 4.3rem); font-weight: 500; letter-spacing: -.04em; }
.conclusion-card p { max-width: 760px; margin-bottom: 0; font-size: 1.1rem; }

.site-footer { padding: 2rem 0 3rem; }
.footer-shell {
  width: min(calc(100% - 2rem), var(--content));
  margin: 0 auto;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a { text-underline-offset: 4px; }

.subpage-main { min-height: calc(100vh - 160px); padding: 5rem 0 7rem; }
.subpage-shell { width: min(calc(100% - 2rem), 900px); margin: 0 auto; }
.subpage-shell h1 { font-size: clamp(2.7rem, 7vw, 5.2rem); }
.lead { color: var(--muted); font-size: 1.18rem; max-width: 760px; }
.info-panel {
  margin-top: 2.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.info-panel h2 { font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.map-image { margin-top: 2rem; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); }
.code-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.2rem;
  padding: .9rem 1rem;
  border-radius: 12px;
  background: #f1ede4;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}
.copy-button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: .6rem .85rem;
  color: var(--paper);
  background: var(--forest);
  cursor: pointer;
}
.license-list { padding-left: 1.2rem; }
.license-list li { margin: .7rem 0; }
.external-note { color: var(--muted); font-size: .92rem; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(10,15,12,.88);
}
.lightbox.is-open { display: grid; }
.lightbox-dialog { position: relative; width: min(94vw, 1100px); }
.lightbox img { width: 100%; max-height: 84vh; object-fit: contain; border-radius: 12px; background: #fff; }
.lightbox-close {
  position: absolute;
  right: .6rem;
  top: .6rem;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  font-size: 1.4rem;
  cursor: pointer;
}

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .hero-grid, .history-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-art { min-height: 470px; max-width: 650px; width: 100%; margin: 0 auto; }
  .origin-grid { grid-template-columns: 1fr 1fr; }
  .origin-grid .fact-card:last-child { grid-column: 1 / -1; }
  .nav-links a:not(:last-child) { display: none; }
}
@media (max-width: 640px) {
  .nav-shell { min-height: 68px; }
  .brand span:last-child { display: none; }
  .hero { padding-top: 3rem; }
  h1 { font-size: clamp(3rem, 16vw, 4.5rem); }
  .hero-art { min-height: 390px; }
  .photo-frame { inset: 1.5rem 0 0 1.2rem; }
  .handwritten { width: 180px; right: -.4rem; }
  .year-chip { width: 116px; bottom: 1rem; }
  .year-chip strong { font-size: 1.85rem; }
  .origin-grid, .etymology-grid { grid-template-columns: 1fr; }
  .origin-grid .fact-card:last-child { grid-column: auto; }
  .image-meta, .footer-shell { flex-direction: column; }
  .code-line { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
