/* ================================================================
   HOME - motion and atmosphere layer for the landing page.
   Everything is scoped to .home so inner pages are untouched.
   The static, no-JS state of every effect is its finished state.
================================================================ */

@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

.home { position: relative; }

/* === AMBIENT BACKDROP: drifting aurora, grain, cursor light === */
.home-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fx-aurora { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; will-change: transform; }
.fx-a { left: -28vmax; top: 4vh; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 11%, transparent), transparent); animation: drift-a 28s ease-in-out infinite alternate; }
.fx-b { right: -30vmax; bottom: -18vh; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent); animation: drift-b 34s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate3d(14vw, 22vh, 0) scale(1.15); } }
@keyframes drift-b { to { transform: translate3d(-16vw, -24vh, 0) scale(0.9); } }
.fx-grain {
  position: absolute; inset: 0; opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="light"] .fx-grain { opacity: 0; }
.cursor-glow {
  position: absolute; left: 0; top: 0; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 9%, transparent), transparent);
  opacity: 0; transition: opacity 0.6s; will-change: transform;
}
.cursor-glow.on { opacity: 1; }

/* === SECTION RAIL (wide screens) === */
.rail { position: fixed; left: 1.5rem; top: 50%; transform: translateY(-50%); z-index: 120; display: none; flex-direction: column; }
.rail a { display: flex; align-items: center; gap: 0.7rem; padding: 0.36rem 0; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); transition: color var(--transition); }
.rail a i { width: 14px; height: 1px; background: currentColor; transition: width 0.35s var(--ease); }
.rail a span { opacity: 0; transform: translateX(-4px); transition: opacity 0.25s, transform 0.25s var(--ease); white-space: nowrap; }
.rail a:hover { color: var(--text-primary); }
.rail a:hover i { width: 22px; }
.rail a:hover span, .rail a.active span { opacity: 1; transform: none; }
.rail a.active { color: var(--accent); }
.rail a.active i { width: 30px; height: 2px; }
@media (min-width: 1480px) and (hover: hover) { .rail { display: flex; } }

/* === HERO === */
.js .home .hero-status,
.js .home .hero-eyebrow,
.js .home .hero-title .line,
.js .home .hero-lead,
.js .home .hero-cta,
.js .home .hero-stats { animation: rise 0.9s var(--ease) both; }
.js .home .hero-eyebrow { animation-delay: 0.08s; }
.js .home .hero-title .line { animation-name: line-in; animation-duration: 1.1s; animation-delay: 0.18s; }
.js .home .hero-title .line + .line { animation-delay: 0.34s; }
.js .home .hero-lead { animation-delay: 0.55s; }
.js .home .hero-cta { animation-delay: 0.68s; }
.js .home .mode { animation: rise 0.9s var(--ease) 0.8s both; }
.js .home .hero-stats { animation-name: rise-c; animation-delay: 0.95s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes rise-c { from { opacity: 0; transform: translate(-50%, 16px); } }
@keyframes line-in { from { opacity: 0; transform: translateY(0.35em); filter: blur(14px); } }

/* content drifts back and dims as the hero scrolls away (--hs is set by home.js) */
.home .hero-content { transform: translateY(calc(var(--hs, 0) * 70px)); opacity: calc(1 - var(--hs, 0) * 1.5); }

/* the word "break" breaks. The slices live in a transparent copy of the line laid
   over the real one (.ghost), because a gradient-clipped heading cannot hold
   positioned children: its text mask would paint them too. */
.home .hero-title .line-break { position: relative; }
.home .hero-title .line-break > .accent-text { display: block; padding-bottom: 0.12em; animation: glitch-base 7s steps(1) 2.6s infinite; }
.home .ghost { position: absolute; inset: 0; color: transparent; -webkit-text-fill-color: transparent; pointer-events: none; user-select: none; }
.home .ghost::before { content: attr(data-pre); }
.home .ghost::after { content: attr(data-post); }
.home .ghost i { position: relative; font-style: normal; }
.home .ghost i::before, .home .ghost i::after { content: attr(data-text); display: inline-block; opacity: 0; -webkit-text-fill-color: currentColor; }
.home .ghost i::before { color: #ff3d71; animation: glitch-a 7s steps(1) 2.6s infinite; }
.home .ghost i::after { position: absolute; left: 0; top: 0; color: #5cf2ff; animation: glitch-b 7s steps(1) 2.6s infinite; }
.home .hero-title:hover .line-break > .accent-text, .home .hero-title:hover .ghost i::before, .home .hero-title:hover .ghost i::after { animation-duration: 1.8s; animation-delay: 0s; }
@keyframes glitch-base {
  0%, 89%, 96%, 100% { transform: none; }
  90% { transform: translateX(-0.012em) skewX(-2deg); }
  92% { transform: translateX(0.014em) skewX(1.5deg); }
  94% { transform: translateY(0.01em); }
}
@keyframes glitch-a {
  0%, 89%, 97%, 100% { opacity: 0; }
  90% { opacity: 0.9; transform: translate(-0.07em, -0.02em); clip-path: inset(8% 0 58% 0); }
  92% { opacity: 0.9; transform: translate(0.06em, 0.01em); clip-path: inset(52% 0 12% 0); }
  94% { opacity: 0.9; transform: translate(-0.04em, 0); clip-path: inset(30% 0 40% 0); }
}
@keyframes glitch-b {
  0%, 89%, 97%, 100% { opacity: 0; }
  90% { opacity: 0.9; transform: translate(0.07em, 0.02em); clip-path: inset(46% 0 22% 0); }
  92% { opacity: 0.9; transform: translate(-0.06em, -0.01em); clip-path: inset(6% 0 70% 0); }
  95% { opacity: 0.9; transform: translate(0.03em, 0); clip-path: inset(68% 0 6% 0); }
}

/* stats sit in a glass capsule so they stay readable over the planet */
.home .hero-stats {
  left: 50%; right: auto; bottom: 4rem; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 2rem); gap: 0;
  padding: 0.8rem 0.5rem;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.home .hero-stat { position: relative; padding: 0 1.7rem; }
.home .hero-stat + .hero-stat::before { content: ''; position: absolute; left: 0; top: 12%; bottom: 12%; width: 1px; background: var(--border); }
.home .hero-stat b { font-variant-numeric: tabular-nums; background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* === TICKER === */
.ticker {
  position: relative; overflow: hidden; padding: 1rem 0;
  border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-secondary) 55%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ticker-track { display: flex; width: max-content; will-change: transform; animation: ticker 46s linear infinite; }
.ticker-set { display: flex; align-items: center; gap: 1.8rem; padding-right: 1.8rem; flex-shrink: 0; }
.ticker-set span { font-size: clamp(1.05rem, 2vw, 1.6rem); font-weight: 600; letter-spacing: -0.045em; line-height: 1.1; white-space: nowrap; color: var(--text-primary); }
.ticker-set .hollow { color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--text-secondary) 75%, transparent); }
.ticker-set i { font-style: normal; font-size: 0.8rem; color: var(--accent); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* === SECTION DRESSING === */
/* ghost numeral behind each section head; --par is a small scroll parallax set by home.js */
.home .section[data-n]::before {
  content: attr(data-n);
  position: absolute; top: 3rem; right: max(0.5rem, calc(50% - 610px)); z-index: -1;
  font-size: clamp(4.5rem, 10vw, 9rem); font-weight: 700; letter-spacing: -0.07em; line-height: 0.8;
  color: transparent; -webkit-text-stroke: 1px var(--border);
  -webkit-mask-image: linear-gradient(#000 25%, transparent 92%); mask-image: linear-gradient(#000 25%, transparent 92%);
  transform: translateY(calc(var(--par, 0) * 1px));
  pointer-events: none; user-select: none;
}
.home .section-title .accent-text, .home .cta-title .accent-text { background-size: 220% 100%; animation: sheen 9s ease-in-out infinite alternate; }
@keyframes sheen { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

/* === RECON: radar behind the panel === */
.home #recon { overflow-x: clip; }
.home #recon::before { right: auto; left: max(0.5rem, calc(50% - 610px)); }
.home .recon-wrap { position: relative; }
.radar {
  position: absolute; left: 76%; top: 50%; z-index: -1;
  width: min(780px, 70vw); aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%); pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 47px, color-mix(in srgb, var(--accent) 34%, transparent) 47px 48px);
  -webkit-mask-image: radial-gradient(circle, #000 25%, transparent 70%); mask-image: radial-gradient(circle, #000 25%, transparent 70%);
}
.radar i { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 72%, color-mix(in srgb, var(--accent) 42%, transparent) 100%); animation: spin 7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === LABS: living cards === */
.js .home .lab[data-aos] { transform: translateY(26px) scale(0.975); }
.js .home .lab[data-aos].in { transform: none; }
/* a light runs round the border while hovered */
.home .lab::before {
  content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0 60%, var(--accent) 78%, var(--accent-2) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  opacity: 0; transition: opacity 0.35s; animation: ang 3.6s linear infinite paused;
}
.home .lab:hover::before { opacity: 1; animation-play-state: running; }
@keyframes ang { to { --ang: 360deg; } }

/* JWT: header, payload and signature light up in turn; findings land one by one */
.home .viz-token > span:nth-child(odd) { animation: seg 5.4s ease-in-out infinite; }
.home .viz-token > span:nth-child(3) { animation-delay: 1.8s; }
.home .viz-token > span:nth-child(5) { animation-delay: 3.6s; }
@keyframes seg { 0%, 34%, 100% { filter: none; text-shadow: none; } 8%, 24% { filter: brightness(1.45); text-shadow: 0 0 14px currentColor; } }
.js .home .lab .viz-findings > div { opacity: 0; transform: translateX(-10px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.js .home .lab.in .viz-findings > div { opacity: 1; transform: none; transition-delay: 0.55s; }
.js .home .lab.in .viz-findings > div:nth-child(2) { transition-delay: 0.85s; }
.js .home .lab.in .viz-findings > div:nth-child(3) { transition-delay: 1.15s; }

/* typed payloads (home.js wraps each character in .ch) */
.home [data-type] .ch { visibility: hidden; }
.home [data-type] .ch.on { visibility: visible; }
.home [data-type] .ch.cur { box-shadow: 2px 0 0 var(--accent); }
.home .lab-viz .viz-pill { transition: opacity 0.35s, transform 0.35s var(--ease); }
.home .lab-viz .viz-strike { transition: color 0.3s, text-decoration-color 0.3s; }
.home .lab-viz.typing .viz-pill { opacity: 0; transform: translateY(6px) scale(0.96); }
.home .lab-viz.typing .viz-strike { text-decoration-color: transparent; color: var(--text-secondary); }
.home .lab-viz.typing .viz-hl { background: transparent; padding-left: 0; padding-right: 0; }
.home .lab-viz.typing .viz-hl .ch.on { background: color-mix(in srgb, var(--accent-red) 18%, transparent); }

/* OWASP: a probe steps down the list */
.home .viz-scan > div { padding: 0.1rem 0.5rem; margin: 0 -0.5rem; border-radius: 4px; animation: rowscan 6.4s ease-in-out infinite; }
.home .viz-scan > div:nth-child(2) { animation-delay: 1.6s; }
.home .viz-scan > div:nth-child(3) { animation-delay: 3.2s; }
.home .viz-scan > div:nth-child(4) { animation-delay: 4.8s; }
@keyframes rowscan { 0%, 24%, 100% { background: transparent; color: inherit; } 4%, 18% { background: var(--accent-dim); color: var(--text-primary); } }

/* footprint: signal bars breathe */
.home .viz-bars i { transform-origin: bottom; animation: eq 2.6s ease-in-out infinite alternate; }
.home .viz-bars i:nth-child(3n) { animation-duration: 1.9s; animation-delay: -0.6s; }
.home .viz-bars i:nth-child(3n+1) { animation-duration: 3.1s; animation-delay: -1.4s; }
.home .viz-bars i:nth-child(4n) { animation-duration: 2.2s; animation-delay: -0.9s; }
@keyframes eq { from { transform: scaleY(0.4); } to { transform: scaleY(1); } }

/* === RESEARCH ROWS === */
.home .row-num {
  font-family: var(--font-sans); font-size: 1.9rem; font-weight: 700; letter-spacing: -0.06em; line-height: 0.95; padding-top: 0;
  color: transparent !important; -webkit-text-stroke: 1px var(--text-muted);
  transition: -webkit-text-stroke-color var(--transition), color var(--transition);
}
.home .row:hover .row-num { -webkit-text-stroke-color: var(--accent); color: var(--accent-dim) !important; }
.home .row::before { background: linear-gradient(90deg, var(--accent-dim), transparent 75%); }
.home .row::after {
  content: ''; position: absolute; left: -1.25rem; top: 18%; bottom: 18%; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transform: scaleY(0); transition: transform 0.35s var(--ease);
}
.home .row:hover::after { transform: scaleY(1); }
.home .row-title { transition: transform 0.35s var(--ease), color var(--transition); }
.home .row:hover .row-title { transform: translateX(8px); }
.home .row .tech-badge { transition: border-color var(--transition), color var(--transition); }
.home .row:hover .tech-badge { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); color: var(--text-primary); }

/* === ABOUT === */
.home .split-sticky { position: sticky; top: calc(var(--nav-height) + 3rem); }
.home .portrait { box-shadow: 0 50px 110px -40px color-mix(in srgb, var(--accent-2) 55%, transparent), 0 20px 60px -30px color-mix(in srgb, var(--accent) 40%, transparent); will-change: transform; }
.portrait-corners i { position: absolute; z-index: 2; width: 22px; height: 22px; border: 0 solid var(--accent); opacity: 0.9; transition: inset 0.4s var(--ease); pointer-events: none; }
.portrait-corners i:nth-child(1) { inset: 14px auto auto 14px; border-width: 2px 0 0 2px; }
.portrait-corners i:nth-child(2) { inset: 14px 14px auto auto; border-width: 2px 2px 0 0; }
.portrait-corners i:nth-child(3) { inset: auto auto 14px 14px; border-width: 0 0 2px 2px; }
.portrait-corners i:nth-child(4) { inset: auto 14px 14px auto; border-width: 0 2px 2px 0; }
.portrait:hover .portrait-corners i:nth-child(1) { inset: 22px auto auto 22px; }
.portrait:hover .portrait-corners i:nth-child(2) { inset: 22px 22px auto auto; }
.portrait:hover .portrait-corners i:nth-child(3) { inset: auto auto 22px 22px; }
.portrait:hover .portrait-corners i:nth-child(4) { inset: auto 22px 22px auto; }
.home .portrait-cap { padding-left: 2.8rem; padding-right: 2.8rem; padding-bottom: 1.15rem; z-index: 1; }
.portrait-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 34%; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 14%, transparent) 85%, color-mix(in srgb, var(--accent) 55%, transparent) 99%, transparent);
  transform: translateY(-110%); animation: pscan 6s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
@keyframes pscan { 0%, 12% { transform: translateY(-110%); } 70%, 100% { transform: translateY(300%); } }

.home .domain { position: relative; transition: padding-left 0.3s var(--ease); }
.home .domain::after { content: ''; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--gradient); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease); }
.home .domain:hover { padding-left: 0.6rem; }
.home .domain:hover::after { transform: scaleX(1); }
.home .domain-tools { transition: color var(--transition); }
.home .domain:hover .domain-tools { color: var(--text-secondary); }

/* === EXPERIENCE: a timeline that fills as you read (--xp-p from home.js) === */
.home .xp { position: relative; border-top: none; --rail: calc(200px + 1.25rem); }
.home .xp::before, .home .xp::after { content: ''; position: absolute; left: var(--rail); top: 0; width: 1px; }
.home .xp::before { bottom: 0; background: var(--border); }
.home .xp::after { height: calc(var(--xp-p, 1) * 100%); width: 2px; margin-left: -0.5px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 70%, transparent); }
.home .xp-item { position: relative; border-bottom: none; }
.home .xp-item::before {
  content: ''; position: absolute; left: calc(var(--rail) - 5px); top: 2.75rem; z-index: 1;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--accent);
  box-shadow: 0 0 0 5px var(--accent-dim), 0 0 18px color-mix(in srgb, var(--accent) 80%, transparent);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.home .xp-item > * { transition: opacity 0.6s var(--ease); }
.home .xp.xp-live .xp-item:not(.on)::before { background: var(--bg-primary); border-color: var(--border); box-shadow: none; }
.home .xp.xp-live .xp-item:not(.on) > * { opacity: 0.5; }

/* === SIDE QUESTS / WRITING === */
.home .terminal, .home .treasure-card { transition: border-color 0.3s, box-shadow 0.3s; }
.home .terminal:focus-within, .home .treasure-card:focus-within {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow: 0 0 0 1px var(--accent-dim), 0 30px 90px -40px color-mix(in srgb, var(--accent) 60%, transparent);
}
.home .post-feature-img { transition: transform 0.9s var(--ease); }
.home .post-feature:hover .post-feature-img { transform: scale(1.05); }
.home .post-row { position: relative; }
.home .post-row::after { content: ''; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--gradient); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease); }
.home .post-row:hover::after { transform: scaleX(1); }

/* === CONTACT === */
.cta-stars {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.8;
  background-image:
    radial-gradient(1.2px 1.2px at 8% 22%, #fff, transparent), radial-gradient(1px 1px at 17% 64%, #cfe6ff, transparent),
    radial-gradient(1.4px 1.4px at 26% 38%, #fff, transparent), radial-gradient(1px 1px at 34% 12%, #cfe6ff, transparent),
    radial-gradient(1px 1px at 43% 71%, #fff, transparent), radial-gradient(1.3px 1.3px at 57% 18%, #fff, transparent),
    radial-gradient(1px 1px at 66% 58%, #cfe6ff, transparent), radial-gradient(1.4px 1.4px at 74% 30%, #fff, transparent),
    radial-gradient(1px 1px at 83% 68%, #fff, transparent), radial-gradient(1.2px 1.2px at 91% 16%, #cfe6ff, transparent),
    radial-gradient(1px 1px at 96% 47%, #fff, transparent), radial-gradient(1px 1px at 3% 82%, #fff, transparent);
  animation: twinkle 4.5s ease-in-out infinite alternate;
}
[data-theme="light"] .cta-stars { display: none; }
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 0.9; } }
.home .horizon { animation: breathe 6s ease-in-out infinite alternate; }
@keyframes breathe { from { opacity: 0.7; } to { opacity: 1; } }

/* ================================================================
   BUILDER / ATTACKER VIEW
   home.js sets data-mode="break" on <html>. The palette swap is done
   entirely through the design tokens, so the navbar and footer follow.
================================================================ */
body { transition: background-color 0.6s var(--ease), color 0.4s; }

[data-mode="break"] {
  --bg-primary: #0b0608; --bg-secondary: #110709; --bg-tertiary: #2a0f18;
  --surface: #160a0e; --surface-elevated: #1f0f15; --surface-hover: #2a141c;
  --border: #42212c; --border-subtle: #2b151d;
  --text-primary: #f8eaed; --text-secondary: #b99ba3; --text-muted: #84656d; --text-inverse: #1c0509;
  --accent: #ff3b5c; --accent-dim: rgba(255, 59, 92, 0.13); --accent-hover: #ff7189;
  --accent-2: #ff8a3d; --accent-2-dim: rgba(255, 138, 61, 0.15);
  --gradient: linear-gradient(100deg, #ff3b5c 0%, #ff6a4d 50%, #ffb347 100%);
  --glass: rgba(24, 11, 15, 0.62);
  --shadow-glow: 0 0 0 1px rgba(255, 59, 92, 0.25), 0 12px 44px rgba(255, 59, 92, 0.14);
  --grid-line: rgba(255, 120, 140, 0.05);
}
[data-theme="light"][data-mode="break"] {
  --bg-primary: #fbf1f1; --bg-secondary: #f6e7e8; --bg-tertiary: #fde8ea;
  --surface: #ffffff; --surface-elevated: #fdf7f7; --surface-hover: #faeeee;
  --border: #e3c4c9; --border-subtle: #eedadd;
  --text-primary: #2a0c12; --text-secondary: #6b4850; --text-muted: #9a7a82; --text-inverse: #ffffff;
  --accent: #d11f3f; --accent-dim: rgba(209, 31, 63, 0.1); --accent-hover: #a8162f;
  --accent-2: #d9600f; --accent-2-dim: rgba(217, 96, 15, 0.1);
  --gradient: linear-gradient(100deg, #d11f3f 0%, #e0502a 50%, #d9860f 100%);
  --glass: rgba(255, 255, 255, 0.72);
  --grid-line: rgba(42, 12, 18, 0.05);
}
/* the few places main.css spells the cyan out */
[data-mode="break"] .hero { background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 59, 92, 0.1), transparent 70%); }
[data-mode="break"] .btn-primary:hover { box-shadow: 0 0 0 4px var(--accent-dim), 0 10px 36px rgba(255, 59, 92, 0.3); }
[data-mode="break"] .recon { box-shadow: var(--shadow-lg), 0 0 80px rgba(255, 59, 92, 0.08); }
[data-mode="break"] .recon::after { background: linear-gradient(180deg, transparent, rgba(255, 59, 92, 0.06)); border-bottom-color: rgba(255, 59, 92, 0.2); }
[data-mode="break"] .lab:hover { box-shadow: 0 20px 60px rgba(255, 59, 92, 0.1); }
[data-mode="break"] .horizon {
  background: radial-gradient(circle at 50% 1280px,
    #2a0d14 0, var(--bg-primary) 1098px,
    rgba(255, 59, 92, 0.9) 1100px, rgba(255, 59, 92, 0.28) 1103px,
    rgba(255, 138, 61, 0.14) 1160px, transparent 1300px);
}
[data-theme="light"][data-mode="break"] .horizon {
  background: radial-gradient(circle at 50% 1280px,
    #f6dfe2 0, var(--bg-primary) 1098px,
    rgba(209, 31, 63, 0.8) 1100px, rgba(209, 31, 63, 0.2) 1103px,
    rgba(217, 96, 15, 0.1) 1160px, transparent 1300px);
}

/* the switch */
.mode { margin-top: 1.5rem; display: flex; align-items: center; gap: 0.85rem; }
.mode[hidden] { display: none; }
.mode-label { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.mode-switch {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.mode-switch button {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.4rem 0.95rem; border-radius: var(--radius-full);
  font-size: 0.8rem; font-weight: 550; color: var(--text-secondary); transition: color 0.3s;
}
.mode-switch button i { font-size: 0.72rem; }
.mode-switch button:hover { color: var(--text-primary); }
.mode-switch button[aria-checked="true"] { color: var(--text-inverse); }
.mode-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: var(--radius-full);
  background: var(--accent); box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 45%, transparent);
  transition: transform 0.4s var(--ease), background-color 0.4s;
}
[data-mode="break"] .mode-thumb { transform: translateX(100%); }
/* until it has been used once, the bug twitches to say "press me" */
.mode:not(.used) [data-mode-set="break"] i { animation: twitch 4.5s ease-in-out 3s infinite; }
@keyframes twitch { 0%, 86%, 100% { transform: none; } 89% { transform: rotate(-18deg) scale(1.25); } 93% { transform: rotate(14deg) scale(1.25); } 96% { transform: rotate(-6deg); } }

/* the switch-over: a burst of scan bars and a caption */
.mode-flash {
  position: fixed; inset: 0; z-index: 600; pointer-events: none; display: grid; place-items: center; opacity: 0; overflow: hidden;
  background: repeating-linear-gradient(0deg, color-mix(in srgb, var(--accent) 9%, transparent) 0 2px, transparent 2px 5px);
  backdrop-filter: saturate(1.8) contrast(1.25); -webkit-backdrop-filter: saturate(1.8) contrast(1.25);
}
.mode-flash::before, .mode-flash::after { content: ''; position: absolute; left: 0; right: 0; height: 9vh; background: color-mix(in srgb, var(--accent) 22%, transparent); mix-blend-mode: screen; }
.mode-flash.on { animation: flash 0.85s ease-out both; }
.mode-flash.on::before { animation: bar-a 0.85s steps(1) both; }
.mode-flash.on::after { animation: bar-b 0.85s steps(1) both; }
.mode-flash span {
  position: relative; padding: 0.7rem 1.3rem; background: var(--bg-primary); border: 1px solid var(--accent); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 35%, transparent);
}
@keyframes flash { 0% { opacity: 0; } 10%, 68% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bar-a { 0% { top: 12%; } 18% { top: 64%; height: 4vh; } 36% { top: 31%; height: 14vh; } 54% { top: 80%; } 72% { top: 6%; height: 3vh; } }
@keyframes bar-b { 0% { top: 71%; height: 5vh; } 22% { top: 22%; } 40% { top: 90%; height: 12vh; } 60% { top: 45%; height: 2vh; } 78% { top: 58%; } }

/* attacker's notes: only exist in attacker view */
.note {
  display: none; position: relative; max-width: 36ch; margin-top: 1.5rem; padding: 0.75rem 0.95rem 0.8rem 1rem; text-align: left;
  font-family: var(--font-mono); font-size: 0.71rem; line-height: 1.6; color: var(--text-secondary);
  border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.note b { display: block; margin-bottom: 0.3rem; font-size: 0.6rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.note::after { content: '#' attr(data-note); position: absolute; right: 0.75rem; top: 0.72rem; font-size: 0.6rem; color: var(--text-muted); }
[data-mode="break"] .note { display: block; animation: note-in 0.55s var(--ease) 0.45s both; }
@keyframes note-in { from { opacity: 0; transform: translateY(8px); } }
.home .sec-head-side { justify-self: end; max-width: 44ch; }
[data-mode="break"] .home .sec-head { align-items: start; }
/* the hero note is pinned in the margin beside the intro; there is no margin to pin it in below 1100px */
.note-hero { position: absolute; left: 1.5rem; top: 15rem; width: 228px; margin: 0; rotate: -1.5deg; }
@media (max-width: 1099px) { [data-mode="break"] .note-hero { display: none; } }

/* === PLAYABLE SQL INJECTION CARD === */
.lab-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.home .lab-play .lab-viz { position: relative; z-index: 3; padding: 1.25rem 1.5rem; }
.sqli { display: grid; gap: 0.6rem; }
.sqli-task { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); line-height: 1.4; }
.sqli-task b { color: var(--text-primary); font-weight: 500; }
.sqli-field {
  display: flex; align-items: center; gap: 0.65rem; height: 36px; padding: 0 0.75rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.sqli-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.sqli-field span { font-size: 0.68rem; color: var(--text-muted); }
.sqli-field input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-primary); caret-color: var(--accent); }
.sqli-field input::placeholder { color: var(--text-muted); opacity: 0.7; }
.sqli-query { font-size: 0.72rem; line-height: 1.65; min-height: 3.3em; }
.sqli-query .viz-hl:empty { display: none; }
.sqli-query .viz-hl { white-space: pre-wrap; }
#sqli-tail, #sqli-tail * { transition: color 0.25s; }
.lab-play.is-commented #sqli-tail, .lab-play.is-commented #sqli-tail * { color: var(--text-muted); text-decoration: line-through; }
.sqli-out { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.sqli-out .viz-pill { transition: color 0.25s, box-shadow 0.25s; }
.sqli-try { display: inline-flex; gap: 0.35rem; }
.sqli-try button { font-family: var(--font-mono); font-size: 0.64rem; padding: 0.14rem 0.5rem; border: 1px dashed var(--border); border-radius: var(--radius-full); color: var(--text-secondary); white-space: pre; transition: color var(--transition), border-color var(--transition); }
.sqli-try button:hover { color: var(--accent); border-color: var(--accent); }
.home .lab-play.is-pwned { border-color: color-mix(in srgb, var(--accent-3) 70%, var(--border)); box-shadow: 0 0 0 1px var(--accent-3-dim), 0 20px 70px -20px color-mix(in srgb, var(--accent-3) 45%, transparent); }
.lab-play.is-pwned .sqli-out .viz-pill { box-shadow: 0 0 18px color-mix(in srgb, var(--accent-3) 45%, transparent); animation: pop 0.4s var(--ease); }
@keyframes pop { 0% { transform: scale(0.9); } 60% { transform: scale(1.06); } }

/* === TARGET LOCK: brackets snap onto whatever the pointer is over === */
.reticle {
  position: fixed; left: 0; top: 0; z-index: 250; width: 0; height: 0; pointer-events: none; opacity: 0;
  transition: opacity 0.2s, transform 0.26s var(--ease), width 0.26s var(--ease), height 0.26s var(--ease);
}
.reticle.on { opacity: 1; }
.reticle i { position: absolute; width: 9px; height: 9px; border: 0 solid var(--accent); }
.reticle i:nth-child(1) { left: 0; top: 0; border-width: 1.5px 0 0 1.5px; }
.reticle i:nth-child(2) { right: 0; top: 0; border-width: 1.5px 1.5px 0 0; }
.reticle i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 1.5px 1.5px; }
.reticle i:nth-child(4) { right: 0; bottom: 0; border-width: 0 1.5px 1.5px 0; }

/* === RESPONSIVE === */
@media (max-width: 1080px) {
  .home .split-sticky { position: static; }
  .radar { left: 50%; top: auto; bottom: -14%; transform: translateX(-50%); width: min(680px, 120vw); }
}
@media (max-width: 760px) {
  .mode { flex-direction: column; gap: 0.55rem; margin-top: 1.25rem; }
  .note { margin-left: auto; margin-right: auto; }
  .recon-copy .note, .home .sec-head-side .note { margin-left: 0; }
  .home .sec-head-side { justify-self: start; }
  .home .hero-stats { bottom: 1.6rem; width: calc(100% - 2rem); display: grid; grid-template-columns: repeat(4, 1fr); padding: 0.8rem 0.2rem; }
  .home .hero-stat { padding: 0 0.4rem; }
  .home .hero-stat span { letter-spacing: 0.06em; line-height: 1.35; }
  .ticker { padding: 1.1rem 0; }
  .ticker-set { gap: 1.4rem; padding-right: 1.4rem; }
  .home .section[data-n]::before { top: 2rem; }
  .home .row-num { font-size: 1.6rem; }
  .home .xp { --rail: 5px; }
  .home .xp-item { padding-left: 1.9rem; }
  .home .xp-item::before { top: 2.3rem; }
}
