/* Helly Studios — shared layout. Each page sets a theme class on <body>. */

/* Fonts are served with the site (SIL Open Font License, see fonts/LICENSE-*.txt), so every visitor sees the same ones. */
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-700-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "DotGothic16"; src: url("../fonts/dotgothic16-latin-400-normal.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  /* The site's own fonts: the header and footer always use these, whatever the page's theme. */
  --site-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --site-display: "IBM Plex Mono", Consolas, monospace;
  --bg: #0e0a0a;
  --bg-2: #1a1111;
  --panel: #1f1414;
  --line: #3a2323;
  --text: #f1e6dc;
  --muted: #b7a297;
  --accent: #ff5a2a;
  --accent-2: #ffb347;
  --on-accent: #1a0a05;
  --radius: 6px;
  --font-body: var(--site-body);
  --font-display: var(--site-display);
  --font-jp: "Yu Gothic", "Meiryo", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --max: 1080px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-2); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(6px);
}
.site-header, .site-footer { font-family: var(--site-body); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 34px; height: 34px; image-rendering: pixelated; }
.brand-name { font: 700 15px/1.2 var(--site-display); letter-spacing: .02em; }
.brand-name small { display: block; font: 400 12px/1.2 var(--site-body); color: var(--muted); letter-spacing: 0; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: var(--radius);
  font: 600 14px/1 var(--site-body);
}
.nav a:hover { color: var(--text); background: var(--bg-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--bg-2); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 32px; }
.hero .wrap { display: grid; gap: 32px; grid-template-columns: 1.05fr 1fr; align-items: center; }
.hero-art { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #000; }
.eyebrow { font: 600 13px/1.4 var(--font-display); text-transform: uppercase; letter-spacing: .12em; color: var(--accent-2); margin: 0 0 8px; }
h1 { font: 700 clamp(32px, 6vw, 52px)/1.05 var(--font-display); margin: 0 0 6px; letter-spacing: -.01em; }
.subtitle { font-size: 18px; color: var(--muted); margin: 0 0 20px; }
.lede { font-size: 18px; margin: 0 0 24px; max-width: 46ch; }
.native-title { font-family: var(--font-jp); font-weight: 700; }

/* ---------- Buttons & badges ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font: 700 15px/1 var(--font-body); text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--on-accent);
}
.btn:hover { filter: brightness(1.1); color: var(--on-accent); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--panel); color: var(--text); }
.btn[aria-disabled="true"] { background: var(--panel); color: var(--muted); border-color: var(--line); cursor: not-allowed; filter: none; }
.badge {
  display: inline-block; padding: 3px 8px; border-radius: 99px;
  font: 700 11px/1.4 var(--font-display); text-transform: uppercase; letter-spacing: .08em;
  border: 1px solid var(--line); color: var(--muted); background: var(--bg-2);
}
.badge.soon { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 45%, transparent); }
.badge.ready { color: #8fe38f; border-color: #2f6a2f; }

/* ---------- Sections ---------- */
main { flex: 1; }
section { padding: 32px 0; }
h2 { font: 700 24px/1.2 var(--font-display); margin: 0 0 16px; }
h3 { font: 700 17px/1.3 var(--font-body); margin: 0 0 6px; }
p { margin: 0 0 14px; }
.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.list { margin: 0; padding-left: 20px; }
.list li { margin-bottom: 6px; }
.links { list-style: none; margin: 0 0 14px; padding: 0; }
.links li { margin-bottom: 4px; }
.links a { font-weight: 600; }
.links a::after { content: " ↗"; font-size: .85em; }
.links span { color: var(--muted); font-size: 14px; }
h2 + h3, p + h3 { margin-top: 18px; }

/* ---------- Game cards (main page) ---------- */
.card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--text); }
.card-art { aspect-ratio: 16 / 10; background: #000; overflow: hidden; }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-meta { font: 12px/1.4 var(--font-display); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.card-body p { color: var(--muted); font-size: 15px; margin: 0; flex: 1; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.card-foot .more { font-weight: 700; color: var(--accent-2); font-size: 14px; }

/* ---------- Download box ---------- */
.download { display: grid; gap: 20px; grid-template-columns: 1fr auto; align-items: center; }
.download .size { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.download-files { display: flex; flex-direction: column; gap: 10px; min-width: 240px; }
.download-files .btn { justify-content: space-between; }
.btn small { font-weight: 400; font-size: 13px; opacity: .8; }
.release-notes { margin: 18px 0 6px; }
.release-notes h3 { margin-bottom: 8px; }
.checksums { margin: 10px 0; font-size: 14px; }
.checksums summary { cursor: pointer; color: var(--muted); }
.checksums ul { list-style: none; margin: 8px 0 0; padding: 0; }
.checksums li { margin-bottom: 6px; }
.checksums li span { display: block; }
.checksums code { font-size: 12px; word-break: break-all; color: var(--muted); }
.report { font-size: 14px; color: var(--muted); margin-top: 12px; }
.logo-title { margin: 4px 0 10px; }
.logo-title img { width: 100%; max-width: 520px; image-rendering: pixelated; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; color: var(--muted); font-size: 14px; margin-top: 24px; }
.site-footer p { margin: 0 0 8px; max-width: 80ch; }
.site-footer strong { color: var(--text); }

/* ---------- Narrow screens ---------- */
@media (max-width: 820px) {
  .hero .wrap, .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
  .download { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .site-header .wrap { padding-top: 10px; padding-bottom: 10px; }
  .nav a { padding: 6px 8px; font-size: 13px; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* =====================================================================
   Themes
   ===================================================================== */

/* Main page: embers and soot */
.theme-hub .hero { background:
  radial-gradient(ellipse at 20% 120%, rgba(255, 90, 42, .28), transparent 60%),
  radial-gradient(ellipse at 90% -20%, rgba(255, 179, 71, .12), transparent 55%); }
.theme-hub .hero .wrap { grid-template-columns: 1fr; text-align: left; }
.theme-hub .tagline { font: 600 20px/1.4 var(--font-display); color: var(--accent-2); margin: 0 0 18px; }

/* THE SCREAMER — NEC PC-9801, 1986: black screen, the eight digital colours, 640x400 text */
.theme-pc98 {
  --bg: #000;
  --bg-2: #000;
  --panel: #000;
  --line: #00aa00;
  --text: #fff;
  --muted: #aaa;
  --accent: #00ff00;
  --accent-2: #ffff00;
  --on-accent: #000;
  --radius: 0;
  --font-body: "DotGothic16", "MS Gothic", monospace;
  --font-display: "DotGothic16", "MS Gothic", monospace;
}
.theme-pc98 body, body.theme-pc98 { background:
  repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px), #000; }
.theme-pc98 h1, .theme-pc98 h2 { color: #00ffff; text-transform: uppercase; }
.theme-pc98 h3 { color: #ffff00; }
.theme-pc98 .panel { border: 2px solid #0000ff; box-shadow: inset 0 0 0 2px #000, inset 0 0 0 4px #0000ff; padding: 22px; }
.theme-pc98 .btn { border: 2px solid #00ff00; }
.theme-pc98 .btn.ghost { color: #00ffff; border-color: #00ffff; }
.theme-pc98 .eyebrow { color: #ff00ff; }
.theme-pc98 .hero-art { border: 2px solid #ffffff; image-rendering: pixelated; }
.theme-pc98 .blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Pixel art shown with sharp pixels */
.pixel { image-rendering: pixelated; }

/* OPENILLUSIONCITY — in the style of the Sharp X68000 game (1991): its colours, a bronze console and
   16-colour windows. The logo, frame and picture were drawn for the site; nothing comes from the game. */
.theme-x68k {
  --bg: #040404;
  --bg-2: #2a1d12;
  --panel: #040404;
  --line: #755535;
  --text: #f7f7f7;
  --muted: #f7d796;
  --accent: #3575b6;
  --accent-2: #f7b604;
  --on-accent: #f7f7f7;
  --radius: 0;
  --font-body: "DotGothic16", "MS Gothic", monospace;
  --font-display: "DotGothic16", "MS Gothic", monospace;
}
.theme-x68k .hero { background: linear-gradient(180deg, #040404 0 70%, #1a120a); border-bottom: 6px solid #755535;
  box-shadow: inset 0 -2px 0 #b67535, 0 2px 0 #f7b604; }
.theme-x68k .title-art { margin: 8px 0 18px; }
.theme-x68k .title-art .logo { width: 100%; max-width: 520px; height: auto; }
.theme-x68k h1.visually-hidden, .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.theme-x68k h2 { color: #f7b604; }
.theme-x68k h3 { color: #f7d796; }
.theme-x68k .eyebrow { color: #75b6f7; }
/* a 16-colour window frame */
.theme-x68k .panel {
  background: #040404;
  border: 12px solid transparent; border-image: url("../img/ic/frame.png") 6 / 12px round;
  image-rendering: pixelated; padding: 18px 20px;
}
/* console buttons */
.theme-x68k .btn { background: #3575b6; color: #f7f7f7; border: 3px solid; border-color: #75b6f7 #04254f #04254f #75b6f7; font-weight: 400; }
.theme-x68k .btn:hover { background: #4585c6; color: #fff; filter: none; }
.theme-x68k .btn.ghost { background: #755535; border-color: #f7b604 #3a2614 #3a2614 #f7b604; color: #f7d796; }
.theme-x68k .btn[aria-disabled="true"] { background: #555; border-color: #757575 #222 #222 #757575; color: #b6b696; }
.theme-x68k .hero-art { border: 4px solid #755535; outline: 2px solid #f7b604; background: #040404; }
.theme-x68k .hero-art img { width: 100%; }
.theme-x68k .badge { border-radius: 0; background: #040404; }

/* OPENARCTURUS — in the style of the Windows game (2000): a sunlit forest, parchment pages, illuminated
   initials and brown ink. The logo, parchment and forest were drawn for the site; nothing comes from the game. */
@font-face { font-family: "Nunito"; src: url("../fonts/nunito-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito-latin-700-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("../fonts/im-fell-english-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
.theme-arcturus {
  --bg: #0d2208;
  --bg-2: #431b00;
  --panel: #f2e68a;
  --line: #632f0b;
  --text: #fffeba;
  --muted: #e6d57b;
  --accent: #632f0b;
  --accent-2: #ffffbb;
  --on-accent: #ffffbb;
  --radius: 2px;
  --ink: #4a2e0c;
  --font-body: "Nunito", var(--site-body);
  --font-display: "IM Fell English", Georgia, serif;
}
body.theme-arcturus { background: #0d2208; }
.theme-arcturus main { font-size: 17px; }
.theme-arcturus h2 { font-size: 34px; font-weight: 400; color: #ffffbb; }
.theme-arcturus h3 { font-family: var(--font-display); font-size: 21px; font-weight: 400; }
.theme-arcturus .eyebrow { color: #f2e68a; letter-spacing: .04em; text-transform: none; font-size: 17px; font-weight: 400; }
.theme-arcturus .subtitle { font-family: var(--font-display); color: #f2e68a; font-size: 22px; }
/* the painted forest, with the illuminated title on a parchment strip */
.theme-arcturus .hero {
  background: linear-gradient(90deg, rgba(5, 20, 0, .55), rgba(5, 20, 0, .1) 70%), url("../img/arc/forest.jpg") center 35% / cover;
  border-bottom: 6px solid #431b00; box-shadow: 0 2px 0 #632f0b;
}
.theme-arcturus .hero .wrap { grid-template-columns: 1fr; }
.theme-arcturus .wordmark {
  display: inline-block; padding: 12px 18px; margin: 4px 0 14px;
  background: url("../img/arc/parchment.jpg") center / cover; border: 2px solid #632f0b; box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
}
.theme-arcturus .wordmark img { width: min(420px, 100%); height: auto; }
.theme-arcturus .hero p { text-shadow: 0 1px 3px #000, 0 0 12px rgba(0, 0, 0, .6); }
/* parchment pages */
.theme-arcturus .panel {
  color: var(--ink); background: url("../img/arc/parchment.jpg") center / cover;
  border: 2px solid #632f0b; box-shadow: 0 0 0 4px #431b00, inset 0 0 40px rgba(150, 110, 40, .35), 0 8px 24px rgba(0, 0, 0, .5); padding: 24px;
}
.theme-arcturus .panel h2, .theme-arcturus .panel h3, .theme-arcturus .panel a { color: #632f0b; }
.theme-arcturus .panel .facts dt, .theme-arcturus .panel .size { color: #7a5a2a; }
.theme-arcturus .panel .badge { background: #ffffbb; color: #632f0b; border-color: #632f0b; }
.theme-arcturus .btn { background: #632f0b; color: #ffffbb; border: 2px solid #f2e68a; }
.theme-arcturus .btn:hover { background: #7a3c10; color: #ffffbb; filter: none; }
.theme-arcturus .btn.ghost { background: rgba(255, 255, 187, .9); color: #632f0b; border-color: #632f0b; }
.theme-arcturus .panel .btn[aria-disabled="true"] { background: #e6d57b; color: #7a5a2a; border-color: #b39550; }
.theme-arcturus .badge { font-family: var(--site-display); }

/* Legal notice */
.legal { max-width: 760px; }
.legal h1 { font-size: clamp(28px, 5vw, 40px); margin-bottom: 8px; }
.legal h2 { font-size: 20px; margin: 28px 0 8px; }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.legal-link { font-size: 13px; }
