/* ------------------------------------------------------------ tokens */
:root {
  --accent: #14b8a6;
  --accent-ink: #04201d;
  --radius: 18px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --maxw: 1180px;
}
[data-theme="dark"] {
  --bg: #0a0f1e;
  --bg-2: #0e1530;
  --surface: rgba(255, 255, 255, .045);
  --surface-solid: #111a35;
  --border: rgba(255, 255, 255, .09);
  --text: #e8edf7;
  --muted: #98a3bd;
  --doc-bg: #0f1730;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .6);
  --mark: color-mix(in srgb, var(--accent) 40%, transparent);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #e9edf7;
  --surface: rgba(255, 255, 255, .75);
  --surface-solid: #ffffff;
  --border: rgba(15, 23, 42, .1);
  --text: #0d1426;
  --muted: #55607a;
  --doc-bg: #ffffff;
  --shadow: 0 20px 50px -24px rgba(15, 23, 42, .25);
  --mark: color-mix(in srgb, var(--accent) 30%, transparent);
  color-scheme: light;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
main { overflow-x: clip; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(99, 102, 241, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color .4s var(--ease), color .4s var(--ease);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -.02em; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd {
  font: 600 11px/1 var(--font);
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; }
.skip:focus { left: 16px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 15px/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--ease), background .3s, box-shadow .3s, border-color .3s;
}
.btn:active { transform: scale(.97); }
.btn-sm { padding: 9px 14px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 30px -10px var(--accent);
}
.btn-accent:hover { box-shadow: 0 14px 36px -8px var(--accent); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn:active { transform: scale(.94); }

/* ------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100vw - var(--maxw)) / 2));
  backdrop-filter: blur(16px) saturate(1.4);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 11px;
  font: 700 14px var(--display);
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #6366f1));
  transition: background .5s;
}
.nav-links { display: flex; gap: 28px; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
[data-theme="dark"] .i-sun, [data-theme="light"] .i-moon { display: none; }

/* ------------------------------------------------------------ hero */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 88px 16px 40px;
}
#flow {
  position: absolute; inset: 0 -20vw 0 30%;
  width: auto; height: 100%;
  opacity: .9;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 35%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%, #000 85%, transparent);
}
.hero-inner { position: relative; max-width: 700px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 22px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px; font-weight: 500;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.hero h1 { font-size: clamp(40px, 7vw, 76px); font-weight: 700; }
.lede { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); margin: 18px 0 26px; max-width: 34ch; }
.facts { list-style: none; padding: 0; margin: 0 0 32px; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 15px; }
.facts li { display: flex; align-items: center; gap: 8px; }
.facts svg { color: var(--accent); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.stats {
  position: relative;
  list-style: none; padding: 0; margin: 64px 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.stat {
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
}
.stat-value { display: block; font: 700 34px/1 var(--display); color: var(--accent); transition: color .5s; }
.stat-label { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); }

/* ------------------------------------------------------------ section heads */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.kicker { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); transition: color .5s; }
h2 { font-size: clamp(28px, 4vw, 40px); }

/* ------------------------------------------------------------ revolving carousel */
.tracks { max-width: var(--maxw); margin: 0 auto; padding: 64px 16px 24px; }
.carousel-controls { display: flex; gap: 8px; }
#playBtn[aria-pressed="true"] .i-play, #playBtn[aria-pressed="false"] .i-pause { display: none; }
.carousel {
  position: relative;
  height: 300px;
  perspective: 1400px;
  touch-action: pan-y;
  user-select: none;
}
.card {
  --c: var(--accent);
  position: absolute; left: 50%; top: 0;
  width: min(380px, 80vw);
  height: 270px;
  margin-left: calc(min(380px, 80vw) / -2);
  padding: 26px;
  display: flex; flex-direction: column;
  text-align: left;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, transparent), transparent 55%),
    var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  transition: transform .7s var(--ease), opacity .7s var(--ease), filter .7s var(--ease), border-color .4s, box-shadow .4s;
  will-change: transform;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--bg);
  opacity: var(--dim, 0);
  transition: opacity .7s var(--ease);
  pointer-events: none;
  z-index: 2;
}
.card[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--c) 70%, transparent);
  box-shadow: 0 30px 80px -30px var(--c), var(--shadow);
}
.card.featured::after {
  content: "";
  position: absolute; inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--spin, 0deg), transparent 0 60%, var(--c), transparent 85%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin 5s linear infinite;
  pointer-events: none;
}
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --spin: 360deg; } }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: auto; }
.card-icon {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 15px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.card-icon svg { width: 26px; height: 26px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .03em;
  color: var(--accent-ink);
  background: var(--c, var(--accent));
}
.card h3 { font-size: 23px; margin: 18px 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.card-num { font: 600 13px var(--display); color: var(--muted); }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--border); transition: width .4s var(--ease), background .4s; }
.dots span.on { width: 28px; background: var(--accent); }
.dots span.on.progress { background: linear-gradient(90deg, var(--accent) var(--p, 0%), var(--border) var(--p, 0%)); }
.carousel-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* ------------------------------------------------------------ resume area */
.resume-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 16px 80px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start;
}
.sidebar { position: sticky; top: 88px; display: grid; gap: 14px; }
.side-card {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
}
.side-card h3 { font-size: 22px; margin: 10px 0 6px; }
.side-card > .badge { --c: var(--accent); }
.side-card p { margin: 0 0 18px; font-size: 14.5px; }
.side-actions { display: grid; gap: 10px; }
.side-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-grid svg { width: 16px; height: 16px; }

.search {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  transition: border-color .2s;
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 15px var(--font); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.search-count { min-height: 18px; margin: 8px 0 10px !important; font-size: 13px !important; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: 500 13px var(--font);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.facts-card dl { margin: 0; display: grid; gap: 4px; }
.facts-card dt { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.facts-card dt:first-child { margin-top: 0; }
.facts-card dd { margin: 0; font-size: 14.5px; }

/* the resume document */
.doc {
  position: relative;
  padding: clamp(24px, 4vw, 52px);
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--doc-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.doc::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, #6366f1));
}
.doc.swap-out { animation: docOut .22s var(--ease) forwards; }
.doc.swap-in { animation: docIn .45s var(--ease); }
@keyframes docOut { to { opacity: 0; transform: translateY(8px); } }
@keyframes docIn { from { opacity: 0; transform: translateY(-8px); } }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.doc-head h2 { font-size: clamp(26px, 3.4vw, 34px); }
.doc-head .role { margin: 6px 0 0; color: var(--accent); font-weight: 600; transition: color .5s; }
.doc-contact { list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--muted); text-align: right; }
.doc-contact a { text-decoration: none; }
.doc-contact a:hover { color: var(--accent); }
.doc section { padding-top: 26px; }
.doc h4 {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.doc h4::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.doc p { margin: 0; }
.entry { margin-bottom: 20px; }
.entry:last-child { margin-bottom: 0; }
.entry-head { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.entry-head strong { font-size: 16.5px; }
.entry-head .where { color: var(--muted); font-weight: 400; }
.entry-dates { color: var(--muted); font-size: 14px; white-space: nowrap; }
.entry-role { font-style: italic; color: var(--muted); font-size: 14.5px; }
.entry ul { margin: 8px 0 0; padding-left: 20px; }
.entry li { margin: 6px 0; }
.entry li::marker { color: var(--accent); }
.edu-meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 15px; margin-top: 2px; }
.gpa { font-weight: 700; color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 13px; padding: 4px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); }
.skills { display: grid; gap: 12px; }
.skill-row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: baseline; }
.skill-row b { font-size: 14px; }
.dim { opacity: .28; transition: opacity .3s; }
.hit-flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { background: var(--mark); } 100% { background: transparent; } }

/* ------------------------------------------------------------ contact */
.contact {
  max-width: var(--maxw);
  margin: 0 auto 60px;
  padding: 56px clamp(20px, 4vw, 56px);
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background:
    radial-gradient(600px 300px at 0% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--surface);
}
.contact h2 { margin-bottom: 12px; }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.contact-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); }
.contact-list a { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 15px; word-break: break-all; }
.contact-list svg { color: var(--accent); }
.copy { border: 0; background: none; color: var(--muted); font: 600 13px var(--font); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.copy:hover { color: var(--accent); }
.contact-form { display: grid; gap: 14px; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: 15px var(--font);
  resize: vertical;
  transition: border-color .2s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 0; border-color: var(--accent); }
.contact-form .hp { position: absolute; left: -9999px; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-status { margin: 0; min-height: 22px; font-size: 14px; }
.form-status.ok { color: #22c55e; }
.form-status.err { color: #f87171; }

/* ------------------------------------------------------------ footer, modal, toast */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex; justify-content: space-between;
  color: var(--muted); font-size: 14px;
}
.footer a { text-decoration: none; }
.modal {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(5, 8, 20, .6); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .3s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--border); }
.modal-head > div { display: flex; gap: 8px; align-items: center; }
.modal-pdf { width: min(920px, 94vw); height: min(92vh, 1100px); }
.modal-pdf[open] { display: flex; flex-direction: column; }
.modal-pdf iframe { flex: 1; width: 100%; border: 0; background: #525659; }
.modal-keys { width: min(440px, 92vw); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 12px 20px; margin: 0; padding: 22px; align-items: center; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: var(--muted); font-size: 15px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90;
  transform: translate(-50%, calc(100% + 40px));
  visibility: hidden;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600; font-size: 14.5px;
  box-shadow: var(--shadow);
  transition: transform .4s var(--ease), visibility .4s;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 980px) {
  .resume-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .sidebar .side-card:first-child { grid-column: 1 / -1; }
  .contact { grid-template-columns: 1fr; gap: 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  #flow { inset: 0 -40vw 0 0; opacity: .45; }
}
@media (max-width: 640px) {
  .nav-links, .brand-name, #shortcutsBtn, #navDownload span { display: none; }
  .hero { padding-top: 56px; }
  .sidebar { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .carousel { height: 290px; }
  .card { height: 260px; padding: 22px; }
  .carousel-hint { display: none; }
  .doc-contact { text-align: left; }
  .skill-row { grid-template-columns: 1fr; gap: 2px; }
  .contact-form .row { grid-template-columns: 1fr; }
  .stat-value { font-size: 28px; }
  .stat { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------ print: just the resume */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; color: #000; font-size: 11pt; }
  .nav, .hero, .tracks, .sidebar, .contact, .footer, .toast, dialog, .skip { display: none !important; }
  .resume-wrap { display: block; padding: 0; max-width: none; }
  .doc { border: 0; box-shadow: none; padding: 0; background: #fff; --text: #000; --muted: #333; --border: #ccc; --accent: #000; }
  .doc::before { display: none; }
  .tag { background: none; border: 1px solid #ccc; }
  mark { background: none; }
  .dim { opacity: 1; }
  a { text-decoration: none; }
}
