/* HD Expanse LLC: one stylesheet for the whole site.
   System fonts only (nothing loaded from other hosts). Colours follow the logo:
   charcoal, brushed steel, electric blue. */

:root {
  --bg: #f3f5f8;
  --bg-2: #e9edf3;
  --surface: #ffffff;
  --line: #d6dce6;
  --ink: #13161c;
  --dim: #535d6c;
  --accent: #1d5fd0;
  --accent-hover: #174ca8;
  --on-accent: #ffffff;
  --chip: #e6ecf6;
  --chip-ink: #24334d;
  --shadow: 0 1px 2px rgb(20 30 50 / .06), 0 8px 24px rgb(20 30 50 / .08);
  --hero-glow: radial-gradient(60% 80% at 50% 0%, rgb(29 95 208 / .12), transparent 70%);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1015;
    --bg-2: #13161d;
    --surface: #181c24;
    --line: #2a303c;
    --ink: #e9ecf2;
    --dim: #9ba4b4;
    --accent: #4d94ff;
    --accent-hover: #74abff;
    --on-accent: #08101e;
    --chip: #222937;
    --chip-ink: #c9d6ee;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px rgb(0 0 0 / .35);
    --hero-glow: radial-gradient(60% 80% at 50% 0%, rgb(77 148 255 / .18), transparent 70%);
  }
}

/* ---------- language switching ----------
   Text exists twice: lang="en" and lang="zh-Hans". The inline script in <head>
   sets html[data-lang] before first paint; these rules hide the other language.
   .keep marks text that should show in both modes (e.g. a game's other name). */
html[data-lang="zh"] body [lang="en"]:not(.keep),
html:not([data-lang="zh"]) body [lang="zh-Hans"]:not(.keep) { display: none !important; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.65rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px;
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 8px; color: var(--on-accent); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red, blue)) { .site-header { background: var(--bg); } }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: .01em; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand span { white-space: nowrap; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--dim); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--bg-2); }
.lang-toggle {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; min-height: 36px; min-width: 56px;
}
.lang-toggle:hover { border-color: var(--accent); }
.brand { min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 440px) {
  .site-header .wrap { gap: 6px; }
  .brand { gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .brand span { font-size: .92rem; }
  .nav { gap: 0; }
  .nav a { padding: 8px 7px; font-size: .9rem; }
  .lang-toggle { padding: 6px 10px; min-width: 48px; }
}

/* ---------- hero ---------- */
.hero { background: var(--hero-glow); padding: 48px 0 24px; text-align: center; }
.hero-logo { width: 112px; height: 112px; margin: 0 auto 18px; border-radius: 24px; box-shadow: var(--shadow); }
.hero h1 { margin-bottom: .35em; }
.hero .lede { color: var(--dim); font-size: 1.1rem; max-width: 40em; margin: 0 auto; }

/* ---------- sections ---------- */
.section { padding: 32px 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.muted { color: var(--dim); }
.small { font-size: .9rem; }

/* ---------- game cards ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid { grid-template-columns: 1fr 1fr; } }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.card-media { display: block; aspect-ratio: 16 / 9; background: var(--bg-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.card-media:hover img { transform: scale(1.03); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { margin: 0; font-size: 1.2rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.alt-name { color: var(--dim); font-size: .95rem; margin: -6px 0 0; }
.card p { margin: 0; }
.card .actions { margin-top: auto; padding-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.chips li { background: var(--chip); color: var(--chip-ink); font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 16px; border-radius: 10px;
  font: inherit; font-size: .95rem; font-weight: 600; line-height: 1.2; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.btn:hover { border-color: var(--accent); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn.soon { color: var(--dim); background: transparent; border-style: dashed; cursor: default; }
.btn.soon:hover { border-color: var(--line); }
.btn .note { font-weight: 400; font-size: .8rem; opacity: .85; }

/* ---------- game page ---------- */
.game-hero { padding: 28px 0 8px; }
.game-hero .cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 9; background: var(--bg-2); }
.game-hero .cover img { width: 100%; height: 100%; object-fit: cover; }
.game-head { padding-top: 20px; }
.game-head h1 { margin-bottom: .1em; }
.game-head .alt-name { font-size: 1.1rem; margin: 0 0 12px; }
.game-head .pitch { font-size: 1.1rem; margin: 14px 0 18px; }
@media (min-width: 880px) {
  .game-hero .wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: center; }
  .game-head { padding-top: 0; }
}
.breadcrumb { font-size: .9rem; margin: 16px 0 0; }
.breadcrumb a { color: var(--dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.shots {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 14px; margin: 0; list-style: none; overscroll-behavior-x: contain;
}
.shots li { flex: 0 0 auto; scroll-snap-align: start; }
.shots img { border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); }
/* aspect ratio comes from each img's width/height attributes */
.shots.portrait img { height: min(70vh, 480px); width: auto; }
.shots.landscape img { height: min(42vw, 300px); width: auto; }
@media (max-width: 560px) { .shots.landscape img { height: auto; width: 82vw; } }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.todo-note { border-left: 3px solid var(--accent); padding: 4px 12px; color: var(--dim); }

/* ---------- policy pages ---------- */
.doc-head { padding: 32px 0 8px; }
.doc-head h1 { font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.1rem); }
.doc-head .meta { color: var(--dim); font-size: .95rem; }
.policy {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 20px 20px; margin: 20px 0 8px; box-shadow: var(--shadow);
}
.policy h2 { font-size: 1.2rem; margin: 28px 0 8px; scroll-margin-top: 80px; }
.policy h3 { font-size: 1.02rem; margin: 20px 0 4px; }
.policy a { overflow-wrap: anywhere; }
.policy table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.policy th, .policy td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.policy td:first-child { width: 58%; }
.policy th { color: var(--dim); font-weight: 600; }
.policy .box { border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--bg-2); border-radius: 0 10px 10px 0; }
.policy ul { padding-left: 1.25em; }
@media (max-width: 520px) {
  .policy { padding: 4px 14px 16px; }
  .policy table, .policy tbody, .policy tr, .policy td, .policy th { display: block; width: 100% !important; }
  .policy tr:first-child { display: none; }
  .policy td:first-child { border-bottom: 0; padding-bottom: 2px; }
  .policy td:last-child { color: var(--dim); padding-top: 0; }
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 32px; color: var(--dim); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-footer a { color: var(--dim); }
.site-footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
