/* Clanhold website. Palette and type follow the game (src/ui/theme.css, docs/style-sample.html):
   dark warm wood, gold display type in Silkscreen, body in Source Sans 3, crisp pixel edges. */
:root {
  --ground: #140f0b;
  --ground-2: #1b140e;
  --panel: #221a12;
  --panel-2: #2c2117;
  --line: #4b3a22;
  --line-2: #8a6a3a;
  --gold-1: #7e4e10;
  --gold-2: #c08a1e;
  --gold-3: #ecc23e;
  --gold-4: #fff09a;
  --ink: #f1e5c8;
  --ink-dim: #b3a487;
  --ink-faint: #7f7260;
  --vio-2: #7a34c0;
  --vio-3: #b874f4;
  --cyan-3: #62d8ea;
  --fire-2: #e8661a;
  --bad: #e0442c;
  --good: #5df06a;
  --display: 'Silkscreen', 'Courier New', monospace;
  --body: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { background: var(--ground); color: var(--ink); scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(122, 52, 192, 0.16), transparent 70%),
    radial-gradient(900px 500px at 85% 40%, rgba(232, 102, 26, 0.06), transparent 70%),
    var(--ground);
  -webkit-font-smoothing: antialiased;
}
img, video, canvas { max-width: 100%; display: block; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--gold-3); text-underline-offset: 3px; }
a:hover { color: var(--gold-4); }
h1, h2, h3, .display { font-family: var(--display); font-weight: 400; letter-spacing: 0.02em; }
h2 { color: var(--gold-3); font-size: clamp(22px, 3vw, 30px); margin: 0 0 12px; text-shadow: 0 2px 0 #3a2a10; line-height: 1.25; }
h3 { color: var(--gold-3); font-size: 16px; margin: 0 0 8px; line-height: 1.3; }
p { margin: 0 0 12px; }
.eyebrow { font-family: var(--display); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.dim { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 22px; }
section { padding: 64px 0; }
section + section { border-top: 1px solid rgba(75, 58, 34, 0.45); }
kbd, .key {
  display: inline-block; min-width: 1.7em; padding: 1px 6px; margin: 0 1px;
  font-family: var(--display); font-size: 11px; line-height: 1.6; text-align: center; color: #2a1806;
  background: linear-gradient(var(--gold-3), var(--gold-2)); border: 1px solid var(--gold-1);
  box-shadow: 0 2px 0 var(--gold-1); border-radius: 2px; white-space: nowrap; vertical-align: 1px;
}
:focus-visible { outline: 2px solid var(--gold-4); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; z-index: 50; background: var(--panel); padding: 6px 10px; }

/* ---- header ---- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(20, 15, 11, 0.86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 2px solid #3a2c18;
}
.top .wrap { display: flex; align-items: center; gap: 18px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold-3); }
.brand img { width: 32px; height: 32px; }
.brand span { font-family: var(--display); font-size: 18px; text-shadow: 0 2px 0 #3a2a10; }
.top nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { font-family: var(--display); font-size: 12px; color: var(--ink-dim); text-decoration: none; padding: 8px 10px; }
.top nav a:hover, .top nav a[aria-current='page'] { color: var(--gold-4); }
.top nav a.cta { color: #2a1806; background: var(--gold-3); box-shadow: 0 2px 0 var(--gold-1); margin-left: 6px; }
.top nav a.cta:hover { background: var(--gold-4); }
@media (max-width: 640px) {
  .top nav a:not(.cta) { display: none; }
  .hero .actions .btn { flex: 1 1 100%; }
  .brand span { font-size: 15px; }
}

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  font-family: var(--display); font-size: 14px; line-height: 1.2; text-decoration: none; cursor: pointer;
  padding: 13px 18px; color: var(--ink); background: linear-gradient(#3a2c1c, #271d13);
  border: 2px solid var(--line-2); box-shadow: inset 0 0 0 1px #1a120a, 0 3px 0 #120c07; border-radius: 0;
}
.btn:hover { color: var(--gold-4); border-color: var(--gold-2); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px #1a120a, 0 1px 0 #120c07; }
.btn.primary { color: #2a1806; background: linear-gradient(var(--gold-3), var(--gold-2)); border-color: var(--gold-4); box-shadow: inset 0 0 0 1px var(--gold-1), 0 3px 0 var(--gold-1); }
.btn.primary:hover { background: linear-gradient(var(--gold-4), var(--gold-3)); color: #2a1806; }
.btn.magic { border-color: var(--vio-3); background: linear-gradient(#3b1f5c, #24133a); color: #efe0ff; }
.btn.magic:hover { color: #fff; border-color: #e8ccff; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }
.btn small { font-family: var(--body); font-size: 13px; opacity: 0.8; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---- frames (the in-game bevelled panel) ---- */
.frame {
  border: 3px solid #5a4426; outline: 1px solid #2a2016; background: #0c0a07;
  box-shadow: inset 0 0 0 1px var(--line-2), 0 16px 40px rgba(0, 0, 0, 0.55);
}
.frame > img, .frame > video { width: 100%; height: 100%; object-fit: cover; }
.ph {
  aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center; padding: 20px;
  background:
    repeating-linear-gradient(45deg, rgba(75, 58, 34, 0.18) 0 8px, transparent 8px 16px),
    radial-gradient(circle at 50% 60%, rgba(122, 52, 192, 0.25), transparent 60%), #120d09;
  color: var(--ink-faint); font-family: var(--display); font-size: 12px;
}

/* ---- hero ---- */
.hero { padding: 44px 0 56px; position: relative; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 40px; align-items: center; }
.hero-logo { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.hero-logo img { width: 84px; height: 84px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6)); }
.hero h1 { font-size: clamp(38px, 6vw, 64px); margin: 0; color: var(--gold-3); line-height: 1; text-shadow: 0 4px 0 #3a2a10, 0 0 34px rgba(236, 194, 62, 0.22); }
.hero .pitch { font-size: clamp(19px, 2.1vw, 23px); line-height: 1.45; color: var(--ink); margin: 0 0 14px; }
.hero .sub { color: var(--ink-dim); margin-bottom: 24px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .meta { margin-top: 14px; font-size: 14px; color: var(--ink-faint); }
.trailer { aspect-ratio: 16 / 9; position: relative; }
.trailer video, .trailer img { width: 100%; height: 100%; object-fit: cover; background: #000; }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .hero { padding-top: 26px; }
}

/* ---- embers (the darkness and the light, a few pixels drifting up) ---- */
.embers { position: absolute; inset: 0; pointer-events: none; z-index: -1; opacity: 0.8; }

/* ---- downloads ---- */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 22px; }
.dl {
  text-decoration: none;
  display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px; text-align: left; width: 100%;
  background: linear-gradient(#2c2117, #1e1610); border: 2px solid var(--line); color: var(--ink);
  font: inherit; cursor: pointer; position: relative; box-shadow: 0 3px 0 #0e0a06;
}
.dl:hover { border-color: var(--gold-2); color: var(--ink); }
.dl-grid.soon-mode .dl { opacity: 0.5; pointer-events: none; }
.dl .os { font-family: var(--display); font-size: 15px; color: var(--gold-3); display: flex; align-items: center; gap: 8px; }
.dl .os svg { width: 20px; height: 20px; }
.dl .what { font-size: 14px; color: var(--ink-dim); }
.dl .size { font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.dl.rec { border-color: var(--gold-3); box-shadow: 0 0 0 1px var(--gold-1), 0 0 26px rgba(236, 194, 62, 0.15), 0 3px 0 #0e0a06; }
.dl.rec::after {
  content: 'For your computer'; position: absolute; top: -11px; right: 10px; padding: 2px 7px;
  font-family: var(--display); font-size: 10px; color: #2a1806; background: var(--gold-3);
}
.dl-note { margin-top: 16px; font-size: 14px; color: var(--ink-faint); }
.soon { padding: 20px; border: 2px dashed var(--line); color: var(--ink-dim); margin-top: 22px; }

/* ---- features ---- */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px; align-items: center; padding: 34px 0; }
.feature:nth-child(even) .media { order: -1; }
.feature .media .frame { aspect-ratio: 16 / 9; }
.feature ul { margin: 10px 0 0; padding-left: 0; list-style: none; }
.feature li { padding-left: 20px; position: relative; margin-bottom: 6px; color: var(--ink-dim); }
.feature li::before { content: ''; position: absolute; left: 2px; top: 0.6em; width: 8px; height: 8px; background: var(--gold-2); box-shadow: 2px 2px 0 var(--gold-1); }
.feature.dark li::before { background: var(--vio-3); box-shadow: 2px 2px 0 var(--vio-2); }
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; gap: 18px; }
  .feature:nth-child(even) .media { order: 0; }
}
.tag { display: inline-block; font-family: var(--display); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }

/* ---- gallery ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 18px; }
.gallery a { display: block; aspect-ratio: 16 / 10; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(8, 6, 4, 0.94); display: none; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-height: 92vh; max-width: 96vw; width: auto; border: 3px solid #5a4426; }

/* ---- cards / columns ---- */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 18px; }
.card { background: linear-gradient(#251c13, #1b140e); border: 2px solid var(--line); padding: 18px; box-shadow: 0 3px 0 #0e0a06; }
.card p:last-child, .card ol:last-child, .card ul:last-child { margin-bottom: 0; }
.card ol, .card ul { padding-left: 20px; margin: 8px 0 12px; color: var(--ink-dim); }
.card li { margin-bottom: 4px; }
table.spec { border-collapse: collapse; width: 100%; font-size: 15px; }
table.spec th, table.spec td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.spec th { font-family: var(--display); font-size: 11px; font-weight: 400; color: var(--gold-3); letter-spacing: 0.05em; white-space: nowrap; }
table.spec td { color: var(--ink-dim); }

/* ---- news ---- */
.news { display: grid; gap: 12px; margin-top: 18px; }
.news article { border-left: 3px solid var(--gold-2); padding: 4px 0 4px 16px; }
.news time { font-family: var(--display); font-size: 11px; color: var(--ink-faint); }
.news h3 { margin: 2px 0 4px; }
.news p { color: var(--ink-dim); margin: 0; }

/* ---- prose pages (guide, press) ---- */
.page-head { padding: 46px 0 10px; }
.page-head h1 { font-size: clamp(30px, 5vw, 46px); color: var(--gold-3); margin: 0 0 10px; text-shadow: 0 3px 0 #3a2a10; }
.prose { max-width: 760px; }
.prose ol, .prose ul { color: var(--ink-dim); padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose li b, .prose p b { color: var(--ink); font-weight: 600; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; align-items: baseline; margin: 14px 0; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: var(--ink-dim); }
@media (max-width: 560px) { .keys { grid-template-columns: 1fr; gap: 2px; } .keys dd { margin-bottom: 10px; } }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.toc a { font-family: var(--display); font-size: 11px; text-decoration: none; padding: 6px 9px; border: 1px solid var(--line); color: var(--ink-dim); }
.toc a:hover { color: var(--gold-4); border-color: var(--gold-2); }
.copy { position: relative; background: #120d09; border: 1px solid var(--line); padding: 14px 16px; color: var(--ink-dim); white-space: pre-wrap; }

/* ---- footer ---- */
footer { border-top: 2px solid #3a2c18; padding: 30px 0 46px; color: var(--ink-faint); font-size: 14px; margin-top: 30px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--ink-dim); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .embers { display: none; }
}
.wrap.prose { max-width: var(--max); }
.wrap.prose > * { max-width: 760px; }
