/* Final Fortress: tenebrae.lat marketing/support/privacy pages.
   Design tokens and CRT stack are taken pixel-for-pixel from the design
   handoff (design_handoff_tenebrae_site/README.md + Tenebrae.dc.html),
   itself sourced from the game's own Palette.swift / PhosphorTheme.swift /
   CRT.metal / TerminalRow.swift. Do not hand-tune a color or a timing
   value here without checking the handoff first. "High fidelity,
   recreate pixel-perfectly" is a binding instruction, not a suggestion.

   One structural change from the prototype (explicitly called for in the
   handoff's "Interactions & behaviour" section): the prototype scrolls an
   *inner* container because its tube is `position:fixed`. Here the
   document itself scrolls and the CRT layers are `position:fixed`
   instead, so mobile browsers keep native scrolling and address-bar
   behavior. */

:root {
  --color-bg: #0A0A0A;                    /* the unlit glass, page background */
  --color-page: #050505;                  /* html/body behind the tube */
  --color-primary: #7AD87A;               /* biolume, all text, borders, default tube */
  --color-dim: rgba(122, 216, 122, 0.55); /* secondary text, labels, body copy */
  --color-faint: rgba(122, 216, 122, 0.22); /* hairlines, dotted leaders, footer */
  --color-alert: #FFB000;                 /* hover states only on the site */
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-page);
}

body {
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  color: var(--color-primary);
  background: var(--color-bg);
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: 0.04em;
  min-height: 100vh;
}

/* Bloom: not a layer, a text-shadow on the scrolling content root. */
#root {
  text-shadow: 0 0 7px currentColor;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-faint);
}
a:hover {
  color: var(--color-alert);
  border-bottom-color: var(--color-alert);
}

:focus-visible {
  outline: 1px solid var(--color-alert);
  outline-offset: 3px;
}

button {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.wrap {
  max-width: 840px;
  margin: 0 auto;
  padding: 52px 34px 110px;
  position: relative;
  z-index: 1;
}

/* ── Header, lang row, footer (all three pages) ─────────────────────── */

header.chrome {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--color-faint);
}
header.chrome .wordmark {
  font-size: 13px;
}
header.chrome .wordmark span {
  color: var(--color-dim);
}
header.chrome nav {
  display: flex;
  gap: 20px;
  font-size: 12.5px;
}
header.chrome nav a {
  border-bottom: none;
  color: var(--color-dim);
}
header.chrome nav a:hover {
  color: var(--color-alert);
}
header.chrome nav a[aria-current="page"] {
  color: var(--color-primary);
}

.lang-row {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--color-dim);
}
.lang-row .label {
  color: var(--color-faint);
}
.lang-row a {
  border-bottom: none;
  color: var(--color-dim);
}
.lang-row a:hover {
  color: var(--color-alert);
}
.lang-row a[aria-current="true"] {
  color: var(--color-primary);
}

footer.chrome {
  margin-top: 88px;
  padding-top: 16px;
  border-top: 1px dashed var(--color-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  color: var(--color-faint);
  font-size: 11.5px;
}
footer.chrome a {
  border-bottom: none;
  color: var(--color-faint);
}
footer.chrome a:hover {
  color: var(--color-alert);
}
footer.chrome .links {
  display: flex;
  gap: 18px;
}

/* ── Titles ──────────────────────────────────────────────────────────── */

h1.title-overview {
  font-size: clamp(34px, 7vw, 60px);
  line-height: 1.04;
  letter-spacing: 0.06em;
  margin: 54px 0 0;
  font-weight: normal;
}
h1.title-page {
  font-size: clamp(26px, 4.4vw, 40px);
  line-height: 1.1;
  letter-spacing: 0.06em;
  margin: 54px 0 0;
  font-weight: normal;
}
.page-meta {
  color: var(--color-dim);
  margin-top: 10px;
  font-size: 12.5px;
}

/* The readout row: the site's only list format */

.readout {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-height: 30px;
}
.readout .label {
  color: var(--color-dim);
}
.readout .leader {
  flex: 1;
  border-bottom: 1.5px dotted var(--color-faint);
  transform: translateY(-4px);
}
.readout-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 560px;
}
.readout-block.narrow { max-width: 520px; }

@media (max-width: 480px) {
  .readout { flex-direction: column; align-items: flex-start; gap: 2px; min-height: 0; padding: 6px 0; }
  .readout .leader { display: none; }
}

/* ── Overview ────────────────────────────────────────────────────────── */

.subtitle {
  margin-top: 26px;
  max-width: 60ch;
}
.subtitle .lede {
  font-size: 15px;
}
.subtitle .cursor {
  animation: ff-blink 1.1s steps(1) infinite;
}
.subtitle p {
  color: var(--color-dim);
  margin: 14px 0 0;
  text-wrap: pretty;
}
.subtitle p:first-of-type {
  margin-top: 22px;
}

.cta-row {
  margin-top: 46px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}
.btn-store {
  display: inline-block;
  border: 1px solid var(--color-primary);
  padding: 15px 26px;
  font-size: 13px;
  letter-spacing: 0.12em;
}
.btn-store:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-alert);
  border-color: var(--color-alert);
}
.cta-row .note {
  color: var(--color-dim);
  font-size: 11.5px;
}

/* ── Support / Privacy body copy ────────────────────────────────────── */

.section-label {
  color: var(--color-dim);
  font-size: 12.5px;
  margin-top: 48px;
}
.section-label:first-of-type { margin-top: 38px; }
.section-body {
  color: var(--color-dim);
  margin: 16px 0 0;
  max-width: 66ch;
  text-wrap: pretty;
}

.contact-box {
  margin-top: 40px;
  padding: 22px 24px;
  border: 1px solid var(--color-faint);
  max-width: 66ch;
}
.contact-box .note {
  color: var(--color-dim);
  margin: 16px 0 0;
  font-size: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 18px;
}
.field:first-child { margin-top: 0; }
.field label {
  font-size: 12px;
  color: var(--color-dim);
}
.field label .optional {
  color: var(--color-faint);
}
.field textarea,
.field input {
  font: inherit;
  letter-spacing: inherit;
  color: var(--color-primary);
  background: transparent;
  border: 1px solid var(--color-faint);
  padding: 10px 12px;
  resize: vertical;
}
.field textarea::placeholder,
.field input::placeholder {
  color: var(--color-faint);
}
.field textarea:hover,
.field input:hover {
  border-color: var(--color-dim);
}
.field textarea:focus-visible,
.field input:focus-visible {
  border-color: var(--color-alert);
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.btn-send {
  border: 1px solid var(--color-primary);
  padding: 11px 20px;
  font-size: 13px;
  letter-spacing: 0.1em;
  background: none;
}
.btn-send:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-alert);
  border-color: var(--color-alert);
}
.btn-send:disabled {
  opacity: 0.5;
  cursor: default;
}
#support-status {
  font-size: 12.5px;
  color: var(--color-dim);
}

.faq {
  display: flex;
  flex-direction: column;
  gap: 34px;
  margin-top: 22px;
  max-width: 66ch;
}
.faq .q {
  color: var(--color-primary);
}
.faq p {
  color: var(--color-dim);
  margin: 10px 0 0;
  text-wrap: pretty;
}

.closing-note {
  color: var(--color-faint);
  margin: 46px 0 0;
  font-size: 12px;
  max-width: 62ch;
}

/* ── The CRT stack (fixed to the viewport, not the scrolling content) ── */

.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.crt-scanlines {
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .55) 0 1px, rgba(0, 0, 0, 0) 1px 3px);
  opacity: .34;
  mix-blend-mode: multiply;
}
.crt-grain {
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22140%22 height=%22140%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.9%22 numOctaves=%222%22/%3E%3C/filter%3E%3Crect width=%22140%22 height=%22140%22 filter=%22url(%23n)%22/%3E%3C/svg%3E');
  opacity: .055;
  mix-blend-mode: screen;
  animation: ff-grain 1.4s steps(4) infinite;
}
.crt-hum {
  left: 0;
  right: 0;
  height: 26%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .035), rgba(255, 255, 255, 0));
  mix-blend-mode: screen;
  animation: ff-hum 9s linear infinite;
}
.crt-flicker {
  background: #fff;
  mix-blend-mode: screen;
  animation: ff-flicker 3.1s ease-in-out infinite;
}
.crt-vignette {
  box-shadow: inset 0 0 180px 60px rgba(0, 0, 0, .85), inset 0 0 60px 10px rgba(0, 0, 0, .6);
  border-radius: 26px;
}

@keyframes ff-flicker {
  0%, 100% { opacity: .04; }
  43% { opacity: .085; }
  51% { opacity: .015; }
  79% { opacity: .06; }
}
@keyframes ff-hum {
  0% { transform: translateY(115%); }
  100% { transform: translateY(-115%); }
}
@keyframes ff-grain {
  0% { background-position: 0 0; }
  100% { background-position: 180px 130px; }
}
@keyframes ff-blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .crt-grain, .crt-hum, .crt-flicker { display: none; }
  .subtitle .cursor { animation: none; opacity: 1; }
}

@media (max-width: 480px) {
  .wrap { padding: 40px 20px 90px; }
}
