/* --- Design tokens --- */
:root {
  --bg: #06080f;
  --bg-elevated: #0c1019;
  --bg-card: rgba(16, 22, 36, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(61, 214, 198, 0.35);
  --text: #e8ecf4;
  --text-muted: #8b95a8;
  --accent: #3dd6c6;
  --accent-dim: rgba(61, 214, 198, 0.12);
  --accent-2: #8b7cff;
  --accent-2-dim: rgba(139, 124, 255, 0.15);
  --gradient: linear-gradient(135deg, #3dd6c6 0%, #8b7cff 55%, #e87cff 100%);
  --font: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 72px;
  --max: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
}

/* --- Ambient effects --- */
.cursor-glow {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 214, 198, 0.08), transparent 65%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  transition: opacity 0.3s;
  opacity: 0;
}

body:hover .cursor-glow {
  opacity: 1;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  background: rgba(6, 8, 15, 0.65);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(6, 8, 15, 0.88);
}

.logo {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.logo-dot {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.75rem;
}

.nav a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

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

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.header-cta {
  margin-left: 1rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
}

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

.btn-primary {
  background: var(--gradient);
  color: #06080f;
  box-shadow: 0 8px 32px rgba(61, 214, 198, 0.25);
}

.btn-outline {
  border: 1px solid var(--border);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--border-strong);
  background: var(--accent-dim);
}

.btn-ghost {
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.9rem 1.75rem;
  font-size: 1rem;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 3rem) clamp(1.25rem, 4vw, 2.5rem) 4rem;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(61, 214, 198, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 214, 198, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black, transparent);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--max), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 34rem;
  margin-bottom: 2rem;
}

.hero-lead strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --- Stack visual --- */
.hero-visual {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stack {
  position: relative;
  width: 100%;
  max-width: 340px;
  perspective: 900px;
}

.stack-layer {
  position: relative;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  margin-bottom: -1.25rem;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease);
}

.stack-layer:last-child {
  margin-bottom: 0;
}

.stack:hover .layer-ai {
  transform: translate3d(12px, -8px, 40px) rotateX(4deg);
}

.stack:hover .layer-app {
  transform: translate3d(6px, -4px, 20px) rotateX(2deg);
}

.stack:hover .layer-engine {
  transform: translate3d(0, 0, 0);
}

.layer-ai {
  z-index: 3;
  border-color: rgba(232, 124, 255, 0.3);
  box-shadow: 0 20px 50px rgba(139, 124, 255, 0.15);
}

.layer-app {
  z-index: 2;
  border-color: rgba(61, 214, 198, 0.25);
}

.layer-engine {
  z-index: 1;
  border-color: var(--border);
}

.layer-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.4rem;
}

.layer-ai .layer-tag { color: #e87cff; }

.stack-layer p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(61, 214, 198, 0.15);
  pointer-events: none;
}

.orbit-1 {
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  animation: spin 28s linear infinite;
}

.orbit-2 {
  width: 90%;
  height: 90%;
  top: 5%;
  left: 5%;
  animation: spin 20s linear infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Sections --- */
main {
  position: relative;
  z-index: 1;
}

.section {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 5rem clamp(1.25rem, 4vw, 2.5rem);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-num {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.section-head h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

/* --- About --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.about-lead {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--text);
}

.about-grid p {
  color: var(--text-muted);
}

.about-lead em {
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}

/* --- Experience --- */
.company-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
}

.company-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.timeline {
  position: relative;
  margin-top: 2rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
}

.role-card {
  position: relative;
  margin-bottom: 2rem;
  padding: 1.5rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, transform 0.3s var(--ease);
}

.role-card::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 5px);
  top: 1.75rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.role-card:hover {
  border-color: var(--border-strong);
  transform: translateX(4px);
}

.role-meta time {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.role-meta h4 {
  font-size: 1.15rem;
  margin: 0.35rem 0 1rem;
}

.role-card ul {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.role-card li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.role-card li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8rem;
}

.role-card strong {
  color: var(--text);
  font-weight: 600;
}

/* --- Projects --- */
.projects-intro {
  max-width: 36rem;
  margin: -1.25rem 0 2rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.projects-intro em {
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}

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

.project-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.project-top h3 {
  font-size: 1.1rem;
}

.tech {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  white-space: nowrap;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1;
}

.project-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.project-link:hover {
  text-decoration: underline;
}

/* --- Skills bento --- */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.bento-cell {
  padding: 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.bento-wide {
  grid-column: span 3;
}

.bento-accent {
  background: linear-gradient(145deg, var(--accent-2-dim), var(--accent-dim));
  border-color: rgba(139, 124, 255, 0.25);
}

.bento-cell h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chips span {
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
}

.chips span:hover {
  border-color: var(--border-strong);
  background: var(--accent-dim);
}

.bento-note {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Award --- */
.award-card {
  padding: 1.75rem 2rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent-2);
  background: var(--accent-2-dim);
}

.award-card p:first-child {
  margin-bottom: 0.5rem;
}

.award-card p:last-child {
  color: var(--text-muted);
}

/* --- Education --- */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.edu-grid article {
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.edu-grid h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.edu-grid p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.edu-badge {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
}

/* --- Contact --- */
.contact-section {
  padding-bottom: 6rem;
}

.contact-card {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem);
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(ellipse at top, var(--accent-dim), transparent 55%),
    var(--bg-elevated);
}

.contact-card h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.contact-card > p {
  color: var(--text-muted);
  max-width: 28rem;
  margin: 0 auto 1.75rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.contact-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.contact-links a:hover {
  color: var(--accent);
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 300px;
    order: -1;
  }

  .stack {
    max-width: 300px;
    margin: 0 auto;
  }

  .about-grid,
  .edu-grid {
    grid-template-columns: 1fr;
  }

  .bento {
    grid-template-columns: 1fr;
  }

  .bento-wide {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  .nav,
  .header-cta {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .site-header.nav-open .nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    padding: 1.25rem 2rem 1.5rem;
    background: rgba(6, 8, 15, 0.96);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
  }

  .site-header.nav-open .header-cta {
    display: inline-flex;
    position: absolute;
    top: calc(var(--header-h) + 11.5rem);
    right: 2rem;
  }

  .hero-stats {
    gap: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .orbit { animation: none; }
  .pulse { animation: none; }
}
