/* ==========================================================================
   SCP Docs — site theme
   Dark "containment terminal" aesthetic. No external assets, system fonts.
   Legacy class names (card, dl-flat, prose, screen-frame, …) are kept
   working so generated bodies in all languages render consistently.
   ========================================================================== */

:root {
  --bg: #0a0c0e;
  --bg-raise: #0e1114;
  --surface: #12161a;
  --surface-2: #171c21;
  --text: #cfd3cc;
  --bright: #f2f3ee;
  --muted: #838c94;
  --border: #232b31;
  --line: rgba(242, 243, 238, 0.08);
  --accent: #e13030;
  --accent-strong: #ff4a3f;
  --accent-dim: rgba(225, 48, 48, 0.14);
  --amber: #e3b04b;
  --radius: 10px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(1100px 500px at 75% -120px, rgba(225, 48, 48, 0.07), transparent 60%),
    radial-gradient(900px 460px at 8% 4%, rgba(227, 176, 75, 0.04), transparent 55%),
    var(--bg);
}

/* faint scanlines over everything, very low key */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.014) 0,
    rgba(255, 255, 255, 0.014) 1px,
    transparent 1px,
    transparent 3px
  );
}

::selection {
  background: var(--accent);
  color: #0a0c0e;
}

a {
  color: inherit;
}

a:not(.btn):not(.pill):not(.btn-primary):not(.btn-ghost) {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(225, 48, 48, 0.55);
}

a:not(.btn):not(.pill):not(.btn-primary):not(.btn-ghost):hover {
  color: var(--accent-strong);
}

strong {
  color: var(--bright);
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px 90px;
}

.layout-wide {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px 90px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.terminal-header {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0 -20px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 14, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* thin hazard strip along the very top */
.terminal-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(
    -45deg,
    var(--accent) 0 12px,
    #1a1d20 12px 24px
  );
}

.terminal-header-inner {
  max-width: 1020px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
  align-items: center;
}

.terminal-header-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.brand-line {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-line::before {
  content: "▮ ";
  color: var(--accent);
}

.brand-title {
  font-family: var(--font-mono);
  font-size: clamp(17px, 3vw, 21px);
  font-weight: 700;
  margin: 2px 0 0;
  letter-spacing: 0.06em;
  color: var(--bright);
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.terminal-header .nav a {
  text-decoration: none;
  padding: 5px 0;
  color: var(--muted);
}

.nav a.nav-store {
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 5px 10px;
  color: var(--bright);
  background: var(--accent-dim);
}

.nav a:not([aria-current="page"]):hover {
  color: var(--accent-strong);
}

.nav a.nav-store:hover {
  background: var(--accent);
  color: #0a0c0e;
}

.nav a[aria-current="page"] {
  color: var(--bright);
  border-bottom: 2px solid var(--accent);
  text-decoration: none;
}

.language-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.language-switch-label {
  color: var(--muted);
  margin-right: 2px;
}

.language-switch a {
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  padding: 3px 7px;
  text-decoration: none;
  background: transparent;
}

.language-switch a:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.language-switch a[aria-current="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0c0e;
  font-weight: 700;
}

@media (max-width: 720px) {
  .terminal-header-actions {
    align-items: flex-start;
    width: 100%;
  }

  .language-switch {
    justify-content: flex-start;
  }
}

.main-pad {
  margin-top: 34px;
}

/* --------------------------------------------------------------------------
   Section headings
   -------------------------------------------------------------------------- */

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin: 0 0 10px;
}

.section-label::before {
  content: "// ";
  color: var(--muted);
}

.section-title-lg {
  font-family: var(--font-mono);
  font-size: clamp(21px, 3.6vw, 30px);
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: 0.015em;
  color: var(--bright);
  overflow-wrap: anywhere;
}

section {
  scroll-margin-top: 90px;
}

/* --------------------------------------------------------------------------
   Hero (index)
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  margin-top: 40px;
}

.hero-grid {
  display: grid;
  gap: 34px;
  align-items: center;
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  }
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-raise);
}

.hero-kicker .accent {
  color: var(--accent-strong);
}

.blink {
  color: var(--accent);
  animation: blink 1.15s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blink {
    animation: none;
  }
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(38px, 7.2vw, 68px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--bright);
  margin: 0 0 20px;
}

.hero-title .accent {
  color: var(--accent-strong);
  text-shadow: 0 0 34px rgba(225, 48, 48, 0.45);
}

.hero-lede {
  font-size: clamp(15.5px, 2.1vw, 17.5px);
  line-height: 1.8;
  max-width: 56ch;
  margin: 0 0 26px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  padding: 8px 22px;
  border-radius: 7px;
  font-family: var(--font-mono);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #0b0c0d;
  box-shadow: 0 0 26px rgba(225, 48, 48, 0.35);
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  transform: translateY(-1px);
}

.btn-primary .btn-main,
.btn-ghost .btn-main {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.btn-primary .btn-sub,
.btn-ghost .btn-sub {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.3;
  opacity: 0.75;
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--bright);
  background: var(--bg-raise);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.hero-badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.hero-badges li {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--bg-raise);
}

.hero-shot {
  position: relative;
  margin: 0;
  justify-self: center;
  max-width: 320px;
  width: 100%;
  transform: rotate(1.6deg);
}

.hero-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 6px rgba(18, 22, 26, 0.9),
    0 24px 70px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(225, 48, 48, 0.16);
}

.hero-shot::after {
  content: "UNOFFICIAL // FAN-MADE";
  position: absolute;
  top: 16px;
  left: -14px;
  transform: rotate(-8deg);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent-strong);
  border: 2px solid var(--accent-strong);
  border-radius: 4px;
  padding: 4px 8px;
  background: rgba(10, 12, 14, 0.82);
  opacity: 0.9;
}

/* stat strip under the hero */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
}

@media (min-width: 760px) {
  .hero-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.hero-stat {
  background: var(--surface);
  padding: 18px 20px 16px;
}

.hero-stat .num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--bright);
  line-height: 1.1;
}

.hero-stat .num em {
  font-style: normal;
  color: var(--accent-strong);
}

.hero-stat .lbl {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Cards & grids
   -------------------------------------------------------------------------- */

.card,
.feature-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  padding: 20px 22px;
  margin-bottom: 16px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.card:hover,
.feature-card:hover {
  border-color: rgba(225, 48, 48, 0.5);
}

.card-flat {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--bg-raise);
}

.card-invert {
  position: relative;
  background: linear-gradient(180deg, #151a1f, #101418);
  color: var(--text);
  border-radius: var(--radius);
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.card-invert a {
  color: var(--bright);
  text-decoration: underline;
}

.card-invert a:hover {
  color: var(--accent-strong);
}

.card h3,
.feature-card h3 {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  color: var(--bright);
}

.feature-card {
  margin-bottom: 0;
}

.feature-card > .section-label {
  margin-bottom: 6px;
}

.feature-card p:last-child {
  margin-bottom: 0;
}

.grid-2 {
  display: grid;
  gap: 16px;
}

.grid-2 > *,
.feature-hero > *,
.feature-grid > *,
.feature-shot-grid > * {
  min-width: 0;
}

.grid-2 .card {
  margin-bottom: 0;
}

.feature-hero {
  display: grid;
  gap: 22px;
  align-items: start;
}

.feature-grid,
.feature-shot-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .feature-hero {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .feature-grid,
  .feature-shot-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .feature-shot-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Screenshots
   -------------------------------------------------------------------------- */

.screen-frame {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.screen-frame:hover {
  border-color: rgba(225, 48, 48, 0.55);
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.screen-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.screen-frame figcaption {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  text-transform: uppercase;
  background: var(--bg-raise);
}

.screen-frame figcaption::before {
  content: "▸ ";
  color: var(--accent);
}

.screen-frame-compact {
  max-width: 340px;
}

.hero-media {
  margin: 22px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* --------------------------------------------------------------------------
   Store CTA block (inside card-invert)
   -------------------------------------------------------------------------- */

.store-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.store-cta-copy {
  display: grid;
  gap: 2px;
  min-width: min(100%, 280px);
}

.store-cta-copy strong {
  font-family: var(--font-mono);
  font-size: clamp(15px, 2vw, 17px);
  letter-spacing: 0.04em;
  color: var(--bright);
}

.store-cta-copy span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.store-cta-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.card-invert a.store-cta-link {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-width: min(100%, 200px);
  min-height: 56px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #0b0c0d;
  text-decoration: none;
  box-shadow: 0 0 26px rgba(225, 48, 48, 0.3);
}

.card-invert a.store-cta-link:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #0b0c0d;
}

.store-cta-link-main {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.store-cta-link-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  line-height: 1.3;
  text-transform: uppercase;
  opacity: 0.75;
}

@media (max-width: 520px) {
  .store-cta {
    align-items: stretch;
  }

  .card-invert a.store-cta-link {
    width: 100%;
    min-width: 0;
  }
}

/* --------------------------------------------------------------------------
   Chips, pills, lists
   -------------------------------------------------------------------------- */

.code-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-right: 6px;
  margin-bottom: 6px;
  color: var(--text);
  background: var(--bg-raise);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  background: var(--bg-raise);
}

.pill:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.ft-list {
  margin: 0;
  padding-left: 1.2em;
}

.ft-list li {
  margin-bottom: 9px;
}

.ft-list li::marker {
  color: var(--accent);
}

.ft-muted {
  color: var(--muted);
  font-size: 14px;
}

.lede {
  font-size: clamp(15.5px, 2.2vw, 17px);
  line-height: 1.8;
}

.dl-flat {
  margin: 0;
}

.dl-flat dt {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-top: 16px;
  color: var(--accent-strong);
}

.dl-flat dt:first-child {
  margin-top: 0;
}

.dl-flat dt::before {
  content: "▸ ";
  color: var(--muted);
}

.dl-flat dd {
  margin: 4px 0 0;
}

/* --------------------------------------------------------------------------
   Comparison table (Free vs Premium)
   -------------------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.cmp-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14px;
}

.cmp-table th,
.cmp-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.cmp-table thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-raise);
  border-bottom: 2px solid var(--accent);
}

.cmp-table thead th:not(:first-child),
.cmp-table td:not(:first-child) {
  text-align: center;
  white-space: nowrap;
}

.cmp-table tbody tr:last-child td {
  border-bottom: none;
}

.cmp-table tbody tr:hover td {
  background: rgba(225, 48, 48, 0.045);
}

.cmp-table .yes {
  color: var(--accent-strong);
  font-weight: 700;
  font-family: var(--font-mono);
}

.cmp-table .no {
  color: var(--muted);
  font-family: var(--font-mono);
}

.cmp-table .part {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   Long-form legal pages
   -------------------------------------------------------------------------- */

article.prose {
  padding-top: 16px;
}

article.prose section {
  margin-bottom: 30px;
}

article.prose h2 {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 38px 0 12px;
  padding: 8px 12px;
  color: var(--bright);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
}

article.prose p {
  margin: 10px 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 70px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 120px;
  height: 3px;
  background: repeating-linear-gradient(
    -45deg,
    var(--accent) 0 10px,
    transparent 10px 20px
  );
}

.site-footer-inner {
  display: grid;
  gap: 14px;
}

@media (min-width: 560px) {
  .site-footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

.site-footer strong {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Buttons (legacy)
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 7px;
  text-decoration: none;
  background: var(--surface);
  color: var(--bright);
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}
