/* Chrono-Fracture — Trefoil site
   Palette drawn from the game's key art:
   deep space navy, inked cream, brass gold, ring teal, ring magenta */

:root {
  --navy-900: #070d18;
  --navy-800: #0b1524;
  --navy-700: #10203a;
  --navy-600: #16294a;
  --cream: #f2e9d8;
  --cream-dim: #cfc4ad;
  --gold: #d9a441;
  --gold-bright: #f0c169;
  --teal: #3aa89e;
  --magenta: #c04a8c;
  --serif: "Cormorant Garamond", "Georgia", "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--navy-900);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

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

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 13, 24, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(217, 164, 65, 0.25);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 15px;
  color: var(--cream);
}
.nav-brand:hover { text-decoration: none; color: var(--gold-bright); }
.nav-mark { width: 26px; height: 26px; }
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--cream-dim);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-radius: 6px;
}
.nav-links a:hover { color: var(--gold-bright); background: rgba(217, 164, 65, 0.08); text-decoration: none; }

.music-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(217, 164, 65, 0.5);
  color: var(--gold-bright);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.music-toggle:hover { background: rgba(217, 164, 65, 0.12); }
.music-toggle[aria-pressed="true"] {
  background: var(--gold);
  color: var(--navy-900);
}
@keyframes pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: no-preference) {
  .music-toggle[aria-pressed="true"] .music-icon { animation: pulse 1.6s ease-in-out infinite; }
  .music-fab[aria-pressed="true"] { animation: pulse 1.6s ease-in-out infinite; }
}

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-burger span { width: 22px; height: 2px; background: var(--cream); display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url("../assets/img/hero.jpg") 72% center / cover no-repeat var(--navy-900);
  transform: scale(1.02);
}
.hero-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7,13,24,0.96) 0%, rgba(7,13,24,0.82) 34%, rgba(7,13,24,0.25) 62%, rgba(7,13,24,0.35) 100%),
    linear-gradient(180deg, rgba(7,13,24,0.4) 0%, rgba(7,13,24,0) 30%, rgba(7,13,24,0) 70%, var(--navy-900) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--wrap);
  width: 100%;
  margin: 0 auto;
  padding: 80px 24px 88px;
}
.hero-logo {
  width: min(460px, 82vw);
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.65));
}
.hero-kicker {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  text-transform: uppercase;
}
.hero-tagline {
  margin-top: 8px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 2vw, 22px);
  color: var(--cream-dim);
}
.hero-ctas { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-platforms {
  margin-top: 22px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.03em;
  padding: 13px 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #241a05;
  box-shadow: 0 6px 22px rgba(217, 164, 65, 0.35);
}
.btn-ghost {
  border-color: rgba(242, 233, 216, 0.45);
  color: var(--cream);
  background: rgba(7, 13, 24, 0.35);
}
.btn-ghost:hover { border-color: var(--cream); }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-alt {
  background:
    linear-gradient(rgba(11, 21, 36, 0.84), rgba(11, 21, 36, 0.9)),
    url("../assets/img/page-bg.jpg") center / cover;
  border-top: 1px solid rgba(217, 164, 65, 0.14);
  border-bottom: 1px solid rgba(217, 164, 65, 0.14);
}
@media (min-width: 821px) {
  .section-alt { background-attachment: fixed, fixed; }
}
.section-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-bottom: 18px;
}
.section-title .rule {
  flex: 0 1 140px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.section-title .rule:last-child {
  background: linear-gradient(90deg, var(--gold), transparent);
}
.section-sub {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 44px;
  color: var(--cream-dim);
  font-size: 17px;
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Story ---------- */
.story-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 44px;
  align-items: center;
  margin-top: 34px;
}
.story-copy .lede {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.5;
  color: var(--cream);
  margin-bottom: 16px;
}
.story-copy p { margin-bottom: 14px; color: var(--cream-dim); }
.story-copy strong { color: var(--gold-bright); font-weight: 600; }
.story-art img {
  border-radius: 10px;
  border: 1px solid rgba(217, 164, 65, 0.35);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  cursor: zoom-in;
}
.story-art figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--cream-dim);
  font-style: italic;
  text-align: center;
}

.fact-panel {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border: 1px solid rgba(217, 164, 65, 0.3);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(16, 32, 58, 0.5);
}
.fact-panel > div {
  padding: 18px 20px;
  border-right: 1px solid rgba(217, 164, 65, 0.15);
}
.fact-panel > div:last-child { border-right: none; }
.fact-panel dt {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
.fact-panel dd { font-size: 15px; font-weight: 600; color: var(--cream); }

/* ---------- Features ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 40px;
}
.feature-card {
  background: rgba(16, 32, 58, 0.55);
  border: 1px solid rgba(217, 164, 65, 0.2);
  border-radius: 12px;
  padding: 26px 24px;
  transition: transform 0.2s, border-color 0.2s;
}
.feature-card:hover { transform: translateY(-4px); border-color: rgba(217, 164, 65, 0.55); }
.feature-card h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-bright);
  margin-bottom: 10px;
}
.feature-card p { font-size: 14.5px; color: var(--cream-dim); }
.c-assault { color: #e06666; }
.c-ward { color: #6fa8dc; }
.c-flux { color: var(--gold-bright); }

/* ---------- Eras ---------- */
.era-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  margin-top: 44px;
}
.era-card {
  display: grid;
  grid-template-columns: 44% 56%;
  background: rgba(16, 32, 58, 0.55);
  border: 1px solid rgba(217, 164, 65, 0.22);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.era-card:hover { transform: translateY(-4px); border-color: rgba(217, 164, 65, 0.6); }
.era-card img { width: 100%; height: 100%; object-fit: cover; }
.era-body { padding: 20px 22px; }
.era-num {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
}
.era-body h3 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  color: var(--cream);
  margin: 4px 0 6px;
}
.era-year {
  display: inline-block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-bright);
  margin-left: 6px;
  letter-spacing: 0.06em;
}
.era-body p { font-size: 14px; color: var(--cream-dim); }
.era-hazard { margin-top: 8px; font-size: 13px !important; color: #e585b7 !important; }
.era-hazard strong { color: #f0a8cc; }
.era-final { border-color: rgba(192, 74, 140, 0.5); }

/* ---------- Screenshots ---------- */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 40px;
}
.shot {
  border: 1px solid rgba(217, 164, 65, 0.25);
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  background: none;
  cursor: zoom-in;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.shot:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------- Music ---------- */
.music-panel {
  max-width: 820px;
  margin: 34px auto 0;
  text-align: center;
  background: rgba(16, 32, 58, 0.5);
  border: 1px solid rgba(217, 164, 65, 0.25);
  border-radius: 14px;
  padding: 40px 36px;
}
.btn-play { font-size: 16px; }
.btn-play.playing { background: linear-gradient(180deg, #e585b7, var(--magenta)); color: #fff; }
.track-list {
  margin-top: 30px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 24px;
  text-align: left;
  font-size: 13.5px;
  color: var(--cream-dim);
  border-top: 1px solid rgba(217, 164, 65, 0.18);
  padding-top: 24px;
}

/* ---------- Press ---------- */
.press-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 36px;
}
.press-grid h3 {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--gold-bright);
  margin: 18px 0 8px;
}
.press-grid h3:first-child { margin-top: 0; }
.press-grid p, .press-grid li { font-size: 14.5px; color: var(--cream-dim); }
.key-facts { list-style: none; }
.key-facts li {
  padding: 7px 0;
  border-bottom: 1px solid rgba(217, 164, 65, 0.12);
}
.key-facts strong { color: var(--cream); }

/* ---------- Contact ---------- */
.contact-panel {
  max-width: 640px;
  margin: 30px auto 0;
  text-align: center;
  background: rgba(16, 32, 58, 0.5);
  border: 1px solid rgba(217, 164, 65, 0.25);
  border-radius: 14px;
  padding: 40px 32px;
}
.contact-panel p { margin-bottom: 16px; color: var(--cream-dim); }
.contact-panel strong { color: var(--cream); font-size: 18px; }
.contact-mail { font-size: 18px; font-weight: 600; }
.contact-small { font-size: 13px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid rgba(217, 164, 65, 0.25);
  background: var(--navy-900);
  padding: 44px 0 52px;
  text-align: center;
}
.footer-links { margin-bottom: 18px; font-size: 14px; }
.footer-links .dot { color: var(--gold); margin: 0 10px; }
.footer-legal { font-size: 13.5px; color: var(--cream-dim); margin-bottom: 16px; }
.footer-fine {
  max-width: 860px;
  margin: 0 auto;
  font-size: 11.5px;
  line-height: 1.7;
  color: #8d8471;
}

/* ---------- Floating music button ---------- */
.music-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(217, 164, 65, 0.6);
  background: rgba(11, 21, 36, 0.92);
  color: var(--gold-bright);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s, background 0.2s;
}
.music-fab:hover { transform: scale(1.08); }
.music-fab[aria-pressed="true"] {
  background: var(--gold);
  color: var(--navy-900);
}
.music-fab.fab-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}
.music-fab { transition: transform 0.15s, background 0.2s, opacity 0.25s; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 8, 15, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 8px;
  border: 1px solid rgba(217, 164, 65, 0.4);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
}
.lb-close {
  position: absolute;
  top: 18px;
  right: 26px;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 40px;
  cursor: pointer;
  line-height: 1;
}
.lb-close:hover { color: var(--gold-bright); }
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(11, 21, 36, 0.85);
  border: 1px solid rgba(217, 164, 65, 0.5);
  color: var(--cream);
  font-size: 26px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
}
.lb-nav:hover { background: var(--gold); color: var(--navy-900); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-count {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--cream-dim);
  font-size: 13px;
  letter-spacing: 0.1em;
}

/* ---------- Legal pages ---------- */
.legal-main { padding: 72px 0 88px; }
.legal-main h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 44px);
  color: var(--cream);
  margin-bottom: 8px;
}
.legal-updated { color: var(--cream-dim); font-size: 13.5px; margin-bottom: 36px; }
.legal-main h2 {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--gold-bright);
  margin: 34px 0 10px;
}
.legal-main p, .legal-main li { color: var(--cream-dim); font-size: 15px; margin-bottom: 10px; }
.legal-main ul { padding-left: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .shot-grid { grid-template-columns: repeat(3, 1fr); }
  .era-grid { grid-template-columns: 1fr; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(7, 13, 24, 0.98);
    border-bottom: 1px solid rgba(217, 164, 65, 0.3);
    padding: 12px 20px 18px;
  }
  .nav-links.open { display: flex; }
  .music-toggle { margin-left: auto; }
  .nav-burger { display: flex; }
}
@media (max-width: 820px) {
  .hero-bg { background-position: 68% center; }
  .hero-fade {
    background:
      linear-gradient(90deg, rgba(7,13,24,0.97) 0%, rgba(7,13,24,0.88) 55%, rgba(7,13,24,0.55) 100%),
      linear-gradient(180deg, rgba(7,13,24,0.45) 0%, rgba(7,13,24,0.1) 30%, rgba(7,13,24,0.1) 70%, var(--navy-900) 100%);
  }
  .story-grid { grid-template-columns: 1fr; }
  .press-grid { grid-template-columns: 1fr; gap: 24px; }
  .fact-panel { grid-template-columns: repeat(2, 1fr); }
  .fact-panel > div { border-bottom: 1px solid rgba(217, 164, 65, 0.15); }
  .fact-panel > div:last-child { grid-column: 1 / -1; }
  .track-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .section { padding: 60px 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .shot-grid { grid-template-columns: repeat(2, 1fr); }
  .era-card { grid-template-columns: 1fr; }
  .era-card img { aspect-ratio: 16 / 9; }
  .music-label { display: none; }
  .section-title .rule { flex-basis: 40px; }
}
