/* ============================================================
   PentestDeck — Design tokens, reset, base typography
   Monochromatic chrome + one configurable accent.
   Light / dark themes driven by [data-theme].
   ============================================================ */

:root {
  /* ---- Brand (overridable per project via inline style) ---- */
  --brand-accent: #6b7280;         /* neutral graphite (monochromatic default) */
  --brand-accent-strong: #4b5563;
  --brand-accent-contrast: #ffffff;
  --brand-ink: #111827;            /* heading ink */
  --brand-text: #374151;           /* body text (light theme) */
  --brand-graphite: #111827;       /* deep decorative shapes (cover art) */
  --brand-graphic-2: #9ca3af;      /* secondary decorative */

  /* ---- Type ---- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Cascadia Code",
    Consolas, "Liberation Mono", Menlo, monospace;

  --step--1: clamp(0.78rem, 0.74rem + 0.2vw, 0.86rem);
  --step-0:  clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  --step-1:  clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.4vw, 4.4rem);
  --step-5:  clamp(3.2rem, 2.2rem + 5vw, 6rem);

  /* ---- Spacing / shape ---- */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 36px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.55s;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.04),
    0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-2: 0 8px 24px -8px rgba(16, 24, 40, 0.12),
    0 2px 6px rgba(16, 24, 40, 0.06);
  --shadow-3: 0 24px 60px -20px rgba(16, 24, 40, 0.28),
    0 8px 24px -12px rgba(16, 24, 40, 0.14);

  color-scheme: light;
}

/* ---------------- Light theme (default) ---------------- */
:root,
:root[data-theme="light"] {
  --bg: #f7f9fa;
  --bg-tint: radial-gradient(
      1200px 700px at 85% -10%,
      color-mix(in srgb, var(--brand-accent) 12%, transparent),
      transparent 60%
    ),
    radial-gradient(
      900px 600px at -10% 110%,
      color-mix(in srgb, var(--brand-ink) 7%, transparent),
      transparent 55%
    );
  --surface: #ffffff;
  --surface-2: #f2f5f6;
  --surface-3: #eaeef0;
  --ink: var(--brand-ink);
  --text: #2b3244;
  --text-soft: #55607a;
  --muted: #8a93a6;
  --line: rgba(27, 42, 74, 0.1);
  --line-strong: rgba(27, 42, 74, 0.18);
  --accent: var(--brand-accent);
  --accent-strong: var(--brand-accent-strong);
  --accent-contrast: var(--brand-accent-contrast);
  --accent-tint: color-mix(in srgb, var(--brand-accent) 14%, var(--surface));
  --glass: rgba(255, 255, 255, 0.72);
}

/* ---------------- Dark theme ---------------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-tint: radial-gradient(
      1200px 700px at 85% -10%,
      color-mix(in srgb, var(--brand-accent) 16%, transparent),
      transparent 60%
    ),
    radial-gradient(
      900px 600px at -10% 110%,
      color-mix(in srgb, var(--brand-accent) 8%, transparent),
      transparent 55%
    );
  --surface: #12171f;
  --surface-2: #171d27;
  --surface-3: #1e2530;
  --ink: #eef2f7;
  --text: #cdd6e2;
  --text-soft: #9aa6b6;
  --muted: #6d7688;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: color-mix(in srgb, var(--brand-accent) 88%, white 12%);
  --accent-strong: var(--brand-accent-strong);
  --accent-contrast: var(--brand-accent-contrast);
  --accent-tint: color-mix(in srgb, var(--brand-accent) 16%, var(--surface));
  --glass: rgba(18, 23, 31, 0.72);
}

/* Follow system when no explicit choice is stored */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #0b0f14;
    --surface: #12171f;
    --surface-2: #171d27;
    --surface-3: #1e2530;
    --ink: #eef2f7;
    --text: #cdd6e2;
    --text-soft: #9aa6b6;
    --muted: #6d7688;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --accent-contrast: var(--brand-accent-contrast);
    --glass: rgba(18, 23, 31, 0.72);
  }
}

/* ---------------- Reset ---------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 {
  color: var(--ink);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

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

::selection {
  background: color-mix(in srgb, var(--accent) 32%, transparent);
}

/* Thin custom scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

/* ---------------- Shared atoms ---------------- */
.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-strong);
  font-weight: 600;
}

.btn {
  --_bg: var(--surface);
  --_fg: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.7em 1.25em;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--_bg);
  color: var(--_fg);
  font-weight: 600;
  font-size: var(--step--1);
  letter-spacing: 0.01em;
  transition: transform 0.18s var(--ease-out), background 0.2s,
    border-color 0.2s, box-shadow 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); }
.btn--primary {
  --_bg: var(--accent);
  --_fg: var(--accent-contrast);
  border-color: transparent;
}
.btn--primary:hover { --_bg: var(--accent-strong); }
.btn--ghost { --_bg: transparent; border-color: var(--line); }
.btn--sm { padding: 0.5em 0.9em; }
.btn--icon { padding: 0.6em; border-radius: var(--radius-md); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.32em 0.7em;
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

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