/* =====================================================================
   SUNOGARD.TV
   Layout: the key art is the cover; below it, the stream overlay's
   hairline HUD language (corner marks, tracked mono labels, one accent
   tick) carries the rest of the page. Deliberately dark-only.
   ===================================================================== */

@font-face {
  font-family: "Hemi Head";
  src: url("../fonts/HemiHead-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "UAV OSD Sans Mono";
  src: url("../fonts/UAV-OSD-Sans-Mono.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  color-scheme: dark;

  /* colour — pulled from the key art */
  --void:      #050506;               /* page */
  --char:      #0d0b0c;               /* raised surface */
  --soot:      #171214;               /* hover surface */
  --blood:     #d3121c;               /* wordmark red */
  --ember:     #ff3a3a;               /* lightning glow */
  --blood-dim: rgba(211, 18, 28, 0.35);
  --blood-ghost: rgba(211, 18, 28, 0.10);
  --bone:      #ece6e1;               /* ink */
  --bone-2:    rgba(236, 230, 225, 0.66);
  --bone-3:    rgba(236, 230, 225, 0.40);
  --hair:      rgba(236, 230, 225, 0.11);
  --hair-soft: rgba(236, 230, 225, 0.05);

  /* type */
  --f-display: "Hemi Head", "Arial Black", Impact, sans-serif;
  --f-hud:     "UAV OSD Sans Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --f-body:    "Barlow", "Segoe UI", system-ui, sans-serif;

  --s-xs: 0.75rem;  --s-sm: 0.875rem; --s-md: 1.0625rem;
  --s-lg: 1.375rem; --s-xl: clamp(2rem, 5vw, 3.25rem);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --r: 2px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; background: var(--void); }
body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font: 400 var(--s-md)/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--blood); color: #fff; padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

.ico { width: 1.05em; height: 1.05em; flex: none; }

/* ---------- shared HUD primitives (from the overlay) ---------------- */
.label {
  font-family: var(--f-hud);
  font-size: var(--s-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-3);
  white-space: nowrap;
}
.value {
  font-family: var(--f-hud);
  font-size: var(--s-sm);
  letter-spacing: 0.08em;
  color: var(--bone);
  font-variant-numeric: tabular-nums;
}
.eyebrow {
  margin: 0 0 6px;
  font-family: var(--f-hud);
  font-size: var(--s-xs);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--blood);
}
h2 {
  margin: 0;
  font-family: var(--f-display);
  font-size: var(--s-xl);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}
.corner { position: absolute; width: 26px; height: 26px; border: 1px solid var(--hair); pointer-events: none; }
.corner.tl { top: 18px; left: 18px; border-right: 0; border-bottom: 0; }
.corner.tr { top: 18px; right: 18px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 18px; left: 18px; border-right: 0; border-top: 0; }
.corner.br { bottom: 18px; right: 18px; border-left: 0; border-top: 0; }

.fineprint { margin: 12px 0 0; font-size: var(--s-sm); color: var(--bone-3); }
.fineprint a { color: var(--bone-2); text-underline-offset: 3px; }
.fineprint a:hover { color: var(--ember); }

/* ---------- buttons -------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px;
  font-family: var(--f-hud); font-size: var(--s-sm);
  letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none;
  border-radius: var(--r); border: 1px solid transparent;
  transition: background .2s, border-color .2s, box-shadow .2s, color .2s;
  white-space: nowrap;
}
.btn-primary { background: var(--blood); color: #fff; box-shadow: 0 0 0 0 var(--blood-dim); }
.btn-primary:hover { background: var(--ember); box-shadow: 0 0 28px var(--blood-dim); }
.btn-ghost { border-color: var(--hair); color: var(--bone); background: rgba(5,5,6,.55); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--blood); color: #fff; }

.textlink {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-hud); font-size: var(--s-sm); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bone); text-decoration: none; border-bottom: 1px solid var(--blood); padding-bottom: 3px;
}
.textlink:hover { color: var(--ember); }

/* ---------- top bar -------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(5, 5, 6, 0.82);
  backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid var(--hair);
}
.topbar-inner {
  max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter);
  height: 60px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--hair); object-fit: cover; }
.brand span { font-family: var(--f-display); font-size: 1.125rem; letter-spacing: 0.14em; }
.nav { display: flex; gap: 22px; margin-right: auto; }
.nav a {
  font-family: var(--f-hud); font-size: var(--s-xs); letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bone-2); text-decoration: none; padding-block: 6px; border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--bone); border-bottom-color: var(--blood); }

.livepill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 12px; border: 1px solid var(--hair); border-radius: var(--r);
  font-family: var(--f-hud); font-size: var(--s-xs); letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bone-2); text-decoration: none; white-space: nowrap;
}
.livepill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bone-3); }
.livepill[data-state="live"] { border-color: var(--blood); color: #fff; background: var(--blood-ghost); }
.livepill[data-state="live"] .dot { background: var(--ember); box-shadow: 0 0 10px var(--ember); animation: pulse 2.2s ease-in-out infinite; }
.livepill[data-state="hidden"] { display: none; }

/* ---------- hero ----------------------------------------------------- */
.hero { position: relative; isolation: isolate; }
.hero picture { display: block; }
.hero-art {
  width: 100%; height: auto; max-height: 86vh; object-fit: cover; object-position: 50% 30%;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
}
.hero .corner { border-color: rgba(236,230,225,.22); }
.hero-foot {
  position: relative; margin-top: clamp(-88px, -5vw, -24px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px;
}
.tagline {
  margin: 0;
  font-family: var(--f-hud); font-size: clamp(0.8rem, 1.6vw, 1rem);
  letter-spacing: 0.5em; text-transform: uppercase; color: var(--bone-2);
}
.tagline i { font-style: normal; color: var(--blood); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hud {
  margin-top: 28px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px;
  padding-block: 14px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  position: relative;
}
.hud::before {   /* the overlay's single accent tick */
  content: ""; position: absolute; left: var(--gutter); top: -1px; width: 64px; height: 2px;
  background: var(--blood); box-shadow: 0 0 12px var(--blood-dim);
}
.hud-cell { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.hud-sep { width: 1px; height: 14px; background: var(--hair); }
.hud-on { margin-left: auto; gap: 10px 16px; }
.plat { display: inline-flex; align-items: center; gap: 7px; font-family: var(--f-hud); font-size: var(--s-sm); letter-spacing: 0.06em; color: var(--bone-2); }
.plat .ico { color: var(--blood); }
#hud-status[data-live="true"] { color: var(--ember); }

/* ---------- section scaffolding ------------------------------------- */
.watch, .games, .community { padding-block: clamp(56px, 8vw, 104px) 0; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin-bottom: 22px;
}

/* ---------- watch ---------------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--hair); border-radius: var(--r); }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; background: none; border: 0; cursor: pointer;
  font-family: var(--f-hud); font-size: var(--s-xs); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--bone-3);
  border-right: 1px solid var(--hair);
}
.tab:last-child { border-right: 0; }
.tab:hover { color: var(--bone); background: var(--soot); }
.tab[aria-selected="true"] { color: #fff; background: var(--blood-ghost); box-shadow: inset 0 -2px 0 var(--blood); }
.tab[aria-selected="true"] .ico { color: var(--ember); }

.nowline { margin: 0 0 14px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; color: var(--bone-2); }
.nowline #now-text { min-width: 0; overflow-wrap: anywhere; }

.stage {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px;
}
.stage-solo { grid-template-columns: minmax(0, 1fr); }
.frame {
  position: relative; background: var(--char); border: 1px solid var(--hair); border-radius: var(--r);
  overflow: hidden; min-width: 0;
}
.frame.video { aspect-ratio: 16 / 9; }
.frame.video::before {   /* corner marks on the player, like the cam frame */
  content: ""; position: absolute; inset: 10px; pointer-events: none; z-index: 2;
  background:
    linear-gradient(var(--blood), var(--blood)) top left / 18px 1px no-repeat,
    linear-gradient(var(--blood), var(--blood)) top left / 1px 18px no-repeat,
    linear-gradient(var(--blood), var(--blood)) bottom right / 18px 1px no-repeat,
    linear-gradient(var(--blood), var(--blood)) bottom right / 1px 18px no-repeat;
  opacity: .8;
}
.frame.chat { min-height: 420px; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.frame-empty {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  background:
    linear-gradient(180deg, rgba(5,5,6,.55), rgba(5,5,6,.92)),
    url("../img/reaper-wide.webp") center 35% / cover no-repeat;
}
.frame-empty p { margin: 0 0 14px; color: var(--bone-2); }

/* ---------- games ---------------------------------------------------- */
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.game {
  position: relative; padding: 28px 28px 30px;
  background: var(--char); border: 1px solid var(--hair); border-radius: var(--r);
  display: flex; flex-direction: column; gap: 14px;
}
.game::before {
  content: ""; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 2px;
  background: var(--blood); box-shadow: 0 0 12px var(--blood-dim);
}
.game-tag { margin: 0; }
.game h3 {
  margin: 0; font-family: var(--f-display); font-size: var(--s-lg); letter-spacing: 0.03em; text-transform: uppercase;
}
.game p:not(.game-tag) { margin: 0; color: var(--bone-2); max-width: 62ch; }
.proflinks {
  list-style: none; margin: auto 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px;
  border-top: 1px solid var(--hair);
}
.proflinks a {
  display: grid; grid-template-columns: 108px minmax(0, 1fr) auto; align-items: baseline; gap: 10px;
  padding-block: 9px; border-bottom: 1px solid var(--hair-soft);
  text-decoration: none; font-size: var(--s-sm); color: var(--bone);
}
.proflinks .ico { width: 13px; height: 13px; color: var(--bone-3); align-self: center; }
.proflinks a:hover { color: var(--ember); }
.proflinks a:hover .ico { color: var(--ember); }
@media (max-width: 1100px) { .proflinks { grid-template-columns: minmax(0, 1fr); } }
.charsheet { margin: auto 0 0; display: grid; gap: 0; border-top: 1px solid var(--hair); }
.charsheet div { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding-block: 9px; border-bottom: 1px solid var(--hair-soft); align-items: baseline; }
.charsheet dd { margin: 0; font-size: var(--s-sm); }

/* ---------- community ----------------------------------------------- */
.community {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); align-items: center;
}
.community-art {
  aspect-ratio: 1 / 1; max-width: 100%;
  background: url("../img/avatar-512.webp") center / cover no-repeat;
  border: 1px solid var(--hair); border-radius: var(--r);
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
}
.community-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.community-body h2 { margin-top: -12px; }
.lede { margin: 0; color: var(--bone-2); font-size: 1.125rem; max-width: 52ch; }

.socials {
  list-style: none; margin: 10px 0 0; padding: 0; width: 100%;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  border-top: 1px solid var(--hair);
}
.socials a {
  display: flex; align-items: center; gap: 12px; padding: 14px 4px;
  border-bottom: 1px solid var(--hair); text-decoration: none; min-width: 0;
  transition: background .2s;
}
.socials a:hover { background: var(--soot); }
.socials a:hover .s-ico { color: var(--ember); }
.s-ico { width: 18px; height: 18px; color: var(--blood); flex: none; }
.s-text { display: flex; flex-direction: column; min-width: 0; }
.s-handle { font-size: var(--s-sm); color: var(--bone-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.socials .ico-arrow { margin-left: auto; width: 14px; height: 14px; color: var(--bone-3); flex: none; }

/* ---------- footer --------------------------------------------------- */
.footer {
  position: relative; margin-top: clamp(72px, 10vw, 128px);
  padding-block: 56px calc(48px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--hair);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.footer-mark {
  margin: 0; font-family: var(--f-display); font-size: clamp(2.25rem, 9vw, 5.5rem); line-height: 1;
  letter-spacing: 0.08em; color: transparent; -webkit-text-stroke: 1px var(--blood-dim);
}

/* ---------- motion --------------------------------------------------- */
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1) } 50% { opacity: .35; transform: scale(.8) } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------------------------------------------- */
@media (max-width: 1000px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .frame.chat { min-height: 0; height: 460px; }
}
@media (max-width: 860px) {
  .community { grid-template-columns: minmax(0, 1fr); }
  .community-art { max-width: 320px; }
  .game-grid { grid-template-columns: minmax(0, 1fr); }
  .hud-on { margin-left: 0; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .topbar-inner { justify-content: space-between; }
  .hero-art { max-height: none; }
  .hero-foot { margin-top: -18px; }
  .hero-actions, .hero-actions .btn { width: 100%; }
  .hero-actions .btn { justify-content: center; }
  .hud-sep { display: none; }
  .hud-cell { width: 100%; justify-content: space-between; }
  .hud-on { justify-content: flex-start; }
  .tabs { width: 100%; }
  .tab { flex: 1 1 0; justify-content: center; padding-inline: 8px; }
  .game { padding: 22px 20px 24px; }
  .corner { display: none; }
  .tagline { letter-spacing: 0.32em; }
  .brand span { font-size: 1rem; }
  .livepill { min-width: 0; max-width: 46vw; overflow: hidden; }
}
