/* Antikythera Cosmos landing page. Lamp-black and bronze, inscription capitals over a book face;
   verdigris is kept for the real sky alone, as in the exhibit. */
:root {
  --ink: #14100c;
  --ink-2: #1d1712;
  --ink-3: #2a2119;
  --bronze: #c9975b;
  --bronze-hi: #e4ba80;
  --vellum: #ece1cb;
  --ash: #a8987f;
  --verdigris: #7fb09d;
  --rule: rgba(201, 151, 91, 0.24);
  --gutter: clamp(16px, 4vw, 56px);
  --measure: 36rem;
  --display: "Forum", "Trajan Pro", Georgia, serif;
  --text: "Newsreader", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { background: var(--ink); color-scheme: dark; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--vellum);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: var(--bronze-hi); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--vellum); }
:focus-visible { outline: 2px solid var(--bronze-hi); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); color: var(--vellum); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--ink); padding: 0.5em 0.8em; }

/* ---- top line: two words and a door, over the hero ---- */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 20px var(--gutter);
}
.mark { font-family: var(--display); font-size: 1.25rem; color: var(--vellum); text-decoration: none; letter-spacing: 0.06em; }
.top-go { font-size: 1rem; color: var(--bronze-hi); }

/* ---- hero ---- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(20, 16, 12, 0.94) 0%, rgba(20, 16, 12, 0.72) 32%, rgba(20, 16, 12, 0) 62%),
    linear-gradient(0deg, rgba(20, 16, 12, 0.9) 0%, rgba(20, 16, 12, 0) 38%);
}
.hero-text { padding: 0 var(--gutter) clamp(40px, 9vh, 96px); max-width: 44rem; }
.status { display: inline-flex; align-items: center; gap: 0.6em; font-size: 0.95rem; color: var(--ash); margin-bottom: 1.2rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--verdigris); box-shadow: 0 0 0 3px rgba(127, 176, 157, 0.18); }
h1 { font-size: clamp(3.1rem, 8.4vw, 7.2rem); color: var(--vellum); margin-bottom: 1.4rem; }
.lede { font-size: clamp(1.15rem, 1.6vw, 1.35rem); max-width: 34rem; color: #e3d6bd; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.8rem; }
.btn {
  display: inline-block; padding: 0.72em 1.35em; font-family: var(--text); font-size: 1.05rem; font-weight: 500;
  text-decoration: none; border-radius: 2px; transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-solid { background: var(--bronze); color: #1b130b; }
.btn-solid:hover { background: var(--bronze-hi); color: #1b130b; }
.btn-line { border: 1px solid var(--rule); color: var(--vellum); }
.btn-line:hover { border-color: var(--bronze); color: var(--vellum); }

/* ---- one crank, one year: a stage that turns the year by itself, or by the crank slider ---- */
.year { padding: clamp(56px, 10vh, 120px) var(--gutter); border-top: 1px solid var(--rule); }
.year-intro { max-width: var(--measure); margin: 0 auto 36px; }
.year-intro h2 { margin-bottom: 0.6em; }
.key { color: var(--ash); font-size: 1rem; }
.year-stage { position: relative; max-width: 1200px; margin: 0 auto; aspect-ratio: 16 / 9; overflow: hidden; background: #0f0c09; border-radius: 2px; }
.year-canvas, .year-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.year-fallback { object-fit: cover; }
.js .year-fallback { display: none; }
.year-hud {
  position: absolute; left: 20px; bottom: 20px;
  display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center;
  padding: 14px 20px 12px 14px; background: rgba(20, 16, 12, 0.8); border-left: 2px solid var(--bronze);
}
.wheel { width: 56px; height: 56px; grid-row: span 3; transform: rotate(-90deg); }
.wheel-track { fill: none; stroke: var(--rule); stroke-width: 6; }
.wheel-turn { fill: none; stroke: var(--bronze); stroke-width: 6; stroke-dasharray: 1; stroke-dashoffset: 1; }
.year-date { font-family: var(--display); font-size: clamp(1.5rem, 2.8vw, 2.2rem); line-height: 1; margin: 0; font-variant-numeric: lining-nums; }
.year-sub { margin: 0.3em 0 0; color: var(--ash); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.year-note {
  position: absolute; right: 20px; bottom: 20px; max-width: 24rem;
  padding: 14px 18px; background: rgba(20, 16, 12, 0.88); border-left: 2px solid var(--verdigris);
  font-size: 0.98rem; line-height: 1.5; opacity: 0; transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s;
}
.year-note.on { opacity: 1; transform: none; }
.year-note b { font-weight: 600; color: var(--vellum); }
.year-note .glyph { font-family: var(--display); font-size: 1.2em; color: var(--bronze-hi); }
.year-note .sky { color: var(--verdigris); }
.year-note.quiet { color: var(--ash); border-left-color: var(--rule); }
.year-note p { margin: 0 0 0.4em; }
.year-note p:last-child { margin: 0; }
.year-controls { max-width: 1200px; margin: 16px auto 0; display: flex; align-items: center; gap: 16px; }
.year-play {
  font-family: var(--text); font-size: 1rem; font-weight: 500; min-width: 6.5em; padding: 0.5em 1em;
  background: transparent; color: var(--vellum); border: 1px solid var(--rule); border-radius: 2px; cursor: pointer;
}
.year-play:hover { border-color: var(--bronze); }
.year-label { color: var(--ash); font-size: 1rem; }
.year-slider { flex: 1; accent-color: var(--bronze); height: 28px; cursor: grab; }

/* ---- rooms: a clip and a wall label ---- */
.room {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 80px);
  align-items: center; padding: clamp(48px, 8vh, 96px) var(--gutter); max-width: 1440px; margin: 0 auto;
}
.room-flip .room-media { order: 2; }
.room-media { margin: 0; }
.room-media video, .proof-media video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0f0c09; border-radius: 2px; }
figcaption { margin-top: 0.8em; font-size: 0.95rem; font-style: italic; color: var(--ash); }
.room-text { max-width: 32rem; }
.room-text h2 { margin-bottom: 0.55em; }

.ledger { width: 100%; border-collapse: collapse; margin-top: 1.4rem; font-size: 0.98rem; font-variant-numeric: tabular-nums lining-nums; }
.ledger caption { text-align: left; color: var(--ash); font-style: italic; margin-bottom: 0.5em; }
.ledger th, .ledger td { text-align: left; padding: 0.45em 0.6em 0.45em 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.ledger thead th { font-weight: 500; color: var(--ash); font-size: 0.9rem; }
.ledger tbody th { font-weight: 500; }
.ledger td:nth-child(2), .ledger td:nth-child(3) { font-family: var(--display); font-size: 1.2rem; color: var(--bronze-hi); }
.ledger td:last-child { color: var(--ash); font-size: 0.92rem; }

/* ---- the proof: a lighter room, the numbers carved large ---- */
.proof { background: var(--ink-2); padding: clamp(80px, 14vh, 160px) var(--gutter); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.proof-head { max-width: var(--measure); margin: 0 auto 48px; }
.proof-head h2 { margin-bottom: 0.55em; }
.proof-media { max-width: 1100px; margin: 0 auto; }
.proof-figures { max-width: 1100px; margin: 56px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 4vw, 56px); }
.proof-figures div { border-top: 1px solid var(--rule); padding-top: 18px; }
.proof-figures dt { font-family: var(--display); font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1; color: var(--bronze-hi); font-variant-numeric: lining-nums; }
.proof-figures dd { margin: 0.6em 0 0; color: #d8cbb2; font-size: 1rem; }
.proof-foot { max-width: var(--measure); margin: 48px auto 0; color: var(--ash); font-size: 1rem; }

/* ---- where this copy departs: a plain list, set like the catalogue's notes ---- */
.departs { max-width: var(--measure); margin: 0 auto; padding: clamp(72px, 12vh, 140px) var(--gutter) 0; }
.departs h2 { margin-bottom: 0.6em; }
.departs ul { padding-left: 1.1em; margin: 0; color: #d8cbb2; }
.departs li { margin-bottom: 0.9em; }
.departs b { color: var(--vellum); font-weight: 600; }

/* ---- the two editions ---- */
.editions { padding: clamp(80px, 14vh, 160px) var(--gutter); max-width: 1440px; margin: 0 auto; }
.editions h2 { max-width: var(--measure); margin: 0 auto 40px; }
.editions-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.5vw, 32px); }
.editions-pair figure { margin: 0; }
.editions-pair a { display: block; }
.editions-pair a:hover img { border-color: var(--bronze); }
.editions-pair img { width: 100%; height: auto; border-radius: 2px; border: 1px solid var(--rule); }
.editions > p { max-width: var(--measure); margin: 36px auto 0; }

/* ---- how it was made: a sequence, numbered the Greek way ---- */
.made { max-width: var(--measure); margin: 0 auto; padding: clamp(40px, 8vh, 96px) var(--gutter) clamp(72px, 12vh, 140px); }
.made h2 { margin-bottom: 1em; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.6rem 3.4rem; }
.steps li::before {
  content: counter(step, lower-greek); position: absolute; left: 0; top: -0.1em;
  font-family: var(--display); font-size: 1.9rem; color: var(--bronze); line-height: 1;
}
.steps h3 { margin-bottom: 0.3em; color: var(--vellum); }
.steps p { margin: 0; color: #d8cbb2; }
.made-credit { margin-top: 1rem; color: var(--ash); font-size: 1rem; }

/* ---- sources ---- */
.sources { max-width: 60rem; margin: 0 auto; padding: 0 var(--gutter) clamp(72px, 12vh, 140px); font-size: 0.98rem; }
.sources h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 1em; }
.refs { padding-left: 1.2em; margin: 0 0 2rem; color: #d8cbb2; }
.refs li { margin-bottom: 0.7em; }
.refs cite { font-style: italic; }
.credits { width: 100%; border-collapse: collapse; }
.credits caption { text-align: left; color: var(--ash); font-style: italic; margin-bottom: 0.5em; }
.credits th, .credits td { text-align: left; padding: 0.45em 0.8em 0.45em 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.credits th { font-weight: 500; color: var(--ash); font-size: 0.9rem; }

/* ---- the last word ---- */
.last { text-align: center; padding: clamp(72px, 14vh, 160px) var(--gutter); border-top: 1px solid var(--rule); }
.last-line { font-family: var(--display); font-size: clamp(1.9rem, 4.4vw, 3.4rem); line-height: 1.15; margin: 0 auto 0.4em; max-width: 22ch; }
.last .actions { justify-content: center; }
.foot { padding: 28px var(--gutter) 40px; color: var(--ash); font-size: 0.9rem; border-top: 1px solid var(--rule); }
.foot p { max-width: 60rem; margin: 0; }

/* on a wide screen the machine stands to the right of the title wall, not behind it */
@media (min-width: 861px) {
  .hero-video { left: 30%; width: 70%; object-position: 50% 50%; }
  .hero::after {
    background:
      linear-gradient(90deg, var(--ink) 0%, var(--ink) 30%, rgba(20, 16, 12, 0.55) 40%, rgba(20, 16, 12, 0) 56%),
      linear-gradient(0deg, rgba(20, 16, 12, 0.85) 0%, rgba(20, 16, 12, 0) 30%);
  }
}

@media (max-width: 860px) {
  .room { grid-template-columns: 1fr; }
  .room-flip .room-media { order: 0; }
  .proof-figures { grid-template-columns: 1fr; gap: 28px; }
  .editions-pair { grid-template-columns: 1fr; }
  .hero::after { background: linear-gradient(0deg, rgba(20, 16, 12, 0.97) 0%, rgba(20, 16, 12, 0.88) 50%, rgba(20, 16, 12, 0.15) 82%); }
  .hero-video { object-position: 50% 30%; }
  .year-stage { aspect-ratio: auto; overflow: visible; background: none; }
  .year-canvas, .year-fallback { position: relative; aspect-ratio: 16 / 9; height: auto; }
  .year-hud { position: static; margin-top: 12px; padding: 12px 14px; column-gap: 12px; }
  .wheel { width: 44px; height: 44px; }
  .year-note { position: static; max-width: none; margin-top: 12px; font-size: 0.95rem; min-height: 7.5em; transform: none; }
}
@media (max-width: 520px) {
  body { font-size: 1.06rem; }
  .ledger td:last-child { display: none; }
  .ledger thead th:last-child { display: none; }
  .credits td:nth-child(3), .credits th:nth-child(3) { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .year-note { transition: none; }
  .btn { transition: none; }
}
