/* Project Epoch site — shared chrome and the landing page.
   Palette: midnight navy, royal blue, burnt parchment, antique gold. */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --navy: #0b1422;
  --blue: #214995;
  --paper: #e9ce98;
  --ink: #1b1a18;
  --gold: #d6ab57;
  --muted: #bcae96;
  --cream: #f4e8cb;
  --display: Cinzel, 'Times New Roman', Georgia, serif;
  --body: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --header-height: 72px;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--navy); color: var(--cream); font-family: var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }
.wordmark, h1, h2, h3, .section-kicker, .atlas-label, footer { font-family: var(--display); }

/* Accessibility helpers */
.skip-link { position: fixed; left: 18px; top: -60px; z-index: 20; background: var(--blue); color: #f8e6b8; padding: 12px 16px; font: 12px var(--display); letter-spacing: .08em; transition: top .2s; }
.skip-link:focus { top: 18px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid #f4dc9a; outline-offset: 4px; }

/* Header */
.site-header { height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 clamp(22px, 6vw, 96px); border-bottom: 1px solid rgba(214, 171, 87, .5); background: rgba(7, 14, 25, .94); position: sticky; top: 0; z-index: 5; transition: background-color .3s, box-shadow .3s; }
.site-header.is-scrolled { background: rgba(7, 14, 25, .8); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 10px 34px rgba(0, 0, 0, .35); }
.wordmark { font-size: 20px; letter-spacing: .2em; color: var(--gold); white-space: nowrap; }
nav { display: flex; gap: 32px; align-items: center; font-family: var(--display); font-size: 12px; letter-spacing: .12em; color: #d7ccb6; }
nav a { white-space: nowrap; position: relative; padding-bottom: 3px; transition: color .25s; }
nav a:not(.nav-cta)::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out); }
nav a:hover, nav a.is-current { color: var(--gold); }
nav a:not(.nav-cta):hover::after, nav a.is-current::after { transform: scaleX(1); }
.nav-cta, .button { border: 1px solid var(--gold); padding: 15px 22px; color: #f6dfaa; background: rgba(20, 45, 91, .9); font-family: var(--display); font-size: 12px; letter-spacing: .1em; display: inline-flex; gap: 18px; align-items: center; transition: background-color .25s, color .25s, transform .25s; }
.nav-cta:hover, .button:hover { background: var(--gold); color: var(--ink); }
.button span { display: inline-block; transition: transform .3s var(--ease-out); }
.button:hover span { transform: translateX(5px); }

/* Hero */
.hero { min-height: calc(100vh - var(--header-height)); min-height: calc(100svh - var(--header-height)); position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; padding: 9vw; background-color: var(--navy); }
.hero-bg { position: absolute; inset: 0; z-index: 0; will-change: transform; }
.hero-bg-img { position: absolute; inset: 0; background: url('assets/epoch-hero-bg.png') center top / cover no-repeat; transform: scale(1.06); animation: kenburns 42s ease-in-out infinite alternate; }
@keyframes kenburns {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to { transform: scale(1.15) translate3d(-1.6%, -1.2%, 0); }
}
.hero::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(7, 14, 25, .92), rgba(7, 14, 25, .55) 42%, rgba(7, 14, 25, .08)); }
.hero-dust { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; }
.hero-copy { position: relative; z-index: 2; max-width: 610px; }
.hero h1 { font-size: clamp(48px, 7vw, 94px); line-height: 1.02; font-weight: 500; margin: 0 0 26px; color: #f5dfac; }
.hero h1 .rise { display: inline-block; }
.hero h1 em, h2 em { font-family: var(--body); font-style: italic; color: #fff0c8; }
.hero p { max-width: 510px; line-height: 1.85; color: #d7c9ad; font-size: 16px; margin: 0 0 34px; }
.hero-note { position: absolute; z-index: 2; bottom: 34px; left: 9vw; color: var(--gold); font: 11px var(--display); letter-spacing: .22em; }
.scroll-cue { position: absolute; z-index: 2; right: 9vw; bottom: 30px; width: 26px; height: 42px; border: 1px solid rgba(214, 171, 87, .7); border-radius: 13px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 9px; margin-left: -1.5px; border-radius: 2px; background: var(--gold); animation: cue 1.9s ease-in-out infinite; }
@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(14px); opacity: .15; }
}
.rise { opacity: 0; transform: translateY(18px); animation: rise .9s var(--ease-out) forwards; animation-delay: calc(.15s + var(--i, 0) * .13s); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s var(--ease-out); }
[data-reveal].is-visible { opacity: 1; transform: none; }
.steps[data-reveal] li, .tour-thumbs[data-reveal] .thumb { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s var(--ease-out); }
.steps.is-visible li, .tour-thumbs.is-visible .thumb { opacity: 1; transform: none; }
.steps.is-visible li:nth-child(2), .tour-thumbs.is-visible .thumb:nth-child(2) { transition-delay: .08s; }
.steps.is-visible li:nth-child(3), .tour-thumbs.is-visible .thumb:nth-child(3) { transition-delay: .16s; }
.steps.is-visible li:nth-child(4), .tour-thumbs.is-visible .thumb:nth-child(4) { transition-delay: .24s; }
.steps.is-visible li:nth-child(5), .tour-thumbs.is-visible .thumb:nth-child(5) { transition-delay: .32s; }

/* Section frame shared by the walkthrough and the Atlas preview */
.section-grid { padding: 110px clamp(24px, 8vw, 130px); border-top: 1px solid rgba(214, 171, 87, .25); display: grid; grid-template-columns: 1fr 1.6fr; gap: 52px; background-color: var(--navy); background-image: radial-gradient(circle at 70% 20%, rgba(34, 74, 148, .22), transparent 40%); }
.section-kicker { font-size: 11px; letter-spacing: .2em; color: var(--gold); margin: 0 0 18px; }
.section-heading h2, .atlas-heading h2, .closing h2 { font-size: clamp(42px, 5vw, 72px); font-weight: 500; line-height: 1.08; margin: 0 0 22px; color: var(--paper); }
.section-heading > p, .atlas-heading > p:last-of-type { color: var(--muted); line-height: 1.8; max-width: 390px; }
.section-heading > .section-kicker { max-width: none; }
.tour-hint { font-size: 13px; color: #9a8f7c; }

/* Walkthrough tour */
.map-card { grid-column: 2; grid-row: 1 / span 2; align-self: start; margin: 0; border: 1px solid var(--gold); padding: 10px; background: #101f34; box-shadow: 0 14px 50px rgba(0, 0, 0, .35); }
.tour-frames { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0c1728; cursor: zoom-in; }
.tour-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: 0; transition: opacity .7s ease; }
.tour-frame.is-active { opacity: 1; }
.tour-expand { position: absolute; right: 10px; top: 10px; z-index: 2; width: 36px; height: 36px; border: 1px solid rgba(214, 171, 87, .75); background: rgba(7, 14, 25, .72); color: var(--gold); font-size: 18px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .25s, background-color .25s; }
.tour-frames:hover .tour-expand, .tour-expand:focus-visible { opacity: 1; }
.tour-expand:hover { background: var(--gold); color: var(--ink); }
.map-caption { padding: 16px 10px 8px; min-height: 66px; display: flex; gap: 30px; align-items: baseline; }
.map-caption strong { font-family: var(--display); color: var(--gold); font-size: 12px; letter-spacing: .12em; white-space: nowrap; }
.map-caption span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.tour-bar { height: 2px; margin: 4px 10px 0; background: rgba(214, 171, 87, .18); }
.tour-bar i { display: block; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.tour-bar i.is-running { animation: tourbar linear forwards; }
@keyframes tourbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.tour-toggle { margin: 8px 10px 0; padding: 6px 0; border: 0; background: transparent; color: var(--muted); font: 10px var(--display); letter-spacing: .14em; cursor: pointer; transition: color .25s; }
.tour-toggle:hover { color: var(--gold); }
.steps { grid-column: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step { width: 100%; text-align: left; background: transparent; border: 0; border-top: 1px solid rgba(214, 171, 87, .45); border-left: 2px solid transparent; padding: 16px 12px 14px; color: inherit; cursor: pointer; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; transition: background-color .3s, border-color .3s; }
.step:hover { background: rgba(33, 73, 149, .14); }
.step.is-active { background: rgba(33, 73, 149, .24); border-left-color: var(--gold); }
.step-index { font: 12px var(--display); color: var(--gold); letter-spacing: .12em; padding-top: 4px; }
.step-title { font: 600 19px var(--display); color: var(--paper); }
.step-copy { grid-column: 2; color: var(--muted); font-size: 13px; line-height: 1.7; margin-top: 6px; }
.tour-thumbs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 18px; }
.thumb { border: 0; padding: 10px 0 0; background: transparent; border-top: 1px solid rgba(214, 171, 87, .35); text-align: left; color: var(--gold); cursor: pointer; transition: border-color .3s; }
.thumb img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; filter: saturate(.65) brightness(.78); transition: filter .35s, transform .35s var(--ease-out); }
.thumb:hover img, .thumb.is-active img { filter: none; transform: translateY(-3px); }
.thumb.is-active { border-top-color: var(--gold); }
.thumb span { display: block; font: 11px var(--display); letter-spacing: .06em; margin-top: 10px; }

/* Lightbox */
.lightbox { border: 1px solid var(--gold); background: #0c1728; color: var(--cream); padding: 10px; width: min(92vw, 1300px); max-width: none; }
.lightbox::backdrop { background: rgba(5, 10, 18, .88); }
.lightbox img { display: block; width: 100%; height: auto; }
.lightbox p { margin: 12px 0 2px; font: 12px var(--display); color: var(--gold); letter-spacing: .1em; line-height: 1.6; }
.lightbox-close { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border: 1px solid var(--gold); background: rgba(7, 14, 25, .85); color: var(--gold); font-size: 20px; line-height: 1; cursor: pointer; }
.lightbox-close:hover { background: var(--gold); color: var(--ink); }

/* Living map: sticky frame scrubbed by scroll */
.living { position: relative; height: 240vh; background: #070e19; border-top: 1px solid rgba(214, 171, 87, .25); }
.living-sticky { position: sticky; top: var(--header-height); height: calc(100vh - var(--header-height)); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.living-frame { position: relative; width: min(100%, calc((100vh - var(--header-height)) * 16 / 9)); aspect-ratio: 16 / 9; background: #070e19; }
.living-frame canvas, .living-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.living-frame canvas[hidden], .living-frame img[hidden] { display: none; }
.living-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 120px clamp(24px, 6vw, 80px) 40px; background: linear-gradient(180deg, rgba(7, 14, 25, 0) 0%, rgba(7, 14, 25, .85) 70%); pointer-events: none; }
.living-caption h2 { font-size: clamp(34px, 4.2vw, 60px); font-weight: 500; line-height: 1.08; margin: 0 0 12px; color: var(--paper); }
.living-caption p:not(.section-kicker) { max-width: 560px; margin: 0; color: #d7c9ad; line-height: 1.7; font-size: 15px; }
.living-hint { position: absolute; right: clamp(24px, 6vw, 80px); bottom: 40px; font: 11px var(--display); letter-spacing: .18em; color: var(--gold); pointer-events: none; }

/* Motion loops captured in-engine */
.loops { grid-template-columns: 1fr; gap: 34px; padding-top: 90px; padding-bottom: 90px; }
.loops .section-heading { max-width: 640px; }
.loop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.loop-grid figure { margin: 0; border: 1px solid rgba(214, 171, 87, .55); background: #101f34; padding: 8px; box-shadow: 0 14px 40px rgba(0, 0, 0, .3); transition: transform .35s var(--ease-out), border-color .35s; }
.loop-grid figure:hover { transform: translateY(-4px); border-color: var(--gold); }
.loop-grid img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.loop-grid figcaption { padding: 14px 6px 6px; }
.loop-grid figcaption strong { display: block; font: 600 17px var(--display); color: var(--paper); margin-bottom: 6px; }
.loop-grid figcaption span { display: block; color: var(--muted); font-size: 13px; line-height: 1.6; }
.loop-grid figcaption small { display: block; margin-top: 10px; font: 10px var(--display); letter-spacing: .12em; color: var(--gold); }

/* Atlas preview */
.atlas { color: var(--ink); background-color: var(--paper); background-image: linear-gradient(120deg, rgba(233, 206, 152, .98), rgba(214, 183, 126, .94)); }
.atlas-heading h2 { color: var(--ink); }
.atlas-heading > p:last-of-type { color: #5f5039; }
.atlas-search { margin-top: 26px; max-width: 420px; }
.search { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #6e5528; padding: 8px 0; color: #6e5528; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font: 15px var(--body); color: var(--ink); }
.search input::placeholder { color: #8a7451; }
.topic-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 30px; }
.topic { border: 1px solid #9b7a3d; background: rgba(245, 221, 171, .86); padding: 13px 16px; font: 11px var(--display); letter-spacing: .1em; color: #554528; cursor: pointer; transition: background-color .25s, color .25s, transform .25s; }
.topic:hover { transform: translateY(-2px); }
.topic.active, .topic:hover { background: var(--blue); color: #f8e6b8; }
.atlas-page { background: rgba(246, 226, 181, .92); padding: 42px; align-self: center; min-height: 300px; box-shadow: 0 12px 30px rgba(60, 43, 22, .2); border: 1px solid #b88f48; }
.atlas-rule { width: 80px; border-top: 3px solid var(--gold); margin-bottom: 32px; }
.atlas-label { font-size: 11px; letter-spacing: .15em; color: #755c2d; }
.atlas-page h3 { font-size: 38px; font-weight: 500; margin: 20px 0 18px; color: var(--ink); }
.atlas-page p:not(.atlas-label) { line-height: 1.8; max-width: 460px; color: #65543a; }
.teasers { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; transition: opacity .26s ease, transform .26s ease; }
.teasers.is-swapping { opacity: 0; transform: translateY(6px); }
.teasers a { display: block; padding: 12px 14px; border: 1px solid rgba(155, 122, 61, .5); background: rgba(255, 246, 222, .45); transition: transform .25s var(--ease-out), background-color .25s, border-color .25s; }
.teasers a:hover { transform: translateX(5px); background: rgba(255, 246, 222, .9); border-color: var(--blue); }
.teaser-meta { display: block; font: 10px var(--display); letter-spacing: .12em; color: #8a6a35; }
.teaser-title { display: block; font: 500 18px var(--display); color: var(--ink); margin: 4px 0; line-height: 1.2; }
.teaser-copy { display: block; font-size: 13px; line-height: 1.6; color: #65543a; }
.text-link { display: inline-flex; gap: 14px; color: #193d7d; font: 12px var(--display); letter-spacing: .12em; margin-top: 24px; transition: color .25s; }
.text-link:hover { color: #8b631e; }

/* Closing and footer */
.closing { padding: 120px clamp(24px, 8vw, 130px); display: flex; justify-content: space-between; align-items: end; gap: 40px; background: linear-gradient(120deg, #101d30, #0b1422 40%, #142848 70%, #0b1422); background-size: 300% 300%; animation: sheen 22s ease-in-out infinite; }
@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.closing h2 { margin: 0; }
.closing .button { margin-bottom: 8px; flex-shrink: 0; }
footer { display: flex; justify-content: space-between; gap: 24px; padding: 28px clamp(24px, 8vw, 130px); font-size: 10px; letter-spacing: .15em; color: var(--muted); border-top: 1px solid rgba(214, 171, 87, .35); }

@media (max-width: 800px) {
  .site-header { position: static; height: auto; min-height: 56px; padding: 12px 20px; flex-wrap: wrap; gap: 8px 16px; }
  .site-header.is-scrolled { -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; background: rgba(7, 14, 25, .94); }
  .wordmark { font-size: 14px; letter-spacing: .14em; }
  nav { gap: 10px 14px; font-size: 10px; flex-wrap: wrap; max-width: 100%; }
  .nav-cta { display: none; }
  .hero { min-height: 720px; padding: 90px 24px 70px; }
  .hero-bg-img { background-position: 62% top; }
  .hero h1 { font-size: 50px; }
  .hero p { font-size: 14px; }
  .hero-note { left: 24px; font-size: 9px; }
  .scroll-cue { display: none; }
  .section-grid { padding: 76px 24px; display: flex; flex-direction: column; gap: 36px; }
  .section-heading, .atlas-heading { order: 0; }
  .map-card, .atlas-page { order: 1; }
  .steps { order: 2; }
  .tour-thumbs { order: 3; display: flex; overflow-x: auto; gap: 12px; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .thumb { flex: 0 0 46%; scroll-snap-align: start; }
  .map-caption { flex-direction: column; align-items: flex-start; gap: 8px; }
  .tour-expand { opacity: 1; }
  .lightbox { width: 96vw; }
  .living { height: 200vh; }
  .living-sticky { top: 0; height: 100vh; height: 100svh; align-items: flex-start; }
  .living-frame { width: 100%; }
  .living-caption { padding: 60px 20px 24px; }
  .living-hint { display: none; }
  .loop-grid { grid-template-columns: 1fr; }
  .atlas-page { padding: 30px; }
  .atlas-page h3 { font-size: 31px; }
  .closing { padding: 84px 24px; display: block; }
  .closing .button { margin-top: 32px; }
  footer { display: block; line-height: 2.1; padding: 26px 24px; }
  footer span { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .rise, [data-reveal], .steps[data-reveal] li, .tour-thumbs[data-reveal] .thumb { opacity: 1; transform: none; }
  .hero-bg-img { animation: none; transform: scale(1.06); }
  .scroll-cue span { animation: none; }
  .closing { animation: none; }
}

/* DEMO menu: the Era One demo downloads, from every page's header. */
.nav-demo { position: relative; }
.nav-demo-toggle { white-space: nowrap; border: 1px solid var(--gold); background: rgba(20, 45, 91, .9); color: #f6dfaa; padding: 9px 14px; font: inherit; letter-spacing: inherit; cursor: pointer; transition: background-color .25s, color .25s; }
.nav-demo-toggle span { font-size: .8em; margin-left: 4px; }
.nav-demo:hover .nav-demo-toggle, .nav-demo-toggle[aria-expanded="true"] { background: var(--gold); color: var(--ink); }
/* padding-top bridges the gap so the pointer can travel into the menu */
.nav-demo-menu { position: absolute; left: 0; top: 100%; padding-top: 8px; width: 272px; max-width: calc(100vw - 40px); display: none; z-index: 10; }
.nav-demo:hover .nav-demo-menu, .nav-demo:focus-within .nav-demo-menu, .nav-demo-toggle[aria-expanded="true"] + .nav-demo-menu { display: block; }
.nav-demo-menu::before { content: ''; position: absolute; inset: 8px 0 0; background: #0c1728; border: 1px solid var(--gold); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
nav .nav-demo-item { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 14px 16px; white-space: normal; border-bottom: 1px solid rgba(214, 171, 87, .25); }
nav .nav-demo-item::after { display: none; }
.nav-demo-item strong { font-weight: 600; letter-spacing: .14em; color: var(--gold); }
.nav-demo-item small { font: 12px/1.4 var(--body); letter-spacing: 0; color: var(--cream); text-transform: none; }
a.nav-demo-item:hover { background: rgba(33, 73, 149, .45); }
a.nav-demo-item:hover strong { color: #f6dfaa; }
.nav-demo-item.is-soon { cursor: default; }
.nav-demo-item.is-soon strong, .nav-demo-item.is-soon small { color: var(--muted); }
.nav-demo-note { position: relative; margin: 0; padding: 12px 16px 14px; font: italic 11px/1.5 var(--body); letter-spacing: 0; color: var(--muted); }
@media (max-width: 800px) {
  .nav-demo-toggle { padding: 7px 10px; }
}
