/* ---------- tokens ---------- */
:root {
  --parchment: #F3ECDF;
  --sapwood: #E7DCC6;
  --bark: #241B16;
  --bark-soft: #362920;
  --heartwood: #7B3F30;
  --heartwood-deep: #5A2E22;
  --ink: #2A211C;
  --ink-soft: #5c5049;
  --gold: #B8862E;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Work Sans", -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0;
  color: var(--ink);
}

/* ---------- site header ---------- */
.site-header {
  background: var(--bark);
  padding: 1.4rem 2.5rem;
}

.site-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--parchment);
  text-decoration: none;
  letter-spacing: 0.01em;
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: var(--bark);
  color: var(--parchment);
  min-height: 92vh;
}

.hero-media {
  position: relative;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.03);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 60%, var(--bark) 100%);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 4.5rem;
  gap: 1.5rem;
}

.kicker {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--gold);
  margin: 0;
  letter-spacing: 0.02em;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1.12;
  color: var(--parchment);
}

.hero-copy .lede {
  font-size: 1.08rem;
  line-height: 1.65;
  color: #D8CFC2;
  max-width: 42ch;
  margin: 0;
}

.cta {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  color: var(--parchment);
  border-bottom: 1px solid var(--gold);
  width: fit-content;
  padding-bottom: 3px;
  transition: opacity 0.2s ease;
}
.cta:hover { opacity: 0.7; }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--heartwood-deep);
  color: var(--parchment);
}

.stat {
  padding: 2.4rem 1.5rem;
  text-align: center;
  border-left: 1px solid rgba(255,255,255,0.12);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.stat:first-child { border-left: none; }

.stat-num {
  font-family: var(--serif);
  font-size: 1.7rem;
  color: #F0DFC3;
}

.stat-label {
  font-size: 0.85rem;
  color: #CBB6A8;
}

/* ---------- section shared ---------- */
.section-head {
  max-width: 62ch;
  margin: 0 auto 2.5rem;
  text-align: left;
}

.section-head h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  margin-bottom: 0.9rem;
}

.section-head p {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- rings ---------- */
.rings-section {
  padding: 6rem 2rem 5rem;
  max-width: 1180px;
  margin: 0 auto;
}

.rings-wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}

.rings-canvas {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ringSvg {
  width: 100%;
  height: auto;
  max-width: 560px;
  cursor: crosshair;
}

.ring-readout {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  background: rgba(243, 236, 223, 0.88);
  border-radius: 50%;
  width: 128px;
  height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.readout-year {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--heartwood-deep);
  line-height: 1;
}

.readout-sub {
  font-size: 0.72rem;
  color: var(--ink-soft);
  max-width: 90px;
  line-height: 1.25;
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid rgba(42,33,28,0.15);
}

.event-row {
  display: grid;
  grid-template-columns: 4px 4.5rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(42,33,28,0.15);
  cursor: pointer;
  transition: background 0.15s ease;
}
.event-row:hover, .event-row.active {
  background: rgba(123,63,48,0.06);
}

.event-swatch {
  width: 4px;
  height: 100%;
  min-height: 2.2rem;
  border-radius: 2px;
}

.event-year {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  padding-top: 1px;
}

.event-body h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  margin: 0 0 0.25rem;
}

.event-body p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.event-row.active .event-body p {
  max-height: 6rem;
}

/* ---------- year lookup ---------- */
.year-highlight-marker {
  position: absolute;
  border-radius: 50%;
  border: 3.5px dashed #FFFDF6;
  box-shadow: 0 0 0 7px rgba(36,27,22,0.45);
  pointer-events: none;
  z-index: 5;
  animation: pulseMarker 1.3s ease-in-out infinite;
}

@keyframes pulseMarker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.year-lookup {
  margin-top: 3rem;
  padding: 2.4rem 2.6rem;
  background: var(--sapwood);
  border-radius: 6px;
  border: 1px solid rgba(42,33,28,0.1);
}

.year-lookup h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

.year-lookup > p {
  margin: 0 0 1.4rem;
  max-width: 56ch;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.year-lookup-form {
  display: flex;
  gap: 0.75rem;
  max-width: 320px;
}

.year-lookup-form input {
  flex: 1;
  font-family: var(--sans);
  font-size: 1.02rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(42,33,28,0.25);
  border-radius: 4px;
  background: var(--parchment);
  color: var(--ink);
}

.year-lookup-form input:focus {
  outline: 2px solid var(--heartwood);
  outline-offset: 1px;
}

.year-lookup-form button {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.98rem;
  padding: 0.65rem 1.3rem;
  background: var(--heartwood-deep);
  color: var(--parchment);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.year-lookup-form button:hover {
  background: var(--heartwood);
}

.year-lookup-error {
  margin: 1.1rem 0 0;
  font-size: 0.92rem;
  font-style: italic;
  color: var(--heartwood-deep);
  max-width: 56ch;
}

.year-lookup-result {
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(42,33,28,0.15);
  max-width: 56ch;
}

.ylr-year {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--heartwood-deep);
  margin: 0 0 0.2rem;
}

.ylr-location {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-soft);
  margin: -0.4rem 0 0.9rem;
}

.year-lookup-result h4 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.08rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.year-lookup-result p {
  margin: 0 0 0.8rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.year-lookup-result a {
  font-size: 0.85rem;
  color: var(--heartwood-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
}

.year-lookup-result a:hover { opacity: 0.75; }

/* ---------- method ---------- */
.method {
  background: var(--sapwood);
  padding: 5.5rem 2rem 6rem;
}

.method .section-head { margin-bottom: 2.5rem; }

.method-img {
  max-width: 920px;
  margin: 0 auto;
  border-radius: 4px;
  box-shadow: 0 12px 30px rgba(36, 27, 22, 0.18);
}

.method-caveat {
  max-width: 62ch;
  margin: 1.5rem auto 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- footer ---------- */
.closing {
  background: var(--bark);
  color: #C9BEB2;
  padding: 4.5rem 2rem;
  text-align: center;
}

.closing p {
  max-width: 48ch;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.55;
  color: #E4D9C9;
}

.closing-signoff {
  margin-top: 2rem !important;
  font-size: 0.95rem !important;
  color: var(--gold) !important;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-media { height: 46vh; }
  .hero-media::after { background: linear-gradient(0deg, var(--bark) 5%, transparent 40%); }
  .hero-copy { padding: 2.6rem 1.6rem 3rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(2), .stat:nth-child(4) { border-left: 1px solid rgba(255,255,255,0.12); }
  .stat:nth-child(3), .stat:nth-child(4) { border-top: 1px solid rgba(255,255,255,0.12); }
  .rings-wrap { grid-template-columns: 1fr; }
  .rings-section { padding: 4rem 1.3rem; }
  .year-lookup { padding: 1.8rem 1.5rem; margin-top: 2.4rem; }
  .year-lookup-form { max-width: none; }
  .method { padding: 4rem 1.3rem; }
}
