/* factions.si: marble and gold at golden hour, taken from the world's own HUD. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/CormorantGaramond-normal-500-600.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/CormorantGaramond-italic-500.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-normal-400-600.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0c0a08;
  --ink-2: #13100b;
  --ink-3: #1b1710;
  --marble: #f4eee3;
  --marble-dim: #c8bfae;
  --marble-faint: #8f8676;
  --gold: #d9b56a;
  --gold-bright: #ecca82;
  --gold-deep: #a9813a;
  --line: rgba(217, 181, 106, 0.22);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--marble);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 20;
  padding: 10px 14px; background: var(--gold); color: var(--ink);
  font-weight: 600; text-decoration: none; border-radius: 4px;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- header ---------- */

.top {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--gutter);
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--gold); text-decoration: none;
  font: 600 15px/1 var(--serif); letter-spacing: 0.32em; text-transform: uppercase;
}
.brand span { color: var(--marble); }
.mark { width: 30px; height: 30px; flex: none; }
.top nav { display: flex; gap: 28px; }
.top nav a {
  color: var(--marble-dim); text-decoration: none;
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: color 0.2s;
}
.top nav a:hover { color: var(--gold-bright); }
@media (max-width: 680px) { .top nav { display: none; } }

/* ---------- hero ---------- */

.hero {
  position: relative; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: 120px var(--gutter) clamp(56px, 9vh, 104px);
  overflow: hidden;
}
.hero picture, .hero-img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
}
.hero-img { object-fit: cover; object-position: 50% 45%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(12, 10, 8, 0.55) 0%, rgba(12, 10, 8, 0) 22%),
    linear-gradient(0deg, var(--ink) 0%, rgba(12, 10, 8, 0.8) 18%, rgba(12, 10, 8, 0.2) 50%, rgba(12, 10, 8, 0) 68%),
    linear-gradient(90deg, rgba(12, 10, 8, 0.6) 0%, rgba(12, 10, 8, 0) 60%);
}
.hero-copy { max-width: 760px; }
@media (max-width: 520px) { .wordmark { letter-spacing: 0.12em; margin-right: -0.12em; } }
/* The tall crop is brightest where the copy sits, so it gets a deeper, higher fade. */
@media (max-aspect-ratio: 4/5) {
  .hero::before {
    background:
      linear-gradient(180deg, rgba(12, 10, 8, 0.55) 0%, rgba(12, 10, 8, 0) 18%),
      linear-gradient(0deg, var(--ink) 0%, rgba(12, 10, 8, 0.9) 34%, rgba(12, 10, 8, 0.55) 52%, rgba(12, 10, 8, 0) 70%);
  }
}

.tag {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 22px; padding: 7px 14px 7px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(12, 10, 8, 0.45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--gold-bright);
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright);
  box-shadow: 0 0 0 0 rgba(236, 202, 130, 0.6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(236, 202, 130, 0.55); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(236, 202, 130, 0); }
}

.wordmark {
  margin: 0;
  font: 600 clamp(44px, 12vw, 168px)/0.9 var(--serif);
  letter-spacing: 0.18em; margin-right: -0.18em;
  text-transform: uppercase;
  color: var(--marble);
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.35);
}
.tagline {
  margin: 18px 0 0;
  font: italic 500 clamp(24px, 3.4vw, 40px)/1.2 var(--serif);
  color: var(--gold-bright);
}
.lede {
  margin: 20px 0 0; max-width: 600px;
  color: var(--marble-dim); font-size: clamp(16px, 1.6vw, 18px);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 3px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-bright); transform: translateY(-1px); }
.btn-ghost { border: 1px solid rgba(244, 238, 227, 0.35); color: var(--marble); background: rgba(12, 10, 8, 0.3); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-bright); }

.hero-credit {
  position: absolute; right: var(--gutter); bottom: 22px; margin: 0;
  color: var(--marble-faint); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
}
@media (max-width: 680px) { .hero-credit { display: none; } }

/* ---------- bands ---------- */

.band { position: relative; padding: clamp(80px, 12vw, 152px) 0; }
.band + .band::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 20px;
  background: url("img/meander.svg") repeat-x center / 20px 20px;
  opacity: 0.55;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
}
h2 {
  margin: 0;
  font: 500 clamp(36px, 5.2vw, 64px)/1.05 var(--serif);
  letter-spacing: -0.005em;
  color: var(--marble);
  text-wrap: balance;
}
h3 { margin: 0; font: 600 clamp(24px, 2.4vw, 30px)/1.15 var(--serif); color: var(--marble); }
p { text-wrap: pretty; }

/* how it works */

.how { background: var(--ink); }
.steps {
  list-style: none; margin: clamp(48px, 7vw, 80px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 36px);
}
.step {
  position: relative;
  padding: 34px 30px 32px;
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
}
.step::after {
  content: ""; position: absolute; left: 30px; right: 30px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.numeral {
  display: block; margin-bottom: 18px;
  font: 500 46px/1 var(--serif); color: var(--gold);
}
.step p { margin: 14px 0 0; color: var(--marble-dim); font-size: 16px; }
.aside {
  margin: 36px 0 0; color: var(--marble-faint);
  font: italic 500 22px/1.4 var(--serif);
}
.aside em { color: var(--gold-bright); }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }

/* the machine */

.machine { background: var(--ink-2); overflow: hidden; }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(40px, 6vw, 88px); align-items: center; }
.split-copy p { color: var(--marble-dim); max-width: 460px; }
.split-copy h2 { margin-bottom: 22px; }
.split-media { position: relative; padding-bottom: 18%; }
.frame { overflow: hidden; border-radius: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.frame-main { border: 1px solid var(--line); }
.frame-inset {
  position: absolute; right: -6%; bottom: 0; width: 56%;
  border: 1px solid rgba(217, 181, 106, 0.4);
}
.frame-inset figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 14px 10px;
  background: linear-gradient(0deg, rgba(12, 10, 8, 0.9), transparent);
  color: var(--marble); font-size: 13px;
}
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
  .split-media { padding-bottom: 22%; margin-right: 4%; }
  .frame-inset { right: -4%; width: 60%; }
}

/* the world */

.world { background: var(--ink); padding-bottom: 0; }
.intro { margin: 20px 0 0; max-width: 620px; color: var(--marble-dim); }
.gallery {
  margin: clamp(44px, 6vw, 72px) 0 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2.4vw, 28px);
}
.card {
  overflow: hidden; border-radius: 4px;
  border: 1px solid var(--line); background: var(--ink-2);
}
.card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; transition: transform 0.8s cubic-bezier(.2, .7, .2, 1); }
.card:hover img { transform: scale(1.03); }
.card figcaption { padding: 18px 22px 22px; color: var(--marble-dim); font-size: 15px; }
.card strong {
  display: block; margin-bottom: 4px;
  font: 600 24px/1.2 var(--serif); color: var(--marble);
}
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } }

.flyover { margin: clamp(64px, 9vw, 120px) 0 0; position: relative; }
.flyover-video { width: 100%; max-height: 86vh; object-fit: cover; aspect-ratio: 16 / 9; background: var(--ink-2); }
.flyover figcaption {
  padding: 16px var(--gutter) 0;
  color: var(--marble-faint); font-size: 13px; letter-spacing: 0.04em;
}

/* status */

.status { background: var(--ink); }
.ledger {
  margin: clamp(44px, 6vw, 72px) 0 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 36px);
}
.ledger-col {
  padding: 32px 30px; border: 1px solid var(--line); border-radius: 4px; background: var(--ink-2);
}
.ledger ul { list-style: none; margin: 22px 0 0; padding: 0; }
.ledger li {
  position: relative; padding: 13px 0 13px 34px;
  border-top: 1px solid rgba(244, 238, 227, 0.08);
  color: var(--marble-dim); font-size: 16px;
}
.ledger li::before {
  content: ""; position: absolute; left: 2px; top: 19px;
  width: 14px; height: 14px; border-radius: 50%;
}
.done li::before { background: url("img/check.svg") center / 14px no-repeat; }
.todo li::before { border: 1.5px solid var(--marble-faint); }
@media (max-width: 760px) { .ledger { grid-template-columns: 1fr; } }

/* closing */

.closing {
  position: relative; isolation: isolate;
  min-height: min(78vh, 760px);
  display: flex; align-items: flex-end;
  padding: 0 var(--gutter) clamp(56px, 8vw, 96px);
  margin-top: clamp(40px, 6vw, 80px);
  overflow: hidden;
}
.closing-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.closing::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--ink) 0%, rgba(12, 10, 8, 0) 30%, rgba(12, 10, 8, 0.2) 60%, var(--ink) 100%);
}
.closing-copy { width: min(var(--max), 100%); margin-inline: auto; }
.closing p { margin: 14px 0 0; color: var(--gold-bright); font: italic 500 clamp(20px, 2.4vw, 28px)/1.3 var(--serif); }

/* footer */

.foot { padding: 34px 0 44px; border-top: 1px solid var(--line); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; }
.foot p { margin: 0; color: var(--marble-faint); font-size: 13px; }
.brand-small { font-size: 13px; }
.brand-small .mark { width: 24px; height: 24px; }

/* ---------- reveal on scroll (progressive: only where scroll timelines exist) ---------- */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 38%;
    }
    @keyframes rise {
      from { opacity: 0; transform: translateY(28px); }
      to { opacity: 1; transform: none; }
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
  .card img, .btn { transition: none; }
}

/* ---------- 404 ---------- */

.lost {
  min-height: 100vh; min-height: 100svh;
  display: grid; place-content: center; gap: 18px;
  padding: 40px var(--gutter); text-align: center;
}
.lost h1 { margin: 0; font: 600 clamp(40px, 8vw, 72px)/1 var(--serif); letter-spacing: 0.12em; text-transform: uppercase; }
.lost p { margin: 0; color: var(--marble-dim); }
.lost .btn { justify-self: center; margin-top: 10px; }
