/* =========================================================
   BASE
   Design tokens, reset, page atmosphere and shared utilities.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #0a0a0a;
  --bg-raise: #111113;
  --bg-card: #0e0e10;
  --bg-card-hover: #101013;
  --text: #ededed;
  --muted: #7a7a7e;
  --faint: #2a2a2e;
  --hair: #1c1c20;
  --white: #fafafa;
  --on-accent: #06130d;

  /* Discipline accents */
  --accent-design: #ff6a3d; /* graphic & web -> warm orange */
  --accent-sec: #2fe6a8;    /* cyber & IT    -> electric green */
  --accent: var(--accent-sec);
  --accent-soft: rgba(47, 230, 168, 0.14);

  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --rail: 272px;
  --gutter: clamp(24px, 6vw, 96px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --streaks-blur: 2px; /* softness of the background light streaks; 0 = sharp */
}

html[data-mode='design'] {
  --accent: var(--accent-design);
  --accent-soft: rgba(255, 106, 61, 0.14);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #07110c;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* The hidden attribute always wins (e.g. the icon sprite, which the rule above would otherwise show) */
[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font-family: inherit;
}

/* Lists used for layout keep their semantics (role="list") but lose bullets */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

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

/* ---------- Atmosphere: faint grid + accent beam ---------- */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 64px 64px;
}

body::after {
  opacity: 0.5;
  background: radial-gradient(900px 500px at 78% -5%, var(--accent-soft), transparent 60%);
  transition: background 0.6s var(--ease);
}

/* Light streaks drifting right, fixed to the viewport (drawn by initStreaks in main.js).
   Sits with the grid and beam under .page (z-index 1), so content scrolls over it. */
.streaks {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: blur(var(--streaks-blur));
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

/* ---------- Utilities ---------- */
.text-accent {
  color: var(--accent);
  transition: color 0.6s var(--ease);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Content tagged data-show="security|design" only appears in that focus mode;
   untagged content shows in both. */
html[data-mode='security'] [data-show='design'],
html[data-mode='design'] [data-show='security'] {
  display: none;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* <main> takes focus from the skip link; no ring needed on the whole region */
main:focus {
  outline: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  border: 1px solid var(--hair);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.25s;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn--solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn--solid:hover {
  filter: brightness(1.08);
  color: var(--on-accent);
}

/* White hollow button: transparent fill, white outline */
.btn--outline {
  border-color: var(--white);
  color: var(--white);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
