/* ===========================================================
   Dreamcast Linux — landing page
   Modern dark layout with retro / CRT accents.
   =========================================================== */

:root {
  --orange:      #f06d00;   /* Dreamcast swirl orange */
  --orange-soft: #ff8a2b;
  --bg:          #0a0a0c;
  --bg-2:        #111114;
  --panel:       #16161b;
  --panel-2:     #1c1c22;
  --line:        #2a2a33;
  --text:        #e9e9ee;
  --text-dim:    #9a9aa6;
  --ok:          #5ad17a;
  --no:          #ff5d5d;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--orange-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

/* External-link marker — auto-appended to any link that opens in a new tab,
   so visitors can see when a link leaves the site. New external links get it
   for free; the big CTA buttons and the release badge are opted out. */
a[target="_blank"]:not(.btn):not(.hero__badge)::after {
  content: "\00A0↗";
  font-size: 0.78em;
  opacity: 0.6;
  vertical-align: baseline;
}
a[target="_blank"]:not(.btn):not(.hero__badge):hover::after { opacity: 0.9; }

code {
  font-family: var(--mono);
  background: #000;
  color: var(--orange-soft);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  font-size: 0.86em;
  border: 1px solid var(--line);
}

.accent { color: var(--orange); }

/* ---- CRT scanline overlay (subtle) ---- */
.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.18) 3px,
    rgba(0,0,0,0) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

/* ---- Swirl mark (CSS-drawn) ---- */
.swirl {
  display: inline-block;
  width: 0.9em; height: 0.9em;
  border-radius: 50%;
  background:
    conic-gradient(from 220deg, var(--orange), transparent 65%),
    radial-gradient(circle at center, transparent 30%, var(--orange) 32%, transparent 42%);
  vertical-align: -0.1em;
  margin-right: 0.45em;
  box-shadow: 0 0 12px rgba(240,109,0,0.5);
}

/* ===================== NAV ===================== */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(10,10,12,0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  font-weight: 700; font-size: 1.1rem; color: var(--text);
  display: flex; align-items: center;
}
.nav__brand:hover { text-decoration: none; }
.nav__links { display: flex; align-items: center; gap: clamp(0.6rem, 2vw, 1.6rem); }
.nav__links a { color: var(--text-dim); font-size: 0.92rem; }
.nav__links a:hover { color: var(--text); text-decoration: none; }
.nav__gh {
  border: 1px solid var(--line); border-radius: 6px;
  padding: 0.35rem 0.7rem; color: var(--text) !important;
}
.nav__gh:hover { border-color: var(--orange); }
@media (max-width: 720px) {
  .nav__links a:not(.nav__gh) { display: none; }
}

/* ===================== HERO ===================== */
.hero {
  position: relative;
  text-align: center;
  padding: clamp(3rem, 9vw, 7rem) 1.25rem 3rem;
  overflow: hidden;
}
.hero__glow {
  position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
  width: 1100px; height: 1100px; max-width: 150vw;
  background: radial-gradient(circle, rgba(240,109,0,0.13), transparent 62%);
  filter: blur(30px); pointer-events: none; z-index: 0;
}
.hero__inner { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin: 0 0 1.4rem; padding: 0.35rem 0.85rem;
  font-family: var(--mono); font-size: 0.8rem; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .12s, transform .12s;
}
.hero__badge:hover { text-decoration: none; border-color: var(--orange); transform: translateY(-1px); }
.hero__badge strong { color: var(--orange); }
.hero__badge-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(90,209,122,0.6); animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(90,209,122,0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(90,209,122,0); }
  100% { box-shadow: 0 0 0 0 rgba(90,209,122,0); }
}
.hero__kicker {
  font-family: var(--mono); color: var(--orange);
  letter-spacing: 0.08em; font-size: 0.85rem; margin: 0 0 0.6rem;
}
.hero__title {
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  line-height: 1.1; margin: 0 0 1.1rem; font-weight: 700;
  letter-spacing: -0.01em;
}
.hero__sub {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--text-dim); max-width: 640px; margin: 0 auto 1.8rem;
}
.hero__sub strong { color: var(--text); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; }
.hero__note { margin-top: 1.4rem; color: var(--text-dim); font-size: 0.85rem; font-family: var(--mono); }

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: 0.7rem 1.3rem;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font-weight: 500; font-size: 0.95rem;
  background: var(--panel); transition: transform .12s, border-color .12s, background .12s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--orange); }
.btn--primary {
  background: var(--orange); border-color: var(--orange); color: #1a0c00; font-weight: 700;
  box-shadow: 0 6px 24px rgba(240,109,0,0.35);
}
.btn--primary:hover { background: var(--orange-soft); }

/* ===================== TERMINAL ===================== */
.terminal-wrap { max-width: 760px; margin: 0 auto; padding: 0 1.25rem 1rem; }
.terminal {
  position: relative;
  background: #000; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
/* fade hint at the bottom of the scrollable log */
.terminal__fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 52px;
  background: linear-gradient(rgba(0,0,0,0), #000);
  pointer-events: none;
}
.terminal__bar {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 0.9rem; background: var(--panel-2); border-bottom: 1px solid var(--line);
}
.dot { width: 11px; height: 11px; border-radius: 50%; background: #444; }
.dot:nth-child(1){ background:#ff5f56;} .dot:nth-child(2){ background:#ffbd2e;} .dot:nth-child(3){ background:#27c93f;}
.terminal__title { margin-left: 0.6rem; font-family: var(--mono); font-size: 0.78rem; color: var(--text-dim); }
.terminal__body {
  margin: 0; padding: 1.1rem 1.2rem 3.4rem; font-family: var(--mono);
  font-size: clamp(0.7rem, 1.9vw, 0.86rem); line-height: 1.7;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
  max-height: 360px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.terminal__body:focus-visible { outline: 1px solid var(--orange); outline-offset: -1px; }
.terminal__body::-webkit-scrollbar { width: 10px; }
.terminal__body::-webkit-scrollbar-track { background: transparent; }
.terminal__body::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 6px; border: 2px solid #000;
}
.terminal__body::-webkit-scrollbar-thumb:hover { background: var(--orange); }
.c-ok { color: var(--ok); } .c-acc { color: var(--orange); } .c-dim { color: var(--text-dim); }
.cursor { color: var(--orange); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.terminal__cap { text-align: center; color: var(--text-dim); font-size: 0.85rem; margin-top: 0.9rem; }

/* ===================== GALLERY ===================== */
.gallery {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 320px));
  justify-content: center; gap: 1.1rem;
}
.shot { margin: 0; }
.shot__btn {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; cursor: pointer; background: #000;
  transition: border-color .15s, transform .15s;
}
/* show the whole image at its natural ratio — no cropping; the capped tile
   width keeps the box small/short */
.shot__btn img {
  display: block; width: 100%; height: auto; background: #000;
}
.shot__btn:hover { border-color: var(--orange); transform: translateY(-3px); }
.shot__btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.shot figcaption { margin-top: 0.6rem; color: var(--text-dim); font-size: 0.9rem; text-align: center; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(5,5,7,0.92); backdrop-filter: blur(6px);
}
.lightbox[hidden] { display: none; }
/* the visible box hugs the image, so it always reads as a landscape card
   (not a tall void) even in a narrow preview pane */
.lightbox__fig {
  margin: 0; text-align: center;
  display: inline-block; max-width: min(94vw, 860px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: clamp(0.7rem, 2vw, 1.2rem);
  box-shadow: 0 30px 80px rgba(0,0,0,0.65);
}
.lightbox__img {
  display: block; width: auto; height: auto;
  max-width: 100%; max-height: 64vh; border-radius: 6px;
}
.lightbox__cap { margin-top: 0.7rem; color: var(--text-dim); font-size: 0.9rem; }
.lightbox__close {
  position: absolute; top: 1rem; right: 1.2rem;
  width: 44px; height: 44px; line-height: 40px; font-size: 1.8rem;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 50%; cursor: pointer;
}
.lightbox__close:hover { border-color: var(--orange); color: var(--orange); }

@media (prefers-reduced-motion: reduce) {
  .shot__btn { transition: none; }
}

/* ===================== STATS ===================== */
.stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1rem, 5vw, 4rem);
  max-width: var(--maxw); margin: 2.5rem auto 1rem; padding: 1.5rem 1.25rem;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { text-align: center; }
.stat__num { display: block; font-family: var(--mono); font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--orange); }
.stat__num small { font-size: 0.5em; color: var(--orange-soft); }
.stat__lbl { color: var(--text-dim); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ===================== SECTIONS ===================== */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(3rem, 7vw, 5rem) clamp(1rem, 4vw, 2rem); }
.section__title { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 0.5rem; font-weight: 700; }
.section__title .accent { font-family: var(--mono); }
.section__lead { color: var(--text-dim); font-size: 1.05rem; max-width: 680px; margin: 0 0 2rem; }
.section__foot { color: var(--text-dim); font-size: 0.88rem; margin-top: 1.2rem; }

/* ---- Feature grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.card {
  background: linear-gradient(160deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: 12px; padding: 1.3rem;
  transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-4px); border-color: var(--orange); }
.card h3 { margin: 0 0 0.5rem; font-size: 1.08rem; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.92rem; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; min-width: 540px; font-size: 0.92rem; }
.table th, .table td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
.table thead th { background: var(--panel-2); color: var(--text); font-family: var(--mono); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(240,109,0,0.05); }
.table .ok { color: var(--ok); white-space: nowrap; }
.table .no { color: var(--no); white-space: nowrap; }
.cta-row { margin-top: 1.6rem; }

/* ---- Latest release panel ---- */
.release {
  margin-bottom: 1.8rem; padding: 1.2rem 1.4rem;
  background: linear-gradient(160deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-left: 3px solid var(--orange);
  border-radius: 12px;
}
.release__head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 0.9rem;
  margin-bottom: 0.9rem;
}
.release__tag {
  font-family: var(--mono); font-weight: 700; font-size: 0.95rem;
  color: #1a0c00; background: var(--orange);
  padding: 0.18rem 0.7rem; border-radius: 6px;
}
.release__meta { font-family: var(--mono); font-size: 0.82rem; color: var(--text-dim); }
.release__link { margin-left: auto; font-size: 0.85rem; white-space: nowrap; }
.release__notes { margin: 0; padding-left: 1.2rem; color: var(--text-dim); font-size: 0.95rem; }
.release__notes li { margin-bottom: 0.35rem; }
.release__notes strong { color: var(--text); }

/* ===================== HERITAGE ===================== */
.section--heritage {
  max-width: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(240,109,0,0.10), transparent 55%),
    var(--bg-2);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.heritage { max-width: var(--maxw); margin: 0 auto; }
.heritage__intro { color: var(--text-dim); font-size: 1.08rem; max-width: 760px; margin: 0 0 2.2rem; }
.heritage__intro strong { color: var(--text); }
.heritage__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.tribute {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.4rem;
}
.tribute h3 { margin: 0 0 0.6rem; color: var(--orange); font-size: 1.05rem; }
.tribute p { margin: 0 0 0.8rem; color: var(--text-dim); font-size: 0.92rem; }
.tribute__meta { font-family: var(--mono); font-size: 0.78rem; color: var(--text-dim); }
.heritage__quote {
  margin: 2.4rem auto 0; max-width: 700px; text-align: center;
  font-family: var(--mono); font-size: 1rem; color: var(--orange-soft); line-height: 1.6;
}
.heritage__quote span { display: block; margin-top: 0.8rem; font-size: 0.8rem; color: var(--text-dim); }

/* ===================== FOOTER ===================== */
.footer { background: var(--bg); border-top: 1px solid var(--line); padding: 3rem clamp(1rem, 4vw, 2.5rem) 2rem; }
.footer__cols {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem;
}
.footer__cols h4 { margin: 0 0 0.8rem; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.footer__cols a { display: block; color: var(--text-dim); font-size: 0.9rem; margin-bottom: 0.45rem; }
.footer__cols a:hover { color: var(--orange); text-decoration: none; }
.footer__tag { color: var(--text-dim); font-size: 0.88rem; margin: 0.6rem 0 0; max-width: 260px; }
.footer__bar {
  max-width: var(--maxw); margin: 2.5rem auto 0; padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: space-between;
  color: var(--text-dim); font-size: 0.78rem;
}
@media (max-width: 720px) {
  .footer__cols { grid-template-columns: 1fr 1fr; }
}

/* ===================== MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .btn:hover, .card:hover { transform: none; }
  .scanlines { display: none; }
}
