:root {
  --bg-deep: #0a0e17;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.65);
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #f0f4f8;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #22d3ee;
  --accent-green: #34d399;
  --accent-amber: #fbbf24;
  --accent-violet: #a78bfa;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --nav-height: 64px;
  --scroll-padding: 1.25rem;
  --scroll-offset: calc(var(--nav-height) + var(--scroll-padding));
  --container: min(1120px, 92vw);
  --hero-container: min(1600px, 98vw);
  --section-gap: 4rem;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--scroll-offset);
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* Cursor trail */
.cursor-trail {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-cyan);
  opacity: 0.35;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease-out;
  mix-blend-mode: screen;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(10, 14, 23, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 7px;
  border: 1.5px solid var(--accent-cyan);
  border-radius: 8px;
}

.nav-logo-icon {
  display: block;
  width: 22px;
  height: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.25s var(--ease);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-cyan);
  transition: width 0.25s var(--ease);
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a.active {
  font-weight: 600;
  color: var(--accent-cyan);
}

.nav-links a.active::after,
.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Sections */
section {
  padding: var(--section-gap) 0;
}

section + section {
  padding-top: 0;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 4vw;
}

.section-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
}

.career-subsection {
  margin-top: var(--section-gap);
}

.career-subsection .section-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 1.5rem;
}

/* Scroll animations */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

#neural-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--hero-container);
  margin: 0 auto;
  padding: 0 4vw;
  min-height: calc(100vh - var(--nav-height));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.hero-copy,
.hero-rest {
  position: relative;
  z-index: 2;
  max-width: none;
  padding-left: 0;
}

.hero-portrait {
  position: relative;
  z-index: 1;
  width: 100%;
  height: var(--hero-text-height, auto);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  align-self: center;
  line-height: 0;
}

.hero-portrait img {
  display: block;
  width: auto;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.55));
}

.hero-tagline {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  display: block;
  white-space: nowrap;
  max-width: 540px;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.5rem;
}

.hero-typewriter {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  font-weight: 500;
  color: var(--accent-green);
  min-height: 2.5em;
  margin-bottom: 0;
}

.hero-typewriter .cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent-cyan);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-oneliner {
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.btn-primary {
  background: var(--accent-cyan);
  color: var(--bg-deep);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent-violet);
  color: var(--accent-violet);
  transform: translateY(-2px);
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  --timeline-gap: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-violet));
  transform: translateX(-50%);
  opacity: 0.4;
}

.timeline-row {
  display: grid;
  grid-template-columns: 1fr var(--timeline-gap) 1fr;
  align-items: start;
  margin-bottom: 5rem;
}

.timeline-row:nth-child(odd) .timeline-item {
  grid-column: 1;
  grid-row: 1;
  padding-right: calc(var(--timeline-gap) / 2);
  text-align: right;
}

.timeline-row:nth-child(odd) .timeline-media {
  grid-column: 3;
  grid-row: 1;
  padding-left: calc(var(--timeline-gap) / 2);
}

.timeline-row:nth-child(even) .timeline-item {
  grid-column: 3;
  grid-row: 1;
  padding-left: calc(var(--timeline-gap) / 2);
  text-align: left;
}

.timeline-row:nth-child(even) .timeline-media {
  grid-column: 1;
  grid-row: 1;
  padding-right: calc(var(--timeline-gap) / 2);
}

.timeline-item,
.timeline-media {
  align-self: start;
}

.timeline-media {
  transition: margin-top 0.25s var(--ease);
}

.timeline-item {
  position: relative;
  width: 100%;
}

.timeline-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}

.timeline-dot {
  position: absolute;
  top: 1.5rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--accent-cyan);
  z-index: 1;
  transition: top 0.2s var(--ease);
}

.timeline-row:nth-child(odd) .timeline-dot {
  right: calc(var(--timeline-gap) / -2);
  left: auto;
  transform: translateX(50%);
}

.timeline-row:nth-child(even) .timeline-dot {
  left: calc(var(--timeline-gap) / -2);
  right: auto;
  transform: translateX(-50%);
}

.timeline-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.timeline-card-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

.timeline-card-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  overflow: hidden;
  border-radius: inherit;
  transition: opacity 0.45s var(--ease);
}

.timeline-card-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.28);
  pointer-events: none;
}

.timeline-card-bg img,
.timeline-card-bg-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.28;
  filter: saturate(0.85) brightness(0.4);
}

.timeline-card[data-career-effect="brainsway"] .timeline-card-bg-video {
  opacity: 0.3;
  filter: saturate(0.9) brightness(0.38);
}

.timeline-card[data-career-effect="rutgers"] .timeline-card-bg img {
  opacity: 0.32;
  filter: saturate(1) brightness(0.38);
}

.timeline-card:has(.timeline-card-bg) .timeline-company {
  color: #eef2f7;
  text-shadow: 0 1px 10px rgba(10, 14, 23, 0.9);
}

.timeline-card:has(.timeline-card-bg) .timeline-desc {
  color: #c5d1df;
  text-shadow: 0 1px 8px rgba(10, 14, 23, 0.85);
}

.timeline-card:has(.timeline-card-bg) .timeline-dates {
  color: #a3b3c7;
  text-shadow: 0 1px 8px rgba(10, 14, 23, 0.85);
}

.timeline-card:has(.timeline-card-bg) .timeline-role {
  text-shadow: 0 1px 8px rgba(10, 14, 23, 0.85);
}

.timeline-card.is-active .timeline-card-fx,
.timeline-card:hover .timeline-card-fx,
.timeline-card:focus-within .timeline-card-fx,
.timeline-card.is-active .timeline-card-bg,
.timeline-card:hover .timeline-card-bg,
.timeline-card:focus-within .timeline-card-bg {
  opacity: 1;
}

.timeline-card > :not(.timeline-card-fx):not(.timeline-card-bg) {
  position: relative;
  z-index: 2;
}

.timeline-card[data-career-effect="brainsway"].is-active,
.timeline-card[data-career-effect="brainsway"]:hover,
.timeline-card[data-career-effect="brainsway"]:focus-within {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 8px 40px rgba(34, 211, 238, 0.14);
}

.timeline-card[data-career-effect="brainlab"].is-active,
.timeline-card[data-career-effect="brainlab"]:hover,
.timeline-card[data-career-effect="brainlab"]:focus-within {
  border-color: rgba(52, 211, 153, 0.4);
  box-shadow: 0 8px 40px rgba(52, 211, 153, 0.12);
}

.timeline-card[data-career-effect="rutgers"].is-active,
.timeline-card[data-career-effect="rutgers"]:hover,
.timeline-card[data-career-effect="rutgers"]:focus-within {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 8px 40px rgba(167, 139, 250, 0.12);
}

.timeline-card:hover {
  border-color: rgba(34, 211, 238, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.timeline-card:not(.timeline-card--brainsway) {
  cursor: pointer;
}

.timeline-card--brainsway .timeline-role-block {
  cursor: pointer;
}

.timeline-card--brainsway {
  position: relative;
}

.timeline-company-header--with-quote {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.timeline-company-header--with-quote .timeline-company-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-shrink: 0;
}

.timeline-row:nth-child(odd) .timeline-company-header--with-quote .timeline-company-meta {
  text-align: right;
}

.stock-quote {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  flex-shrink: 0;
  gap: 0.2rem;
  padding: 0.28rem 0.5rem 0.32rem;
  border-radius: 6px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  background: rgba(10, 14, 23, 0.72);
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.stock-quote:hover {
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.08);
}

.stock-quote__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  font-size: 0.68rem;
}

.stock-quote__ticker {
  color: var(--accent-cyan);
}

.stock-quote__price {
  display: block;
  width: 100%;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--text-primary);
}

.stock-quote__change--up {
  color: var(--accent-green);
}

.stock-quote__change--down {
  color: #f87171;
}

.stock-quote__change--flat {
  color: var(--text-muted);
}

.timeline-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent-cyan);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.timeline-logo--img {
  padding: 0;
  background: none;
  overflow: hidden;
  border: 1px solid var(--border);
}

.timeline-logo--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

a.timeline-logo-link {
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

a.timeline-logo-link:hover {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.22);
  transform: scale(1.05);
}

.timeline-company-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.timeline-row:nth-child(odd) .timeline-company-header {
  flex-direction: row-reverse;
}

.timeline-row:nth-child(odd) .timeline-company-header--with-quote {
  flex-direction: row;
}

.timeline-company-meta {
  flex: 1;
  min-width: 0;
}

.timeline-row:nth-child(odd) .timeline-company-meta {
  text-align: right;
}

.timeline-role-block + .timeline-role-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.timeline-role-block .timeline-desc {
  margin-bottom: 0;
}

.timeline-company {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0;
  line-height: 1.2;
}

.timeline-role {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  color: var(--accent-green);
  font-weight: 500;
  margin-bottom: 0.15rem;
  text-align: inherit;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.timeline-role:hover,
.timeline-role:focus-visible {
  color: var(--accent-cyan);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.timeline-row:nth-child(odd) .timeline-role {
  text-align: right;
}

.timeline-dates {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline-company-link {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  line-height: 1.2;
  margin-top: 0.1rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.timeline-company-link:hover {
  border-bottom-color: var(--accent-cyan);
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0;
}

.timeline-desc a {
  color: var(--accent-cyan);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.timeline-desc a:hover {
  border-bottom-color: var(--accent-cyan);
}

/* Role detail modal */
.role-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 4vw;
}

.role-modal[hidden] {
  display: none;
}

.role-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.role-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(85vh, 720px);
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.role-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.role-modal-close:hover,
.role-modal-close:focus-visible {
  color: var(--text-primary);
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.08);
  outline: none;
}

.role-modal-company {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.35rem;
}

.role-modal-title {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.35rem;
  padding-right: 2.5rem;
}

.role-modal-dates {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.role-modal-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.role-modal-body p {
  margin-bottom: 1rem;
}

.role-modal-body ul {
  margin: 0;
  padding-left: 1.25rem;
}

.role-modal-body li + li {
  margin-top: 0.5rem;
}

body.role-modal-open,
body.contact-modal-open,
body.project-modal-open {
  overflow: hidden;
}

/* Project detail modal */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 4vw;
}

.project-modal[hidden] {
  display: none;
}

.project-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.project-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(88vh, 820px);
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.project-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.project-modal-close:hover,
.project-modal-close:focus-visible {
  color: var(--text-primary);
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.08);
  outline: none;
}

.project-modal-category {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-violet);
  margin-bottom: 0.35rem;
}

.project-modal-title {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  padding-right: 2.5rem;
}

.project-modal-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.project-modal-body p {
  margin-bottom: 1rem;
}

.project-modal-body ul {
  margin: 0;
  padding-left: 1.25rem;
}

.project-modal-body li + li {
  margin-top: 0.5rem;
}

.project-modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.project-modal-gallery figure {
  margin: 0;
}

.project-modal-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.project-modal-gallery figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}

.project-modal-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
  font-style: italic;
}

/* Contact form modal */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 4vw;
}

.contact-modal[hidden] {
  display: none;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.contact-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.contact-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.contact-modal-close:hover,
.contact-modal-close:focus-visible {
  color: var(--text-primary);
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.08);
  outline: none;
}

.contact-modal-title {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.35rem;
  padding-right: 2.5rem;
}

.contact-modal-intro {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.contact-form-field input,
.contact-form-field textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.contact-form-field input:focus,
.contact-form-field textarea:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.contact-form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.contact-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.contact-form-error {
  font-size: 0.85rem;
  color: #f87171;
}

.contact-form-success {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-form-success p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.contact-form-success .btn {
  align-self: flex-start;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Education */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.edu-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.3s var(--ease);
}

.edu-cap-fx-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 500;
}

.edu-card:hover,
.edu-card:focus-within {
  border-color: rgba(167, 139, 250, 0.25);
}

.edu-card:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.55);
  outline-offset: 2px;
}

.edu-school {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.edu-degree {
  font-size: 0.875rem;
  color: var(--accent-violet);
  margin-bottom: 0.25rem;
}

.edu-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Skills */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.skill-pill {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  cursor: default;
}

.skill-pill:hover {
  color: var(--accent-cyan);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.25), 0 0 40px rgba(34, 211, 238, 0.1);
}

/* Projects */
.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  padding: 0.5rem 1.1rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--bg-deep);
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  align-content: start;
  position: relative;
}

.project-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  height: var(--project-card-height, 17.5rem);
  min-height: var(--project-card-height, 17.5rem);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), opacity 0.4s var(--ease);
  opacity: 1;
  transform: scale(1);
}

.project-card.hidden {
  display: none;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  border-color: rgba(251, 191, 36, 0.2);
}

.project-card.featured {
  grid-column: span 2;
  border-color: rgba(34, 211, 238, 0.2);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.06) 0%, rgba(17, 24, 39, 0.65) 100%);
}

.project-card--hex-cascade {
  position: relative;
  overflow: hidden;
}

.project-card--hex-cascade .project-hex-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.project-card--hex-cascade > :not(.project-hex-bg) {
  position: relative;
  z-index: 1;
}

.project-card:has(.project-card-bg) {
  position: relative;
  overflow: hidden;
}

.project-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  transition: opacity 0.45s var(--ease);
}

.project-card-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.3);
  pointer-events: none;
}

.project-card-bg img,
.project-card-bg-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.3;
  filter: saturate(0.85) brightness(0.4);
}

.project-card:has(.project-card-bg):hover .project-card-bg,
.project-card:has(.project-card-bg):focus-within .project-card-bg {
  opacity: 1;
}

.project-card:has(.project-card-bg) > :not(.project-card-bg):not(.project-hex-bg) {
  position: relative;
  z-index: 1;
}

.project-card:has(.project-card-bg):hover .project-name,
.project-card:has(.project-card-bg):focus-within .project-name {
  color: #eef2f7;
  text-shadow: 0 1px 10px rgba(10, 14, 23, 0.9);
}

.project-card:has(.project-card-bg):hover .project-desc,
.project-card:has(.project-card-bg):focus-within .project-desc {
  color: #c5d1df;
  text-shadow: 0 1px 8px rgba(10, 14, 23, 0.85);
}

.project-card:has(.project-card-bg):hover .project-link,
.project-card:has(.project-card-bg):focus-within .project-link {
  text-shadow: 0 1px 8px rgba(10, 14, 23, 0.85);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.featured-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.12);
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  width: fit-content;
}

.project-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  width: fit-content;
}

.cat-game { background: rgba(251, 191, 36, 0.15); color: var(--accent-amber); }
.cat-hardware { background: rgba(167, 139, 250, 0.15); color: var(--accent-violet); }
.cat-web { background: rgba(52, 211, 153, 0.15); color: var(--accent-green); }
.cat-volunteering { background: rgba(34, 211, 238, 0.15); color: var(--accent-cyan); }

.project-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.project-name .mark {
  font-size: 0.55em;
  color: var(--text-muted);
  vertical-align: super;
  font-weight: 500;
  margin-left: 0.12em;
  letter-spacing: 0;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
  line-height: 1.55;
}

.project-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-amber);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 1.25rem;
  transition: gap 0.2s var(--ease);
}

button.project-link {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: var(--accent-amber);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  line-height: inherit;
}

.project-card:has(.project-link) {
  cursor: pointer;
}

.project-link:hover {
  gap: 0.6rem;
}

.project-link::after {
  content: '→';
}

/* Contact */
.contact {
  text-align: center;
  padding-bottom: var(--section-gap);
}

.contact-text {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: 2rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn-contact:hover {
  transform: translateY(-3px);
}

.btn-contact svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.btn-linkedin {
  background: #0a66c2;
}

.btn-linkedin:hover {
  box-shadow: 0 12px 32px rgba(10, 102, 194, 0.4);
}

.btn-github {
  background: #24292f;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-github:hover {
  box-shadow: 0 12px 32px rgba(36, 41, 47, 0.55);
}

.btn-email {
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--accent-cyan);
}

.btn-email:hover {
  box-shadow: 0 12px 32px rgba(34, 211, 238, 0.2);
}

footer {
  text-align: center;
  padding: 2rem 4vw;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Mobile */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.5rem 4vw 2rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
    pointer-events: none;
  }

  .nav-links a::after {
    left: auto;
    right: 0;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-bottom: 1rem;
    gap: 1.25rem;
  }

  .hero-portrait {
    order: -1;
    max-width: min(720px, 92vw);
    margin: 0 auto;
  }

  .hero-text {
    order: 0;
  }

  .hero-portrait img {
    max-height: 100%;
  }

  .hero-oneliner {
    max-width: none;
  }

  .timeline {
    --timeline-rail: 1.75rem;
  }

  .timeline::before {
    left: 0;
    transform: none;
  }

  .timeline-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 3.5rem;
  }

  .timeline-row:nth-child(odd) .timeline-item,
  .timeline-row:nth-child(even) .timeline-item {
    grid-column: 1;
    grid-row: auto;
    padding-left: var(--timeline-rail);
    padding-right: 0;
    text-align: left;
    width: 100%;
    max-width: 100%;
  }

  .timeline-row:nth-child(odd) .timeline-media,
  .timeline-row:nth-child(even) .timeline-media {
    grid-column: 1;
    padding-left: var(--timeline-rail);
    padding-right: 0;
    order: -1;
  }

  .timeline-row:nth-child(odd) .timeline-dot,
  .timeline-row:nth-child(even) .timeline-dot {
    left: 0;
    right: auto;
    transform: translateX(-50%);
  }

  .timeline-row:nth-child(odd) .timeline-company-header,
  .timeline-row:nth-child(even) .timeline-company-header {
    flex-direction: row;
  }

  .timeline-row:nth-child(odd) .timeline-company-header--with-quote {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .timeline-row:nth-child(odd) .timeline-company-meta,
  .timeline-row:nth-child(even) .timeline-company-meta,
  .timeline-row:nth-child(odd) .timeline-company-header--with-quote .timeline-company-meta {
    text-align: left;
  }

  .timeline-row:nth-child(odd) .timeline-role,
  .timeline-row:nth-child(even) .timeline-role {
    text-align: left;
  }

  .timeline-company-header--with-quote .timeline-company-brand {
    order: 1;
    flex: 1;
    min-width: 0;
  }

  .timeline-company-header--with-quote .stock-quote {
    order: 2;
    margin-left: 0;
    flex-shrink: 0;
    align-self: flex-start;
  }

  .project-card.featured {
    grid-column: span 1;
  }

  .cursor-trail {
    display: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-typewriter .cursor {
    animation: none;
  }

  .cursor-trail {
    display: none;
  }

  .project-card,
  .btn,
  .timeline-card,
  .skill-pill,
  .role-modal-close,
  .role-modal-dialog {
    transition: none;
  }
}
