/* The Intelligence Horizon website: the game's palette (deep navy, cyan, amber) and fonts. */

@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk.woff2') format('woff2'); font-weight: 300 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-ext.woff2') format('woff2'); font-weight: 300 700; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #05080f;
  --bg-2: #0a1020;
  --panel: rgba(16, 24, 42, 0.72);
  --line: rgba(120, 160, 200, 0.18);
  --text: #e6eef8;
  --muted: #94a3b8;
  --cyan: #00f2fe;
  --cyan-soft: rgba(0, 242, 254, 0.12);
  --amber: #feb700;
  --sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
}

/* Space Grotesk covers Latin only: Cyrillic falls back to the system font, and CJK pages get a native stack. */
:lang(ja) { --sans: 'Space Grotesk', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', Meiryo, 'Noto Sans JP', sans-serif; }
:lang(ko) { --sans: 'Space Grotesk', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif; }
:lang(zh-Hans) { --sans: 'Space Grotesk', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif; }
:lang(zh-Hant) { --sans: 'Space Grotesk', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', sans-serif; }
:lang(ja), :lang(ko), :lang(zh-Hans), :lang(zh-Hant) { --mono: 'JetBrains Mono', var(--sans); }
:lang(ja) .kicker, :lang(ko) .kicker, :lang(zh-Hans) .kicker, :lang(zh-Hant) .kicker, :lang(ja) .stats span, :lang(ko) .stats span, :lang(zh-Hans) .stats span, :lang(zh-Hant) .stats span { letter-spacing: 0.04em; }
:lang(ja) body, :lang(zh-Hans) body, :lang(zh-Hant) body { line-break: strict; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: radial-gradient(1200px 700px at 70% -10%, #142039 0%, transparent 60%), var(--bg);
  -webkit-font-smoothing: antialiased;
}
/* height: auto, or the width/height attributes (there to avoid layout shift) would fix the height. */
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); }
a:hover { color: #7ff8ff; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -0.01em; }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

.skip { position: absolute; left: -999px; top: 8px; padding: 8px 12px; background: var(--cyan); color: #000; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px var(--gutter);
  background: rgba(5, 8, 15, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: 0.02em; }
.top nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.top nav > a:not(.button) { color: var(--muted); text-decoration: none; font-size: 15px; }
.top nav > a:not(.button):hover { color: var(--text); }
/* The language menu: a plain <details>, so it works without JavaScript. */
.lang-menu { position: relative; }
.lang-menu summary { display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 14px; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--text); border-color: rgba(0, 242, 254, 0.45); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; margin: 0; padding: 6px; list-style: none; min-width: 190px; max-height: 70vh; overflow: auto; background: #0a101e; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); }
.lang-menu a { display: block; padding: 7px 12px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 15px; }
.lang-menu a:hover { background: var(--cyan-soft); color: var(--cyan); }
.lang-menu a[aria-current] { color: var(--cyan); font-weight: 700; }
.facts .wide a { color: var(--text); text-decoration: none; }
.facts .wide a:hover { color: var(--cyan); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 10px;
  font-weight: 700; font-size: 16px; text-decoration: none; color: #031018;
  background: linear-gradient(135deg, var(--cyan), #38bdf8);
  box-shadow: 0 0 24px rgba(0, 242, 254, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.button:hover { color: #031018; transform: translateY(-1px); box-shadow: 0 0 32px rgba(0, 242, 254, 0.4); }
.button.small { padding: 8px 14px; font-size: 14px; }
.button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.button.soon { background: var(--cyan-soft); color: var(--cyan); border: 1px solid rgba(0, 242, 254, 0.35); box-shadow: none; cursor: default; }
.button.soon:hover { transform: none; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.actions.center { justify-content: center; }

/* Hero */
.hero {
  position: relative;
  min-height: min(88vh, 820px);
  display: flex; align-items: center;
  padding: 72px var(--gutter);
  overflow: hidden;
  isolation: isolate;
  background: url('/media/hero-poster.webp') center / cover no-repeat;
}
/* The intro's opening shot, looping silently behind the text; the poster stands in until it plays. */
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -3; }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 8, 15, 0.94) 0%, rgba(5, 8, 15, 0.7) 45%, rgba(5, 8, 15, 0.15) 100%),
    linear-gradient(0deg, var(--bg) 0%, transparent 35%),
    repeating-linear-gradient(0deg, rgba(0, 242, 254, 0.025) 0 1px, transparent 1px 4px); /* faint scan lines */
}
/* A slowly drifting starfield over the video. */
.stars {
  position: absolute; inset: -50%; z-index: -2; pointer-events: none; opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 140px 80px, #9fe8ff, transparent),
    radial-gradient(1.5px 1.5px at 260px 160px, #fff, transparent), radial-gradient(1px 1px at 380px 40px, #ffe9a8, transparent),
    radial-gradient(1px 1px at 90px 210px, #fff, transparent), radial-gradient(1.2px 1.2px at 330px 260px, #9fe8ff, transparent);
  background-size: 420px 300px;
  animation: drift 120s linear infinite;
}
@keyframes drift { to { transform: translate(-420px, -300px); } }
.hero-text { position: relative; max-width: 660px; padding: 28px 30px; }
/* HUD corner brackets, as in the game's Telemetry layout. */
.hud { position: relative; }
.hud::before, .hud::after { content: ''; position: absolute; width: 22px; height: 22px; border: 2px solid var(--cyan); opacity: 0.7; pointer-events: none; }
.hud::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.hud::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.pulse { display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 rgba(0, 242, 254, 0.7); animation: pulse 2s infinite; vertical-align: 1px; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(0, 242, 254, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 242, 254, 0); } }
.scroll-hint { position: absolute; left: 50%; bottom: 22px; width: 26px; height: 40px; margin-left: -13px; border: 2px solid rgba(230, 238, 248, 0.45); border-radius: 14px; }
.scroll-hint::after { content: ''; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--cyan); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
.kicker { font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 14px; }
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); letter-spacing: -0.02em; margin-bottom: 12px; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6); }
.tagline { font-size: clamp(20px, 2.4vw, 26px); color: var(--amber); font-weight: 600; }
.premise { color: #c7d4e4; max-width: 560px; }

/* The game in numbers */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.06), transparent); }
.stats ul { list-style: none; margin: 0 auto; padding: 22px var(--gutter); max-width: 1180px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 44px; }
.stats li { display: flex; flex-direction: column; align-items: center; }
.stats b { font-family: var(--mono); font-size: 34px; line-height: 1.1; color: var(--cyan); text-shadow: 0 0 18px rgba(0, 242, 254, 0.35); }
.stats span { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* Screenshots and their lightbox (CSS only: each opens at #shot-name) */
.shot { margin: 0; }
.shot a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.shot a:hover { transform: translateY(-3px); border-color: rgba(0, 242, 254, 0.5); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 24px rgba(0, 242, 254, 0.18); }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.shot figcaption { margin-top: 10px; font-size: 14.5px; color: var(--muted); }
.shot.featured { margin-bottom: 26px; }
.shot.featured figcaption { text-align: center; font-size: 16px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.lightbox { display: none; position: fixed; inset: 0; z-index: 50; align-items: center; justify-content: center; padding: 56px 72px; background: rgba(2, 4, 9, 0.92); backdrop-filter: blur(4px); }
.lightbox:target { display: flex; }
.lb-backdrop { position: absolute; inset: 0; }
.lightbox figure { position: relative; margin: 0; max-width: 1600px; width: 100%; }
.lightbox img { width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 8px; border: 1px solid var(--line); }
.lightbox figcaption { margin-top: 12px; text-align: center; color: #c7d4e4; }
.lb-nav, .lb-close { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(16, 24, 42, 0.85); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 30px; line-height: 1; }
.lb-nav:hover, .lb-close:hover { border-color: var(--cyan); color: var(--cyan); }
.lb-prev { left: 14px; top: 50%; margin-top: -24px; }
.lb-next { right: 14px; top: 50%; margin-top: -24px; }
.lb-close { top: 14px; right: 14px; font-size: 20px; }

/* The intro film */
.video-frame { padding: 10px; max-width: 980px; margin: 0 auto; }
.video-frame video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; background: #000; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6); }

/* Card art drifting past */
.card-strip { overflow: hidden; padding: 30px 0; margin: 40px 0 0; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.strip-track { display: flex; gap: 16px; width: max-content; animation: strip 80s linear infinite; }
.strip-track img { width: 240px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); opacity: 0.85; }
@keyframes strip { to { transform: translateX(-50%); } }

/* The last call to action */
.final-cta { text-align: center; margin: 48px auto 0; max-width: 720px; padding: 34px 24px; background: radial-gradient(400px 160px at 50% 50%, rgba(0, 242, 254, 0.08), transparent); }
.final-cta .tagline { margin: 0; }

/* Sections slide in as they scroll into view, where the browser can do it without JavaScript. */
@supports (animation-timeline: view()) {
  .reveal, .shots .shot, .faction { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 22%; }
  @keyframes reveal { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
}

/* Sections */
.section { max-width: 1120px; margin: 0 auto; padding: 72px var(--gutter) 24px; }
.section > h2 { text-align: center; }
.lead { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 32px; }

.feature { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; margin: 40px 0; }

.feature .frame { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); }
.feature img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 6s ease; }
.feature:hover img { transform: scale(1.05); }
.feature.flip .frame { order: 2; }
.feature h3 { font-size: 26px; }
.feature p { color: #c7d4e4; }

.factions { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.faction { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s, border-color 0.2s; }
.faction:hover { transform: translateY(-3px); border-color: rgba(0, 242, 254, 0.45); }
.faction img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.faction > div { padding: 14px 16px 6px; }
.faction h3 { margin-bottom: 2px; }
.faction .hq { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); margin-bottom: 8px; }
.faction p:last-child { color: var(--muted); font-style: italic; font-size: 15px; }
.faction.extension { border-color: rgba(212, 236, 90, 0.45); }
.faction.extension .hq { color: #d4ec5a; }

.extensions, .facts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.extensions li, .facts li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 6px; }
.extensions h3, .facts h3 { font-size: 17px; color: var(--cyan); }
.extensions p, .facts p { color: #c7d4e4; font-size: 15.5px; }
.facts .wide { grid-column: 1 / -1; }
.play { padding-bottom: 72px; }

/* Legal pages */
.legal { max-width: 780px; margin: 0 auto; padding: 56px var(--gutter); font-size: 16px; }
.legal h1 { font-size: clamp(30px, 4vw, 40px); }
.legal h2 { font-size: 22px; margin-top: 1.8em; }
.legal h3 { font-size: 18px; margin-top: 1.4em; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 4px; }
.legal .table { overflow-x: auto; margin: 0 0 1.2em; }
.legal table { border-collapse: collapse; font-size: 14.5px; min-width: 480px; }
.legal th, .legal td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.legal th { background: var(--panel); }
.legal pre { white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; max-height: 340px; overflow: auto; }
.legal code { font-family: var(--mono); font-size: 0.9em; }
.legal a { overflow-wrap: anywhere; }
mark { background: rgba(254, 183, 0, 0.18); color: var(--amber); border-radius: 3px; padding: 0 3px; }

.notfound { text-align: center; padding-top: 120px; padding-bottom: 120px; }

/* Footer */
.bottom { border-top: 1px solid var(--line); padding: 28px var(--gutter) 40px; font-size: 14px; color: var(--muted); text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-links a { color: var(--text); }
.bottom p { margin: 4px auto; max-width: 820px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .top nav > a:not(.button) { display: none; }
  .hero { min-height: min(78vh, 640px); align-items: flex-end; }
  .hero::after { background: linear-gradient(0deg, rgba(5, 8, 15, 0.97) 0%, rgba(5, 8, 15, 0.72) 55%, rgba(5, 8, 15, 0.3) 100%); }
  .hero-text { padding: 20px 18px; }
  .scroll-hint { display: none; }
  .stats ul { gap: 10px 26px; }
  .stats b { font-size: 26px; }
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 16px; }
  .feature.flip .frame { order: 0; }
  .lightbox { padding: 60px 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 10px; margin: 0; }
  .factions { grid-template-columns: 1fr; }
}

/* Small phones: the header keeps to one line (the hero repeats the name just below). */
@media (max-width: 420px) {
  .top { flex-wrap: nowrap; }
  .brand span { display: none; }
  .lang-menu summary span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .shot a, .faction, .feature img { transition: none; }
  .stars, .pulse, .scroll-hint::after, .strip-track { animation: none; }
  .reveal, .shots .shot, .faction { animation: none !important; }
  .hero-video { display: none; } /* the poster image stays */
}
