:root {
  --bg: #2a2a38; /* lightened toward #48485a */
  --panel: rgba(255, 255, 255, 0.045);
  --panel-hi: rgba(255, 255, 255, 0.08);
  --line: rgba(157, 149, 162, 0.22);
  --line-hi: rgba(244, 205, 169, 0.5);
  --text: #e4dedc;
  --muted: #b5aebb;
  --white: #faf6f2;
  --accent: #f4cda9;
  --accent-2: #9d95a2;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: linear-gradient(180deg, #3a3a4b 0, var(--bg) 900px, #252531 100%) fixed; color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.7; font-weight: 300;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--white); }
::selection { background: var(--accent); color: #2a2a38; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.1; color: var(--white); font-weight: 600; }

/* ---------- background ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(219,184,171,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(219,184,171,.08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(700px 420px at 80% 0%, rgba(91,90,112,.7), transparent 70%),
    radial-gradient(600px 420px at 10% 10%, rgba(244,205,169,.12), transparent 70%);
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(42,42,56,.7); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-display); font-weight: 700; letter-spacing: .08em; font-size: 17px; color: var(--white); }
.brand span { color: var(--accent); }
.nav nav { display: flex; gap: 26px; align-items: center; font-size: 14px; }
.nav nav a { color: var(--muted); }
.nav nav a:hover { color: var(--white); }
.nav-cta { color: var(--white) !important; border: 1px solid var(--line-hi); padding: 6px 16px; border-radius: 999px; }
.nav-cta:hover { background: rgba(244,205,169,.12); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--white); font-size: 22px; padding: 2px 12px; border-radius: 8px; cursor: pointer; }

/* ---------- layout ---------- */
main, .footer { position: relative; z-index: 2; }
.section { max-width: 1040px; margin: 0 auto; padding: 120px 24px 0; }
.kicker { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: .18em; text-transform: uppercase; margin: 0 0 12px; }
h2 { font-size: clamp(28px, 4.4vw, 42px); letter-spacing: -.02em; margin-bottom: 44px; }
.hl { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.prose p { margin: 0 0 16px; }
.prose b { color: var(--white); font-weight: 500; }

/* ---------- hero ---------- */
.hero { min-height: 100vh; display: flex; align-items: center; padding: 110px clamp(24px, 6vw, 80px) 60px; position: relative; z-index: 2; }
.hero-inner { max-width: 1040px; margin: 0 auto; width: 100%; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 22px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); margin-right: 10px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.big { font-size: clamp(46px, 9.5vw, 112px); font-weight: 700; letter-spacing: -.035em; }

/* subtle glitch: brief RGB split every few seconds and on hover */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; clip-path: inset(0 0 100% 0); }
.glitch::before { color: var(--accent);   mix-blend-mode: screen; animation: glitch-a 7s infinite steps(1); }
.glitch::after  { color: var(--accent-2); mix-blend-mode: screen; animation: glitch-b 7s infinite steps(1); }
.glitch:hover::before, .glitch:hover::after { animation-duration: 1.2s; }
@keyframes glitch-a {
  0%, 93%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  94% { clip-path: inset(12% 0 60% 0); transform: translate(-5px, 0); }
  96% { clip-path: inset(55% 0 18% 0); transform: translate(4px, 0); }
  98% { clip-path: inset(80% 0 2% 0);  transform: translate(-3px, 0); }
}
@keyframes glitch-b {
  0%, 94%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  95% { clip-path: inset(62% 0 10% 0); transform: translate(5px, 0); }
  97% { clip-path: inset(8% 0 78% 0);  transform: translate(-4px, 0); }
  99% { clip-path: inset(38% 0 40% 0); transform: translate(3px, 0); }
}

.tagline { font-size: clamp(18px, 2.4vw, 24px); color: var(--text); margin: 26px 0 36px; max-width: 700px; min-height: 3.4em; }
.cursor::after { content: ""; display: inline-block; width: 2px; height: 1em; background: var(--accent); margin-left: 3px; vertical-align: -2px; animation: pulse 1s steps(1) infinite; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 56px; }
.btn {
  display: inline-block; padding: 12px 26px; cursor: pointer; border-radius: 999px;
  font-family: var(--font-body); font-weight: 500; font-size: 15px;
  color: var(--white); background: transparent; border: 1px solid var(--line-hi);
  transition: background .2s, box-shadow .2s, transform .2s;
}
.btn:hover { background: rgba(244,205,169,.12); box-shadow: 0 0 24px rgba(244,205,169,.25); transform: translateY(-1px); color: var(--white); }
.btn.primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #2a2a38; border-color: transparent; font-weight: 600; }
.btn.primary:hover { color: #2a2a38; box-shadow: 0 0 30px rgba(244,205,169,.35); }
.hero-meta { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; max-width: 800px; }
.hero-meta li { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; display: flex; flex-direction: column; backdrop-filter: blur(8px); }
.hero-meta b { font-family: var(--font-display); font-size: 20px; color: var(--white); font-weight: 600; }
.hero-meta span { font-size: 13px; color: var(--muted); }
.scroll-hint { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }

/* ---------- about ---------- */
.about-grid { max-width: 760px; }

/* ---------- experience ---------- */
.timeline { position: relative; padding-left: 30px; display: grid; gap: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--accent), var(--accent-2), transparent); }
.job { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px; transition: border-color .2s, background .2s; }
.job:hover { border-color: var(--line-hi); background: var(--panel-hi); }
.job::before { content: ""; position: absolute; left: -30px; top: 32px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 12px var(--accent); }
.job-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.job h3 { font-size: 21px; }
.job-meta { margin: 4px 0 14px; color: var(--muted); font-family: var(--font-mono); font-size: 13px; }
.job ul { margin: 0; padding-left: 18px; }
.job li { margin-bottom: 6px; }
.job li::marker { color: var(--accent); }
.badge { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--line-hi); background: rgba(244,205,169,.08); padding: 2px 10px; border-radius: 999px; }

/* ---------- skills ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.skill-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; transition: border-color .2s, transform .2s; }
.skill-card:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.skill-card h3 { font-size: 13px; font-family: var(--font-mono); font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { font-size: 13px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); background: rgba(219,184,171,.03); transition: all .2s; }
.chips span:hover { border-color: var(--line-hi); color: var(--white); }
.chips.small span { font-size: 12px; padding: 2px 10px; }

/* ---------- projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 18px; }
.project { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; transition: transform .25s, border-color .25s; }
.project::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 160px at var(--mx, 50%) var(--my, 0%), rgba(244,205,169,.12), transparent 70%); opacity: 0; transition: opacity .25s; pointer-events: none; }
.project:hover { transform: translateY(-3px); border-color: var(--line-hi); }
.project:hover::before { opacity: 1; }
.project h3 { font-size: 21px; }
.project p { margin: 0; font-size: 15px; flex: 1; }
.tag { align-self: flex-start; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent-2); }
.link { font-size: 14px; }
.sub { margin: 60px 0 18px; font-size: 22px; }
.noteworthy { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.noteworthy li { padding: 16px 22px; display: grid; grid-template-columns: 200px 1fr; gap: 20px; border-top: 1px solid var(--line); }
.noteworthy li:first-child { border-top: none; }
.noteworthy b { color: var(--white); font-family: var(--font-display); font-weight: 500; }
.noteworthy span { font-size: 15px; }

/* ---------- education / certs ---------- */
.edu { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 26px; max-width: 460px; }
.edu h3 { font-size: 21px; }
.edu p { margin: 4px 0 0; color: var(--muted); }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.cert { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; display: flex; flex-direction: column; position: relative; }
.cert b { font-family: var(--font-display); font-size: 17px; color: var(--white); font-weight: 500; }
.cert span { font-size: 13px; color: var(--muted); }
.cert.new { border-color: var(--line-hi); background: rgba(244,205,169,.06); }
.cert.new::after { content: "NEW"; position: absolute; top: 14px; right: 16px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--accent); border: 1px solid var(--line-hi); border-radius: 999px; padding: 1px 8px; }

/* ---------- contact ---------- */
.contact-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: clamp(24px, 5vw, 48px); max-width: 720px; }
.contact-card p { margin: 0 0 24px; font-size: 17px; }
.contact-card .cta-row { margin-bottom: 24px; }
.contact-card .loc { font-family: var(--font-mono); font-size: 13px; color: var(--muted); margin: 0; }

/* ---------- footer ---------- */
.footer { margin-top: 120px; padding: 28px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .noteworthy li { grid-template-columns: 1fr; gap: 2px; }
  .menu-btn { display: block; }
  .nav nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0; background: rgba(42,42,56,.97); border-bottom: 1px solid var(--line); }
  .nav nav.open { display: flex; }
  .nav nav a { width: 100%; padding: 14px 24px; border-top: 1px solid var(--line); }
  .nav-cta { border: none; border-radius: 0; border-top: 1px solid var(--line); }
  .section { padding-top: 90px; }
  .timeline { padding-left: 22px; }
  .job::before { left: -22px; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .glitch::before, .glitch::after { display: none; }
  .reveal { opacity: 1; transform: none; }
}

.cert a { font-size: 13px; margin-top: 8px; }
.cert.new b { padding-right: 52px; }
.cert b { line-height: 1.25; }
