/* ============================================================
   ROOT & RESET
============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Color Palette */
  --ink:      #010101;
  --ink-2:    #3a3a3a;
  --ink-3:    #888888;
  --paper:    #f5f2ed;
  --paper-2:  #ede9e1;
  --paper-3:  #e4dfd6;
  --paper-4:  #d8d2c8;
  --dark:     #0e0e1a;
  --dark-2:   #141428;
  --dark-3:   #1e1e3a;
  --gold:     #c8a96e;
  --gold-2:   #a8853e;

  /* Typography */
  --ff-serif: 'Playfair Display', Georgia, serif;
  --ff-mono:  'DM Mono', 'Courier New', monospace;

  /* Spacing */
  --section-pad: 8rem 4rem;
  --nav-h: 80px;

  /* Transitions */
  --ease:     cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in:  cubic-bezier(0.55, 0, 1, 0.45);
}

[data-theme="light"] {
  --ink:     #010101;
  --ink-2:   #3a3a3a;
  --ink-3:   #888888;
  --paper:   #f5f2ed;
  --paper-2: #ede9e1;
  --paper-3: #e4dfd6;
  --paper-4: #d8d2c8;
  --dark:    #0e0e1a;
  --dark-2:  #141428;
  --dark-3:  #1e1e3a;
  --gold:    #c8a96e;
  --gold-2:  #a8853e;
  /* body bg/text stay as-is (paper + ink) — this is the default light theme */
}

[data-theme="dark"] {
  --ink:     #f3f3f0;
  --ink-2:   #d4d4d1;
  --ink-3:   #8f908c;
  --paper:   #080808;
  --paper-2: #121212;
  --paper-3: #1d1d1d;
  --paper-4: #2a2a2a;
  --dark:    #070707;
  --dark-2:  #101010;
  --dark-3:  #191919;
  --gold:    #dfe3dc;
  --gold-2:  #b8bbb4;
  --page-bg: radial-gradient(circle at 50% 0%, #101010 0%, #080808 38%, #050505 100%);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-serif);
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

body,
button,
a,
input,
textarea {
  cursor: auto;
}

/* Hide default cursor site-wide */
*, *::before, *::after { cursor: none !important; }

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  body,
  button,
  a,
  input,
  textarea,
  *,
  *::before,
  *::after {
    cursor: auto !important;
  }

  #cursor,
  #cursor-ring {
    display: none;
  }
}

:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 1rem;
  z-index: 10000;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 101;
  width: 0;
  height: 3px;
  background: var(--gold-2);
  transition: width 0.1s linear;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { background: none; border: none; font-family: inherit; }

/* ============================================================
   CURSOR
============================================================ */
#cursor {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s var(--ease),
              height 0.2s var(--ease),
              background 0.2s;
  mix-blend-mode: multiply;
}

#cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease),
              height 0.3s var(--ease),
              opacity 0.3s,
              border-color 0.2s;
}

/* ============================================================
   THEME TOGGLE
============================================================ */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--paper-4);
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color 0.3s, color 0.3s, background 0.3s, transform 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--gold-2);
  color: var(--gold-2);
  transform: rotate(20deg);
}

/* Mobile version inside the mobile menu */
.theme-toggle--mobile {
  margin-top: 2rem;
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
  border-color: var(--paper-3);
  color: var(--ink);
}

/* Also fix the cursor mix-blend-mode in dark mode so the dot stays visible */
[data-theme="dark"] #cursor {
  mix-blend-mode: screen;
}

/* Work section text — hardcoded to var(--paper) which flips dark in dark mode */
[data-theme="dark"] .project-title {
  color: #f0ece4;
}

[data-theme="dark"] .work-title {
  color: #f0ece4;
}

[data-theme="dark"] .project-desc {
  color: #9a9490;
}

[data-theme="dark"] #testimonial {
  background: #010101;
  color: #f5f2ed;
}

[data-theme="dark"] #testimonial .testimonial-quote,
[data-theme="dark"] #testimonial .quote-mark {
  color: inherit;
}

/* Nav scrolled state for dark mode */
[data-theme="dark"] #nav.scrolled {
  background: rgba(0, 0, 0, 0.92);
  box-shadow: 0 1px 0 var(--paper-4);
}

#cursor.hovered {
  width: 20px;
  height: 20px;
  background: var(--gold-2);
}

#cursor-ring.hovered {
  width: 60px;
  height: 60px;
  opacity: 0.5;
}

/* ============================================================
   NAVIGATION
============================================================ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4rem;
  height: var(--nav-h);
  transition: background 0.4s, backdrop-filter 0.4s, box-shadow 0.4s;
}

#nav.scrolled {
  background: rgba(245, 242, 237, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--paper-4);
}

.nav-logo {
  font-family: var(--ff-mono);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--ink);
  transition: color 0.3s;
}

.nav-logo:hover { color: var(--gold-2); }

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s var(--ease);
}

.nav-links a:hover { color: var(--gold-2); }
.nav-links a:hover::after { width: 100%; }

/* Hamburger (mobile) */
.nav-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-menu-btn span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

.nav-menu-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-menu-btn.open span:nth-child(2) { opacity: 0; }

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(100%);
  transition: transform 0.5s var(--ease);
}

.mobile-menu.open { transform: translateX(0); }

.mobile-menu ul {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}

.mobile-link {
  font-family: var(--ff-serif);
  font-size: 3rem;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: color 0.3s;
}

.mobile-link:hover { color: var(--gold-2); }

/* ============================================================
   SCROLL REVEAL
============================================================ */
.reveal,
.reveal-left,
.reveal-scale {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease),
              transform 0.9s var(--ease);
}

.reveal-left {
  transform: translateX(-40px);
}

.reveal-scale {
  transform: scale(0.96);
}

.reveal.visible,
.reveal-left.visible,
.reveal-scale.visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

/* ============================================================
   HERO
============================================================ */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

/* Vertical rule */
#hero::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--paper-3);
  pointer-events: none;
}

.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 5rem 3rem 5rem 4rem;
  position: relative;
  z-index: 2;
}

.hero-eyebrow-group {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hero-eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.63rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-2);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.3s var(--ease) forwards;
}

.hero-resume-btn {
  font-family: var(--ff-mono);
  font-size: 0.63rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--ink-3);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.hero-resume-btn:hover {
  color: var(--gold-2);
  border-color: var(--gold-2);
  transform: translateY(-1px);
}

.hero-name {
  font-size: clamp(3rem, 6.5vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.9s 0.5s var(--ease) forwards;
}

.hero-name em {
  font-style: italic;
  color: var(--gold-2);
}

.hero-title {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.7s var(--ease) forwards;
}

.hero-desc {
  font-size: 1.3rem;
  font-weight: 300;
  line-height: 1.85;
  max-width: 380px;
  color: var(--ink-2);
  opacity: 0;
  animation: fadeUp 0.8s 0.9s var(--ease) forwards;
}

.hero-desc strong {
  font-weight: 400;
  color: var(--ink);
}

.hero-cta {
  margin-top: 3rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 0;
  animation: fadeUp 0.8s 1.1s var(--ease) forwards;
}

/* Buttons */
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  padding: 0.85rem 2.2rem;
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background 0.3s, transform 0.2s;
  display: inline-block;
}

.btn-primary:hover {
  background: var(--gold-2);
  transform: translateY(-1px);
}

.btn-ghost {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s;
}

.btn-ghost:hover { color: var(--gold-2); }

.btn-ghost .arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.btn-ghost:hover .arrow { transform: translateX(5px); }

/* Hero Right — Photo */
.hero-right {
  position: relative;
  overflow: hidden;
}

.hero-img-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-img-placeholder {
  width: 68%;
  aspect-ratio: 0.75;
  background: var(--paper-3);
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  animation: revealRight 1s 0.4s var(--ease) both;
}

.hero-img-placeholder img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Hero decorative elements */
.hero-meta {
  position: absolute;
  right: 3.5rem;
  bottom: 4rem;
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--ink-3);
  writing-mode: vertical-rl;
  opacity: 0;
  animation: fadeIn 1s 1.4s var(--ease) forwards;
}

.scroll-hint {
  position: absolute;
  bottom: 3.5rem;
  left: 4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-3);
  opacity: 0;
  animation: fadeUp 0.8s 1.6s var(--ease) forwards;
}

.scroll-line {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--gold);
  transform-origin: left;
  animation: expandLine 1s 2s var(--ease) both;
}

/* ============================================================
   MARQUEE
============================================================ */
.marquee-section {
  padding: 1.4rem 0;
  border-top: 1px solid var(--paper-3);
  border-bottom: 1px solid var(--paper-3);
  overflow: hidden;
  background: var(--paper);
}

.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee 24s linear infinite;
}

.marquee-section:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-item {
  font-family: var(--ff-mono);
  font-size: 0.63rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.marquee-item::before {
  content: '◆';
  color: var(--gold);
  font-size: 0.45rem;
}

/* ============================================================
   ABOUT
============================================================ */
#about {
  padding: var(--section-pad);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 6rem;
  align-items: start;
}

.section-number {
  font-family: var(--ff-mono);
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  color: var(--gold-2);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.section-title em {
  font-style: italic;
  color: var(--gold-2);
}

.about-right { padding-top: 1rem; }

.about-text {
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.9;
  color: var(--ink-2);
  margin-bottom: 1.8rem;
}

.about-text strong {
  font-weight: 400;
  color: var(--ink);
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--paper-3);
  border: 1px solid var(--paper-3);
  margin-top: 3rem;
}

.skill-item {
  background: var(--paper);
  padding: 1.25rem 1rem;
  transition: background 0.3s;
}

.skill-item:hover { background: var(--paper-2); }

.skill-label {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 0.3rem;
}

.skill-name {
  font-size: 0.98rem;
  color: var(--ink-2);
}

/* Stats */
.about-stats {
  display: flex;
  gap: 3rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--paper-3);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-num {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
}

.stat-label {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ============================================================
   LEETCODE PROGRESS
============================================================ */
#leetcode {
  padding: var(--section-pad);
  background: var(--paper-2);
}

.leetcode-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 4rem;
}

.leetcode-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 0.3rem;
}

.leetcode-live,
.leetcode-refresh,
.leetcode-kicker,
.leetcode-updated,
.leetcode-metric-label,
.leetcode-subsection-heading,
.leetcode-submissions time {
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.leetcode-live {
  color: var(--gold-2);
  font-size: 0.65rem;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: #5c9f6c;
  box-shadow: 0 0 0 4px rgba(92, 159, 108, 0.14);
}

.leetcode-refresh {
  color: var(--ink-2);
  font-size: 0.62rem;
  transition: color 0.3s;
}

.leetcode-refresh:hover { color: var(--gold-2); }
.leetcode-refresh:disabled { opacity: 0.5; }

.leetcode-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.9fr;
  gap: 2px;
}

.leetcode-summary,
.leetcode-metrics,
.leetcode-recent {
  background: var(--paper);
  border: 1px solid var(--paper-3);
}

.leetcode-summary {
  grid-row: span 2;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 18rem;
}

.leetcode-kicker {
  color: var(--gold-2);
  font-size: 0.7rem;
}

.leetcode-profile-link {
  color: var(--ink-3);
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  margin-top: 0.6rem;
}

.leetcode-profile-link:hover { color: var(--gold-2); }

.leetcode-total { margin-top: 3rem; }

.leetcode-total-number {
  display: block;
  color: var(--ink);
  font-size: clamp(3.5rem, 7vw, 6rem);
  font-weight: 300;
  line-height: 0.9;
}

.leetcode-total-label {
  display: block;
  margin-top: 1rem;
  color: var(--ink-3);
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.leetcode-updated {
  color: var(--ink-3);
  font-size: 0.57rem;
  line-height: 1.6;
  margin-top: 2rem;
}

.leetcode-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 2rem;
  gap: 1rem;
}

.leetcode-metric { border-right: 1px solid var(--paper-3); }
.leetcode-metric:last-child { border-right: 0; }

.leetcode-metric-value {
  display: block;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 300;
}

.leetcode-metric-label {
  display: block;
  color: var(--ink-3);
  font-size: 0.55rem;
  line-height: 1.5;
  margin-top: 0.45rem;
}

.leetcode-recent { padding: 2rem; }

.leetcode-subsection-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--gold-2);
  font-size: 0.62rem;
}

.leetcode-subsection-rule {
  height: 1px;
  flex: 1;
  background: var(--paper-3);
}

.leetcode-submissions { margin-top: 1rem; }

.leetcode-submissions li {
  border-top: 1px solid var(--paper-3);
}

.leetcode-submissions a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0;
  color: var(--ink-2);
  font-size: 1rem;
}

.leetcode-submissions a:hover { color: var(--gold-2); }

.leetcode-submissions time {
  flex-shrink: 0;
  color: var(--ink-3);
  font-size: 0.55rem;
}

.leetcode-empty {
  padding-top: 1rem;
  color: var(--ink-3);
  font-family: var(--ff-mono);
  font-size: 0.65rem;
}

/* ============================================================
   WORK / PROJECTS
============================================================ */
#work {
  padding: var(--section-pad);
  background: var(--dark);
  color: var(--paper);
}

.work-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 4rem;
}

.work-num { color: var(--gold); }

.work-title { color: var(--paper); }
.work-title em { color: var(--gold); }

.view-all {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  transition: gap 0.3s, opacity 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-all:hover { opacity: 0.7; gap: 0.9rem; }

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.project-card {
  background: var(--dark-2);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  transition: background 0.4s;
  border: 1px solid transparent;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.project-card:hover {
  background: var(--dark-3);
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-num {
  font-family: var(--ff-mono);
  font-size: 0.70rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.project-title {
  font-size: 1.7rem;
  font-weight: 300;
  color: var(--paper);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.project-desc {
  font-family: var(--ff-mono);
  font-size: 0.80rem;
  letter-spacing: 0.03em;
  color: #888;
  line-height: 1.75;
  margin-bottom: 2rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2rem;
}

.tag {
  font-family: var(--ff-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(200, 169, 110, 0.25);
  padding: 0.2rem 0.65rem;
  transition: border-color 0.3s, color 0.3s;
}

.project-card:hover .tag {
  border-color: rgba(200, 169, 110, 0.5);
}

.project-link {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.3s, opacity 0.3s;
  width: fit-content;
}

.project-link:hover { gap: 0.8rem; opacity: 0.8; }

/* ============================================================
   EXPERIENCE
============================================================ */
#experience {
  padding: var(--section-pad);
  background: var(--paper-2);
}

.exp-header {
  margin-bottom: 4rem;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 14rem;
}

/* Vertical timeline line */
.timeline::before {
  content: '';
  position: absolute;
  left: 10rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--paper-4);
}

.timeline-item {
  position: relative;
  padding: 2.5rem 0 2.5rem 3rem;
  border-bottom: 1px solid var(--paper-3);
}

.timeline-item:last-child { border-bottom: none; }

/* Dot on the line */
.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-3rem - 4px);
  top: 2.8rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--paper-2);
}

.timeline-date {
  position: absolute;
  left: -14rem;
  top: 2.7rem;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--ink-3);
  text-transform: uppercase;
  width: 10rem;
  text-align: right;
}

.timeline-role {
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.timeline-company {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 1rem;
}

.timeline-desc {
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 580px;
}

/* ============================================================
   SERVICES
============================================================ */
#services {
  padding: var(--section-pad);
  background: var(--paper);
}

.services-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: end;
  margin-bottom: 4rem;
}

.services-sub {
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--ink-2);
  padding-bottom: 0.25rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--paper-3);
  border: 1px solid var(--paper-3);
}

.service-item {
  background: var(--paper);
  padding: 2.5rem 2rem;
  transition: background 0.3s;
}

.service-item:hover { background: var(--paper-2); }

.service-icon {
  width: 30px;
  height: 30px;
  margin-bottom: 1.5rem;
  color: var(--gold);
}

.service-title {
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.service-desc {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  line-height: 1.85;
  color: var(--ink-3);
}

/* ============================================================
   TESTIMONIAL
============================================================ */
#testimonial {
  padding: 7rem 4rem;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
}

.quote-mark {
  font-size: 7rem;
  line-height: 0.5;
  color: var(--gold);
  opacity: 0.2;
  font-style: normal;
  display: block;
  margin-bottom: 1.5rem;
  font-family: var(--ff-serif);
}

.testimonial-quote {
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  font-weight: 300;
  line-height: 1.65;
  max-width: 780px;
  margin: 0 auto 2.5rem;
  font-style: italic;
  letter-spacing: 0.01em;
}

.testimonial-author {
  font-family: var(--ff-mono);
  font-size: 0.80rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ============================================================
   CONTACT
============================================================ */
#contact {
  padding: var(--section-pad);
  background: var(--paper-2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}

.contact-title {
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.contact-title em {
  font-style: italic;
  color: var(--gold-2);
}

.contact-subtitle {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 3rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.contact-detail {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.contact-label {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.contact-value {
  font-size: 1.2rem;
  color: var(--ink);
  transition: color 0.3s;
}

a.contact-value:hover { color: var(--gold-2); }

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  padding-top: 0.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.form-label {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.form-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--paper-4);
  padding: 0.7rem 0;
  font-family: var(--ff-serif);
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--ink);
  outline: none;
  transition: border-color 0.3s;
  width: 100%;
}

.form-input:focus { border-bottom-color: var(--gold-2); }
.form-input::placeholder { color: var(--ink-3); }

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-error {
  font-family: var(--ff-mono);
  font-size: 0.90rem;
  letter-spacing: 0.1em;
  color: #c0392b;
  opacity: 0;
  transition: opacity 0.3s;
}

.form-error.visible { opacity: 1; }

.form-submit {
  background: var(--ink);
  color: var(--paper);
  padding: 1rem 2.5rem;
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  align-self: flex-start;
  transition: background 0.3s, transform 0.2s;
}

.form-submit:hover {
  background: var(--gold-2);
  transform: translateY(-1px);
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.form-submit:hover .btn-arrow { transform: translateX(4px); }

.form-success {
  font-family: var(--ff-mono);
  font-size: 0.90rem;
  letter-spacing: 0.12em;
  color: #2e7d32;
  opacity: 0;
  transition: opacity 0.5s;
  margin-top: -0.5rem;
}

.form-success.visible { opacity: 1; }

/* ============================================================
   FOOTER
============================================================ */
footer {
  padding: 2.5rem 4rem;
  border-top: 1px solid var(--paper-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper);
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.footer-logo {
  font-family: var(--ff-serif);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--ink);
}

.footer-copy {
  font-family: var(--ff-mono);
  font-size: 0.80rem;
  letter-spacing: 0.15em;
  color: var(--ink-3);
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-family: var(--ff-mono);
  font-size: 0.63rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.3s;
  position: relative;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s var(--ease);
}

.footer-links a:hover { color: var(--gold-2); }
.footer-links a:hover::after { width: 100%; }

/* ============================================================
   GRAIN OVERLAY (Subtle texture)
============================================================ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.022;
  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");
}

/* ============================================================
   KEYFRAMES
============================================================ */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes revealRight {
  from { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
  to   { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

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

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   RESPONSIVE — TABLET (≤900px)
============================================================ */
@media (max-width: 900px) {
  :root { --section-pad: 5rem 2.5rem; }

  #nav { padding: 0 2.5rem; }
  .nav-links { display: none; }
  .nav-menu-btn { display: flex; }

  #hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-bottom: 4rem;
  }
  #hero::before { display: none; }
  .hero-left { padding: 4rem 2.5rem 2rem; }
  .hero-right { height: 70vw; }
  .hero-img-placeholder { width: 100%; height: 100%; aspect-ratio: auto; }
  .hero-img-placeholder img { object-fit: contain; }
  .hero-meta, .scroll-hint { display: none; }

  #about {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .skills-grid { grid-template-columns: repeat(2, 1fr); }

  .projects-grid { grid-template-columns: 1fr; }
  .leetcode-grid { grid-template-columns: 1fr; }
  .leetcode-summary { grid-row: auto; }
  .leetcode-metrics { grid-template-columns: repeat(3, 1fr); }
  .leetcode-metric:nth-child(3) { border-right: 0; }
  .leetcode-metric:nth-child(n + 4) { margin-top: 1rem; }

  .services-header { grid-template-columns: 1fr; gap: 1.5rem; }
  .services-grid   { grid-template-columns: 1fr; }

  #contact {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .timeline { padding-left: 0; }
  .timeline::before { display: none; }
  .timeline-item { padding: 2rem 0; padding-left: 0; }
  .timeline-item::before { display: none; }
  .timeline-date {
    position: static;
    width: auto;
    text-align: left;
    margin-bottom: 0.5rem;
  }

  footer {
    padding: 2rem 2.5rem;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    align-items: center;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤480px)
============================================================ */
@media (max-width: 480px) {
  :root { --section-pad: 4rem 1.5rem; }
  #nav { padding: 0 1.5rem; }
  .hero-left { padding: 3rem 1.5rem 2rem; }
  .hero-cta { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
  .about-stats { flex-wrap: wrap; gap: 1.5rem; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  #testimonial { padding: 5rem 1.5rem; }
  .work-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .leetcode-header { align-items: flex-start; flex-direction: column; gap: 1.5rem; }
  .leetcode-actions { padding-bottom: 0; }
  .leetcode-summary, .leetcode-metrics, .leetcode-recent { padding: 1.5rem; }
  .leetcode-metrics { grid-template-columns: repeat(2, 1fr); }
  .leetcode-metric:nth-child(3) { border-right: 1px solid var(--paper-3); }
  .leetcode-metric:nth-child(even) { border-right: 0; }
  .leetcode-submissions a { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
  footer { padding: 2rem 1.5rem; }
}

/* ============================================================
   VISUAL REFRESH — warm studio palette, layered surfaces,
   and softer interaction states
============================================================ */
:root {
  --ink: #20252a;
  --ink-2: #5d656b;
  --ink-3: #8c9294;
  --paper: #f1eee8;
  --paper-2: #e8e4dc;
  --paper-3: #d9d5cc;
  --paper-4: #c3beb4;
  --dark: #172634;
  --dark-2: #203547;
  --dark-3: #29465a;
  --gold: #ff765f;
  --gold-2: #dd554b;
  --page-bg: radial-gradient(circle at 8% 0%, #f7f3ed 0%, #e7e3dc 42%, #dcdedc 100%);
  --radius: 18px;
  --shadow-soft: 0 18px 55px rgba(31, 42, 52, 0.09);
  --ff-serif: 'Manrope', Arial, sans-serif;
}

[data-theme="dark"] {
  --ink: #f2f2ef;
  --ink-2: #d8d8d4;
  --ink-3: #8f8f8a;
  --paper: #090909;
  --paper-2: #121212;
  --paper-3: #1e1e1e;
  --paper-4: #2d2d2d;
  --dark: #070707;
  --dark-2: #101010;
  --dark-3: #1a1a1a;
  --gold: #ff6b61;
  --gold-2: #8fb8c8;
  --page-bg: radial-gradient(circle at 50% 0%, #111111 0%, #090909 38%, #050505 100%);
}

body {
  background: var(--page-bg);
  letter-spacing: -0.01em;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: linear-gradient(rgba(24, 33, 43, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 43, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

#nav {
  height: 76px;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
}

#nav.scrolled {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  box-shadow: 0 1px 0 var(--paper-3), 0 12px 30px rgba(31, 42, 52, 0.06);
}

.nav-logo {
  font-weight: 800;
  letter-spacing: -0.04em;
}

.nav-links a,
.nav-logo,
.hero-title,
.hero-eyebrow,
.section-number,
.project-num,
.tag,
.project-link,
.view-all,
.form-label,
.contact-label {
  letter-spacing: 0.12em;
}

#hero {
  min-height: 92vh;
  background: transparent;
}

[data-theme="light"] #hero {
  background: linear-gradient(120deg, #f0ebe4 0%, #d9dedd 100%);
}

#hero::before {
  background: var(--paper-3);
  opacity: 0.75;
}

.hero-left {
  justify-content: flex-start;
  padding: 3.5rem 3rem 5rem clamp(1.5rem, 7vw, 7rem);
}

.hero-name {
  max-width: 680px;
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 0.94;
}

.hero-eyebrow { color: var(--gold); }

.hero-name em,
.section-title em,
.contact-title em {
  color: var(--gold);
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
}

.hero-desc {
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 470px;
}

.hero-resume-btn,
.btn-primary,
.form-submit {
  border-radius: 999px;
}

.btn-primary {
  background: var(--gold);
  color: #111111;
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.08);
}

.btn-primary:hover,
.form-submit:hover {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 12px 26px rgba(255, 255, 255, 0.08);
}

.hero-right {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2.5rem;
}

.hero-img-wrap {
  position: relative;
  inset: auto;
  width: min(72%, 470px);
  aspect-ratio: 0.82;
}

.hero-img-wrap::before {
  content: '';
  position: absolute;
  inset: 14px -18px -18px 14px;
  background: var(--gold-2);
  opacity: 0.75;
  pointer-events: none;
  z-index: 0;
}

.hero-img-wrap::after {
  content: 'AJAY VARSAN  /  2026';
  position: absolute;
  left: 1rem;
  bottom: -1.25rem;
  font-family: var(--ff-mono);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  color: #141414;
  pointer-events: none;
  z-index: 3;
}

.hero-img-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: 10px solid #e8e6df;
  border-bottom-width: 42px;
  box-shadow:
    15px 18px 0 var(--gold-2),
    0 22px 55px rgba(0, 0, 0, 0.24);
  position: relative;
  z-index: 1;
  transform: rotate(-2deg);
}

.hero-img-placeholder::before {
  display: none;
}

.hero-img-placeholder::after {
  display: none;
}

.hero-img-placeholder img {
  filter: saturate(0.84) contrast(1.05);
}

.hero-img-placeholder {
  animation: revealRight 1s 0.4s var(--ease) both;
}

.marquee-section {
  background: var(--ink);
  border-color: var(--ink);
}

.marquee-item { color: var(--paper); }
.marquee-item::before { color: var(--gold); }

#about,
#leetcode,
#experience,
#contact {
  position: relative;
}

#about { padding-top: 10rem; padding-bottom: 10rem; }
[data-theme="light"] .about-text,
[data-theme="light"] .section-title,
[data-theme="light"] .section-number {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
}
.section-title { font-weight: 700; letter-spacing: -0.06em; }
.about-text { font-size: 1.08rem; line-height: 1.85; }

.skills-grid,
.services-grid {
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.skill-item,
.service-item {
  padding: 1.5rem 1.25rem;
  transition: background 0.35s, transform 0.35s;
}

.skill-item:hover,
.service-item:hover {
  background: color-mix(in srgb, var(--gold) 10%, var(--paper));
  transform: translateY(-3px);
}

#leetcode {
  background: linear-gradient(145deg, var(--paper-2), var(--paper));
}

[data-theme="light"] #about,
[data-theme="light"] #experience,
[data-theme="light"] #contact {
  background: linear-gradient(145deg, #e9e5de 0%, #f1eee8 62%, #e2e4e2 100%);
}

.leetcode-summary,
.leetcode-metrics,
.leetcode-recent {
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.leetcode-summary { min-height: 21rem; }
.leetcode-total-number { color: var(--gold-2); font-weight: 700; }

#work {
  --gold: var(--gold-2);
  background:
    radial-gradient(circle at 100% 0%, rgba(110, 159, 187, 0.18), transparent 30rem),
    var(--dark);
}

.project-card {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  box-shadow: 0 16px 45px rgba(4, 11, 17, 0.14);
  transition: background 0.4s, transform 0.4s, border-color 0.4s;
}

.project-card:hover {
  border-color: color-mix(in srgb, var(--gold) 48%, transparent);
  transform: translateY(-5px);
}

.project-card::before { background: var(--gold); }
.project-title { font-weight: 600; letter-spacing: -0.035em; }
.project-desc { color: #aab6bd; line-height: 1.8; }
.tag {
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  border-color: color-mix(in srgb, var(--gold-2) 28%, transparent);
}

#experience { background: var(--paper-2); }
.timeline-item { transition: padding-left 0.35s ease; }
.timeline-item:hover { padding-left: 3.35rem; }
.timeline-item::before { box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 16%, transparent); }

.service-icon { color: var(--gold-2); }
#testimonial {
  --gold: var(--gold-2);
  background: var(--ink);
}
#contact { background: linear-gradient(135deg, var(--paper-2), var(--paper)); }
.contact-title { font-weight: 700; letter-spacing: -0.07em; }
.form-input { border-bottom-width: 2px; }
footer { background: var(--paper); }

@keyframes floatOrb {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, 14px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 900px) {
  .hero-left { padding: 3rem 2.5rem 3rem; }
  .hero-img-wrap { width: min(74%, 400px); }
  .timeline-item:hover { padding-left: 0; }
}

@media (max-width: 480px) {
  .hero-left { padding: 2.5rem 1.5rem 2rem; }
  .hero-img-wrap { width: 80%; }
  .hero-img-placeholder { border-width: 6px; }
  .hero-name { font-size: clamp(3.3rem, 15vw, 5rem); }
}
