/* ==========================================================================
   HL-SAT — site styles
   Console and flag colours are the app's own dark palette (AppPalette.cs),
   so the page and the tool read as the same product.
   ========================================================================== */

:root {
  --bg:        #0e1116;
  --bg-alt:    #12161c;
  --panel:     #171c23;
  --panel-2:   #1c222b;
  --line:      #262e39;
  --line-soft: #1e242d;

  --text:      #d7dce3;
  --text-dim:  #98a2b0;
  --text-mute: #737d8b;

  --accent:      #6495ED;   /* console "command" colour */
  --accent-soft: #8fb2f2;
  --green:       #7FD98F;
  --amber:       #E0C06A;
  --red:         #CD5C5C;

  /* console palette, verbatim */
  --c-out:   #808080;
  --c-cmd:   #6495ED;
  --c-err:   #CD5C5C;
  --c-info:  #A9A9A9;
  --c-chat:  #7FD98F;
  --c-team:  #6FC5D9;
  --c-join:  #E0C06A;
  --c-frag:  #B09AC8;
  --c-event: #939CA8;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas,
          "SF Mono", Menlo, monospace;

  --radius:    12px;
  --radius-sm: 8px;
  --wrap:      1140px;
}

* { box-sizing: border-box; }

/* Nothing may push the page wider than the viewport. Belt-and-braces: the
   screenshot is also sized by its frame, but a full-resolution image loading
   against a stale stylesheet would otherwise blow the layout out sideways. */
img, svg, video { max-width: 100%; height: auto; }

html {
  scroll-behavior: smooth;
  /* The topbar is sticky and ~62px tall, so an anchor jump would otherwise park
     the section's label underneath it. Keep the heading clear of the bar. */
  scroll-padding-top: 82px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -0.02em; }
p { margin: 0; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 0.1em 0.38em;
  color: var(--accent-soft);
  white-space: nowrap;
}

a { color: var(--accent-soft); text-decoration-color: rgba(143, 178, 242, 0.35); }
a:hover { text-decoration-color: currentColor; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.narrow { max-width: 760px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #0b0e12;
  padding: 10px 16px; border-radius: var(--radius-sm); z-index: 100;
}
.skip:focus { left: 16px; top: 16px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 17, 22, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; height: 62px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.brand-mark { display: flex; }
.brand-text { font-weight: 700; letter-spacing: 0.01em; font-size: 1.05rem; }

.topnav { display: flex; align-items: center; gap: 26px; }
.topnav a {
  color: var(--text-dim); text-decoration: none; font-size: 0.94rem;
  transition: color 0.15s ease;
}
.topnav a:hover { color: var(--text); }
.topnav .btn { color: #0b0e12; }

@media (max-width: 860px) {
  .topnav a:not(.btn) { display: none; }
}

/* -------------------------------------------------------------------- button */

.btn {
  --btn-bg: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--btn-bg);
  color: #0b0e12;
  font-weight: 640;
  font-size: 0.95rem;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px -10px rgba(100, 149, 237, 0.75);
}
.btn:active { transform: translateY(0); }
.btn-sm { padding: 7px 14px; font-size: 0.88rem; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; border-radius: 10px; }
.btn-icon { flex: none; }

.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: var(--panel-2); color: var(--text);
  box-shadow: none; border-color: #35404e;
}

/* ---------------------------------------------------------------------- hero */

.hero {
  position: relative;
  padding: clamp(48px, 9vw, 104px) 0 clamp(44px, 7vw, 84px);
  overflow: hidden;
}
.hero::before {
  /* soft glow behind the copy, keeps the top of the page from reading flat */
  content: "";
  position: absolute; inset: -40% 0 auto -10%;
  height: 620px; width: 780px;
  background: radial-gradient(closest-side, rgba(100, 149, 237, 0.16), transparent 72%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2.15rem, 4.6vw, 3.35rem);
  letter-spacing: -0.033em;
  margin-bottom: 20px;
}
.lede {
  font-size: clamp(1.02rem, 1.5vw, 1.14rem);
  color: var(--text-dim);
  max-width: 52ch;
}
.lede strong { color: var(--text); font-weight: 620; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.cta-center { justify-content: center; margin-top: 40px; }

.meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  list-style: none; padding: 0; margin: 22px 0 0;
  font-size: 0.88rem; color: var(--text-mute);
}
.meta li { display: flex; align-items: center; gap: 8px; }
.meta li::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--green); flex: none;
}
.meta code { background: none; border: none; padding: 0; color: var(--text-dim); }

/* ------------------------------------------------------------------- console */

.console {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 26px 60px -28px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  min-width: 0;
}
.console-chrome {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
}
.tabs { display: flex; gap: 6px; min-width: 0; overflow: hidden; }
.tab {
  font-family: var(--mono); font-size: 0.76rem;
  color: var(--text-mute);
  padding: 5px 11px; border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tab-on {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}
.dot-live {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(127, 217, 143, 0.55);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(127, 217, 143, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(127, 217, 143, 0); }
  100% { box-shadow: 0 0 0 0 rgba(127, 217, 143, 0); }
}

.console-body {
  margin: 0;
  padding: 18px 20px 20px;
  font-family: var(--mono);
  font-size: 0.795rem;
  line-height: 1.72;
  color: var(--c-out);
  overflow-x: auto;
  tab-size: 4;
}
.ts      { color: var(--c-info); opacity: 0.4; }
.c-out   { color: var(--c-out); }
.c-cmd   { color: var(--c-cmd); }
.c-err   { color: var(--c-err); }
.c-info  { color: var(--c-info); }
.c-chat  { color: var(--c-chat); }
.c-team  { color: var(--c-team); }
.c-join  { color: var(--c-join); }
.c-frag  { color: var(--c-frag); }
.c-event { color: var(--c-event); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .console-body { font-size: 0.73rem; }
}

/* Below this the second tab label is clipped mid-word by .tabs' overflow.
   Drop it rather than show a severed one — it is decorative either way. */
@media (max-width: 460px) {
  .tab:not(.tab-on) { display: none; }
}

/* Inline links sit in a ~24px line box, well under what a fingertip needs.
   Only on touch pointers, so the desktop nav keeps its tight spacing. */
@media (pointer: coarse) {
  .topnav a:not(.btn),
  .footer-links a { padding-block: 10px; }
  .brand { padding-block: 6px; }
  .footer-links { gap: 2px 22px; }
}

/* -------------------------------------------------------------------- strip */

.strip {
  border-block: 1px solid var(--line-soft);
  background: var(--bg-alt);
  padding: 38px 0;
}
.strip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 40px;
}
.strip h3 {
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--accent); margin-bottom: 8px; font-weight: 600;
}
.strip p { color: var(--text-dim); font-size: 0.94rem; }

/* ------------------------------------------------------------------ sections */

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line-soft); }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  max-width: 22ch;
  margin-bottom: 14px;
}
.narrow .section-title { max-width: 26ch; }
.body { color: var(--text-dim); margin-top: 16px; }
.muted { color: var(--text-mute); font-size: 0.95rem; }

/* --------------------------------------------------------------- screenshot */

.shot-lede { max-width: 60ch; }

.shot { margin: 40px 0 0; }

.shot-frame {
  display: block;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  line-height: 0;              /* no descender gap under the image */
  box-shadow: 0 34px 80px -34px rgba(0, 0, 0, 0.95);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.shot-frame:hover { border-color: #3a4756; transform: translateY(-2px); }

/* Sized by the image's own proportions rather than a hard-coded ratio, so the
   screenshot can be replaced at any dimensions without being cropped. */
.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.shot figcaption {
  margin-top: 16px;
  color: var(--text-mute);
  font-size: 0.88rem;
  max-width: 68ch;
}

/* ------------------------------------------------------------------ credits */

.credits {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.credits li {
  color: var(--text-mute);
  font-size: 0.94rem;
  line-height: 1.65;
  padding-left: 16px;
  border-left: 2px solid var(--line);
}

.credits strong { color: var(--text); }

/* ------------------------------------------------------- screenshot viewer */

/* Fills the viewport so that a click anywhere outside the image lands on the
   dialog itself, which is what the close handler keys off. */
.viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.viewer::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.viewer img {
  display: block;
  margin: auto;
  /* Fits either dimension, so a wide screenshot is limited by width and a tall
     one by height, and neither is ever cropped or scrollable. */
  max-width: calc(100vw - 48px);
  max-height: calc(100dvh - 48px);
  width: auto;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
}

.viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;                 /* a real tap target, not a 20px glyph */
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
  color: #fff;
  background: rgba(20, 26, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  cursor: pointer;
}
.viewer-close:hover { background: rgba(40, 50, 64, 0.9); }

@media (max-width: 640px) {
  .viewer img {
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
}

/* -------------------------------------------------------------------- cards */

.cards {
  display: grid;
  /* min() keeps the track from insisting on 285px inside a container narrower
     than that, which pushed cards past the right gutter on small phones. */
  grid-template-columns: repeat(auto-fit, minmax(min(285px, 100%), 1fr));
  gap: 18px;
  margin-top: 44px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 24px 24px 26px;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.card:hover {
  border-color: #33404f;
  background: var(--panel-2);
  transform: translateY(-2px);
}
.card h3 {
  font-size: 1.02rem;
  margin-bottom: 9px;
  display: flex; align-items: baseline; gap: 9px;
}
.card h3::before {
  content: ""; flex: none;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent);
  transform: translateY(-2px);
}
.card p { color: var(--text-dim); font-size: 0.935rem; }

/* -------------------------------------------------------------------- notes */

.note {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  margin-top: 32px;
}
.note h3 { font-size: 1rem; margin-bottom: 8px; }
.note p { color: var(--text-dim); font-size: 0.94rem; }
.note-warn { border-left-color: var(--amber); }
.note-warn h3 { color: var(--amber); }

.checks { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 16px; }
.checks li {
  position: relative;
  padding-left: 30px;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.checks li::before {
  content: "";
  position: absolute; left: 4px; top: 0.62em;
  width: 9px; height: 5px;
  border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(-45deg);
}
.checks strong { color: var(--text); font-weight: 620; }

/* -------------------------------------------------------------------- steps */

.steps {
  list-style: none; counter-reset: step;
  padding: 0; margin: 40px 0 0;
  display: grid; gap: 26px;
}
.steps li { position: relative; padding-left: 56px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 50%;
  font-family: var(--mono); font-size: 0.85rem;
  color: var(--accent);
}
.steps h3 { font-size: 1.02rem; margin-bottom: 6px; }
.steps p { color: var(--text-dim); font-size: 0.94rem; }

.fineprint {
  text-align: center; margin-top: 14px;
  color: var(--text-mute); font-size: 0.86rem;
}

/* ---------------------------------------------------------------- changelog */

.releases {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  display: grid;
  gap: 30px;
}
.releases > li {
  border-left: 2px solid var(--line);
  padding-left: 22px;
}
.releases > li:first-child { border-left-color: var(--accent); }

.releases h3 {
  font-family: var(--mono);
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.rel-date {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-mute);
}

.releases ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  color: var(--text-dim);
  font-size: 0.94rem;
}
.releases ul li::marker { color: var(--text-mute); }
.releases strong { color: var(--text); }

/* Older releases, folded away behind a native <details>. */
.older { margin-top: 26px; }

.older > summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-dim);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  list-style: none;              /* hide the default triangle… */
  transition: color 0.15s ease, border-color 0.15s ease;
}
.older > summary::-webkit-details-marker { display: none; }

.older > summary::before {       /* …and draw our own, which rotates when open */
  content: "";
  width: 6px; height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.18s ease;
}
.older[open] > summary::before { transform: rotate(-135deg) translate(-2px, -2px); }

.older > summary:hover { color: var(--text); border-color: #35404e; }
.older > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.older .releases { margin-top: 26px; }

/* ------------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--line-soft);
  padding: 38px 0;
  background: var(--bg);
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 22px 40px;
  align-items: start; justify-content: space-between;
}
.footer-brand { font-weight: 620; font-size: 0.95rem; }
.footer-note {
  color: var(--text-mute); font-size: 0.85rem;
  max-width: 58ch; margin-top: 6px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-links a {
  color: var(--text-dim); text-decoration: none; font-size: 0.9rem;
}
.footer-links a:hover { color: var(--text); }
