/* Cloudfall: Expeditions — landing page.
   Palette: art-direction-bible §12 (warm parchment / ink / off-white); faction accents are
   trim only. Cloud-iridescence (cyan → magenta → gold) is reserved for Cloud-touched things,
   so it appears in exactly two places: the brand mark and the "edges shimmer" hero rim. */

:root {
  --ink: #211b17;
  --ink-2: #2e2620;
  --parchment: #d8cbb0;
  --parchment-2: #cdbf9f;
  --paper: #f3ecdd;
  --muted: #6b5f52;
  --muted-on-ink: #b9ad97;
  --hair: rgba(33, 27, 23, 0.16);
  --hair-on-ink: rgba(243, 236, 221, 0.16);
  --accent: #a5542a;          /* warm rust: buttons + kickers. Not the reserved hostile red-orange. */
  --accent-ink: #f3ecdd;
  --iris: linear-gradient(120deg, #7fe3e0 0%, #e59ad8 50%, #f0cf7a 100%);

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 72px);
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-display); background: var(--paper); color: var(--ink);
  line-height: 1.55; font-size: 17px; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter); padding-top: max(14px, env(safe-area-inset-top));
  color: var(--paper); transition: background 0.25s, box-shadow 0.25s;
}
.topbar.scrolled { background: rgba(33, 27, 23, 0.92); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--hair-on-ink); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand b { font-weight: 800; }
.brand .mark {
  width: 22px; height: 25px; background: var(--iris);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.topbar .right { display: flex; align-items: center; gap: 14px; }
.nav-link { font-size: 14px; color: var(--muted-on-ink); transition: color 0.2s; }
.nav-link:hover { color: var(--paper); }
.pill {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--hair-on-ink); border-radius: 999px; padding: 5px 11px;
  display: inline-flex; align-items: center; gap: 7px; color: var(--muted-on-ink);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #f0cf7a; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  transition: transform 0.15s, filter 0.2s, background 0.2s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn.big { font-size: 16px; padding: 14px 24px; }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; opacity: 0.85; }
.btn.ghost:hover { opacity: 1; filter: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: min(100svh, 920px); display: flex; align-items: flex-end;
  background: var(--ink); color: var(--paper); overflow: hidden; isolation: isolate;
}
.hero-art, .hero-art > * { position: absolute; inset: 0; }
.hero-art { z-index: -1; }
/* Painted fallback first, then the image on top: a missing media/hero.jpg leaves the gradient. */
.hero-img {
  background:
    url("media/hero.jpg") center / cover no-repeat,
    radial-gradient(120% 80% at 70% 12%, #f0cf7a33 0%, transparent 55%),
    radial-gradient(90% 70% at 18% 30%, #7fe3e022 0%, transparent 60%),
    linear-gradient(180deg, #4a6a7a 0%, #6f8a6a 42%, #3d4a2e 70%, #211b17 100%);
}
.hero-video { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.8s; }
.hero-video.on { opacity: 1; }
.hero-hexes {
  opacity: 0.1; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64v33M0 48l-28 16M56 48l28 16' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E");
  mask-image: linear-gradient(180deg, transparent 30%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 30%, #000 100%);
}
.hero-shade {
  background:
    linear-gradient(180deg, rgba(33,27,23,0.55) 0%, rgba(33,27,23,0) 28%, rgba(33,27,23,0.35) 58%, rgba(33,27,23,0.94) 100%);
}
/* The "edges shimmer" rim — the one decorative use of Cloud-iridescence. */
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--iris); opacity: 0.85;
}
.hero-copy { width: 100%; padding-top: 140px; padding-bottom: clamp(48px, 8vh, 96px); }
.eyebrow, .kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
}
.eyebrow { color: var(--muted-on-ink); margin-bottom: 18px; }
.kicker { color: var(--accent); margin-bottom: 14px; }
h1 {
  font-size: clamp(52px, 10.5vw, 136px); line-height: 0.9; letter-spacing: -0.035em;
  font-weight: 800; text-transform: uppercase; text-shadow: 0 2px 30px rgba(0,0,0,0.35);
}
h1 span { color: #f0cf7a; }
.hero-sub { max-width: 620px; font-size: clamp(17px, 2vw, 21px); margin-top: 24px; color: #e9e0cc; text-wrap: pretty; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.facts {
  list-style: none; display: grid; grid-template-columns: repeat(4, auto); justify-content: start;
  gap: 8px 40px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--hair-on-ink);
}
.facts b { display: block; font-size: 30px; font-weight: 800; line-height: 1; }
.facts span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-on-ink); }

/* ---------- sections ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section.alt { background: var(--parchment); }
h2 { font-size: clamp(32px, 4.6vw, 56px); line-height: 1; letter-spacing: -0.028em; font-weight: 800; text-wrap: balance; }
h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.lede { font-size: clamp(17px, 1.7vw, 20px); color: var(--muted); max-width: 680px; margin-top: 18px; text-wrap: pretty; }
.two-col { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 6vw, 88px); align-items: start; }
.prose p + p { margin-top: 18px; }
.prose .sub { color: var(--muted); }

.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 48px; counter-reset: s; }
.steps li { background: var(--paper); border: 1px solid var(--hair); border-radius: 14px; padding: 26px; }
.steps .n { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.steps .n::before { counter-increment: s; content: counter(s) " · "; }
.steps h3 { margin: 10px 0 8px; }
.steps p, .feature p, .unit p, .faction p, .deal-item p { color: var(--muted); font-size: 16px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.feature { background: var(--ink); color: var(--paper); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.feature p { color: var(--muted-on-ink); margin-top: 8px; }
.f-img {
  aspect-ratio: 16 / 10;
  background: var(--img) center / cover no-repeat, linear-gradient(135deg, #4a6a7a 0%, #6f8a6a 55%, #3d4a2e 100%);
}
.feature:nth-child(2) .f-img { background: var(--img) center / cover no-repeat, linear-gradient(135deg, #8a6a3e 0%, #a5542a 60%, #2e2620 100%); }
.feature:nth-child(3) .f-img { background: var(--img) center / cover no-repeat, linear-gradient(135deg, #2e2620 0%, #5a4a6a 50%, #7fe3e0 130%); }
.f-body { padding: 22px 24px 26px; }

.units { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 48px; }
.unit { border: 1px solid var(--hair); border-radius: 14px; overflow: hidden; background: #fbf7ee; padding-bottom: 24px; }
.unit > :not(.u-img) { padding-inline: 24px; }
.u-img {
  aspect-ratio: 4 / 5; display: grid; place-items: center; margin-bottom: 20px;
  background: var(--img) center top / cover no-repeat, linear-gradient(160deg, var(--parchment) 0%, var(--parchment-2) 100%);
}
.u-img span { font-size: 84px; color: rgba(33, 27, 23, 0.18); }
.u-img.has-img span { display: none; }
.unit .role { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 6px 0 10px; }

.factions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 48px; }
.faction {
  background: var(--fg); color: var(--paper); border-radius: 14px; padding: 24px 20px 26px;
  border-top: 4px solid var(--fa); position: relative; overflow: hidden;
}
.faction .crest { font-size: 34px; line-height: 1; color: var(--fa); display: block; margin-bottom: 16px; }
.faction h3 { font-size: 18px; }
.faction .tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fa); margin: 6px 0 12px; }
.faction p:last-child { color: rgba(243, 236, 221, 0.78); font-size: 15px; }

.deal { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin-top: 44px; border-top: 1px solid var(--hair); }
.deal-item { padding: 28px 28px 28px 0; border-bottom: 1px solid var(--hair); }
.deal-item:nth-child(even) { padding: 28px 0 28px 28px; border-left: 1px solid var(--hair); }
.deal-item h3 { margin-bottom: 8px; }

.notify-card { background: var(--ink); color: var(--paper); border-radius: 16px; padding: clamp(26px, 4vw, 40px); }
.notify-card p { color: var(--muted-on-ink); margin: 10px 0 22px; }
.notify-card .fine { font-size: 13px; margin: 18px 0 0; }
.notify-card .fine a { text-decoration: underline; text-underline-offset: 2px; }

.mmo { background: var(--ink); color: var(--paper); }
.mmo .kicker { color: #f0cf7a; }
.mmo-card { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.mmo-card > div { max-width: 640px; }
.mmo-card p:last-child { color: var(--muted-on-ink); margin-top: 16px; }

.footer { background: #17120f; color: var(--muted-on-ink); padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); font-size: 13px; }
.f-row { display: flex; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; }
.f-links { display: inline-flex; gap: 18px; flex-wrap: wrap; }
.f-links a:hover { color: var(--paper); }
.art-note { margin-top: 14px; font-family: var(--font-mono); font-size: 11px; opacity: 0.7; }

/* ---------- reveal (JS adds .reveal only when motion is allowed) ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .factions { grid-template-columns: repeat(3, 1fr); }
  .topbar .nav-link { display: none; }
}
@media (max-width: 860px) {
  .two-col, .steps, .features, .units { grid-template-columns: 1fr; }
  .units { max-width: 460px; }
  .u-img { aspect-ratio: 4 / 3; }
  .deal { grid-template-columns: 1fr; }
  .deal-item, .deal-item:nth-child(even) { padding: 24px 0; border-left: 0; }
  .topbar .pill, .topbar .btn.ghost { display: none; }
}
@media (max-width: 640px) {
  .factions { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr 1fr; gap: 20px 28px; }
  .cta-row .btn { flex: 1 1 100%; }
}
@media (max-width: 420px) { .factions { grid-template-columns: 1fr; } }
@media (orientation: portrait) and (max-width: 860px) {
  .hero-img {
    background:
      url("media/hero-portrait.jpg") center / cover no-repeat,
      url("media/hero.jpg") center / cover no-repeat,
      linear-gradient(180deg, #4a6a7a 0%, #6f8a6a 42%, #3d4a2e 70%, #211b17 100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .hero-video, .topbar { transition: none; }
}
