/* ============ SELF-HOSTED FONTS ============
   Replaces the Google Fonts stylesheet, which cost a render-blocking
   third-party round trip (~1.9s) before first paint. Both families are
   variable fonts, so these 2 files cover weights 100-900; the italic
   face is a separate static file. Latin subset only. */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/outfit-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('./fonts/playfair-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/playfair-italic-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Metric-matched fallback: while the webfont loads, the fallback occupies
   near-identical space, so the swap does not shift layout. */
@font-face {
  font-family: 'Outfit Fallback';
  src: local('Arial'), local('Helvetica Neue'), local('Liberation Sans');
  size-adjust: 105%;
  ascent-override: 100%;
  descent-override: 26%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Playfair Fallback';
  src: local('Georgia'), local('Times New Roman'), local('Liberation Serif');
  size-adjust: 96%;
  ascent-override: 108%;
  descent-override: 25%;
  line-gap-override: 0%;
}

:root {
  --bg: #050507;
  --bg-soft: #0a0a0f;
  --surface: #111118;
  --text: #f5f5f5;
  --text-muted: #a0a0b0;
  --accent: #ff3b3b;
  --accent-dim: rgba(255, 59, 59, 0.12);
  --accent-soft: rgba(255, 59, 59, 0.06);
  --accent-glow: rgba(255, 59, 59, 0.3);
  --border: rgba(255, 255, 255, 0.07);
  --border-soft: rgba(255, 255, 255, 0.04);
  --font-sans: 'Outfit', 'Outfit Fallback', system-ui, sans-serif;
  --font-serif: 'Playfair Display', 'Playfair Fallback', Georgia, serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 8rem;
  --radius: 14px;
  --radius-lg: 22px;
  --transition: 0.45s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

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

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

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: hidden;
  touch-action: pan-y;
}

body {
  overflow-x: hidden;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  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.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg-soft);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #ff5252;
}

/* ============ HEADER ============ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--space-lg);
  background: rgba(5, 5, 7, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-soft);
  transition: all var(--transition);
}

.header.scrolled {
  padding: 0.8rem var(--space-lg);
  background: rgba(5, 5, 7, 0.94);
  border-bottom-color: var(--border);
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 20%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
}

.nav {
  display: flex;
  gap: var(--space-md);
}

.nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s;
}

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

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

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

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

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

/* Scroll lock while mobile menu is open */
body.menu-open {
  overflow: hidden;
}

/* Menu backdrop */
.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: linear-gradient(to left, rgba(5, 5, 7, 0.5) 0%, rgba(5, 5, 7, 0.15) 60%, transparent 100%);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

/* Active nav link (desktop navbar only) */
.nav:not(.open) a.active {
  color: var(--text);
}

.nav:not(.open) a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ============ HERO ============ */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: var(--space-xl);
  padding: calc(76px + var(--space-xl)) var(--space-lg) var(--space-2xl);
  margin: 0;
  position: relative;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero::before {
  content: '';
  position: absolute;
  top: 15%;
  right: -12%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(70px);
  z-index: -1;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 5%;
  left: -15%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
}

.hero-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin-bottom: var(--space-md);
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.9rem, 7.5vw, 5rem);
  font-weight: 500;
  line-height: 1.08;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.hero-title .line {
  display: block;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}

.hero-title .line:nth-child(1) {
  animation-delay: 0.1s;
}

.hero-title .line:nth-child(2) {
  animation-delay: 0.25s;
}

.hero-title .line:nth-child(3) {
  animation-delay: 0.4s;
}

.hero-title .accent {
  color: var(--accent);
  font-style: italic;
  position: relative;
  display: inline-block;
}

.hero-title .accent::before {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 0;
  width: 100%;
  height: 28%;
  background: var(--accent-soft);
  z-index: -1;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: var(--space-lg);
  opacity: 0;
  animation: fadeUp 0.7s ease 0.55s forwards;
}

.hero-cta {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.7s forwards;
}

.btn {
  display: inline-block;
  padding: 0.9rem 1.9rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 50px;
  transition: all var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
  width: 320px;
  height: 320px;
}

.btn-primary:hover {
  background: #ff5252;
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(255, 59, 59, 0.32);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
}

.hero-meta {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.85s forwards;
}

.hero-meta-item {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Ping is drawn by a pseudo-element so the pulse animates on the compositor
   (transform/opacity) instead of repainting box-shadow every frame. */
.hero-meta-item .pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-meta-item .pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 2.4s infinite;
}

@keyframes pulseDot {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  70%,
  100% {
    transform: scale(2.25);
    opacity: 0;
  }
}

/* Code editor mockup */
.hero-code {
  width: min(380px, 34vw);
  z-index: 1;
  display: none;
  transform: translateX(-70px) translateY(40px);
}

@media (min-width: 961px) {
  .hero-code {
    display: block;
  }
}

.code-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02);
  overflow: hidden;
  font-family: ui-monospace, 'Cascadia Code', Menlo, monospace;
  animation: codeFloat 7s ease-in-out infinite;
}

@keyframes codeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: rgba(10, 10, 15, 0.85);
  border-bottom: 1px solid var(--border);
}

.code-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.code-bar span:nth-child(1) { background: var(--accent); }
.code-bar span:nth-child(2) { background: #f5a623; }
.code-bar span:nth-child(3) { background: #4ade80; }

.code-bar em {
  font-style: normal;
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.code-body {
  margin: 0;
  padding: 18px 20px 20px;
  font-size: 0.78rem;
  line-height: 1.85;
  min-height: 210px;
  overflow-x: hidden;
}

.code-body code {
  color: #d7d8ea;
  white-space: pre-wrap;
}

.code-line-k { color: var(--accent); }
.code-line-s { color: #9ece6a; }
.code-line-v { color: #7aa2f7; }

.code-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blinkCursor 1s steps(2, start) infinite;
}

@keyframes blinkCursor {
  to { visibility: hidden; }
}

/* ============ ANIMATIONS ============ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ SECTIONS ============ */
    .section {
      padding: var(--space-lg) var(--space-lg);
      position: relative;
  scroll-margin-top: 76px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin-bottom: var(--space-sm);
  padding: 0.3rem 0.9rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  border-radius: 50px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 500;
  margin-bottom: var(--space-xl);
  letter-spacing: -0.02em;
}

/* ============ ABOUT ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-xl);
  align-items: center;
}

.about-content .about-badge {
  margin-bottom: var(--space-sm);
}

.about-badge span {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
}

.about-content h2 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 500;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.about-content h2 .highlight {
  color: var(--accent);
  position: relative;
  font-style: italic;
}

.about-content .subtitle {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: var(--space-md);
  letter-spacing: 0.02em;
  font-weight: 500;
}

.about-content p {
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  line-height: 1.75;
  font-size: 0.96rem;
}

.about-content p strong {
  color: var(--text);
  font-weight: 600;
}

.personal-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  transition: all var(--transition);
}

.info-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-3px);
  background: var(--bg-soft);
}

.info-card .info-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.info-card .info-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-top: 4px;
  display: block;
}

.info-card .status {
  color: #4ade80;
}

.about-links {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.about-link {
  padding: 0.65rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.85rem;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.about-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Portrait */
.about-image {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.about-image::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(6%);
  width: 130%;
  height: 85%;
  border-radius: 50%;
  background: radial-gradient(ellipse, var(--accent-dim) 0%, transparent 65%);
  filter: blur(8px);
  z-index: 0;
}

.about-image-frame {
  position: relative;
  z-index: 1;
  padding-bottom: 0.1rem;
}

.about-image-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 260 / 460;
  overflow: hidden;
  border-radius: 32px 32px 170px 170px;
  border: 1px solid var(--border);
}

.about-image-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 10%;
  transition: transform 0.8s cubic-bezier(0.3, 1, 0.3, 1);
}

.about-image:hover .about-image-inner img {
  transform: scale(1.07);
}

.about-image-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 59, 59, 0.12));
  pointer-events: none;
}

.image-dots {
  position: absolute;
  bottom: -14px;
  right: -14px;
  width: 96px;
  height: 96px;
  background-image: radial-gradient(var(--accent) 2px, transparent 2px);
  background-size: 16px 16px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
  transition: opacity 0.3s;
}

.about-image:hover .image-dots {
  opacity: 1;
}

.image-glow {
  position: absolute;
  top: -22px;
  left: -22px;
  width: 76px;
  height: 76px;
  border: 1px solid var(--accent-dim);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  animation: rotateSlow 22s linear infinite;
}

@keyframes rotateSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ============ STATS ============ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  padding: var(--space-xl) 0 var(--space-sm);
  margin-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
  position: relative;
}

.stat-num {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  font-weight: 600;
  color: var(--accent);
  display: inline-block;
  margin-bottom: var(--space-xs);
}

/* Bars are full width and reveal via scaleX so the animation stays on the
   compositor. --w holds the target width, unchanged from the width-based
   version, so the rendered result is identical. */
.stat-bar {
  width: var(--w, 100%);
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 160%);
  margin: 12px auto 8px;
  border-radius: 4px;
  transform: scaleX(0);
  transform-origin: left center;
}

.stat:nth-child(1) .stat-bar {
  --w: 72%;
  animation: barIn 1.1s 0.2s ease both;
}

.stat:nth-child(2) .stat-bar {
  --w: 55%;
  animation: barIn 1.1s 0.35s ease both;
}

.stat:nth-child(3) .stat-bar {
  --w: 48%;
  animation: barIn 1.1s 0.5s ease both;
}

.stat:nth-child(4) .stat-bar {
  --w: 100%;
  animation: barIn 1.1s 0.65s ease both;
}

@keyframes barIn {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ============ WORK / PROJECTS ============ */
.projects {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl);
}

.project {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

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

.project:nth-child(even) {
  direction: rtl;
}

.project:nth-child(even) > * {
  direction: ltr;
}

.project:hover {
  border-color: var(--accent-dim);
  transform: translateY(-6px);
  box-shadow: 0 30px 50px -18px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--accent-dim);
}

.project-visual {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/10;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
}

.window-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(4px);
  z-index: 3;
  border-bottom: 1px solid var(--border);
}

.window-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.window-bar span:first-child {
  background: var(--accent);
}

.project-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.7s cubic-bezier(0.3, 1, 0.3, 1);
}

.project:hover .project-visual img {
  transform: scale(1.05) translateY(0);
}

.project-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 55%, rgba(0, 0, 0, 0.35));
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.project:hover .project-visual::after {
  opacity: 1;
}

/* Project info */
.project-number {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: var(--space-xs);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-number::after {
  content: '';
  width: 34px;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
}

.project-info h3 {
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #fff, var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.project-info p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.project-tags span {
  font-size: 0.7rem;
  padding: 0.32rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-muted);
  transition: all var(--transition);
}

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

/* ============ SERVICES ============ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.service-card {
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(24px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.service-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.service-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-8px);
}

.service-card:hover::before {
  opacity: 1;
}

.service-card h3 {
  font-size: 1.15rem;
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.service-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ============ SKILLS ============ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.skill-card {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(24px);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
  transition: left 0.7s;
}

.skill-card:hover::before {
  left: 100%;
}

.skill-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.skill-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-6px);
}

.skill-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.skill-card > p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.skill-progress {
  margin-top: var(--space-md);
}

.skill-progress-bar {
  height: 5px;
  background: var(--surface);
  border-radius: 5px;
  overflow: hidden;
}

.skill-progress-fill {
  width: var(--w, 80%);
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff8c8c);
  border-radius: 5px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.2s cubic-bezier(0.2, 0.9, 0.4, 1);
}

.skill-card.visible .skill-progress-fill {
  transform: scaleX(1);
}

.skill-progress-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ============ TIMELINE ============ */
.timeline {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-dim), transparent);
}

.timeline-item {
  position: relative;
  padding-left: 52px;
  padding-bottom: var(--space-2xl);
  opacity: 0;
  transform: translateX(-20px);
  transition: all var(--transition);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: all var(--transition);
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.15);
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.timeline-item h3 {
  font-size: 1.2rem;
  margin-bottom: 4px;
  font-weight: 600;
}

.timeline-item .role {
  color: var(--accent);
  font-size: 0.83rem;
  margin-bottom: var(--space-sm);
  letter-spacing: 0.02em;
}

.timeline-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============ CONTACT ============ */
.contact {
  text-align: center;
  position: relative;
}

.contact::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  z-index: -1;
}

.contact-text {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto var(--space-md);
  font-size: 1.02rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: var(--space-xl);
  margin-top: var(--space-sm);
  padding: 0.85rem 1.7rem;
  border: 1px solid var(--border);
  border-radius: 60px;
  background: var(--bg-soft);
  transition: all var(--transition);
  word-break: break-all;
}

.contact-email:hover {
  background: var(--accent-dim);
  transform: translateY(-3px);
  border-color: var(--accent);
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.contact-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 0.55rem 1.2rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.contact-links a:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* ============ BACK TO TOP ============ */
.back-top {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition);
  z-index: 99;
  box-shadow: 0 6px 18px var(--accent-glow);
}

.back-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  background: #ff5252;
  transform: translateY(-3px);
}

/* ============ FOOTER ============ */
.footer {
  padding: var(--space-lg);
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============ MOBILE MENU ANIMATIONS ============ */
@keyframes menuPop {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes menuItem {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============ REDUCED MOTION ============
   The JS typewriter already honours prefers-reduced-motion; these rules stop
   the remaining CSS animations so the hero panel is not the only thing that
   respects the preference. */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-tag,
  .hero-title .line,
  .hero-desc,
  .hero-cta,
  .hero-meta,
  .project,
  .service-card,
  .skill-card,
  .timeline-item {
    opacity: 1 !important;
    transform: none !important;
  }

.stat-bar,
  .skill-progress-fill {
    transform: scaleX(1) !important;
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .menu-toggle {
    display: flex;
  }

  .hero {
    grid-template-columns: 1fr;
  }
  .hero::before,
  .hero::after,
  .hero-meta::before,
  .hero-meta::after {
    display: none;
  }

  .nav {
    display: none;
  }

  .nav.open {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: fixed;
    top: 74px;
    right: var(--space-md);
    width: min(210px, 60vw);
    background: rgba(17, 17, 24, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    z-index: 100;
    animation: menuPop 0.32s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  }

  .nav.open::before {
    content: '';
    position: absolute;
    top: 0;
    left: 18px;
    right: 18px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.65;
    pointer-events: none;
  }

  .nav.open a {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    width: 100%;
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s ease;
    animation: menuItem 0.32s ease both;
  }

  .nav.open a::after {
    content: '→';
    font-size: 0.8rem;
    color: var(--accent);
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.25s ease;
  }

  .nav.open a:hover,
  .nav.open a.active {
    background: var(--accent-soft);
    color: var(--text);
  }

  .nav.open a:hover::after,
  .nav.open a.active::after {
    opacity: 1;
    transform: translateX(0);
  }

  .nav.open a:nth-child(1) { animation-delay: 0.03s; }
  .nav.open a:nth-child(2) { animation-delay: 0.06s; }
  .nav.open a:nth-child(3) { animation-delay: 0.09s; }
  .nav.open a:nth-child(4) { animation-delay: 0.12s; }
  .nav.open a:nth-child(5) { animation-delay: 0.15s; }
  .nav.open a:nth-child(6) { animation-delay: 0.18s; }

  .nav.open a.active::after {
    color: var(--accent);
  }

  .menu-toggle {
    display: flex;
    width: 44px;
    height: 44px;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0.5rem;
    z-index: 101;
  }

  .menu-toggle span {
    width: 20px;
    height: 2px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .about-image {
    order: -1;
  }

  .project {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: var(--space-lg);
  }

  .project:nth-child(even) {
    direction: ltr;
  }

  .project-info {
    order: -1;
  }

  .skills-grid,
  .services-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .personal-info {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .section {
    padding: var(--space-xl) var(--space-md);
  }

  .hero {
    padding: calc(76px + var(--space-md)) var(--space-md) var(--space-2xl);
  }

  .hero-meta {
    gap: var(--space-md);
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  .personal-info {
    grid-template-columns: 1fr;
  }

  .contact-email {
    font-size: 0.95rem;
    padding: 0.7rem 1.1rem;
  }
}

/* ============ MOBILE: DISABLE SCROLL FX ============ */
@media (max-width: 960px) {
  html {
    scroll-behavior: auto;
  }

  .hero-tag,
  .hero-title .line,
  .hero-desc,
  .hero-cta,
  .hero-meta,
  .project,
  .skill-card,
  .service-card,
  .timeline-item,
  .nav.open,
  .nav.open a {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

.stat-bar,
  .skill-progress-fill {
    transform: scaleX(1) !important;
    animation: none !important;
    transition: none !important;
  }

  .stat:nth-child(1) .stat-bar {
    --w: 72%;
  }

  .stat:nth-child(2) .stat-bar {
    --w: 55%;
  }

  .stat:nth-child(3) .stat-bar {
    --w: 48%;
  }
}
