/* CSS variables with OKLCH theme palette */
:root {
  --background: oklch(99.4% 0 0);
  --foreground: oklch(0% 0 0);
  --popover: oklch(99.11% 0 0);
  --popover-foreground: oklch(0% 0 0);
  --muted: oklch(97.02% 0 0);
  --muted-foreground: oklch(43.86% 0 0);
  --border: oklch(93% 0.0094 286.216);
  --accent: oklch(96.56% 0.0176 39.4009);
  --accent-foreground: oklch(55.81% 0.1911 35.3377);
  --destructive: oklch(57.7% 0.245 27.325);
  --destructive-foreground: oklch(50.5% 0.213 27.518);
  
  --ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --background: oklch(14.48% 0 0);
  --foreground: oklch(95.51% 0 0);
  --popover: oklch(14.48% 0 0);
  --popover-foreground: oklch(95.51% 0 0);
  --muted: oklch(25.7% 0.0037 286.136);
  --muted-foreground: oklch(67.31% 0 0);
  --border: oklch(23.93% 0 0);
  --accent: oklch(37.34% 0.1246 36.384);
  --accent-foreground: oklch(99.7% 0 0);
  --destructive: oklch(70.4% 0.191 22.216);
  --destructive-foreground: oklch(70.4% 0.191 22.216);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: oklch(14.48% 0 0);
    --foreground: oklch(95.51% 0 0);
    --popover: oklch(14.48% 0 0);
    --popover-foreground: oklch(95.51% 0 0);
    --muted: oklch(25.7% 0.0037 286.136);
    --muted-foreground: oklch(67.31% 0 0);
    --border: oklch(23.93% 0 0);
    --accent: oklch(37.34% 0.1246 36.384);
    --accent-foreground: oklch(99.7% 0 0);
    --destructive: oklch(70.4% 0.191 22.216);
    --destructive-foreground: oklch(70.4% 0.191 22.216);
  }
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.625;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}

/* Layout Classes */
.mx-auto { margin-left: auto; margin-right: auto; }
.relative { position: relative; }
.fixed { position: fixed; }
.absolute { position: absolute; }
.pointer-events-none { pointer-events: none; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.p-8 { padding: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-20 { margin-top: 5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.pl-4 { padding-left: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 1rem; }
.gap-3 { gap: 0.75rem; }
.gap-1.5 { gap: 0.375rem; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.gap-x-6 { column-gap: 1.5rem; }
.gap-y-4 { row-gap: 1rem; }
.hidden { display: none; }
.block { display: block; }
.mt-0\.5 { margin-top: 0.125rem; }

@media (min-width: 768px) {
  .md\:p-24 { padding: 6rem; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:mt-0 { margin-top: 0; }
}

.max-w-\[650px\] { max-width: 650px; }

/* Typography */
.font-medium { font-weight: 500; }
.font-mono { font-family: var(--font-mono); }
.text-2xl { font-size: 1.5rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.uppercase { text-transform: uppercase; }
.text-left { text-align: left; }
.text-center { text-align: center; }

/* Colors */
.text-foreground { color: var(--foreground); }
.text-muted-foreground { color: var(--muted-foreground); }
.border-t { border-top: 1px solid var(--border); }
.border-l { border-left: 2px solid var(--border); }
.border-border { border-color: var(--border); }

/* Buttons & Links Reset */
a {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
  outline: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
}

/* Links Scribble Underline Effect */
.link-scribble {
  display: inline-block;
  cursor: pointer;
}

.scribble-svg {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: -6px;
  width: 100%;
  height: 12px;
  overflow: visible;
  color: var(--destructive);
  opacity: 0.75;
  pointer-events: none;
}

.scribble-svg path {
  stroke-dashoffset: 1;
  stroke-dasharray: 1 2;
  transition: stroke-dashoffset 0.15s var(--ease-out-quart);
}

.group:hover .scribble-svg path {
  stroke-dashoffset: 0;
  transition-duration: 0.35s;
}

/* Custom Interactive Burst Triggers (Waterloo Gradients) */
.burst-trigger {
  font-weight: 500;
  text-decoration: none;
}

/* Rungta Orange-Blue-Gold Gradient */
.hover-gradient-rungta {
  background-clip: text;
  -webkit-background-clip: text;
  background-position: 100% 50%;
  background-size: 300% 100%;
  background-image: linear-gradient(
    in oklch 120deg,
    var(--foreground) 0%,
    var(--foreground) 33%,
    oklch(70% 0.18 55) 42%,       /* Orange */
    oklch(60% 0.15 250) 58%,      /* Blue */
    oklch(80% 0.15 85) 67%,       /* Gold */
    var(--foreground) 75%,
    var(--foreground) 100%
  );
  transition: background-position 1s var(--ease-out-quart);
}

.hover-gradient-rungta:hover {
  background-position: 0% 50%;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Name heading — smaller, matching Sunnie Kapar weight/size */
.name-heading {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Inline links — Sunnie Kapar style: foreground color, no underline by default */
.inline-link {
  color: var(--foreground);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s ease;
}

.inline-link:hover {
  border-bottom-color: var(--foreground);
}

/* Tech Tags styling */
.tech-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  background-color: var(--muted);
  color: var(--muted-foreground);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Entrance Animations */
.animate-reveal {
  opacity: 0;
  transform: translateY(15px);
  animation: reveal 0.7s var(--ease-out-quart) forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Theme Toggle Button Style */
.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--foreground);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: background-color 0.2s, transform 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.05);
  background-color: var(--accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: opacity 0.2s, transform 0.2s;
}

/* Sun/Moon toggle visibility state */
.sun-icon { opacity: 0; transform: rotate(90deg) scale(0.8); }
.moon-icon { opacity: 1; transform: rotate(0) scale(1); }

[data-theme="dark"] .sun-icon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] .moon-icon { opacity: 0; transform: rotate(-90deg) scale(0.8); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sun-icon { opacity: 1; transform: rotate(0) scale(1); }
  :root:not([data-theme="light"]) .moon-icon { opacity: 0; transform: rotate(-90deg) scale(0.8); }
}

/* Hover Preview Card styling (GitHub Card) */
.hover-card {
  z-index: 999;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.15s var(--ease-out-quart), transform 0.15s var(--ease-out-quart);
  margin-top: 8px;
}

.hover-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hover-card-inner {
  background-color: var(--popover);
  color: var(--popover-foreground);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  width: 280px;
}

.hover-card .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

/* Simulated contribution graph grid */
.contrib-graph {
  display: flex;
  gap: 2px;
}

.contrib-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contrib-box {
  width: 6px;
  height: 6px;
  border-radius: 1px;
}

/* Contribution Level colors */
.level-0 { background-color: var(--muted); }
.level-1 { background-color: oklch(75% 0.12 140); opacity: 0.6; }
.level-2 { background-color: oklch(65% 0.14 140); opacity: 0.8; }
.level-3 { background-color: oklch(55% 0.16 140); }
.level-4 { background-color: oklch(45% 0.18 140); }

/* Prevent animations if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .animate-reveal,
  .burst-trigger,
  .scribble-svg path,
  .hover-card,
  .theme-toggle {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  .burst-trigger:hover {
    color: var(--foreground) !important;
    background-image: none !important;
    -webkit-text-fill-color: initial !important;
  }
}


/* ── Years trigger ───────────────────────────────────────── */
.years-trigger {
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.years-trigger:hover {
  border-bottom-color: var(--foreground);
}

/* ── Experience section — hidden by default ──────────────── */
.experience-section {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.7s cubic-bezier(0.165, 0.84, 0.44, 1),
              opacity 0.5s ease,
              margin-top 0.5s ease;
  margin-top: 0;
}

.experience-section.open {
  max-height: 600px;
  opacity: 1;
  margin-top: 3rem;
}

/* ── Timeline ────────────────────────────────────────────── */
.timeline {
  position: relative;
}

.timeline-track {
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background-color: var(--border);
}

.timeline-fill {
  width: 100%;
  background-color: var(--muted-foreground);
  height: 0%;
  transition: height 1s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
}

.timeline-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding-bottom: 2rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

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

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

.timeline-item-now {
  padding-bottom: 0;
}

/* Left column — dot only */
.timeline-left {
  flex-shrink: 0;
  width: 11px;
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.timeline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--background);
  border: 1px solid var(--muted-foreground);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.timeline-dot-now {
  background-color: var(--foreground);
  border-color: var(--foreground);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--foreground) 12%, transparent);
}

/* Content */
.timeline-content {
  flex: 1;
  padding-top: 0;
}

.timeline-year {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
  display: block;
  margin-bottom: 2px;
}

.timeline-role {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1.4;
}

.timeline-company {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  margin-top: 1px;
}

.timeline-location {
  opacity: 0.65;
}

.timeline-desc {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  margin-top: 0.4rem;
  line-height: 1.65;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

/* Light mode — boost highlighted spans to match link weight */
[data-theme="light"] .text-foreground,
:root:not([data-theme="dark"]) .text-foreground {
  font-weight: 500;
}
