/* ════════════════════════════════════════════════════════════════════════════
   Nocturnal Blue · portfolio styles
   Palette  Canvas #050505 · Surface #121212 · Primary #0070f3
            Secondary #1e293b · Text high #f8fafc · Text low #94a3b8
   ──────────────────────────────────────────────────────────────────────────── */

:root {
  --canvas:     #050505;
  --surface:    #121212;
  --surface-2:  #181818;
  --primary:    #0070f3;
  /* --primary-rgb is set by JS (hexToRgb) so rgba(var(--primary-rgb), alpha)
     tracks the Tweaks-panel accent color everywhere, including box-shadows
     and borders that can't use color-mix. Default matches --primary. */
  --primary-rgb: 0, 112, 243;
  --secondary:  #1e293b;
  --border:       rgba(59, 130, 246, 0.10);
  --border-strong: rgba(59, 130, 246, 0.18);
  --text-hi:   #f8fafc;
  --text-mid:  #cbd5e1;
  --text-lo:   #94a3b8;
  --text-fade: #64748b;
  --danger:    #ef4444;
  --success:   #22c55e;

  --section-pad: 7rem;
  --section-gap: 1.75rem;

  /* Theme-dependent washes and ink (overridden for light mode below) */
  --surface-3:     #1f1f23;
  --border-grey:   rgba(148, 163, 184, 0.12);
  --wash-1:        rgba(255,255,255,0.025);
  --wash-2:        rgba(255,255,255,0.06);
  --glass:         rgba(5, 5, 5, 0.55);
  --glass-strong:  rgba(5, 5, 5, 0.7);
  --accent-ink:    color-mix(in oklab, var(--primary) 70%, white);
  --accent-ink-hi: color-mix(in oklab, var(--primary) 80%, white);
  --accent-ink-mix: color-mix(in oklab, var(--primary) 85%, white);
  --success-ink:   #86efac;
  --grid-line:     rgba(148, 163, 184, 0.06);
  --hero-wash:     rgba(0, 29, 61, 0.7);
  --hero-wash-2:   rgba(0, 29, 61, 0.55);

  --font-sans:    "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--canvas);
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  background: var(--canvas);
  color: var(--text-hi);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}
::selection { background: rgba(var(--primary-rgb), 0.35); color: var(--text-hi); }

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

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

/* ─── Layout primitives ─────────────────────────────────────────────────── */
.main { position: relative; }

.section {
  position: relative;
  padding: var(--section-pad) 0;
}
.section-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}
.section-inner.narrow { max-width: 920px; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 3.25rem;
  max-width: 720px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 500;
}
.eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
  font-weight: 500;
  color: var(--text-hi);
  text-wrap: balance;
}
.section-subtitle {
  font-size: 1.0625rem;
  color: var(--text-lo);
  margin: 0;
  max-width: 56ch;
  text-wrap: pretty;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s cubic-bezier(0.2,0.7,0.3,1),
              background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.2s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 12px; font-size: 0.84375rem; border-radius: 8px; }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset,
              0 6px 24px -8px rgba(var(--primary-rgb), 0.6);
}
.btn-primary:hover {
  background: color-mix(in oklab, var(--primary) 88%, white);
  box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset,
              0 10px 30px -8px rgba(var(--primary-rgb), 0.75);
}

/* Disabled-state for the CV button when cvUrl is not yet set */
.btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-ghost {
  background: var(--wash-1);
  color: var(--text-hi);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--wash-2);
  border-color: var(--border-strong);
}

/* Split button: primary "Download" + small "Preview" icon, joined seamlessly. */
.btn-split {
  display: inline-flex;
  border-radius: 10px;
  box-shadow: 0 6px 24px -8px rgba(var(--primary-rgb), 0.6);
}
.btn-split .btn-split-main {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset;
}
.btn-split .btn-split-aux {
  padding: 11px 12px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset;
}
.btn-split .btn-split-aux:hover {
  background: color-mix(in oklab, var(--primary) 82%, white);
}

/* Copy-button — used inline next to copyable values */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-lo);
  background: rgba(var(--primary-rgb), 0.06);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.copy-btn:hover {
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--accent-ink-hi);
}
.copy-btn.is-copied {
  color: var(--success-ink);
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

/* ─── Header ────────────────────────────────────────────────────────────── */
.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, background 0.25s;
}
.hdr-scrolled {
  border-bottom-color: var(--border);
  background: var(--glass-strong);
}
.hdr-inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.hdr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hdr-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--primary), color-mix(in oklab, var(--primary) 60%, #6b21a8 40%));
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: white;
  box-shadow: 0 4px 14px -4px rgba(var(--primary-rgb), 0.5);
}
.hdr-name { font-family: var(--font-mono); font-size: 13.5px; color: var(--text-hi); }

.hdr-nav {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 44px;
}
.hdr-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-size: 13.25px;
  color: var(--text-lo);
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: color 0.18s;
  white-space: nowrap;
}
.hdr-tab:hover { color: var(--text-mid); }
.hdr-tab.active { color: var(--text-hi); }
.hdr-tab-indicator {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition:
    transform 0.45s cubic-bezier(0.4, 1.3, 0.45, 1),
    width 0.45s cubic-bezier(0.4, 1.3, 0.45, 1),
    opacity 0.25s;
  box-shadow: 0 0 10px var(--primary), 0 0 2px var(--primary);
  pointer-events: none;
}

.hdr-cta-wrap { display: flex; align-items: center; gap: 8px; }
.hdr-menu {
  display: none;
  width: 36px; height: 36px;
  background: var(--wash-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.hdr-menu:hover { background: var(--wash-2); }

.hdr-mobile {
  display: none;
  border-top: 1px solid var(--border);
  padding: 12px 24px 18px;
  flex-direction: column;
  gap: 2px;
}
.hdr-mobile-link {
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text-lo);
  border-radius: 8px;
}
.hdr-mobile-link.active { color: var(--text-hi); background: var(--wash-2); }

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  min-height: clamp(620px, 92vh, 880px);
  padding-top: calc(var(--section-pad) - 1rem);
  padding-bottom: calc(var(--section-pad) - 2rem);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1180px;
}
[data-hero-layout="center"] .hero-inner {
  align-items: center;
  text-align: center;
}
[data-hero-layout="center"] .hero-blurb,
[data-hero-layout="center"] .hero-stats { max-width: 56ch; }

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute;
  inset: -10% -5% -10% -5%;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(60% 60% at 50% 40%, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(60% 60% at 50% 40%, black 0%, transparent 75%);
}
.hero-bg-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 22% 32%, rgba(var(--primary-rgb), 0.22) 0%, transparent 60%),
    radial-gradient(70% 60% at 80% 70%, var(--hero-wash) 0%, transparent 65%);
  filter: blur(40px);
  opacity: 0.9;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(50% 70% at 50% 100%, var(--hero-wash-2), transparent 70%);
  z-index: 0;
}

/* ─── Hero nameplate ────────────────────────────────────────────────────── */
.hero-nameplate {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  width: fit-content;
  max-width: 100%;
}
.hero-nameplate-rule {
  width: 36px; height: 1px;
  background: linear-gradient(to right, transparent, var(--primary) 30%, var(--primary));
  flex-shrink: 0;
}
.hero-nameplate-name {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
  font-weight: 400;
  color: var(--text-hi);
  white-space: nowrap;
}
.hero-nameplate-first {
  font-weight: 600;
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  letter-spacing: -0.03em;
  color: var(--text-hi);
}
[data-hero-layout="center"] .hero-nameplate { margin: 0 auto; }

.hero-mono {
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0;
  font-weight: 500;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6.5vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0;
  font-weight: 500;
  max-width: 18ch;
  text-wrap: balance;
  color: var(--text-hi);
}
.hero-word { display: inline-block; }

.hero-blurb {
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--text-lo);
  margin: 0;
  max-width: 56ch;
  text-wrap: pretty;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.hero-stats {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  max-width: 580px;
  border-top: 1px solid var(--border);
}
.hero-stats li {
  padding: 1.25rem 1.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-stat-value {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-hi);
}
.hero-stat-label {
  font-size: 12.5px;
  color: var(--text-fade);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.hero-scroll {
  position: absolute;
  bottom: 1.5rem;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-fade);
}
.hero-scroll-line {
  width: 1px; height: 38px;
  background: linear-gradient(to bottom, var(--text-fade), transparent);
  animation: line-slide 2.4s ease-in-out infinite;
  transform-origin: top;
}
@keyframes line-slide {
  0%, 100% { transform: scaleY(1); opacity: 0.4; }
  50%       { transform: scaleY(0.4); opacity: 1; }
}
@keyframes pulse-out {
  0%   { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ─── Pill ──────────────────────────────────────────────────────────────── */
/* Colors derived from --primary so they follow the Tweaks accent. */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--accent-ink);
  background: rgba(var(--primary-rgb), 0.07);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 6px;
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pill-accent {
  color: var(--accent-ink-mix);
  background: color-mix(in oklab, var(--primary) 18%, transparent);
  border-color: color-mix(in oklab, var(--primary) 40%, transparent);
}
.tl-card:hover .pill,
.pj-card:hover .pill,
.pj-card.is-hover .pill {
  background: rgba(var(--primary-rgb), 0.11);
  border-color: rgba(var(--primary-rgb), 0.28);
  color: var(--accent-ink-mix);
}

/* ─── Experience timeline ──────────────────────────────────────────────── */
.tl {
  position: relative;
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}
.tl-rail {
  position: absolute;
  top: 4px; bottom: 4px; left: 7px;
  width: 1px;
  background: linear-gradient(to bottom,
    transparent,
    var(--border-strong) 4%,
    var(--border-strong) 92%,
    transparent);
}
.tl-rail-fill {
  position: absolute;
  inset: 0 0 auto 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--primary), color-mix(in oklab, var(--primary) 40%, transparent));
  height: 30%;
  filter: blur(0.2px);
}

.tl-item {
  position: relative;
  padding-left: 28px;
}
.tl-node {
  position: absolute;
  left: -22px; top: 18px;
  width: 14px; height: 14px;
}
.tl-node-dot {
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--canvas), 0 0 14px var(--primary);
}
.tl-node-pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--primary);
  animation: pulse-out 2.4s ease-out infinite;
}

.tl-card {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px 20px;
  transition: border-color 0.2s, transform 0.25s, box-shadow 0.25s;
}
.tl-card:hover {
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
  box-shadow: 0 24px 60px -28px rgba(var(--primary-rgb), 0.4);
}
.tl-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.tl-role {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--text-hi);
}
.tl-company {
  margin: 0;
  font-size: 14px;
  color: var(--text-mid);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tl-sep  { color: var(--text-fade); }
.tl-meta { color: var(--text-lo); font-size: 13px; }
.tl-period {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-fade);
  letter-spacing: 0.02em;
  padding-top: 3px;
}
.tl-summary {
  font-size: 14.5px;
  color: var(--text-mid);
  margin: 0 0 12px;
  line-height: 1.55;
}
.tl-achievements {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tl-achievements li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.75px;
  color: var(--text-lo);
  line-height: 1.5;
}
.tl-verb {
  color: var(--text-hi);
  font-weight: 600;
  letter-spacing: -0.005em;
}
.tl-check {
  flex-shrink: 0;
  margin-top: 5px;
  color: var(--primary);
  opacity: 0.85;
}
.tl-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  margin-top: 6px;
}

/* ─── Academic cards ───────────────────────────────────────────────────── */
.ac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.ac-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, transform 0.25s;
}
.ac-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.ac-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ac-period {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--text-fade);
}
.ac-spark      { color: var(--primary); opacity: 0.7; }
.ac-institution {
  font-size: 1.0625rem;
  font-weight: 500;
  margin: 4px 0 0;
  color: var(--text-hi);
  letter-spacing: -0.01em;
}
.ac-degree { margin: 0; font-size: 14px; color: var(--text-mid); }
.ac-detail { margin: 6px 0 0; font-size: 13.25px; color: var(--text-lo); line-height: 1.55; }

/* ─── Projects grid ────────────────────────────────────────────────────── */
/* One project per row: media panel on one side, text on the other.
   Alternate rows flip sides for rhythm; stacks to media-on-top on mobile. */
.pj-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.pj-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "media body";
  gap: 28px;
  align-items: stretch;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2,0.7,0.3,1),
              border-color 0.25s, box-shadow 0.25s;
}
.pj-card-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.pj-card:hover,
.pj-card.is-hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--primary) 50%, var(--border));
  box-shadow: 0 24px 50px -24px rgba(var(--primary-rgb), 0.45);
}
.pj-card:hover .pj-card-glow,
.pj-card.is-hover .pj-card-glow { opacity: 1; }
.pj-card--flip {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "body media";
}
.pj-body {
  grid-area: body;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 6px 0;
  min-width: 0;
}
.pj-media {
  grid-area: media;
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  border: 1px solid var(--border-grey);
  background: var(--surface-3);
  overflow: hidden;
  align-self: center;
  width: 100%;
}
.pj-media img {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.2,0.7,0.3,1);
}
.pj-media--shot img { object-fit: cover; object-position: top center; }
.pj-media--logo { display: grid; place-items: center; }
.pj-media--logo img { object-fit: contain; width: 46%; height: 60%; }
.pj-card:hover .pj-media--shot img,
.pj-card.is-hover .pj-media--shot img { transform: scale(1.03); }
.pj-media--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
}
.pj-monogram {
  font-family: var(--font-mono);
  font-size: 2.75rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--text-hi);
  opacity: 0.85;
  text-transform: lowercase;
}
.pj-media-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-fade);
}
@media (max-width: 760px) {
  .pj-card, .pj-card--flip {
    grid-template-columns: 1fr;
    grid-template-areas: "media" "body";
    gap: 16px;
    padding: 14px;
  }
  .pj-body { padding: 4px 6px 2px; }
}

.pj-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pj-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
}
.pj-code  { color: var(--primary); opacity: 0.75; }
.pj-title {
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text-hi);
}
.pj-stars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-fade);
}
.pj-role {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-ink);
  padding: 3px 8px 3px 7px;
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.22);
  border-radius: 5px;
  width: fit-content;
  margin-top: 2px;
}
.pj-role-dot {
  width: 5px; height: 5px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}
.pj-blurb {
  font-size: 14.5px;
  color: var(--text-mid);
  margin: 0;
  line-height: 1.5;
}
.pj-desc {
  font-size: 13.25px;
  color: var(--text-lo);
  margin: 0;
  line-height: 1.55;
}
.pj-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.pj-tags  { display: flex; flex-wrap: wrap; gap: 5px; }
.pj-links { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pj-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-lo);
  font-family: var(--font-mono);
  transition: color 0.18s, gap 0.18s;
}
.pj-link-sub { color: var(--text-fade); font-size: 11.5px; }
.pj-link-sub:hover { color: var(--text-mid); }
/* Stub links (URL not yet set) look muted and non-clickable */
.pj-link-stub { opacity: 0.35; cursor: default; }
.pj-card:hover .pj-link:not(.pj-link-stub):last-child,
.pj-card.is-hover .pj-link:not(.pj-link-stub):last-child {
  color: var(--primary);
  gap: 9px;
}

/* ─── Skills strip ─────────────────────────────────────────────────────── */
.sk-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px 36px;
  padding: 32px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
}
.sk-col { display: flex; flex-direction: column; gap: 10px; }
.sk-h {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-fade);
  margin: 0;
  font-weight: 500;
}
.sk-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sk-list li { font-size: 14px; color: var(--text-mid); line-height: 1.5; }

/* ─── Contact ──────────────────────────────────────────────────────────── */
.ct-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 1.4fr);
  gap: 24px;
  align-items: start;
}
.ct-info { min-width: 0; }
.ct-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
/* Shared style for the mono sub-headings inside the contact card */
.ct-card-h,
.ct-card-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-fade);
  font-weight: 500;
  margin: 0 0 12px;
}
.ct-card-sub { margin-top: 22px; }

.ct-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ct-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-mid);
  flex-wrap: wrap;
}
.ct-email { flex: 1; min-width: 0; }
.ct-copy  { margin-left: auto; }
.ct-list a {
  color: var(--text-mid);
  border-bottom: 1px dotted transparent;
  transition: border-color 0.18s, color 0.18s;
}
.ct-list a:hover { color: var(--primary); border-bottom-color: var(--primary); }
.ct-icon { color: var(--text-fade); flex-shrink: 0; }

.ct-socials { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ct-socials a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--wash-1);
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.ct-socials a:hover {
  border-color: color-mix(in oklab, var(--primary) 40%, var(--border));
  background: rgba(var(--primary-rgb), 0.06);
}
.ct-socials a > svg { color: var(--text-mid); flex-shrink: 0; }
.ct-socials a div   { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.ct-soc-label  { font-size: 13.5px; color: var(--text-hi); font-weight: 500; }
.ct-soc-handle { font-size: 12px; color: var(--text-lo); font-family: var(--font-mono); }
.ct-soc-go     { color: var(--text-fade); transition: color 0.18s, transform 0.18s; }
.ct-socials a:hover .ct-soc-go { color: var(--primary); transform: translate(2px, -2px); }

/* ─── Contact form ─────────────────────────────────────────────────────── */
.cf {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
}
.cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cf-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 2px;
}
.cf-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-fade);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.cf-err {
  color: var(--danger);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 400;
}
.cf-input {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-hi);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}
.cf-input::placeholder { color: var(--text-fade); }
textarea.cf-input { min-height: 110px; padding-top: 6px; }
.cf-underline {
  position: absolute;
  bottom: 1px; left: 0;
  height: 1px; width: 100%;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.2,0.7,0.3,1), background 0.2s;
}
.cf-field:focus-within .cf-underline       { transform: scaleX(1); }
.cf-field-invalid .cf-input                { border-bottom-color: rgba(239, 68, 68, 0.55); }
.cf-field-invalid .cf-underline            { background: var(--danger); transform: scaleX(1); }
.cf-field-valid .cf-input                  { border-bottom-color: rgba(34, 197, 94, 0.45); }

.cf-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.cf-submit { transition: background 0.2s, transform 0.18s; min-width: 168px; justify-content: center; }
.cf-submit.sent    { background: var(--success); box-shadow: 0 6px 20px -8px rgba(34, 197, 94, 0.6); }
.cf-submit.limited { background: var(--secondary); box-shadow: none; }
.cf-submit.error   { background: var(--danger); box-shadow: 0 6px 20px -8px rgba(239, 68, 68, 0.6); }
.cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cf-submit:disabled { cursor: default; opacity: 0.9; }
.cf-spin {
  width: 14px; height: 14px;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cf-hint { font-size: 12.5px; color: var(--text-fade); }
.cf-hint a {
  color: var(--text-lo);
  border-bottom: 1px dotted var(--border-strong);
}
.cf-hint a:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* ─── Footer ───────────────────────────────────────────────────────────── */
.ft {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 1rem;
}
.ft-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ft-sig,
.ft-meta {
  font-size: 12.5px;
  color: var(--text-fade);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

/* ─── Light theme ────────────────────────────────────────────────────────
   Same structure, inverted surfaces. Accent ink darkens off --primary so the
   Accent tweak still works. Set by data-theme on <html> (see app.jsx). */
:root[data-theme="light"] {
  --canvas: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #eef2f7;
  --secondary: #e2e8f0;
  --border: rgba(37, 99, 235, 0.13);
  --border-strong: rgba(37, 99, 235, 0.24);
  --border-grey: rgba(15, 23, 42, 0.10);
  --text-hi: #0b1220;
  --text-mid: #334155;
  --text-lo: #475569;
  --text-fade: #64748b;

  --wash-1: rgba(15, 23, 42, 0.025);
  --wash-2: rgba(15, 23, 42, 0.06);
  --glass: rgba(246, 247, 249, 0.72);
  --glass-strong: rgba(246, 247, 249, 0.88);
  --accent-ink: color-mix(in oklab, var(--primary) 78%, black);
  --accent-ink-hi: color-mix(in oklab, var(--primary) 65%, black);
  --accent-ink-mix: color-mix(in oklab, var(--primary) 80%, black);
  --success-ink: #15803d;
  --grid-line: rgba(15, 23, 42, 0.07);
  --hero-wash: rgba(var(--primary-rgb), 0.10);
  --hero-wash-2: rgba(var(--primary-rgb), 0.07);
}
html[data-theme="light"] { color-scheme: light; }
html[data-theme="light"] .pj-card:hover, html[data-theme="light"] .pj-card.is-hover,
html[data-theme="light"] .tl-card:hover { box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.22); }
html.theme-anim, html.theme-anim * { transition: background-color .3s, border-color .3s, color .3s !important; }

/* Theme toggle button (header) */
.hdr-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  color: var(--text-mid);
  background: var(--wash-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.hdr-theme:hover { background: var(--wash-2); color: var(--text-hi); border-color: var(--border-strong); }

/* ─── Coming-soon page ─────────────────────────────────────────────────── */
.soon {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 32px 22px;
}
.soon-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.soon-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  letter-spacing: -0.02em;
  color: var(--text-hi);
}
.soon .hero-mono { margin: 0; }
.soon-title {
  margin: 18px 0 22px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.75rem, 11vw, 7.5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--text-hi);
}
.soon-links { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; }
.soon-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13.5px;
  color: var(--text-mid);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--wash-1);
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.soon-links a:hover { color: var(--text-hi); border-color: var(--border-strong); background: var(--wash-2); }
.soon-theme { position: absolute; top: 20px; right: 22px; z-index: 2; }

/* ─── Responsive — desktop-first, narrowest last ──────────────────────── */
@media (max-width: 980px) {
  .hdr-cta-wrap .btn-ghost.btn-sm { display: none; }
}
/* 880px: stack contact grid and form, reduce card padding */
@media (max-width: 880px) {
  :root { --section-pad: 5rem; }
  .section-inner { padding: 0 22px; }
  .ct-grid { grid-template-columns: 1fr; }
  .cf-row  { grid-template-columns: 1fr; }
  .tl-card { padding: 18px 18px 16px; }
  .cf      { padding: 20px; }
}
@media (max-width: 760px) {
  .hdr-name { display: none; }
}
/* 640px: collapse nav into hamburger drawer */
@media (max-width: 640px) {
  .hdr-inner  { padding: 10px 22px; }
  .hdr-nav    { display: none; }
  .hdr-menu   { display: inline-flex; }
  .hdr-mobile { display: flex; }
  .hero-stats  { grid-template-columns: repeat(3, 1fr); }
  .hero-title  { font-size: clamp(2.25rem, 9vw, 3.25rem); }
  .hero-scroll { display: none; }
  .tl { padding-left: 22px; }
  .tl-item { padding-left: 22px; }
}
@media (max-width: 520px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats li:nth-child(3) { display: none; }
  .tl-card-head { flex-direction: column; gap: 4px; }
  .tl-period    { padding-top: 0; }
  .hero-nameplate-rule { width: 22px; }
  .hero-nameplate      { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .tl-node-pulse, .hero-scroll-line { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
