/* Freedom Forge — site styles. No build step; plain CSS.
   Palette is lifted from the logo: navy ground, flag blue, flag red, white.
   Montserrat (OFL, self-hosted) matches the wordmark in the logo. */
@font-face {
  font-family: "Montserrat";
  src: url("assets/fonts/montserrat-600.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --navy: #0a0f27;   /* sampled from the logo file so its crops blend in */
  --navy-2: #101a40;
  --navy-3: #16224f;
  --line: rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.18);
  --line-ctl: rgba(255,255,255,.42);   /* edges of buttons: 3:1+ on every surface (WCAG 1.4.11); .18 is 1.7:1 */
  --ink: #f4f6fb;
  --ink-soft: #b7bfd6;
  --ink-mute: #7f89a8;
  --blue: #2f7bff;
  --blue-deep: #1552e6;
  --red: #f5303f;
  --red-deep: #d0182b;
  /* The flag blue and red are for marks and fills. Under or as small text they
     fall short of 4.5:1, so text and buttons use these instead. */
  --link: #6ba4ff;       /* blue AS text: #2f7bff is 4.3:1 on --navy-2 */
  --blue-btn: #2468f2;   /* blue UNDER white text: #2f7bff is 3.9:1 */
  --red-btn: #d92536;    /* red UNDER white text: #f5303f is 3.9:1 */
  --ok: #38c172;
  --amber: #f0b429;
  --radius: 14px;
  --max: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* scroll-padding: the header is sticky, so anything scrolled to (an anchor, or whatever
   Tab lands on next) has to stop below it, not underneath (WCAG 2.4.11). */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--ink);
  line-height: 1.6;
  font-size: 1.0625rem;
  overflow-x: clip;
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
/* a link inside a sentence is 2:1 against the words round it: colour alone does not mark it (WCAG 1.4.1) */
p a, li a, td a { text-decoration: underline; text-underline-offset: .18em; }
h1, h2, h3 { font-family: "Montserrat", var(--font); line-height: 1.15; letter-spacing: -.01em; font-weight: 700; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.375rem; }
p { color: var(--ink-soft); }
.wrap { width: min(var(--max), 100% - 40px); margin: 0 auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--red-btn); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 6px; }
/* <main> takes focus from the skip link; it should not draw a ring round the page */
main:focus { outline: none; }

/* wordmark ---------------------------------------------------------- */
.wordmark { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; min-height: 44px; }
.wordmark:hover { text-decoration: none; }
.wordmark img { width: 44px; height: auto; }
.wordmark span {
  font-family: "Montserrat", var(--font);
  font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  font-size: .9375rem; white-space: nowrap;
}

/* header ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,18,48,.86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 66px; gap: 16px; }
.site-nav { display: flex; gap: 4px; align-items: center; }
.site-nav a {
  color: var(--ink-soft); padding: 8px 12px; border-radius: 8px; font-size: .9375rem; font-weight: 500;
}
.site-nav a:hover { color: var(--ink); background: var(--navy-3); text-decoration: none; }
.site-nav a.cta { color: #fff; background: var(--red-btn); }
.site-nav a.cta:hover { background: var(--red-deep); }
.menu-btn {
  display: none; background: none; border: 1px solid var(--line-ctl); color: var(--ink);
  border-radius: 8px; padding: 8px 10px; font: inherit; cursor: pointer;
  align-items: center; min-height: 44px; flex: none;
}

/* buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 10px; font-weight: 600; font-size: 1rem;
  text-decoration: none; border: 1px solid transparent; min-height: 46px;
  text-align: center; overflow-wrap: anywhere;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--red-btn); color: #fff; }
.btn-primary:hover { background: var(--red-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-ctl); }
.btn-ghost:hover { border-color: var(--blue); color: #fff; background: rgba(47,123,255,.12); }
.btn-blue { background: var(--blue-btn); color: #fff; }
.btn-blue:hover { background: var(--blue-deep); }
.btn[aria-disabled="true"] { opacity: .55; cursor: default; pointer-events: none; }

/* hero -------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(56px, 9vw, 120px) 0 clamp(48px, 7vw, 96px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(47,123,255,.28), transparent 60%),
    radial-gradient(700px 380px at 90% 10%, rgba(245,48,63,.20), transparent 60%),
    var(--navy);
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero .wrap { position: relative; z-index: 1; }
.hero .wrap > * { min-width: 0; }   /* a long title must not widen its column past the screen */
.hero h1 { overflow-wrap: anywhere; }   /* last resort; the small-screen size below normally prevents it */
/* Pause / play for the rain (hero-rain.js adds the button). Anything that moves for more
   than five seconds needs a way to stop it (WCAG 2.2.2). */
.rain-toggle {
  position: absolute; right: 8px; bottom: 6px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(10,15,39,.72); border: 1px solid var(--line-ctl); color: var(--ink);
}
.rain-toggle:hover { background: var(--navy-3); }
.rain-toggle svg { width: 14px; height: 14px; fill: currentColor; }
/* the character rain behind the hero (hero-rain.js); the mask keeps it away from the edges and the text column */
.hero-rain { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; opacity: .55;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 80%, transparent 100%); }
.hero.no-mark .wrap { grid-template-columns: 1fr; }
.hero.no-mark .hero-mark { display: none; }
.hero-mark { width: min(100%, 520px); margin: 0 auto; filter: drop-shadow(0 24px 40px rgba(0,0,0,.5)); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8125rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.hero h1 {
  font-family: "Montserrat", var(--font);
  margin: 18px 0 8px;
  font-size: clamp(2.375rem, 5.6vw, 4.125rem);
  letter-spacing: .06em; text-transform: uppercase; font-weight: 700;
}
.hero .lede { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); max-width: 34em; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
/* --ink-soft, not --ink-mute: the rain passes behind this line, and mute over a glyph is 3.7:1 */
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 26px; color: var(--ink-soft); font-size: .875rem; }
.hero .meta span::before { content: "✓ "; content: "✓ " / ""; color: var(--ok); }   /* second form: not read out */

/* sections ---------------------------------------------------------- */
section { padding: clamp(56px, 7vw, 96px) 0; }
.section-head { max-width: 46em; margin-bottom: 36px; }
.section-head .kicker { color: var(--link); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; font-size: .8125rem; }
.section-head h2 { margin: 6px 0 10px; }
.alt { background: var(--navy-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* game cards -------------------------------------------------------- */
.games { display: grid; gap: 28px; }
.game {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  background: var(--navy-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.game:nth-child(even) { grid-template-columns: 1fr 1.15fr; }
.game > * { min-width: 0; }   /* or one long word in a card widens the whole page */
.game:nth-child(even) .game-media { order: 2; }
.game-media { position: relative; min-height: 260px; background: #000; }
.game-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.game-media.pixel img { image-rendering: auto; }
.game-body { padding: clamp(22px, 3vw, 40px); display: flex; flex-direction: column; gap: 14px; }
.status {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: .78125rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-soft);
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-mute); }
.status.live::before { background: var(--ok); box-shadow: 0 0 0 4px rgba(56,193,114,.18); }
.status.soon::before { background: var(--amber); box-shadow: 0 0 0 4px rgba(240,180,41,.18); }
.status.dev::before { background: var(--blue); box-shadow: 0 0 0 4px rgba(47,123,255,.18); }
.game h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.game .tag { color: var(--ink); font-weight: 500; font-size: 1.0625rem; }
.game ul { list-style: none; display: grid; gap: 6px; color: var(--ink-soft); font-size: .96875rem; }
.game ul li { padding-left: 22px; position: relative; }
.game ul li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; border-radius: 3px; background: var(--red); transform: rotate(45deg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .8125rem; color: var(--ink-soft); border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 10px; background: rgba(255,255,255,.03); }
.game .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-top: 4px; }
.thumbs img { border-radius: 8px; border: 1px solid var(--line); aspect-ratio: 16/9; object-fit: cover; width: 100%; }
a.zoom { display: block; cursor: zoom-in; position: relative; }
.game-media a.zoom { position: absolute; inset: 0; }
.game-media a.zoom img { position: static; height: 100%; }
a.zoom:hover img { filter: brightness(1.08); }
/* Focus on a screenshot: a white ring with a navy line inside it, drawn over the picture,
   so it shows whatever the picture's colours are. */
a.zoom:focus-visible { outline: none; }
a.zoom:focus-visible::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 8px;
  border: 3px solid #fff; box-shadow: inset 0 0 0 3px var(--navy);
}

/* lightbox ---------------------------------------------------------- */
.lightbox[hidden] { display: none !important; }   /* the class rule below would otherwise beat the hidden attribute in WebKit */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(6,9,24,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); width: auto; height: auto; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.7); }
.lightbox-cap { color: var(--ink-soft); font-size: .875rem; margin-top: 12px; text-align: center; max-width: 60ch; }
.lightbox-close { position: absolute; top: 12px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-ctl); background: var(--navy-2); color: var(--ink); font-size: 1.625rem; line-height: 1; cursor: pointer; }
.lightbox-close:hover { background: var(--navy-3); }

/* principles -------------------------------------------------------- */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.principle {
  background: var(--navy); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px;
}
.principle .ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(47,123,255,.25), rgba(245,48,63,.25)); border: 1px solid var(--line-strong);
}
.principle .ico svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.principle h3 { font-size: 1.125rem; margin-bottom: 6px; }
.principle p { font-size: .9375rem; }

/* about ------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: start; }
.about-grid p + p { margin-top: 14px; }
.facts { display: grid; gap: 12px; }
.fact { background: var(--navy-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.fact dt { display: block; color: var(--ink); font-size: .9375rem; font-weight: 700; }
.fact dd { color: var(--ink-soft); font-size: .90625rem; }

/* contact ----------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.contact-card { background: var(--navy); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px; }
.contact-card h3 { font-size: 1.125rem; margin-bottom: 6px; }
.contact-card p { font-size: .9375rem; margin-bottom: 14px; }

/* footer ------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--ink-mute); font-size: .875rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.site-footer a { color: var(--ink-soft); }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer .legal { width: 100%; font-size: .8125rem; }

/* project pages (<slug>.freedomforge.dev, built by tools/build_project_pages.py) */
.hero-shot { border-radius: 14px; border: 1px solid var(--line-strong); box-shadow: 0 30px 60px rgba(0,0,0,.5); }
.bullets { list-style: none; display: grid; gap: 10px; color: var(--ink-soft); max-width: 62em; margin-bottom: 22px; }
.bullets li { padding-left: 22px; position: relative; }
.bullets li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; border-radius: 3px; background: var(--red); transform: rotate(45deg); }
.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.shots figure { margin: 0; background: var(--navy); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.shots img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.shots figcaption { padding: 12px 16px; font-size: .90625rem; color: var(--ink-soft); }
/* app pages: window captures of different shapes, shown whole instead of cropped to 16:9 */
.shots.natural img { aspect-ratio: auto; object-fit: contain; width: auto; max-width: 100%; max-height: 520px; margin: 0 auto; }
#contact .actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 720px) { .shots { grid-template-columns: 1fr; } }

/* inner pages (privacy / support) ---------------------------------- */
.page { padding: clamp(40px, 6vw, 80px) 0; }
.page .wrap { max-width: 760px; }
.page h1 { font-size: clamp(1.875rem, 4vw, 2.75rem); margin-bottom: 8px; }
.page .updated { color: var(--ink-mute); font-size: .875rem; margin-bottom: 28px; }
.page h2 { font-size: 1.375rem; margin: 32px 0 10px; }
.page p, .page li { color: var(--ink-soft); }
.page ul { padding-left: 22px; display: grid; gap: 6px; }
.page table { width: 100%; border-collapse: collapse; font-size: .9375rem; margin: 12px 0; }
.page th, .page td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.page th { color: var(--ink); font-weight: 600; }
.page td { color: var(--ink-soft); }
.table-scroll { overflow-x: auto; }

/* responsive -------------------------------------------------------- */
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero-mark { width: min(80%, 380px); order: -1; }
  .hero .lede { margin: 0 auto; }
  .hero .actions, .hero .meta { justify-content: center; }
  .principles { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .game, .game:nth-child(even) { grid-template-columns: 1fr; }
  .game:nth-child(even) .game-media { order: 0; }
  .game-media { min-height: 0; aspect-ratio: 16/9; }
  .game-media img { position: static; height: 100%; }
  .game-media a.zoom { position: static; display: block; height: 100%; }
}
@media (max-width: 720px) {
  body { font-size: 1rem; }
  .menu-btn { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 16px 16px;
    background: rgba(11,18,48,.97); border-bottom: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 12px; font-size: 1rem; }
  .principles { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .hero .actions .btn { width: auto; flex: 1 1 180px; }
  .game .actions .btn { width: auto; flex: 1 1 160px; }
}
/* 320px is a small phone, and also a laptop zoomed to 400%: the name and the Menu button
   must both fit. They need 315px side by side at full size, which runs out at 360. */
@media (max-width: 360px) {
  .wordmark { gap: 9px; }
  .wordmark img { width: 34px; }
  .wordmark span { font-size: .8125rem; letter-spacing: .13em; white-space: normal; line-height: 1.25; }
  /* a one-word title (FREEDOMDISK) has nowhere to wrap: at 38px it is wider than the screen */
  .hero h1 { font-size: 1.75rem; }
}
/* A phone on its side, or heavy zoom: a sticky bar would take a fifth of the screen. */
@media (max-height: 500px) {
  .site-header { position: relative; }
  html { scroll-padding-top: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* small print under a project's actions (beta caveats) */
.game-body .note { font-size: .85rem; opacity: .78; margin-top: .9rem; line-height: 1.5; }
.game-body .note code { font: .8rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(255,255,255,.08); padding: .1rem .35rem; border-radius: 4px; white-space: nowrap; }

.fine { font-size: .75rem; color: var(--ink-soft); margin-top: 8px; }
