/* NetSec Visualized — netsecviz.net
   Direction B (calm / flat). Light default + dark toggle.
   Fonts: system stacks for now. TODO: self-host General Sans (sans) + IBM Plex Mono (mono). */

:root {
  --bg: #F1F5F8;
  --surface: #FFFFFF;
  --surface-2: #F7FAFC;
  --text: #1B2A36;
  --heading: #0B1620;
  --muted: #5A6877;
  --border: #DCE4EC;
  --brand: #19E0B4;        /* CTA fill, both themes */
  --brand-text: #0A8F72;   /* teal text/links (AA on light) */
  --brand-ink: #04150F;    /* text on the teal button */
  --node: #2D7FF0;
  --shadow: 0 14px 40px rgba(40, 70, 90, .10);
  --focus: #0A8F72;

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

html[data-theme="dark"] {
  --bg: #0D1117;
  --surface: #161B22;
  --surface-2: #1C232B;
  --text: #D6DEE6;
  --heading: #F4F8F7;
  --muted: #8B949E;
  --border: #243040;
  --brand: #19E0B4;
  --brand-text: #19E0B4;
  --brand-ink: #06140F;
  --node: #58A6FF;
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);
  --focus: #19E0B4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .25s ease, color .25s ease;
}

h1, h2, h3 { color: var(--heading); letter-spacing: -.015em; margin: 0; line-height: 1.15; }
a { color: var(--brand-text); }
p { margin: 0; }
.mono { font-family: var(--mono); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: 22px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--surface); color: var(--heading); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 14px; text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

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

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
  font-weight: 650; font-size: 15px; line-height: 1; cursor: pointer;
  border-radius: 11px; padding: 13px 20px; text-decoration: none;
  border: 1px solid transparent; transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--heading); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-sm { padding: 9px 16px; border-radius: 999px; font-size: 13.5px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand-text); }

/* theme toggle icon swap */
#theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] #theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] #theme-toggle .icon-sun { display: block; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .bar {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; color: var(--heading); text-decoration: none; }
.brand .mark { display: inline-flex; color: var(--heading); }
.wordmark { font-size: 15.5px; letter-spacing: -.01em; }
.actions { display: flex; align-items: center; gap: 9px; }

/* ---------- hero ---------- */
.hero { padding-block: 66px 42px; }
.eyebrow {
  font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand-text); font-weight: 600; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(31px, 6vw, 47px); font-weight: 720; }
.lead { color: var(--muted); font-size: 17.5px; margin: 20px 0 28px; max-width: 56ch; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- video ---------- */
.video { margin: 36px 0 0; }
.video-poster {
  width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; cursor: pointer;
  background:
    radial-gradient(120% 120% at 80% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--border); color: var(--heading);
  display: grid; place-items: center; gap: 16px; position: relative; overflow: hidden;
  transition: border-color .15s ease;
}
.video-poster:hover { border-color: var(--brand); }
.video-poster .play {
  width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.video-cap { position: absolute; left: 16px; bottom: 13px; font-size: 12.5px; color: var(--muted); }
.video-cap .mono { color: var(--text); }
.video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; display: block; }
.video-fallback { margin-top: 12px; }

/* ---------- sections ---------- */
.section { padding-block: 48px; border-top: 1px solid var(--border); }
.label {
  font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 12px;
}
.section h2 { font-size: clamp(23px, 4vw, 30px); font-weight: 680; }
.intro { color: var(--muted); font-size: 16.5px; margin-top: 12px; max-width: 60ch; }

/* ---------- study pack ---------- */
.pack {
  margin-top: 24px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px; box-shadow: var(--shadow);
}
.epno { font-size: 12.5px; color: var(--muted); }
.pack h3 { font-size: 19px; font-weight: 660; margin: 3px 0 12px; }
.tags { display: flex; gap: 7px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 18px; }
.tags li { font-size: 11px; color: var(--brand-text); border: 1px solid var(--border); border-radius: 6px; padding: 4px 9px; font-weight: 600; }
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 10px; }
.dl {
  display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px;
  transition: border-color .15s ease, transform .12s ease;
}
.dl:hover { border-color: var(--brand); transform: translateY(-1px); }
.dl-ic {
  width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--border); color: var(--brand-text); font-weight: 700;
}
.dl-meta { display: flex; flex-direction: column; line-height: 1.3; }
.dl-name { font-weight: 600; font-size: 14px; }
.dl-ext { font-size: 11px; color: var(--muted); }
.foot-note { color: var(--muted); font-size: 14px; margin-top: 16px; }

/* ---------- github card ---------- */
.gh-card {
  margin-top: 22px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px; display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap; box-shadow: var(--shadow);
}
.gh-mark {
  width: 52px; height: 52px; flex: none; border-radius: 13px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--heading);
}
.gh-txt { flex: 1; min-width: 220px; }
.gh-txt strong { color: var(--heading); font-size: 15px; }
.gh-txt p { color: var(--muted); font-size: 15px; margin-top: 4px; }

/* ---------- roadmap timeline ---------- */
.timeline { list-style: none; margin: 24px 0 0; padding: 0 0 0 26px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 12px; width: 2px; background: var(--border); }
.ep { position: relative; padding: 10px 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; }
.ep .node {
  position: absolute; left: -26px; top: 15px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border);
}
.ep.live .node { background: var(--brand); border-color: var(--brand); }
.ep-n { font-size: 12.5px; color: var(--muted); margin-right: 8px; }
.ep-t { font-weight: 530; color: var(--text); }
.ep.live .ep-t { color: var(--heading); font-weight: 640; }
.ep-tag {
  font-size: 10.5px; color: var(--brand-ink); background: var(--brand); border-radius: 5px;
  padding: 2px 7px; margin-left: 8px; font-weight: 700; letter-spacing: .04em;
}
.ep-soon { font-size: 10.5px; color: var(--muted); margin-left: 8px; }
.arc { color: var(--muted); font-size: 15.5px; margin-top: 22px; max-width: 60ch; }

.slate { margin-top: 18px; }
.slate > summary {
  cursor: pointer; color: var(--brand-text); font-weight: 600; font-size: 14.5px;
  list-style: none; display: inline-flex; align-items: center; gap: 7px; width: max-content;
}
.slate > summary::before { content: "▸"; transition: transform .15s ease; }
.slate[open] > summary::before { transform: rotate(90deg); }
.slate-grid { margin-top: 18px; }
.slate-tier { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 18px 0 8px; }
.slate-list { margin: 0; padding-left: 22px; color: var(--text); font-size: 13.5px; line-height: 1.9; }
.slate-list li { padding-left: 4px; }

/* ---------- signup ---------- */
.signup { background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; padding: 30px; }
.signup-form { display: flex; gap: 10px; margin: 18px 0 10px; flex-wrap: wrap; }
.signup-form input[type="email"] {
  flex: 1; min-width: 210px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; padding: 13px 15px; color: var(--text); font: inherit; font-size: 15px;
}
.signup-form input::placeholder { color: var(--muted); }
.form-status { font-size: 14px; margin: 4px 0 0; min-height: 1.2em; }
.form-status.is-ok { color: var(--brand-text); font-weight: 600; }
.form-status.is-error { color: #C2410C; }
html[data-theme="dark"] .form-status.is-error { color: #F8A87A; }
.micro { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: 30px 52px; color: var(--muted); font-size: 14px; margin-top: 8px; }
.frow { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer .brand .mark { color: var(--heading); }
.flinks { display: flex; gap: 18px; flex-wrap: wrap; }
.flinks a { color: var(--text); text-decoration: none; }
.flinks a:hover { color: var(--brand-text); }
.fnote { margin-top: 14px; font-size: 12.5px; opacity: .85; }

/* ---------- responsive ---------- */
@media (max-width: 540px) {
  body { font-size: 16px; }
  .hero { padding-block: 44px 32px; }
  .wordmark { display: none; }          /* keep header tight on small screens */
  .gh-card { gap: 14px; }
  .gh-card .btn { width: 100%; }
  .signup { padding: 22px; }
  .signup-form .btn { width: 100%; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
