/* =====================================================
   duarte.io: dark glassmorphism theme with a light variant
   ===================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/inter-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;
}

:root {
  color-scheme: dark;

  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;

  --accent-1: #7c94f6;
  --accent-2: #9066c9;
  --accent-3: #f093fb;
  --accent-text: #7c94f6;
  --gradient-primary: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);

  --text-primary: #ffffff;
  --text-secondary: #c4c4cc;
  --text-muted: #9898a3;

  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --glow: rgba(102, 126, 234, 0.12);

  --nav-bg: rgba(10, 10, 15, 0.82);
  --menu-bg: rgba(10, 10, 15, 0.96);
  --tag-bg: rgba(124, 148, 246, 0.1);
  --badge-bg: rgba(124, 148, 246, 0.14);
  --badge-border: rgba(124, 148, 246, 0.3);
  --ticker-color: #34ce57;
  --ticker-bg: rgba(52, 206, 87, 0.12);
  --ticker-border: rgba(52, 206, 87, 0.3);
  --side-guide: rgba(255, 255, 255, 0.1);
  --side-passed: #4a5a8a;
  --side-passed-border: #6a7ab0;

  --section-padding: 120px;
  --container-max: 1200px;
  --nav-height: 84px;

  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --ease-out: cubic-bezier(0.03, 0.98, 0.52, 0.99);

  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;
}

[data-theme="light"] {
  color-scheme: light;

  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;

  --accent-text: #4a58c9;

  --text-primary: #18181b;
  --text-secondary: #3f3f46;
  --text-muted: #71717a;

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-hover: rgba(74, 88, 201, 0.3);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --glow: rgba(102, 126, 234, 0.08);

  --nav-bg: rgba(255, 255, 255, 0.85);
  --menu-bg: rgba(255, 255, 255, 0.97);
  --tag-bg: rgba(74, 88, 201, 0.08);
  --badge-bg: rgba(74, 88, 201, 0.08);
  --badge-border: rgba(74, 88, 201, 0.28);
  --ticker-color: #1e7e34;
  --ticker-bg: rgba(30, 126, 52, 0.07);
  --ticker-border: rgba(30, 126, 52, 0.3);
  --side-guide: rgba(0, 0, 0, 0.1);
  --side-passed: #b7c0f2;
  --side-passed-border: #8d9ae6;
}

/* =====================================================
   BASE
   ===================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 8px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent-1);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 3px;
}

.icon {
  width: 1.25em;
  height: 1em;
  fill: currentColor;
  flex-shrink: 0;
  vertical-align: -0.125em;
  overflow: visible;
}

.icon-gradient {
  fill: url(#icon-gradient);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1100;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: var(--accent-1);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: none;
}

/* =====================================================
   ANIMATED BACKGROUND
   ===================================================== */

.bg-animation {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-primary);
  pointer-events: none;
}

/* Grain texture, behind the content so it never dims the text */
.bg-animation::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
}

.gradient-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
  will-change: transform;
}

.sphere-1 {
  width: 600px;
  height: 600px;
  background: var(--accent-1);
  top: -200px;
  right: -100px;
}

.sphere-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-2);
  bottom: -150px;
  left: -100px;
  animation-delay: -7s;
}

.sphere-3 {
  width: 400px;
  height: 400px;
  background: var(--accent-3);
  top: calc(50% - 200px);
  left: calc(50% - 200px);
  animation-delay: -14s;
  opacity: 0.3;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -50px) scale(1.1); }
  50% { transform: translate(-30px, 30px) scale(0.95); }
  75% { transform: translate(-50px, -30px) scale(1.05); }
}

/* Spotlight that follows the mouse (added by site.js on desktop) */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 400px;
  height: 400px;
  margin: -200px 0 0 -200px;
  background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: transform 0.25s ease-out, opacity 0.4s ease;
  will-change: transform;
}

.cursor-glow.visible {
  opacity: 1;
}

/* =====================================================
   NAVIGATION
   ===================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  border-bottom: 1px solid transparent;
  transition: background-color var(--transition-medium), padding var(--transition-medium), border-color var(--transition-medium);
}

.navbar.scrolled,
.navbar.menu-open {
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--glass-border);
  padding: 15px 0;
}

.nav-container {
  position: relative;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 24px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -1px;
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-medium);
}

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

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

.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-toggle,
.hamburger {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-medium), color var(--transition-medium), transform var(--transition-medium);
}

.theme-toggle {
  font-size: 16px;
}

.theme-toggle:hover {
  background: var(--glass-border);
  color: var(--text-primary);
  transform: rotate(15deg);
}

.theme-toggle .icon {
  width: 1em;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
}

.hamburger:hover {
  background: var(--glass-border);
}

.hamburger-line {
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform var(--transition-medium), opacity var(--transition-medium);
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =====================================================
   SCROLL PROGRESS
   ===================================================== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 1001;
  transform: scaleX(0);
  transform-origin: left;
}

/* =====================================================
   HERO
   ===================================================== */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 40px 140px;
  position: relative;
}

.hero-content {
  max-width: 800px;
  animation: hero-in 0.9s ease-out both;
}

/* Slide only: fading from 0 would hold back the Largest Contentful Paint */
@keyframes hero-in {
  from { transform: translateY(24px); }
  to { transform: none; }
}

.hero-image-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 30px;
}

.hero-image-glow {
  position: absolute;
  inset: -10px;
  background: var(--gradient-primary);
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.6;
  animation: pulse-glow 3s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.hero-image {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  border: 3px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.hero-title {
  margin-bottom: 20px;
}

.greeting {
  display: block;
  font-size: 18px;
  font-weight: 400;
  color: #b4c1fb;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.name {
  display: block;
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -2px;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 600;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 15px;
}

[data-theme="light"] .hero-subtitle {
  background-image: linear-gradient(135deg, #4a58c9 0%, #7a4fb8 100%);
}

[data-theme="light"] .greeting {
  color: var(--accent-text);
}

.hero-tagline {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 40px;
}

.hero-cta {
  margin-bottom: 50px;
}

.hero-social {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.social-link {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 20px;
  text-decoration: none;
  animation: float-subtle 3s ease-in-out infinite;
  transition: transform 0.2s var(--ease-out), background-color var(--transition-medium), color var(--transition-medium), box-shadow var(--transition-medium), border-color var(--transition-medium);
}

.social-link:nth-child(2) { animation-delay: 0.2s; }
.social-link:nth-child(3) { animation-delay: 0.4s; }

@keyframes float-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.social-link:hover {
  animation: none;
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: fade-in 1s ease 1.5s forwards;
}

@keyframes fade-in {
  to { opacity: 1; }
}

.mouse {
  width: 26px;
  height: 40px;
  border: 2px solid var(--text-muted);
  border-radius: 20px;
  position: relative;
}

.wheel {
  width: 4px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll-wheel 2s infinite;
}

@keyframes scroll-wheel {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

/* No mouse on touch screens, and no room for it on short screens */
@media (pointer: coarse), (max-height: 720px) {
  .scroll-indicator {
    display: none;
  }
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: var(--radius-xl);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.2s var(--ease-out), box-shadow var(--transition-medium);
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Shimmer */
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  left: -100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary .icon {
  transition: transform var(--transition-medium);
}

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

.btn-large {
  padding: 20px 40px;
  font-size: 16px;
}

/* =====================================================
   SECTIONS
   ===================================================== */

.section {
  padding: var(--section-padding) 40px;
  position: relative;
}

/* Fades in and out so the background glow never ends on a hard line */
.section-alt {
  background: linear-gradient(to bottom, transparent, var(--bg-secondary) 160px, var(--bg-secondary) calc(100% - 160px), transparent);
}

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

.section-title {
  position: relative;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 60px;
  display: flex;
  align-items: center;
  gap: 15px;
  line-height: 1.2;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -15px;
  width: 0;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.section-title:hover::after {
  width: 100px;
}

.title-number {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 20px;
  font-weight: 500;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =====================================================
   GLASS CARD
   ===================================================== */

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: transform 0.4s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease;
}

@media (hover: hover) {
  .glass-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow), 0 0 40px rgba(102, 126, 234, 0.1);
  }
}

/* =====================================================
   ABOUT
   ===================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 60px;
  align-items: start;
  margin-bottom: 60px;
}

.about-text p {
  margin-bottom: 20px;
  font-size: 17px;
  line-height: 1.8;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-text .lead {
  font-size: 20px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.7;
}

.about-text strong {
  color: var(--text-primary);
}

.about-text a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent-1);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.about-text a:hover {
  color: var(--accent-text);
  text-decoration-color: var(--accent-2);
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.stat-card {
  padding: 30px;
  text-align: center;
}

.stat-number {
  font-size: 42px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.travel-note {
  padding: 30px 40px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.travel-note .icon {
  font-size: 28px;
  width: 1em;
}

.travel-note p {
  font-size: 15px;
  line-height: 1.8;
}

/* =====================================================
   TIMELINE
   ===================================================== */

.timeline {
  position: relative;
  padding-left: 40px;
}

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

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

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

.timeline-marker {
  position: absolute;
  left: -40px;
  top: 30px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent-1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-marker-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient-primary);
  animation: marker-pulse 2s ease-in-out infinite;
}

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

.timeline-content {
  position: relative;
  padding: 30px;
}

.timeline-content > :last-child {
  margin-bottom: 0;
}

/* Gradient border on hover */
.timeline-content::before {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.timeline-content:hover::before {
  opacity: 0.8;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px 20px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.timeline-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 8px;
}

.timeline-org {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.timeline-company {
  color: var(--accent-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: color var(--transition-fast);
}

.timeline-company:hover {
  color: var(--text-primary);
}

.timeline-company .icon {
  font-size: 11px;
}

.acquisition-badge,
.ticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.acquisition-badge .icon,
.ticker-badge .icon {
  font-size: 10px;
}

.acquisition-badge {
  background: var(--badge-bg);
  color: var(--accent-text);
  border: 1px solid var(--badge-border);
}

.acquisition-badge:hover {
  background: var(--accent-1);
  color: #fff;
  transform: translateY(-1px);
}

.ticker-badge {
  background: var(--ticker-bg);
  color: var(--ticker-color);
  border: 1px solid var(--ticker-border);
}

.ticker-badge:hover {
  background: var(--ticker-border);
  transform: translateY(-1px);
}

.ticker-symbol {
  font-family: 'SF Mono', Monaco, Consolas, ui-monospace, monospace;
  letter-spacing: 0.5px;
}

.timeline-date {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.timeline-description {
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 20px;
}

.timeline-achievements {
  margin-bottom: 20px;
}

.achievement {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

.achievement:last-child {
  margin-bottom: 0;
}

.achievement .icon {
  color: var(--accent-text);
  font-size: 12px;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--accent-text);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.tag-link {
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.tag-link:hover {
  background: var(--accent-1);
  color: var(--bg-primary);
  transform: translateY(-2px);
}

[data-theme="light"] .tag-link:hover {
  color: #fff;
}

.timeline-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.doc-link-group {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.doc-link-group > .icon {
  font-size: 14px;
  width: 16px;
}

.doc-title {
  flex: 1;
}

.doc-langs {
  display: flex;
  gap: 6px;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--badge-border);
  background: var(--badge-bg);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.lang-pill:hover {
  background: var(--accent-1);
  border-color: transparent;
  color: #fff;
}

.glass-card:hover .doc-link-group {
  color: var(--text-secondary);
}

/* =====================================================
   PUBLICATIONS & PROJECTS
   ===================================================== */

.cards-grid {
  display: grid;
  gap: 20px;
}

.projects-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
}

.publication-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 30px;
  text-decoration: none;
}

@media (hover: hover) {
  .publication-card:hover {
    transform: translateY(-5px) translateX(5px);
  }
}

.publication-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 24px;
}

.publication-content {
  flex: 1;
  min-width: 0;
}

.publication-type {
  font-size: 12px;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.publication-content h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.publication-content p {
  font-size: 14px;
  color: var(--text-muted);
}

/* The title link covers the whole card; the source pills sit above it */
.card-link {
  color: inherit;
  text-decoration: none;
}

.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.publication-sources {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.publication-arrow {
  color: var(--text-muted);
  font-size: 18px;
  transition: color var(--transition-medium);
}

.publication-card:hover .publication-arrow {
  color: var(--accent-text);
  animation: arrow-bounce 0.6s ease infinite;
}

@keyframes arrow-bounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

/* =====================================================
   CONTACT
   ===================================================== */

.contact-content {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.contact-text {
  font-size: 20px;
  line-height: 1.8;
  margin-bottom: 50px;
}

.contact-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 50px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.contact-card:hover {
  color: var(--text-primary);
}

.contact-card .icon {
  font-size: 18px;
}

.email-card .copy-icon {
  font-size: 14px;
  color: var(--text-muted);
}

.email-card.copied .email-text {
  color: var(--ticker-color);
}

/* =====================================================
   FOOTER
   ===================================================== */

.footer {
  padding: 40px;
  text-align: center;
  background: var(--bg-primary);
  border-top: 1px solid var(--glass-border);
}

.footer-content p {
  font-size: 14px;
  color: var(--text-muted);
}

.footer-note {
  margin-top: 8px;
  font-size: 13px;
}

.heart {
  display: inline-block;
  animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
  0%, 50%, 100% { transform: scale(1); }
  25% { transform: scale(1.1); }
  75% { transform: scale(1.2); }
}

/* =====================================================
   SIDE NAVIGATION (wide screens only, where it can't cover the content)
   ===================================================== */

.side-nav {
  position: fixed;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
}

.side-nav-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

/* Guide line */
.side-nav-list::before,
.side-nav-list::after {
  content: '';
  position: absolute;
  top: 14px;
  right: 5px;
  width: 2px;
  border-radius: 2px;
}

.side-nav-list::before {
  height: calc(100% - 28px);
  background: var(--side-guide);
}

/* Progress line */
.side-nav-list::after {
  height: var(--scroll-progress, 0%);
  max-height: calc(100% - 28px);
  background: var(--gradient-primary);
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.6);
  z-index: 1;
}

.side-nav-item {
  position: relative;
}

.side-nav-link {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-decoration: none;
  padding: 8px 0;
  position: relative;
}

.side-nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--text-muted);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.side-nav-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient-primary);
  opacity: 0.3;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.3s ease;
}

.side-nav-label {
  position: absolute;
  right: 24px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 1px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.side-nav-link:hover .side-nav-label,
.side-nav-link:focus-visible .side-nav-label {
  opacity: 1;
  transform: none;
}

.side-nav-link:hover .side-nav-dot {
  border-color: var(--accent-1);
}

.side-nav-item.active .side-nav-dot {
  background: var(--accent-1);
  border-color: var(--accent-1);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.side-nav-item.active .side-nav-dot::before {
  transform: translate(-50%, -50%) scale(1);
  animation: pulse-ring 2s ease-out infinite;
}

.side-nav-item.active .side-nav-label {
  color: var(--accent-text);
  opacity: 1;
  transform: none;
}

.side-nav-item.passed .side-nav-dot {
  background: var(--side-passed);
  border-color: var(--side-passed-border);
}

@keyframes pulse-ring {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

@media (max-width: 1399px) {
  .side-nav {
    display: none;
  }
}

/* =====================================================
   SCROLL REVEAL (site.js adds .js to <html>; without it everything stays visible)
   ===================================================== */

.js [data-reveal] {
  opacity: 0;
}

.js [data-reveal].is-shown {
  opacity: 1;
}

.js [data-reveal].is-visible {
  opacity: 1;
  animation: reveal 0.7s cubic-bezier(0.2, 0.65, 0.3, 1) var(--reveal-delay, 0s) both;
}

@keyframes reveal {
  from { opacity: 0; translate: 0 24px; }
  to { opacity: 1; translate: none; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-links {
    gap: 28px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 80px;
    --nav-height: 74px;
  }

  .hamburger {
    display: flex;
  }

  .nav-container {
    position: static;
    padding: 0 20px;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 10px 20px 20px;
    background: var(--menu-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility 0s linear var(--transition-fast);
  }

  .navbar.menu-open .nav-links {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility 0s;
  }

  .nav-links li {
    border-bottom: 1px solid var(--glass-border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 15px 0;
    font-size: 16px;
  }

  .nav-links a::after {
    display: none;
  }

  .section {
    padding: var(--section-padding) 20px;
  }

  .hero {
    padding: 100px 20px 60px;
  }

  .hero-image {
    width: 150px;
    height: 150px;
  }

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

  .travel-note {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 25px;
  }

  .travel-note p {
    font-size: 14px;
  }

  .timeline {
    padding-left: 30px;
  }

  .timeline::before {
    left: 5px;
  }

  .timeline-marker {
    left: -30px;
    width: 14px;
    height: 14px;
  }

  .timeline-marker-inner {
    width: 6px;
    height: 6px;
  }

  .timeline-content {
    padding: 20px;
  }

  .timeline-header {
    flex-direction: column;
  }

  .timeline-title {
    font-size: 18px;
  }

  .doc-link-group {
    align-items: flex-start;
  }

  .doc-link-group > .icon {
    margin-top: 5px;
  }

  .publication-card {
    flex-direction: column;
    text-align: center;
    padding: 25px;
  }

  .publication-sources {
    justify-content: center;
  }

  .publication-arrow {
    display: none;
  }

  .contact-cards {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .name {
    font-size: 36px;
  }

  .about-stats {
    gap: 15px;
  }

  .stat-card {
    padding: 20px;
  }

  .stat-number {
    font-size: 32px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */

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

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

  .gradient-sphere,
  .hero-image-glow,
  .social-link,
  .timeline-marker-inner,
  .heart {
    animation: none !important;
  }

  .scroll-indicator {
    animation: none;
    opacity: 1;
  }
}

/* =====================================================
   PRINT
   ===================================================== */

@media print {
  .bg-animation,
  .navbar,
  .scroll-progress,
  .side-nav,
  .scroll-indicator,
  .hero-cta,
  .hero-social,
  .hero-image-glow,
  .cursor-glow,
  .skip-link {
    display: none !important;
  }

  :root,
  [data-theme="light"] {
    --text-primary: #000;
    --text-secondary: #222;
    --text-muted: #555;
    --accent-text: #2b3aa8;
  }

  body {
    background: #fff;
  }

  .hero {
    min-height: 0;
    padding: 0 0 24px;
  }

  .section {
    padding: 24px 0;
  }

  .section-alt {
    background: none;
  }

  .glass-card {
    box-shadow: none;
    border-color: #ddd;
    break-inside: avoid;
  }

  .js [data-reveal] {
    opacity: 1 !important;
    animation: none !important;
  }
}
