/* =====================
   MATERIAL DESIGN 3 TOKENS — DARK (default)
   ===================== */
:root {
  /* Primary — vivid blue */
  --primary: #60a5fa;
  --on-primary: #0a1929;
  --primary-container: #1e3a5f;
  --on-primary-container: #bfdbfe;

  /* Secondary */
  --secondary-container: #1e3352;
  --on-secondary-container: #bfdbfe;

  /* Surface scale — dark navy */
  --background: #0c0f16;
  --surface-container-low:     #131720;
  --surface-container:         #181c27;
  --surface-container-high:    #1f2436;
  --surface-container-highest: #252b3a;

  /* On surface */
  --on-surface:         #e2e8f0;
  --on-surface-variant: #94a3b8;

  /* Outline */
  --outline:         #4a5568;
  --outline-variant: #2d3748;

  /* State layers */
  --state-hover:   rgba(96, 165, 250, 0.08);
  --state-pressed: rgba(96, 165, 250, 0.14);

  /* Elevation shadows */
  --elev-1: 0 1px 2px rgba(0,0,0,.5),  0 1px 4px 1px rgba(0,0,0,.3);
  --elev-2: 0 2px 4px rgba(0,0,0,.4),  0 2px 8px 2px rgba(0,0,0,.25);
  --elev-3: 0 4px 12px 3px rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.4);

  /* Layout */
  --nav-rail-width:    88px;
  --top-bar-height:    64px;
  --bottom-nav-height: 80px;

  /* Shape */
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   28px;
  --r-full: 9999px;

  /* Motion */
  --ease-std: cubic-bezier(0.2, 0, 0, 1);
  --dur-s: 150ms;
  --dur-m: 280ms;
  --dur-l: 450ms;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.light-mode {
  --primary: #1d4ed8;
  --on-primary: #ffffff;
  --primary-container: #dbeafe;
  --on-primary-container: #1e3a5f;

  --secondary-container: #dbeafe;
  --on-secondary-container: #1e3a5f;

  --background: #f8fafc;
  --surface-container-low:     #f1f5f9;
  --surface-container:         #e8eef5;
  --surface-container-high:    #dde5ef;
  --surface-container-highest: #d1dce8;

  --on-surface:         #0f172a;
  --on-surface-variant: #475569;
  --outline:         #94a3b8;
  --outline-variant: #cbd5e1;

  --state-hover:   rgba(29, 78, 216, 0.06);
  --state-pressed: rgba(29, 78, 216, 0.10);

  --elev-1: 0 1px 2px rgba(0,0,0,.08), 0 1px 4px 1px rgba(0,0,0,.05);
  --elev-2: 0 2px 4px rgba(0,0,0,.07), 0 2px 8px 2px rgba(0,0,0,.04);
  --elev-3: 0 4px 12px 3px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.07);
}

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

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

body {
  font-family: var(--font);
  background: var(--background);
  color: var(--on-surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

::selection { background: var(--primary-container); color: var(--on-primary-container); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--outline-variant); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline); }

/* =====================
   AMBIENT BACKGROUND
   ===================== */
.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 50% at 55% -5%, rgba(96, 165, 250, 0.09) 0%, transparent 65%),
    radial-gradient(ellipse 35% 35% at 95% 90%, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
}

body.light-mode .bg-ambient {
  background:
    radial-gradient(ellipse 65% 50% at 55% -5%, rgba(29, 78, 216, 0.07) 0%, transparent 65%),
    radial-gradient(ellipse 35% 35% at 95% 90%, rgba(99, 102, 241, 0.04) 0%, transparent 60%);
}

/* =====================
   SOCIAL SIDEBAR
   ===================== */
.social-sidebar {
  position: fixed;
  right: 28px;
  bottom: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.social-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
  font-size: 1.1rem;
  border-radius: var(--r-md);
  text-decoration: none;
  transition:
    color var(--dur-s) var(--ease-std),
    transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1),
    background var(--dur-s);
  opacity: 0;
  animation: sidebarItemIn 0.5s var(--ease-std) forwards;
}

.social-btn:nth-child(1) { animation-delay: 0.7s; }
.social-btn:nth-child(2) { animation-delay: 0.85s; }
.social-btn:nth-child(3) { animation-delay: 1.0s; }

@keyframes sidebarItemIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.social-btn:hover {
  color: var(--primary);
  background: var(--state-hover);
  transform: translateY(-4px);
}

/* Tooltip */
.social-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  padding: 5px 10px;
  background: var(--surface-container-highest);
  color: var(--on-surface);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-s), transform var(--dur-s);
  box-shadow: var(--elev-1);
}

.social-btn:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.social-sidebar-line {
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, var(--outline-variant), transparent);
  margin-top: 4px;
  opacity: 0;
  animation: lineGrow 0.5s var(--ease-std) 1.15s forwards;
  transform-origin: top;
}

@keyframes lineGrow {
  from { opacity: 0; transform: scaleY(0); }
  to   { opacity: 1; transform: scaleY(1); }
}

@media (max-width: 768px) {
  .social-sidebar { display: none; }
}

/* =====================
   ICON BUTTON
   ===================== */
.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-s) var(--ease-std), color var(--dur-s);
  flex-shrink: 0;
  text-decoration: none;
}
.icon-btn:hover  { background: var(--state-hover); color: var(--on-surface); }
.icon-btn:active { background: var(--state-pressed); }

/* =====================
   NAVIGATION RAIL (desktop) — floating card
   ===================== */
.nav-rail {
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 72px;
  max-height: calc(100svh - 32px);
  z-index: 200;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: 28px;
  box-shadow: var(--elev-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 10px;
  overflow: hidden;
}


.nav-rail-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 4px 0;
}

.nav-rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  padding: 4px 0;
  cursor: pointer;
  color: var(--on-surface-variant);
  text-decoration: none;
  transition: color var(--dur-s) var(--ease-std);
}

.nav-indicator {
  width: 40px;
  height: 32px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition:
    background var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1),
    width var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-indicator i {
  transition: transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-rail-item:hover .nav-indicator        { background: var(--state-hover); width: 56px; }
.nav-rail-item:hover .nav-indicator i      { transform: scale(1.2); }
.nav-rail-item:active .nav-indicator       { background: var(--state-pressed); }
.nav-rail-item.active                      { color: var(--on-primary-container); }
.nav-rail-item.active .nav-indicator       { background: var(--primary-container); width: 56px; }
.nav-rail-item.active .nav-indicator i     { transform: scale(1.15); }

.nav-rail-item span {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.4px;
  line-height: 1;
}

/* =====================
   TOP APP BAR (mobile only)
   ===================== */
.top-app-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--top-bar-height);
  background: var(--surface-container-low);
  border-bottom: 1px solid var(--outline-variant);
  align-items: center;
  padding: 0 4px 0 16px;
  gap: 4px;
}

.top-app-bar-title {
  flex: 1;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--on-surface);
  letter-spacing: -0.3px;
}


/* =====================
   BOTTOM NAVIGATION BAR (mobile only) — floating pill
   ===================== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 420px;
  z-index: 200;
  height: 64px;
  background: rgba(24, 28, 39, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--outline-variant);
  border-radius: 24px;
  box-shadow: var(--elev-3);
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
}

body.light-mode .bottom-nav {
  background: rgba(232, 238, 245, 0.82);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--on-surface-variant);
  text-decoration: none;
  flex: 1;
  transition: color var(--dur-s) var(--ease-std);
}

.bottom-indicator {
  width: 40px;
  height: 30px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  transition:
    background var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1),
    width var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-indicator i {
  transition: transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-nav-item.active .bottom-indicator      { background: var(--primary-container); width: 56px; }
.bottom-nav-item.active .bottom-indicator i    { transform: scale(1.15); }
.bottom-nav-item:hover .bottom-indicator i     { transform: scale(1.1); }
.bottom-nav-item.active { color: var(--on-primary-container); }

.bottom-nav-item span {
  font-size: 0.625rem;
  font-weight: 500;
}

/* =====================
   LAYOUT
   ===================== */
.main { margin-left: 96px; /* floating nav (72px) + 12px gap + 12px breathing */ }

.section {
  padding: 80px 72px 80px 56px; /* extra right padding clears social sidebar */
  max-width: 1240px;
  margin: 0 auto;
}

.hero-section {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
}

/* =====================
   TYPOGRAPHY
   ===================== */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--on-surface);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 1.6em;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--on-surface-variant);
  margin-bottom: 40px;
  padding-left: 16px;
}

.subsection-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 16px;
}

/* =====================
   HERO
   ===================== */
.hero-layout {
  display: flex;
  align-items: center;
  gap: 64px;
  max-width: 920px;
}

.hero-photo-wrap {
  flex-shrink: 0;
  position: relative;
}

.hero-photo {
  width: 192px;
  height: 192px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--outline-variant);
  display: block;
  position: relative;
  z-index: 1;
}

/* Subtle glow ring behind photo */
.hero-photo-wrap::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.15), transparent 70%);
  z-index: 0;
  pointer-events: none;
  animation: glow-pulse 4s ease-in-out infinite;
}

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

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--r-full);
  width: fit-content;
  letter-spacing: 0.2px;
}

.hero-name {
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, var(--on-surface) 40%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-bio {
  font-size: 1.0625rem;
  color: var(--on-surface-variant);
  line-height: 1.75;
  max-width: 460px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.hero-social {
  display: flex;
  gap: 4px;
}

/* Buttons */
.btn-filled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--r-full);
  border: none;
  cursor: pointer;
  transition: filter var(--dur-s) var(--ease-std), box-shadow var(--dur-s), transform var(--dur-s);
  text-decoration: none;
}
.btn-filled:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 24px rgba(96, 165, 250, 0.35);
  transform: translateY(-2px);
}
.btn-filled:active { filter: brightness(0.9); transform: translateY(1px) scale(0.97); box-shadow: none; }

.btn-tonal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--r-full);
  border: none;
  cursor: pointer;
  transition: filter var(--dur-s) var(--ease-std), transform var(--dur-s), box-shadow var(--dur-s);
  text-decoration: none;
}
.btn-tonal:hover  { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(96, 165, 250, 0.2); }
.btn-tonal:active { filter: brightness(0.96); transform: translateY(1px) scale(0.97); box-shadow: none; }

/* =====================
   ABOUT
   ===================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 32px;
}

.about-bio {
  font-size: 1rem;
  color: var(--on-surface-variant);
  line-height: 1.8;
  margin-bottom: 24px;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-container);
  border-radius: var(--r-md);
  transition: background var(--dur-s) var(--ease-std), transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.detail-item:hover {
  background: var(--surface-container-high);
  transform: translateX(4px);
}

.detail-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  flex-shrink: 0;
  transition: transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.detail-item:hover .detail-icon-wrap {
  transform: scale(1.12) rotate(-8deg);
}

.detail-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.detail-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.detail-value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--on-surface);
}

.interests-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.interest-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-container);
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
  transition: background var(--dur-s) var(--ease-std), transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow var(--dur-m);
}

/* Diagonal shine sweep on hover */
.interest-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.04) 50%, transparent 70%);
  transition: left 0.7s var(--ease-std);
  pointer-events: none;
}
.interest-card:hover::before { left: 160%; }

.interest-card:hover {
  background: var(--surface-container-high);
  transform: translateY(-6px) rotate(-2deg);
  box-shadow: 0 8px 24px rgba(0,0,0,.2), var(--elev-1);
}
.interest-card:nth-child(even):hover {
  transform: translateY(-6px) rotate(2deg);
}

.interest-card i {
  font-size: 1.125rem;
  color: var(--primary);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.interest-card:hover i {
  transform: scale(1.35) rotate(-12deg);
}

.interest-card h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: 2px;
}

.interest-card p {
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
}

/* =====================
   SKILLS
   ===================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px 16px;
  background: var(--surface-container);
  border-radius: var(--r-md);
  cursor: default;
  border: 1px solid transparent;
  transition:
    background var(--dur-s) var(--ease-std),
    border-color var(--dur-m),
    transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.skill-item:hover {
  background: var(--surface-container-high);
  border-color: var(--primary-container);
  transform: translateY(-6px) rotate(-2deg);
  box-shadow: 0 8px 24px rgba(96, 165, 250, 0.12), var(--elev-1);
}
.skill-item:nth-child(even):hover {
  transform: translateY(-6px) rotate(2deg);
}

.skill-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  transition: transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.skill-item:hover img { transform: scale(1.12); }

.skill-item span {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: center;
}

/* =====================
   PROJECTS CAROUSEL
   ===================== */
.projects-carousel-wrap {
  position: relative;
  margin-top: 32px;
}

/* right-edge fade — hints there's more content */
.projects-carousel-wrap::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 72px;
  background: linear-gradient(to left, var(--background) 10%, transparent 100%);
  pointer-events: none;
  transition: opacity var(--dur-m) var(--ease-std);
  z-index: 2;
}
.projects-carousel-wrap.at-end::after { opacity: 0; }

/* left-edge fade — appears once user has scrolled */
.projects-carousel-wrap::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 72px;
  background: linear-gradient(to right, var(--background) 10%, transparent 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-m) var(--ease-std);
  z-index: 2;
}
.projects-carousel-wrap.scrolled::before { opacity: 1; }

.projects-track {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 32px) / 3); /* 3 cols × 2 rows = 6 visible */
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 20px 4px; /* vertical room so tilt transform isn't clipped by overflow-y */
}
.projects-track::-webkit-scrollbar { display: none; }

.proj-nav-btn {
  position: absolute;
  top: calc(50% - 20px);
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--elev-2);
  transition:
    opacity var(--dur-m) var(--ease-std),
    background var(--dur-s),
    color var(--dur-s),
    transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.proj-nav-btn.visible { opacity: 1; pointer-events: auto; }
.proj-nav-prev { left: -20px; }
.proj-nav-next { right: -20px; }
.proj-nav-btn:hover {
  background: var(--surface-container-highest);
  color: var(--primary);
  transform: scale(1.1);
}
.proj-nav-btn:active { transform: scale(0.95); }

.project-card {
  background: var(--surface-container);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  /* clip-path instead of overflow:hidden — rotates with the card, not the parent axes */
  clip-path: inset(0 round var(--r-lg));
  transition:
    background var(--dur-s) var(--ease-std),
    transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Diagonal shine sweep on hover */
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.04) 50%, transparent 70%);
  transition: left 0.7s var(--ease-std);
  pointer-events: none;
}
.project-card:hover::before { left: 160%; }

.project-card:hover {
  background: var(--surface-container-high);
  transform: translateY(-6px) rotate(-2deg);
}
.project-card:nth-child(even):hover {
  transform: translateY(-6px) rotate(2deg);
}

/* Description line-clamp for consistent card height */
.project-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.project-links { display: flex; gap: 4px; }

.project-link {
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-s), color var(--dur-s);
}
.project-link:hover { background: var(--state-hover); color: var(--primary); }

.project-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.3;
}

.project-card p {
  font-size: 0.875rem;
  color: var(--on-surface-variant);
  line-height: 1.6;
  flex: 1;
}

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.project-tag {
  padding: 4px 10px;
  background: var(--surface-container-highest);
  color: var(--on-surface-variant);
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--r-full);
  letter-spacing: 0.3px;
}

/* =====================
   CERTIFICATIONS
   ===================== */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.cert-card {
  background: var(--surface-container);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition:
    background var(--dur-s) var(--ease-std),
    transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow var(--dur-m);
}
.cert-card:hover {
  background: var(--surface-container-high);
  transform: translateY(-6px) rotate(-2deg);
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
}
.cert-card:nth-child(even):hover {
  transform: translateY(-6px) rotate(2deg);
}

/* Diagonal shine sweep on hover */
.cert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.04) 50%, transparent 70%);
  transition: left 0.7s var(--ease-std);
  pointer-events: none;
}
.cert-card:hover::before { left: 160%; }

.cert-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cert-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--surface-container-high);
  color: var(--cert-color, var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.cert-card-info { flex: 1; min-width: 0; }

.cert-card-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.3;
  margin-bottom: 3px;
}

.cert-card-issuer {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--cert-color, var(--primary));
}

.cert-card-date {
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  white-space: nowrap;
  flex-shrink: 0;
}

.cert-pills { display: flex; flex-wrap: wrap; gap: 4px; }

.cert-pill {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--r-full);
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
}

/* =====================
   CONTACT
   ===================== */
.contact-inner { max-width: 560px; }

/* Contact card — groups items in a bordered container */
.contact-card {
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.contact-list {
  display: flex;
  flex-direction: column;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: transparent;
  border-bottom: 1px solid var(--outline-variant);
  text-decoration: none;
  transition:
    background var(--dur-s) var(--ease-std),
    transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.contact-item:last-child { border-bottom: none; }
.contact-item:hover {
  background: var(--state-hover);
  transform: translateX(4px);
}

.contact-item-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: transform var(--dur-m) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.contact-item:hover .contact-item-icon {
  transform: scale(1.12) rotate(-6deg);
}

.primary-icon  { background: var(--primary-container);  color: var(--on-primary-container); }
.whatsapp-icon { background: #1a4731; color: #6ee7b7; }

/* Hardened: min-width: 0 allows text-overflow to work inside flex */
.contact-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-item-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Hardened: long email/phone addresses truncate instead of overflowing */
.contact-item-value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-chevron {
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  flex-shrink: 0;
  transition: transform var(--dur-m) var(--ease-std), color var(--dur-s);
}
.contact-item:hover .contact-chevron {
  transform: translateX(3px);
  color: var(--primary);
}

/* Response time footer inside the card */
.contact-response {
  padding: 12px 20px;
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--outline-variant);
}

/* Social section below the card */
.contact-social-wrap {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-social-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.contact-social {
  display: flex;
  gap: 4px;
}

/* =====================
   FOOTER
   ===================== */
.site-footer {
  padding: 24px 56px 48px;
  max-width: 1240px;
  margin: 0 auto;
  border-top: 1px solid var(--outline-variant);
}

.site-footer p {
  font-size: 0.875rem;
  color: var(--on-surface-variant);
}

/* =====================
   REVEAL ANIMATION
   ===================== */
.section-inner {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.5s var(--ease-std), transform 0.5s var(--ease-std);
}

.reveal {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}

.section-title::before {
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}

.section-inner.reveal .section-title::before {
  transform: scaleY(1);
}

/* =====================
   HERO CHILD STAGGER
   ===================== */
.hero-photo-wrap,
.hero-badge,
.hero-name,
.hero-bio,
.hero-actions,
.hero-social { opacity: 0; }

@keyframes heroFadeUp {
  from { opacity: 0; translate: 0 22px; }
  to   { opacity: 1; translate: 0 0; }
}

.hero-layout.reveal .hero-photo-wrap { animation: heroFadeUp 0.6s var(--ease-std) 0.00s forwards; }
.hero-layout.reveal .hero-badge      { animation: heroFadeUp 0.5s var(--ease-std) 0.14s forwards; }
.hero-layout.reveal .hero-name       { animation: heroFadeUp 0.6s var(--ease-std) 0.24s forwards; }
.hero-layout.reveal .hero-bio        { animation: heroFadeUp 0.5s var(--ease-std) 0.34s forwards; }
.hero-layout.reveal .hero-actions    { animation: heroFadeUp 0.5s var(--ease-std) 0.44s forwards; }
.hero-layout.reveal .hero-social     { animation: heroFadeUp 0.4s var(--ease-std) 0.54s forwards; }

/* =====================
   STAGGER CARDS (skills, certs, interests, projects)
   ===================== */
@keyframes cardIn {
  from { opacity: 0; translate: 0 18px; }
  to   { opacity: 1; translate: 0 0; }
}

.stagger-card {
  opacity: 0;
  animation: cardIn 0.45s var(--ease-std) var(--stagger-delay, 0ms) both;
  animation-play-state: paused;
}

.stagger-card.play {
  animation-play-state: running;
}

/* =====================
   SKELETON LOADER
   ===================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-container) 25%,
    var(--surface-container-high) 50%,
    var(--surface-container) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-md);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =====================
   REDUCED MOTION
   ===================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .section-inner,
  .hero-photo-wrap, .hero-badge, .hero-name, .hero-bio, .hero-actions, .hero-social,
  .social-btn, .social-sidebar-line,
  .stagger-card { opacity: 1 !important; transform: none !important; animation: none !important; }
  .hero-photo-wrap::after { animation: none; }
  .section-title::before { transform: none; }
}

/* =====================
   RESPONSIVE — TABLET
   ===================== */
@media (max-width: 1024px) {
  .section      { padding: 64px 60px 64px 40px; }
  .site-footer  { padding: 24px 40px 48px; }
  .hero-layout  { gap: 40px; }
  .hero-photo   { width: 156px; height: 156px; }
  .social-sidebar { right: 12px; }
  .projects-track { grid-auto-columns: calc((100% - 16px) / 2); }
}

/* =====================
   RESPONSIVE — MOBILE
   ===================== */
@media (max-width: 768px) {
  .nav-rail    { display: none; }
  .top-app-bar { display: flex; }
  .bottom-nav  { display: flex; }

  .main {
    margin-left: 0;
    padding-top: var(--top-bar-height);
    padding-bottom: calc(64px + 24px + env(safe-area-inset-bottom, 0px));
    /* floating bottom nav height + bottom margin + safe area */
  }

  section { scroll-margin-top: var(--top-bar-height); }

  .section { padding: 48px 20px; }

  .hero-section {
    min-height: calc(100svh - var(--top-bar-height) - 64px - 24px);
    align-items: flex-start;
    padding-top: 40px;
  }

  .hero-layout {
    flex-direction: column;
    gap: 28px;
    text-align: center;
    align-items: center;
  }

  .hero-photo  { width: 136px; height: 136px; }
  .hero-badge  { margin: 0 auto; }
  .hero-bio    { margin: 0 auto; }
  .hero-actions { justify-content: center; }
  .hero-social  { justify-content: center; }
  .hero-name   { letter-spacing: -1px; }

  .about-grid { grid-template-columns: 1fr; gap: 32px; margin-top: 24px; }

  .section-title { font-size: 1.75rem; }
  .section-subtitle { padding-left: 16px; }

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

  .projects-track {
    grid-template-rows: 1fr;
    grid-auto-columns: calc(80%);
  }
  .proj-nav-btn { display: none; }

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

  .contact-inner { max-width: 100%; }

  .site-footer { padding: 24px 20px 32px; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 2.25rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn-filled, .btn-tonal { justify-content: center; width: 100%; }
  .skills-grid { grid-template-columns: repeat(3, 1fr); }
}
