/* ==========================================================================
   rdzsp.id — purple hacker theme
   ========================================================================== */

:root {
  --bg: #07040d;
  --bg-2: #0c0717;
  --surface: rgba(22, 13, 40, 0.62);
  --surface-solid: #120b22;
  --surface-hover: rgba(34, 19, 62, 0.75);
  --border: rgba(168, 85, 247, 0.16);
  --border-strong: rgba(192, 132, 252, 0.42);

  --primary: #a855f7;
  --primary-2: #c084fc;
  --primary-3: #e9d5ff;
  --primary-deep: #6d28d9;
  --accent: #22d3ee;
  --ok: #4ade80;

  --text: #ece6f7;
  --text-2: #b9aed0;
  --muted: #8a7fa3;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1180px;
  --nav-h: 68px;
  --glow: 0 0 0 1px var(--border-strong), 0 18px 60px -20px rgba(168, 85, 247, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--primary-2); text-decoration: none; }
a:hover { color: var(--primary-3); }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
code, .mono { font-family: var(--font-mono); }
strong { color: var(--primary-3); font-weight: 600; }
em { color: var(--text); }
::selection { background: var(--primary); color: #fff; }

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

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.accent { color: var(--primary-2); }

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 8px 14px; border-radius: 8px;
  background: var(--primary); color: #fff;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: #fff; }

/* Ambient background */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
}
.bg-noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.35;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}

/* ---------- Buttons, chips, badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 12px;
  font: 600 15px/1 var(--font-sans);
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  box-shadow: 0 10px 30px -10px rgba(168, 85, 247, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover { color: #fff; box-shadow: 0 14px 40px -10px rgba(168, 85, 247, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-ghost { color: var(--text); background: rgba(168, 85, 247, 0.06); border-color: var(--border-strong); }
.btn-ghost:hover { color: #fff; background: rgba(168, 85, 247, 0.16); }
.btn-sm { padding: 9px 14px; font-size: 14px; border-radius: 10px; }

.chip {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  font: 500 12px/1.5 var(--font-mono);
  color: var(--primary-2);
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid var(--border);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px;
  font: 600 11px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--primary-3);
  background: rgba(10, 5, 20, 0.78);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(6px);
}
.badge .icon { width: 13px; height: 13px; }
.badge-report { color: #fda4af; border-color: rgba(253, 164, 175, 0.4); }
.badge-research { color: #67e8f9; border-color: rgba(103, 232, 249, 0.4); }

.icon-tile {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 12px;
  color: var(--primary-2);
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.22), rgba(109, 40, 217, 0.08));
  border: 1px solid var(--border-strong);
}
.icon-tile .icon { width: 24px; height: 24px; }
.icon-tile-sm { width: 40px; height: 40px; border-radius: 10px; }
.icon-tile-sm .icon { width: 20px; height: 20px; }

.text-link { display: inline-flex; align-items: center; gap: 6px; font: 500 14px var(--font-mono); }
.text-link .icon { transition: transform 0.25s var(--ease); }
.text-link:hover .icon { transform: translate(2px, -2px); }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s, transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.3s;
}
.card::before {
  /* cursor-tracking spotlight, positioned from main.js */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -20%), rgba(168, 85, 247, 0.13), transparent 40%);
  opacity: 0; transition: opacity 0.3s;
}
.card::after {
  /* target-lock brackets on hover */
  --lock: var(--primary-2);
  content: ""; position: absolute; inset: 8px; pointer-events: none; z-index: 2;
  background:
    linear-gradient(var(--lock), var(--lock)) top left / 14px 2px,
    linear-gradient(var(--lock), var(--lock)) top left / 2px 14px,
    linear-gradient(var(--lock), var(--lock)) top right / 14px 2px,
    linear-gradient(var(--lock), var(--lock)) top right / 2px 14px,
    linear-gradient(var(--lock), var(--lock)) bottom left / 14px 2px,
    linear-gradient(var(--lock), var(--lock)) bottom left / 2px 14px,
    linear-gradient(var(--lock), var(--lock)) bottom right / 14px 2px,
    linear-gradient(var(--lock), var(--lock)) bottom right / 2px 14px;
  background-repeat: no-repeat;
  opacity: 0; transform: scale(1.06);
  transition: opacity 0.25s, transform 0.35s var(--ease);
}
.card:hover::after { opacity: 1; transform: none; }
.card:hover { border-color: var(--border-strong); transform: translateY(-4px); box-shadow: 0 24px 60px -30px rgba(168, 85, 247, 0.6); }
.card:hover::before { opacity: 1; }
.card-title { font-size: 1.2rem; font-weight: 600; color: #fff; }
.card-text { color: var(--text-2); font-size: 0.95rem; }
.card-label { display: flex; align-items: center; gap: 8px; font: 500 13px var(--font-mono); color: var(--muted); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(7, 4, 13, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border-color: var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: var(--nav-h); }

.brand { display: inline-flex; align-items: baseline; font: 700 19px var(--font-mono); color: #fff; }
.brand:hover { color: #fff; }
.brand-prompt { color: var(--primary); }
.brand-cursor { color: var(--primary-2); animation: blink 1.1s steps(1) infinite; }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  position: relative;
  padding: 8px 12px; border-radius: 8px;
  font: 500 14px var(--font-sans); color: var(--text-2);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: #fff; background: rgba(168, 85, 247, 0.08); }
.nav-links a.is-active { color: #fff; }
.nav-links a.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.nav-toggle {
  display: none; margin-left: auto;
  width: 42px; height: 42px; border-radius: 10px;
  color: var(--text); background: rgba(168, 85, 247, 0.08); border: 1px solid var(--border);
  cursor: pointer;
}
.nav-toggle .icon { width: 22px; height: 22px; margin: auto; }
.nav-toggle .icon-close { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 48px) 0 96px;
  overflow: hidden;
}
.hero::after {
  /* slow scanner sweep */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 140px; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(168, 85, 247, 0.08) 60%, rgba(192, 132, 252, 0.22) 100%);
  border-bottom: 1px solid rgba(192, 132, 252, 0.25);
  animation: sweep 8s linear infinite;
}
.hero-rain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.32; mask-image: linear-gradient(180deg, #000 40%, transparent 100%); }
.hero-glow {
  position: absolute; z-index: 0; pointer-events: none;
  width: 900px; height: 900px; right: -260px; top: -280px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.28), transparent 60%);
  filter: blur(20px);
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center;
}

.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px; border-radius: 999px;
  font: 500 13px var(--font-mono); color: var(--text-2);
  background: rgba(74, 222, 128, 0.06); border: 1px solid rgba(74, 222, 128, 0.25);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); animation: pulse 2s infinite; }

.hero-title { margin-top: 22px; display: flex; flex-direction: column; gap: 6px; }
.hero-kicker { font: 500 clamp(0.95rem, 1.6vw, 1.1rem) var(--font-mono); color: var(--primary-2); letter-spacing: 0; }
.glitch {
  position: relative; display: inline-block;
  font: 700 clamp(2.6rem, 9vw, 6.4rem)/0.95 var(--font-display);
  letter-spacing: -0.04em; text-transform: uppercase; white-space: nowrap;
  background: linear-gradient(120deg, #fff 10%, var(--primary-3) 40%, var(--primary) 75%, var(--primary-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0;
  background: inherit; -webkit-background-clip: text; background-clip: text;
  opacity: 0.8;
}
.glitch::before { text-shadow: none; color: transparent; animation: glitch-a 4s infinite steps(1); }
.glitch::after { color: transparent; animation: glitch-b 4s infinite steps(1); }

.glitch.is-cracking { filter: drop-shadow(0 0 18px rgba(168, 85, 247, 0.6)); }
.glitch.is-cracking::before, .glitch.is-cracking::after { animation-duration: 0.6s; }
.hero-roles { margin-top: 18px; display: flex; align-items: center; gap: 10px; font: 500 clamp(1rem, 2vw, 1.3rem) var(--font-mono); color: #fff; min-height: 1.6em; }
.hero-roles-prefix { color: var(--ok); }
.caret { display: inline-block; width: 0.55em; height: 1.1em; margin-left: 2px; vertical-align: -0.15em; background: var(--primary-2); animation: blink 1s steps(1) infinite; }
.hero-sub { margin-top: 14px; max-width: 520px; color: var(--text-2); font-size: 1.08rem; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stats {
  margin-top: 44px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: rgba(18, 11, 34, 0.5); backdrop-filter: blur(8px);
  overflow: hidden;
}
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-value { font: 700 1.6rem/1.1 var(--font-display); color: #fff; }
.stat-label { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }

/* Terminal */
.terminal {
  background: rgba(10, 6, 20, 0.86);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--glow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: rgba(168, 85, 247, 0.07);
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }
.terminal-title { margin-left: 10px; font: 500 12px var(--font-mono); color: var(--muted); }
.terminal-body { padding: 20px 22px 24px; font: 400 14px/1.75 var(--font-mono); min-height: 300px; }
.term-block + .term-block { margin-top: 10px; }
.term-cmd { color: #fff; white-space: pre-wrap; word-break: break-word; }
.term-user { color: var(--ok); }
.term-sep { color: var(--muted); }
.term-path { color: var(--accent); }
.term-prompt { color: var(--primary-2); margin-left: 2px; }
.term-out { color: var(--primary-3); opacity: 0.85; padding-left: 2px; white-space: pre-wrap; word-break: break-word; }
.term-idle { margin-top: 10px; }

/* Live session mode (JS): fixed height, auto-scrolling log */
.terminal-body.is-live {
  height: 340px; display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(168, 85, 247, 0.5) transparent;
}
.terminal-body.is-live::-webkit-scrollbar { width: 8px; }
.terminal-body.is-live::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.45); border-radius: 8px; }
.terminal-body.is-live::-webkit-scrollbar-track { background: transparent; }
.terminal-body:focus-visible { outline-offset: -3px; }

.term-autoscroll {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 6px;
  font: 600 11px var(--font-mono); letter-spacing: 0.03em;
  color: var(--muted); background: transparent; border: 1px solid var(--border);
  cursor: pointer; transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.term-autoscroll .icon { width: 13px; height: 13px; }
.term-autoscroll:hover { color: var(--text); border-color: var(--border-strong); }
.term-autoscroll[aria-pressed="true"] { color: var(--primary-3); background: rgba(168, 85, 247, 0.18); border-color: var(--primary); }
.term-autoscroll[aria-pressed="true"] .icon { animation: nudge 1.4s ease-in-out infinite; }
.term-autoscroll:not([hidden]) + .term-live { margin-left: 12px; }
.terminal-body.is-live > :first-child { margin-top: auto; }
.terminal-body.is-live .term-cmd { margin-top: 10px; }
.terminal-body.is-live .term-cmd:first-child { margin-top: 0; }
.k-ok { color: var(--ok); }
.k-info { color: var(--accent); }
.k-warn { color: #fbbf24; }
.k-vuln { color: #fb7185; font-weight: 700; }
.k-money { color: #fde047; font-weight: 700; }
.term-out.k-ok, .term-out.k-info, .term-out.k-warn, .term-out.k-vuln, .term-out.k-money { opacity: 1; }
.is-flash { animation: flash 0.9s steps(2) 1; }

.term-live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: 600 11px var(--font-mono); color: #fb7185; letter-spacing: 0.05em; }
.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: #fb7185; animation: blink 1.2s steps(1) infinite; }

/* CRT scanlines over terminals */
.terminal { position: relative; }
.hero-terminal::after, .notfound-term::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.hero-terminal { transform: perspective(1200px) rotateY(-6deg) rotateX(2deg); transition: transform 0.6s var(--ease); }
.hero-terminal:hover { transform: none; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; z-index: 1; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--border-strong); border-radius: 14px;
}
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--primary-2); animation: scroll 1.8s infinite; }

/* ---------- Sections ---------- */
.section { position: relative; padding: 110px 0; }
.section-head { max-width: 720px; margin-bottom: 52px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 13px var(--font-mono); color: var(--primary-2); text-transform: lowercase; }
.eyebrow-index { color: var(--muted); }
.eyebrow-slash { color: var(--primary); }
.section-title { margin-top: 12px; font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; color: #fff; }
.section-lead { margin-top: 14px; color: var(--text-2); font-size: 1.08rem; }
.sub-title { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font: 600 1.15rem var(--font-display); color: #fff; }
.sub-title .icon { color: var(--primary-2); }

/* About */
.about-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: start; }
.about-text { display: grid; gap: 18px; color: var(--text-2); font-size: 1.05rem; }
.about-focus { padding: 26px; }
.focus-list { margin-top: 18px; display: grid; gap: 4px; }
.focus-list li { display: flex; gap: 16px; padding: 14px 0; border-top: 1px dashed var(--border); }
.focus-list li:first-child { border-top: 0; }
.focus-index { font: 700 13px/1.9 var(--font-mono); color: var(--primary); }
.focus-list h3 { font-size: 1.02rem; color: #fff; }
.focus-list p { font-size: 0.9rem; color: var(--muted); }
.alias-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.88rem; }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.service-card { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.service-featured {
  background: linear-gradient(160deg, rgba(109, 40, 217, 0.28), rgba(22, 13, 40, 0.7) 60%);
  border-color: var(--border-strong);
}
.service-top { display: flex; align-items: center; justify-content: space-between; }
.service-index { font: 500 13px var(--font-mono); color: var(--muted); }
.check-list { display: grid; gap: 9px; margin-top: 4px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.93rem; color: var(--text); }
.check-list .icon { margin-top: 3px; width: 16px; height: 16px; color: var(--ok); }

.cta-strip {
  margin-top: 28px; padding: 22px 26px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: rgba(168, 85, 247, 0.05);
}
.cta-strip p { color: var(--text-2); max-width: 720px; }

/* Tabs + work */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px;
  font: 500 14px var(--font-sans); color: var(--text-2);
  background: rgba(168, 85, 247, 0.05); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s;
}
.tab:hover { color: #fff; border-color: var(--border-strong); }
.tab.is-active { color: #fff; background: rgba(168, 85, 247, 0.2); border-color: var(--primary); }
.tab .icon { width: 16px; height: 16px; }
.tab-count { font: 600 11px var(--font-mono); padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); color: var(--primary-3); }

.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.work-card { overflow: hidden; }
.work-card[hidden] { display: none !important; }
.work-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.work-link:hover { color: inherit; }
.work-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-solid); border-bottom: 1px solid var(--border); }
.work-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85); transition: transform 0.6s var(--ease), filter 0.4s; }
.work-card:hover .work-media img { transform: scale(1.05); filter: saturate(1.05); }
.work-media-empty {
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 70% 30%, rgba(253, 164, 175, 0.12), transparent 50%),
    repeating-linear-gradient(45deg, rgba(168, 85, 247, 0.06) 0 2px, transparent 2px 12px),
    var(--surface-solid);
}
.work-ascii { margin: 0; font: 500 13px/1.7 var(--font-mono); color: var(--primary-3); text-align: center; }
.work-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 22px; }
.work-meta { font-size: 12px; color: var(--primary-2); }
.work-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.read-more { display: inline-flex; align-items: center; gap: 4px; font: 600 13px var(--font-mono); color: var(--primary-2); white-space: nowrap; }
.read-more .icon { transition: transform 0.25s var(--ease); }
.work-card:hover .read-more .icon { transform: translate(2px, -2px); }

/* Recognition */
.awards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.award-card { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.award-card .text-link { margin-top: auto; }
.award-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.award-logo { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.15); }
.award-logo img { width: 36px; height: 36px; object-fit: contain; }
.award-rank {
  font: 700 2.4rem/1 var(--font-display);
  background: linear-gradient(180deg, #fff, var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.recog-split { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cert-card { padding: 24px; display: flex; gap: 20px; align-items: flex-start; }
.cert-code {
  flex: none; display: grid; place-items: center;
  width: 72px; height: 72px; border-radius: 16px;
  font: 700 18px var(--font-mono); color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-deep));
  box-shadow: 0 12px 30px -12px rgba(168, 85, 247, 0.9);
}
.cert-body { display: grid; gap: 8px; }
.cert-body h4 { font-size: 1.1rem; color: #fff; }
.cert-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.cert-meta span { display: inline-flex; align-items: center; gap: 6px; }

.platform-list { display: grid; gap: 12px; }
.platform-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: inherit; }
.platform-card:hover { color: inherit; transform: translateX(4px); }
.platform-body { flex: 1; display: grid; }
.platform-name { font: 600 1rem var(--font-display); color: #fff; }
.platform-desc { font-size: 0.85rem; color: var(--muted); }
.platform-user { font-size: 13px; color: var(--primary-2); }
.platform-arrow { color: var(--muted); transition: color 0.2s, transform 0.25s var(--ease); }
.platform-card:hover .platform-arrow { color: var(--primary-2); transform: translate(2px, -2px); }

/* Talks */
.talks-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.talk-card { overflow: hidden; display: flex; flex-direction: column; }
.talk-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--border); }
.talk-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.talk-card:hover .talk-media img { transform: scale(1.04); }
.talk-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 24px; }
.talk-body .text-link { margin-top: auto; padding-top: 6px; }

/* Tools */
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 36px; }
.tool-card { padding: 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tool-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tool-gh { color: var(--text-2); }
.tool-repo { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.langs { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-2); }
.lang { display: inline-flex; align-items: center; gap: 6px; }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.lang-javascript { background: #f1e05a; }
.lang-html { background: #e34c26; }
.lang-css { background: #663399; }
.lang-python { background: #3572a5; }
.lang-selenium { background: #43b02a; }
.repo-stats { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); }
.repo-stats li { display: inline-flex; align-items: center; gap: 5px; }
.repo-stats .icon { width: 15px; height: 15px; color: var(--muted); }

/* Contact */
.contact-card { position: relative; }
.contact-card::after {
  content: ""; position: absolute; inset: auto -20% -60% auto; width: 520px; height: 520px; pointer-events: none;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.3), transparent 60%);
}
.contact-body { position: relative; z-index: 1; padding: clamp(32px, 6vw, 72px); text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact-title { margin-top: 14px; font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; color: #fff; max-width: 820px; }
.grad { background: linear-gradient(90deg, var(--primary-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.contact-body .section-lead { max-width: 560px; }
.contact-email {
  margin-top: 32px;
  display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 12px;
  padding: 16px 24px; border-radius: 14px;
  font: 500 clamp(1rem, 2.4vw, 1.25rem) var(--font-mono); color: #fff;
  background: rgba(168, 85, 247, 0.1); border: 1px solid var(--border-strong);
  transition: background 0.25s, box-shadow 0.25s, transform 0.25s var(--ease);
}
.contact-email:hover { color: #fff; background: rgba(168, 85, 247, 0.2); box-shadow: var(--glow); transform: translateY(-2px); }
.social-row { margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.social {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  font-size: 14px; color: var(--text-2);
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s;
}
.social:hover { color: #fff; border-color: var(--border-strong); background: rgba(168, 85, 247, 0.12); }

/* Footer */
.footer { padding: 40px 0 calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: rgba(7, 4, 13, 0.8); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; }
.footer-links a { color: var(--text-2); }
.footer-links a:hover { color: var(--primary-2); }
.footer-copy { width: 100%; font-size: 12px; color: var(--muted); }

/* 404 */
.notfound { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.notfound-term { width: min(640px, 100%); }
.notfound .glitch { font-size: inherit; line-height: inherit; letter-spacing: 0; }

/* ---------- Boot overlay ---------- */
.boot {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; justify-content: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) 24px max(24px, env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  font: 400 14px/1.8 var(--font-mono); color: var(--primary-3);
  transition: opacity 0.5s, transform 0.5s var(--ease);
}
.boot::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.25) 0 1px, transparent 1px 3px); }
.boot.is-done { opacity: 0; transform: scale(1.02); pointer-events: none; }
.boot-log { width: min(620px, 100%); margin-inline: auto; }
.boot-log p { white-space: pre-wrap; word-break: break-word; }
.boot-granted { margin-top: 14px; font: 700 clamp(1.6rem, 6vw, 2.6rem) var(--font-mono); color: var(--ok); letter-spacing: 0.08em; text-shadow: 0 0 24px rgba(74, 222, 128, 0.5); }
.boot-hint { position: absolute; bottom: max(24px, env(safe-area-inset-bottom, 0px)); left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- Activity feed ---------- */
.feed {
  position: fixed; left: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  width: min(380px, calc(100vw - 40px)); pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 14px; border-radius: 12px;
  font: 500 12.5px/1.4 var(--font-mono);
  background: rgba(12, 7, 23, 0.92); border: 1px solid var(--border-strong);
  border-left: 3px solid currentColor;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8), 0 0 30px -12px rgba(168, 85, 247, 0.6);
  backdrop-filter: blur(10px);
  opacity: 0; transform: translateX(-24px);
  transition: opacity 0.4s, transform 0.5s var(--ease);
}
.toast.is-in { opacity: 1; transform: none; }
.toast-time { color: var(--muted); }
/* tag inherits the k-* color as its background; text is painted in the page bg */
.toast-tag { padding: 1px 6px; border-radius: 5px; font-weight: 700; font-size: 11px; background: currentColor; -webkit-text-fill-color: var(--bg); }
.toast-text { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-close {
  flex: none; width: 24px; height: 24px; border: 0; border-radius: 6px;
  font: 400 16px/1 var(--font-sans); color: var(--muted); background: transparent; cursor: pointer;
}
.toast-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* ---------- Scroll reveal (only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
@keyframes nudge { 50% { transform: translateY(2px); } }
@keyframes sweep { from { transform: translateY(-140px); } to { transform: translateY(110vh); } }
@keyframes flash { 50% { background: rgba(251, 113, 133, 0.18); } }
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }
@keyframes glitch-a {
  0%, 86%, 100% { transform: none; clip-path: inset(0 0 100% 0); }
  87% { transform: translate(-4px, 1px); clip-path: inset(10% 0 60% 0); filter: hue-rotate(60deg); }
  89% { transform: translate(3px, -1px); clip-path: inset(55% 0 20% 0); }
  91% { transform: translate(-2px, 0); clip-path: inset(30% 0 45% 0); }
}
@keyframes glitch-b {
  0%, 88%, 100% { transform: none; clip-path: inset(100% 0 0 0); }
  89% { transform: translate(4px, 0); clip-path: inset(70% 0 5% 0); filter: hue-rotate(-80deg); }
  92% { transform: translate(-3px, 1px); clip-path: inset(20% 0 65% 0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-terminal { transform: none; max-width: 640px; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .awards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .nav-cta { display: none; }
  .nav-toggle { display: grid; }
  .nav-links {
    position: fixed; top: calc(var(--nav-h) + env(safe-area-inset-top, 0px)); left: 0; right: 0;
    flex-direction: column; gap: 2px; margin: 0;
    padding: 12px 16px 20px;
    background: rgba(7, 4, 13, 0.96); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav-links a { padding: 12px 14px; font-size: 16px; }
  .nav-links a.is-active::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 2px; height: auto; }
  .nav.is-open { background: rgba(7, 4, 13, 0.96); border-color: var(--border); }
  .nav.is-open .nav-links { transform: none; opacity: 1; visibility: visible; }
  .nav.is-open .icon-open { display: none; }
  .nav.is-open .icon-close { display: block; }

  .about-grid, .recog-split, .services-grid, .talks-grid { grid-template-columns: 1fr; }
  .section { padding: 84px 0; }
}

@media (max-width: 640px) {
  .container { padding-inline: 18px; }
  .hero { padding-top: calc(var(--nav-h) + 28px); }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .terminal-body { font-size: 12.5px; padding: 16px; min-height: 0; }
  .terminal-body.is-live { height: 300px; }
  .term-autoscroll span, .terminal-title { display: none; }
  .feed { left: 12px; right: 12px; width: auto; }
  .toast-time { display: none; }
  .tools-grid, .awards-grid, .work-grid { grid-template-columns: 1fr; }
  .service-card, .award-card, .about-focus { padding: 22px; }
  .cert-card { flex-direction: column; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero-terminal { transform: none; }
}
