/* Secblitz website. Same design language as the app (src/gui/theme.rs,
   docs/DESIGN-SYSTEM.md): IBM Plex Sans, Fluent icons, neutral tonal
   surfaces, no borders or shadows, colour only for meaning. Light by default,
   dark when the system asks for it or the visitor picks it. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/ibm-plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/ibm-plex-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/ibm-plex-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens (mirror Palette::LIGHT / Palette::DARK) ---- */
:root {
  color-scheme: light;
  --bg: #F7F7F8;
  --surface: #FFFFFF;
  --surface-alt: #F1F1F3;
  --hover: #EDEDF0;
  --pressed: #E1E1E5;
  --border: #E8E8EB;
  --text: #18181B;
  --muted: #71717A;
  --brand: #18181B;
  --brand-hover: #303034;
  --brand-pressed: #52525B;
  --on-brand: #FFFFFF;
  --focus: #3F3F46;
  --good: #16A34A;
  --warn: #D97706;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s24: 96px;
  --r: 8px;
  --r-large: 12px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --fast: 120ms;
  --normal: 200ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E0E10;
    --surface: #161618;
    --surface-alt: #1E1E21;
    --hover: #212125;
    --pressed: #36363C;
    --border: #2A2A2E;
    --text: #FAFAFA;
    --muted: #A1A1AA;
    --brand: #FAFAFA;
    --brand-hover: #E4E4E7;
    --brand-pressed: #C4C4CA;
    --on-brand: #18181B;
    --focus: #D4D4D8;
    --good: #22C55E;
    --warn: #F59E0B;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E0E10;
  --surface: #161618;
  --surface-alt: #1E1E21;
  --hover: #212125;
  --pressed: #36363C;
  --border: #2A2A2E;
  --text: #FAFAFA;
  --muted: #A1A1AA;
  --brand: #FAFAFA;
  --brand-hover: #E4E4E7;
  --brand-pressed: #C4C4CA;
  --on-brand: #18181B;
  --focus: #D4D4D8;
  --good: #22C55E;
  --warn: #F59E0B;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
strong { font-weight: 600; color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r); }

h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.25rem);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.032em;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.024em;
  text-wrap: balance;
}
h3 { font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -0.005em; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 24px; height: 24px; flex: none; color: var(--muted); }
.tone-warn { color: var(--warn); }
.tone-good { color: var(--good); }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--s6); }
.wrap-wide { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--s6); }

.skip {
  position: absolute; left: var(--s4); top: -100px; z-index: 20;
  padding: var(--s2) var(--s4); border-radius: var(--r);
  background: var(--brand); color: var(--on-brand); text-decoration: none;
}
.skip:focus { top: var(--s4); }

/* ---- Buttons (same sizes and states as the app, scaled for the web) ---- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 44px; padding: 0 var(--s5);
  border: 0; border-radius: var(--r);
  background: var(--brand); color: var(--on-brand);
  font: 500 15px/1 "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.button .icon { width: 20px; height: 20px; color: currentColor; }
.button:hover { background: var(--brand-hover); }
.button:active { background: var(--brand-pressed); transform: scale(0.97); }
.button-quiet { background: var(--surface-alt); color: var(--text); }
.button-quiet:hover { background: var(--hover); }
.button-quiet:active { background: var(--pressed); }
.button-small { height: 36px; padding: 0 var(--s4); font-size: 14px; }

.icon-button {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: var(--r);
  background: transparent; color: var(--text); cursor: pointer;
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.icon-button .icon { width: 20px; height: 20px; color: currentColor; }
.icon-button:hover { background: var(--hover); }
.icon-button:active { background: var(--pressed); transform: scale(0.94); }

/* Theme toggle shows the theme you would switch to. */
.theme-sun { display: none; }
:root[data-theme="dark"] .theme-sun { display: block; }
:root[data-theme="dark"] .theme-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-sun { display: block; }
  :root:not([data-theme="light"]) .theme-moon { display: none; }
}

/* Screenshots that follow the theme. */
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }
:root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block; }
  :root:not([data-theme="light"]) .only-light { display: none; }
}

/* ---- Header ---- */
.header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
}
.header-inner { display: flex; align-items: center; gap: var(--s8); height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-weight: 600; font-size: 17px; letter-spacing: -0.01em; text-decoration: none;
}
.brand-mark { width: 24px; height: 24px; color: var(--text); }
.brand-small { font-size: 15px; }
.brand-small .brand-mark { width: 20px; height: 20px; }
.nav { display: flex; gap: var(--s1); margin-right: auto; }
.nav a {
  padding: var(--s2) var(--s3); border-radius: var(--r);
  color: var(--muted); font-size: 15px; text-decoration: none;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav a:hover { background: var(--hover); color: var(--text); }
.header-actions { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }

/* ---- Hero ---- */
.hero { padding: var(--s16) 0 var(--s12); }
.hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
.lead {
  max-width: 600px; margin-top: var(--s6);
  color: var(--muted); font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.55;
  text-wrap: pretty;
}
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin-top: var(--s8); }
.meta { margin-top: var(--s3); color: var(--muted); font-size: 14px; }
.meta > span { white-space: nowrap; }
.meta a { text-underline-offset: 3px; }
.meta.choice { margin-top: var(--s4); }
.meta a:hover { color: var(--text); }
.hero .shot { margin-top: var(--s12); }

.shot {
  padding: var(--s2);
  border-radius: 18px;
  background: var(--surface-alt);
}
.shot-img {
  width: 100%;
  border-radius: var(--r-large);
  background: var(--surface);
}
/* The tour recording sits over the themed still and shows only once it plays. */
.shot-media { position: relative; }
.shot-img { height: auto; }
.shot-video { position: absolute; inset: 0; height: 100%; object-fit: cover; }
.shot-video[hidden] { display: none; }
.shot-toggle {
  position: absolute; right: var(--s3); bottom: var(--s3);
  display: inline-flex; align-items: center; gap: var(--s2);
  height: 36px; padding: 0 var(--s4); border: 0; border-radius: 999px;
  background: var(--brand); color: var(--on-brand);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  opacity: 0.92; transition: opacity var(--fast) var(--ease), background var(--fast) var(--ease);
}
.shot-toggle:hover { opacity: 1; background: var(--brand-hover); }
.shot-toggle:active { background: var(--brand-pressed); }
.shot-toggle .icon { width: 16px; height: 16px; color: currentColor; }
.shot-toggle[hidden] { display: none; }
@media (max-width: 600px) {
  .shot-toggle { right: var(--s2); bottom: var(--s2); height: 30px; padding: 0 var(--s3); gap: var(--s1); font-size: 13px; }
  .shot-toggle.is-playing { width: 30px; }
  .shot-toggle .icon { width: 14px; height: 14px; }
}
/* While the tour plays, only the pause icon shows; its name stays for screen readers. */
.shot-toggle.is-playing { width: 36px; padding: 0; justify-content: center; }
.shot-toggle.is-playing span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Facts ---- */
.facts { padding-bottom: var(--s16); }
.fact-list {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s8);
  padding-top: var(--s8);
}
.fact-list li { display: flex; gap: var(--s3); color: var(--muted); font-size: 15px; line-height: 1.5; }
.fact-list .icon { width: 22px; height: 22px; margin-top: 1px; color: var(--text); }

/* ---- Sections ---- */
.section { padding-block: var(--s24); }
.section-head { max-width: 640px; }
.section-head p { margin-top: var(--s4); color: var(--muted); font-size: 18px; line-height: 1.55; text-wrap: pretty; }

.split {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--s16); align-items: center;
}
.split-reverse { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }

/* Full-width tonal bands: the web version of a region. */
.explain, .showcase, .download { background: var(--surface); }

/* Steps */
.steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s10);
  margin-top: var(--s12); counter-reset: step;
}
.steps li { counter-increment: step; }
.steps .icon { color: var(--text); }
.steps h3 { margin-top: var(--s4); }
.steps h3::before {
  content: counter(step) ". ";
  color: var(--muted); font-weight: 500;
}
.steps p { margin-top: var(--s2); color: var(--muted); font-size: 15px; }

/* Explainer demo: a Protection row, opened. */
.demo-row {
  border-radius: var(--r-large);
  background: var(--bg);
  padding: var(--s2);
}
.demo-head {
  display: grid; grid-template-columns: 24px 1fr 20px; gap: var(--s4); align-items: center;
  padding: var(--s3) var(--s4);
  border-radius: var(--r);
  background: var(--hover);
}
.demo-title { font-weight: 500; font-size: 15px; }
.demo-sub { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.demo-head .chevron { width: 20px; height: 20px; transform: rotate(180deg); }
.demo-body { display: grid; gap: var(--s4); padding: var(--s5) var(--s4) var(--s4) calc(var(--s4) * 2 + 24px); }
.demo-body dt { font-size: 13px; font-weight: 600; color: var(--text); }
.demo-body dd { margin-top: 2px; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* Check groups */
.check-groups {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--s12) var(--s10); margin-top: var(--s12);
}
.check-group .icon { color: var(--text); }
.check-group h3 { margin-top: var(--s4); }
.check-group p { margin-top: var(--s2); color: var(--muted); font-size: 15px; }

/* Extras: rows, not cards */
.rows {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--s1) var(--s8); margin-top: var(--s10);
}
.rows li {
  display: flex; gap: var(--s4);
  padding: var(--s4); border-radius: var(--r);
}
.rows .icon { margin-top: 1px; }
.rows p { margin-top: 2px; color: var(--muted); font-size: 15px; }

/* FAQ */
.faq-list { display: grid; gap: var(--s1); max-width: 760px; margin-top: var(--s8); }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.faq-list summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  min-height: 56px; padding: var(--s3) var(--s4);
  border-radius: var(--r);
  font-weight: 500; font-size: 16px;
  transition: background-color var(--fast) var(--ease);
}
.faq-list summary:hover { background: var(--hover); }
.chevron { width: 20px; height: 20px; transition: transform var(--normal) var(--ease); }
details[open] > summary .chevron { transform: rotate(180deg); }
.faq-list details p { padding: 0 var(--s4) var(--s5); max-width: 680px; color: var(--muted); font-size: 15px; }

/* Download */
.download { padding: var(--s24) 0; }
.download-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.download-mark { width: 48px; height: 48px; color: var(--text); margin-bottom: var(--s6); }
.download-inner > p { margin-top: var(--s3); color: var(--muted); font-size: 18px; }
.download-inner > .button { margin-top: var(--s8); }
.download-inner > .meta { margin-top: var(--s3); font-size: 14px; }
.linux {
  margin-top: var(--s10); padding: var(--s5); width: 100%; max-width: 560px;
  border-radius: var(--r-large); background: var(--bg); text-align: left;
}
.linux h3 { font-size: 16px; font-weight: 600; }
.linux p { margin-top: var(--s2); color: var(--muted); font-size: 14px; }
.linux a { color: var(--text); text-underline-offset: 3px; }
.command {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3); align-items: center;
  margin-top: var(--s3); padding: var(--s3) var(--s3) var(--s3) var(--s4);
  border-radius: var(--r); background: var(--surface-alt);
}
.command code {
  overflow-wrap: anywhere; font: 13px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: var(--text); user-select: all;
}
.download-details { margin-top: var(--s8); width: 100%; max-width: 560px; text-align: left; }
.download-details summary {
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: var(--s2) var(--s3); border-radius: var(--r);
  color: var(--muted); font-size: 14px;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.download-details summary:hover { background: var(--hover); color: var(--text); }
.download-details { display: flex; flex-direction: column; align-items: center; }
.details-body {
  margin-top: var(--s3); padding: var(--s5);
  border-radius: var(--r-large); background: var(--bg);
  color: var(--muted); font-size: 14px; width: 100%;
}
.details-body p + p { margin-top: var(--s1); }
.hash {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: center;
  margin-top: var(--s4);
}
.hash + p { margin-top: var(--s4); }
.hash-label { font-weight: 600; color: var(--text); font-size: 13px; }
.hash code {
  overflow-wrap: anywhere; font: 12.5px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: var(--text);
}

/* Footer */
.footer { padding: var(--s10) 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.footer p { color: var(--muted); font-size: 14px; }
.footer a, .faq-list details p a { text-underline-offset: 3px; }
.footer a:hover, .faq-list details p a:hover { color: var(--text); }

/* 404 */
.not-found { padding: var(--s24) 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.not-found .lead { margin-top: var(--s4); }
.not-found .button { margin-top: var(--s8); }

/* Privacy */
.policy { padding: var(--s16) var(--s6) var(--s12); max-width: 760px; }
.policy h1 { font-size: clamp(2rem, 5vw, 3rem); }
.policy .lead { max-width: none; }
.policy h2 { font-size: 1.5rem; margin-top: var(--s12); }
.policy h3 { font-size: 1.125rem; font-weight: 600; margin-top: var(--s6); }
.policy p, .policy li { margin-top: var(--s3); color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 680px; }
.policy ul { padding-left: var(--s6); list-style: disc; }
.policy li { margin-top: var(--s2); }
.policy a { text-underline-offset: 3px; }
.policy a:hover { color: var(--text); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .fact-list { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); gap: var(--s10) var(--s8); }
  .check-groups { grid-template-columns: repeat(2, 1fr); }
  .split, .split-reverse { grid-template-columns: 1fr; gap: var(--s10); }
  .nav { display: none; }
}
@media (max-width: 600px) {
  .wrap, .wrap-wide { padding: 0 var(--s4); }
  .hero { padding: var(--s12) 0 var(--s10); }
  .section, .download { padding-block: var(--s16); }
  .fact-list, .steps, .check-groups, .rows { grid-template-columns: 1fr; }
  .fact-list { gap: var(--s5); }
  .cta { flex-direction: column; align-items: stretch; width: 100%; max-width: 320px; }
  .shot { padding: var(--s1); border-radius: 14px; }
  .shot-img { border-radius: 10px; }
  .demo-body { padding-left: var(--s4); }
  .hash { grid-template-columns: 1fr; }
  .rows li { padding: var(--s3) 0; }
}

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