/* ══════════════════════════════════════════════════════════
   JP Personal Site — CIPHER NOIR Theme
   Signal: Phosphor Green #00ff41 (SPARSE) + Amber #f59e0b (accent)
   Display: IBM Plex Mono (self-hosted woff2, SIL OFL)
   Body: Instrument Serif (self-hosted woff2, SIL OFL)
   ══════════════════════════════════════════════════════════ */

/* ─── Fonts ─────────────────────────────────────────────── */
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/InstrumentSerif-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/InstrumentSerif-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
  /* Canvas layers */
  --bg-base:        #0e0f10;
  --bg-layer:       #131415;
  --bg-surface:     #16171a;
  --bg-elevated:    #1c1d21;
  --bg-subtle:      #232428;

  /* Text */
  --text-primary:   #e8e6e0;
  --text-secondary: #a8a6a0;
  --text-muted:     #6a6866;

  /* Signal green — use sparingly */
  --green:          #00ff41;
  --green-dim:      rgba(0, 255, 65, 0.08);
  --green-glow:     rgba(0, 255, 65, 0.25);

  /* Amber accent */
  --amber:          #f59e0b;
  --amber-dim:      rgba(245, 158, 11, 0.10);
  --amber-hover:    #fbbf24;

  /* Borders */
  --border:         rgba(255, 255, 255, 0.06);
  --border-strong:  rgba(255, 255, 255, 0.12);
  --border-green:   rgba(0, 255, 65, 0.20);

  /* Shadows */
  --shadow-sm:      0 1px 4px rgba(0, 0, 0, 0.5);
  --shadow-md:      0 4px 28px rgba(0, 0, 0, 0.6);
  --shadow-lg:      0 8px 56px rgba(0, 0, 0, 0.7);
  --shadow-green:   0 0 16px rgba(0, 255, 65, 0.15);

  /* Typography */
  --font-mono:    "IBM Plex Mono", "Courier New", monospace;
  --font-serif:   "Instrument Serif", Georgia, serif;

  /* Scale */
  --text-2xs: 0.65rem;
  --text-xs:  0.75rem;
  --text-sm:  0.875rem;
  --text-base: 1rem;
  --text-lg:  1.125rem;
  --text-xl:  1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.75rem;
  --text-5xl: 3.75rem;
  --text-6xl: 5rem;

  /* Spacing */
  --sp-1:  0.25rem;  --sp-2:  0.5rem;   --sp-3:  0.75rem;
  --sp-4:  1rem;     --sp-5:  1.25rem;  --sp-6:  1.5rem;
  --sp-8:  2rem;     --sp-10: 2.5rem;   --sp-12: 3rem;
  --sp-16: 4rem;     --sp-20: 5rem;     --sp-24: 6rem;
  --sp-32: 8rem;

  /* Motion */
  --ease-out:  cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-both: cubic-bezier(0.4, 0.0, 0.2, 1);
  --dur-fast:   150ms;
  --dur-base:   250ms;
  --dur-slow:   400ms;
  --dur-reveal: 600ms;
  --dur-decrypt: 600ms;

  /* Layout */
  --max-w: 1100px;
  --nav-h: 60px;
}

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

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

body {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ─── Grain Texture (≤4% opacity) ───────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* Scanline overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.015) 2px,
    rgba(0, 0, 0, 0.015) 4px
  );
}

/* All content must sit above texture */
nav, main, footer, .skip-link {
  position: relative;
  z-index: 1;
}

/* ─── Reduced Motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  body::before, body::after { display: none; }
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .decrypt-overlay { display: none !important; }
}

/* ─── Screen-reader only utility ───────────────────────── */
.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;
}

/* ─── Accessibility ─────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background: var(--green);
  color: #000;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 0 0 4px 4px;
  z-index: 999;
  transition: top var(--dur-fast);
  text-decoration: none;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-subtle); border-radius: 2px; }

/* ─── Typography base ───────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  line-height: 1.1;
  color: var(--text-primary);
}

p { color: var(--text-secondary); }
a { color: inherit; text-decoration: none; }

/* Mono utility */
.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ─── Layout ────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-8);
}

@media (max-width: 640px) {
  .container { padding-inline: var(--sp-5); }
}

/* ─── Navigation ────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
  transition: border-color var(--dur-slow) var(--ease-both);
}

.nav-scrolled {
  border-bottom-color: var(--border-strong);
}

.nav-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-8);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
}

.nav-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border-green);
  color: var(--green);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  border-radius: 4px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.nav-logo:hover .nav-monogram {
  border-color: var(--green);
  box-shadow: var(--shadow-green);
}

.nav-wordmark {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--dur-fast),
    color var(--dur-fast),
    border-color var(--dur-fast),
    box-shadow var(--dur-fast),
    transform var(--dur-fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--green);
  color: #000;
  border-color: var(--green);
  font-weight: 700;
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: #1aff55;
  border-color: #1aff55;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-sm {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-2xs);
}

/* ─── Cert badge chips ───────────────────────────────────── */
.cert-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--sp-3);
  background: var(--amber-dim);
  color: var(--amber-hover);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 3px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  white-space: nowrap;
}

/* ─── Tags ──────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px var(--sp-3);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 400;
  letter-spacing: 0.06em;
  border-radius: 2px;
  border: 1px solid var(--border-strong);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

/* ─── Section numbering ─────────────────────────────────── */
.section {
  padding-block: var(--sp-20);
}

.section-header {
  margin-bottom: var(--sp-10);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.section-num {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--green);
  white-space: nowrap;
}

.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Reveal Animations ─────────────────────────────────── */
/* First-paint rule: content starts visible (opacity 1), JS adds subtle
   transform reveal only. No content is gated behind JS or animation. */
[data-reveal] {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
}
/* JS hooks: before observer fires, hold transform only (not opacity) */
[data-reveal].will-reveal {
  opacity: 1;
  transform: translateY(16px);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
[data-reveal]:nth-child(2) { transition-delay: 80ms; }
[data-reveal]:nth-child(3) { transition-delay: 160ms; }
[data-reveal]:nth-child(4) { transition-delay: 240ms; }
[data-reveal]:nth-child(5) { transition-delay: 320ms; }

/* ─── Hero ──────────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  padding-bottom: var(--sp-8);
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow behind hero text */
.hero::before {
  content: "";
  position: absolute;
  top: 20%;
  left: 0;
  width: 50%;
  height: 60%;
  background: radial-gradient(ellipse at 30% 50%, rgba(0, 255, 65, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 320px;
  align-items: center;
  gap: var(--sp-12);
  width: 100%;
}

@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
  }
  .hero-focus { margin-top: var(--sp-10); }
}

.hero-content {
  max-width: 680px;
  will-change: transform;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.hero-eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--green);
  opacity: 0.6;
}

.hero-name {
  font-family: var(--font-mono);
  font-size: clamp(var(--text-4xl), 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.0;
  color: var(--text-primary);
  margin-bottom: var(--sp-5);
  text-transform: uppercase;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: clamp(var(--text-sm), 1.5vw, var(--text-base));
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.hero-tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.2vw, 1.75rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  max-width: 560px;
  margin-bottom: var(--sp-10);
  font-style: normal;
  letter-spacing: -0.01em;
}

.hero-ctas {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* ─── Hero Focus Panel ──────────────────────────────────── */
.hero-focus {
  /* No animation — always visible on first paint */
}

.focus-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-green);
  border-radius: 4px;
  overflow: hidden;
}

.focus-panel-header {
  display: flex;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-layer);
}

.focus-panel-label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}

.focus-panel-body {
  list-style: none;
  padding: var(--sp-1) 0;
}

.focus-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.4;
}

.focus-item:last-child { border-bottom: none; }

.focus-marker {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--green);
  flex-shrink: 0;
  line-height: 1;
}

/* ─── AI & Security Section ──────────────────────────────── */
.ai-security-section {
  padding-bottom: var(--sp-16);
}

.focus-profile {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 760px;
  margin-bottom: var(--sp-10);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-5);
}

.pillar-card {
  padding: var(--sp-6);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.pillar-card:hover {
  border-color: var(--border-green);
  box-shadow: var(--shadow-green);
}

.pillar-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: var(--sp-3);
}

.pillar-desc {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}

.pillar-link {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.06em;
  text-decoration: none;
  border-bottom: 1px solid var(--border-green);
  transition: color var(--dur-fast), border-color var(--dur-fast);
  white-space: nowrap;
}

.pillar-link:hover {
  color: #1aff55;
  border-color: var(--green);
}

/* ─── Experience — Sticky Stacking Cards ────────────────── */
.experience-section {
  padding-bottom: var(--sp-16);
}

.experience-stack {
  position: relative;
}

.exp-card {
  position: sticky;
  top: calc(var(--nav-h) + var(--sp-4));
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--sp-8);
  margin-bottom: var(--sp-5);
  transition: border-color var(--dur-base) var(--ease-both);
  /* Each card gets slight scale/shadow differentiation via JS class */
}

/* Apply increasing top offsets for stacking feel */
.exp-card:nth-child(1) { top: calc(var(--nav-h) + var(--sp-4)); z-index: 10; }
.exp-card:nth-child(2) { top: calc(var(--nav-h) + var(--sp-6)); z-index: 9; }
.exp-card:nth-child(3) { top: calc(var(--nav-h) + var(--sp-8)); z-index: 8; }
.exp-card:nth-child(4) { top: calc(var(--nav-h) + calc(var(--sp-4) * 3)); z-index: 7; }
.exp-card:nth-child(5) { top: calc(var(--nav-h) + calc(var(--sp-4) * 3.5)); z-index: 6; }
.exp-card:nth-child(6) { top: calc(var(--nav-h) + calc(var(--sp-4) * 4)); z-index: 5; }

.exp-card:hover {
  border-color: var(--border-strong);
}

.exp-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.exp-role {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-transform: uppercase;
  line-height: 1.2;
}

.exp-period {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--green);
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 4px;
}

.exp-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.exp-company {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.04em;
}

.exp-sep { color: var(--text-muted); font-family: var(--font-mono); }

.exp-location {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.exp-desc {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--sp-4);
}

/* Timeline marker line on left */
.experience-stack::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--green-dim), transparent);
  pointer-events: none;
}

/* ─── Skills ────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-5);
}

.skill-group {
  padding: var(--sp-5);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color var(--dur-fast);
}

.skill-group:hover {
  border-color: var(--border-strong);
}

/* AI & Frontier-Model Security group — spans full row on wider screens */
.skill-group-featured {
  border-color: var(--border-green);
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(0, 255, 65, 0.02) 100%);
}

.skill-group-featured:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-green);
}

.skill-group-featured .skill-group-title {
  color: var(--green);
}

@media (min-width: 641px) {
  .skill-group-featured {
    grid-column: 1 / -1;
  }

  .skill-group-featured .skill-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp-2) var(--sp-6);
  }
}

.skill-group-title {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.skill-item {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--sp-1) 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.skill-item::before {
  content: "—";
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  flex-shrink: 0;
}

.skill-item:last-child { border-bottom: none; }

/* ─── Projects Bento ────────────────────────────────────── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--sp-5);
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition:
    border-color var(--dur-fast),
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
  grid-column: span 6;
}

.project-card:hover {
  border-color: var(--border-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-card-inner,
a.project-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--sp-8);
  gap: var(--sp-4);
  text-decoration: none;
  color: inherit;
}

.project-wip {
  grid-column: span 4;
  opacity: 0.55;
}
.project-wip:hover { opacity: 0.75; }

@media (max-width: 900px) {
  .bento-grid { grid-template-columns: 1fr 1fr; }
  .project-card { grid-column: span 1; }
  .project-wip { grid-column: span 2; }
}

@media (max-width: 600px) {
  .bento-grid { grid-template-columns: 1fr; }
  .project-card,
  .project-wip { grid-column: span 1; }
}

.project-card-header { flex-shrink: 0; }

.project-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

/* Project title — hover scramble target */
.project-title {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text-primary);
  transition: color var(--dur-fast);
  position: relative;
}

.project-card:hover .project-title {
  color: var(--green);
}

.project-subtitle {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--amber);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-desc {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  flex: 1;
}

/* Status badges */
.status-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1px solid transparent;
}

.status-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.status-live {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(0, 255, 65, 0.15);
}
.status-live::before { background: var(--green); }

.status-wip {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: var(--border);
}
.status-wip::before { background: var(--text-muted); }

/* ─── Decrypt Effect ────────────────────────────────────── */
/* The actual text is always in the DOM (SEO/a11y).
   .decrypt-wrapper wraps a <span data-text="..."> which holds
   the real text, and a sibling .decrypt-overlay with aria-hidden
   chars that we animate. JS toggles .decrypted on the wrapper. */
.decrypt-wrapper {
  position: relative;
  display: inline;
}

.decrypt-real {
  /* Real text — always visible to screen readers and crawlers */
  position: relative;
}

/* Lead-in decrypt blocks: real text ALWAYS visible (first-paint rule).
   The decrypt overlay animates ON TOP as a decorative clip effect.
   JS hides overlay when animation completes, revealing the real text underneath. */
.decrypt-block {
  display: block;
  position: relative;
}

.decrypt-block .decrypt-real {
  /* Always readable — opacity never 0 */
  opacity: 1;
  position: relative;
  z-index: 1;
}

.decrypt-block.decrypted .decrypt-real {
  opacity: 1;
}

/* Decrypt overlay — aria-hidden, pure visual decoration on top of real text.
   Starts hidden, JS shows it during animation, then hides it on completion.
   Real text underneath is always readable. */
.decrypt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  font-family: var(--font-mono);
  color: var(--green);
  font-size: inherit;
  line-height: inherit;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
  word-break: break-word;
  z-index: 2;
  background: var(--bg-surface);
  opacity: 0;
  transition: opacity 200ms;
}

/* JS adds .decrypting while animation runs — overlay fades in over text */
.decrypt-block.decrypting .decrypt-overlay {
  opacity: 0.92;
}

.decrypt-block.decrypted .decrypt-overlay {
  opacity: 0;
  pointer-events: none;
}

/* Project title scramble hover — JS adds/removes .scrambling */
.project-title .scramble-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: inherit;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--green);
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 80ms;
}

.project-title.scrambling .scramble-overlay { opacity: 1; }
.project-title.scrambling > .title-real { opacity: 0; }
.title-real { transition: opacity 80ms; }

/* ─── Contact ───────────────────────────────────────────── */
.contact-section { padding-bottom: var(--sp-20); }

.contact-body { max-width: 640px; }

.contact-intro {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: var(--sp-8);
  font-style: normal;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}

.contact-link:hover, .contact-link:focus-visible {
  color: var(--text-primary);
  border-color: var(--green);
}

.contact-link-primary {
  color: var(--green);
  font-size: var(--text-base);
  font-weight: 700;
}
.contact-link-primary:hover { color: #1aff55; }

/* ─── Footer ────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--sp-10);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.footer-copy, .footer-built {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ─── Scroll cinematic: hero parallax ──────────────────── */
/* animation-timeline: scroll() with JS fallback handled in main.js */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-content {
      animation: hero-parallax linear both;
      animation-timeline: scroll(root block);
      animation-range: 0px 400px;
    }
  }
}

@keyframes hero-parallax {
  0%   { transform: translateY(0);    opacity: 1; }
  100% { transform: translateY(-60px); opacity: 0; }
}

/* ─── Keyframe Animations ───────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ══════════════════════════════════════════════════════════
   PRINT STYLESHEET — clean black-on-white CV, no green, no fx
   ══════════════════════════════════════════════════════════ */
@media print {
  :root {
    --text-primary:   #000000;
    --text-secondary: #2a2a2a;
    --text-muted:     #666666;
    --amber:          #92400e;
    --green:          #166534;
    --bg-base:        #ffffff;
    --bg-surface:     #ffffff;
    --bg-elevated:    #ffffff;
    --bg-subtle:      #f4f4f4;
    --border:         #ddd;
  }

  @page { margin: 1.5cm 1.8cm; size: A4; }

  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  html { font-size: 11px; }

  body {
    background: #fff !important;
    color: #000 !important;
    font-family: Georgia, serif;
  }

  /* Kill texture + overlays */
  body::before, body::after { display: none !important; }

  /* Kill effects */
  .nav, .skip-link, .hero-focus,
  .hero-ctas, .contact-links .btn,
  .footer-built, [data-reveal] { opacity: 1 !important; transform: none !important; }

  .nav, .skip-link, .hero-focus, .hero-ctas .btn-primary { display: none !important; }

  /* Remove animations */
  .decrypt-overlay { display: none !important; }
  .decrypt-real { opacity: 1 !important; }

  /* Hero condensed */
  .hero {
    min-height: auto;
    padding-top: 0;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #000;
    page-break-after: avoid;
  }
  .hero::before { display: none; }
  .hero .container { grid-template-columns: 1fr; }
  .hero-eyebrow { display: none; }
  .hero-name {
    font-family: Georgia, serif;
    font-size: 2.2rem;
    margin-bottom: 0.3rem;
    text-transform: none;
    color: #000;
  }
  .hero-kicker {
    font-family: "Courier New", monospace;
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  .cert-badge {
    background: #f5f5f5;
    color: #333;
    border-color: #999;
    font-size: 0.75rem;
  }
  .hero-tagline {
    font-size: 0.95rem;
    margin-bottom: 0;
    font-style: italic;
    color: #333;
  }

  /* Sections compact */
  .section { padding-block: 1.2rem; page-break-inside: avoid; }
  .section-header { margin-bottom: 0.8rem; }
  .section-num { color: #333; }
  .section-label { color: #333; }

  /* Experience - disable sticky for print */
  .exp-card {
    position: static !important;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-bottom: 0.8rem;
    padding: 0.75rem;
  }
  .exp-role { font-size: 0.95rem; font-family: "Courier New", monospace; text-transform: none; }
  .exp-desc { font-size: 0.82rem; font-family: Georgia, serif; }
  .experience-stack::before { display: none; }

  /* Bento -> stack */
  .bento-grid { display: flex; flex-direction: column; gap: 0.8rem; }
  .project-card, .project-wip {
    grid-column: span 1;
    border: 1px solid #ddd;
    border-radius: 3px;
    page-break-inside: avoid;
  }
  .project-card-inner, a.project-link { padding: 0.75rem; }
  .project-title { font-size: 0.95rem; font-family: "Courier New", monospace; text-transform: none; }
  .project-desc { font-size: 0.82rem; font-family: Georgia, serif; }
  .project-card:hover { transform: none; border-color: #ddd; box-shadow: none; }

  /* Skills inline */
  .skills-grid { display: flex; flex-wrap: wrap; gap: 0.8rem; }
  .skill-group {
    flex: 1 1 140px;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 0.5rem;
  }
  .skill-item::before { content: none; }
  .skill-item { font-family: Georgia, serif; font-size: 0.8rem; }

  /* Contact minimal */
  .contact-section { padding-bottom: 0.8rem; }
  .contact-intro { font-size: 0.85rem; margin-bottom: 0.5rem; }
  .contact-links { gap: 0.5rem; }
  .contact-link { font-size: 0.8rem; border-bottom: none; font-family: "Courier New", monospace; }
}
