* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #262626;
  --secondary-color: #8a8a8a;
  --accent-color: #4a90e2;
  --background: #f4f4f4;
  --header-foreground: #161616;
  --surface: #ffffff;
  --surface-strong: #f1f1f1;
  --text-color: #161616;
  --muted: #6f6f6f;
  --border: rgba(22, 22, 22, 0.08);
  --header-bg: linear-gradient(135deg, rgba(39, 39, 39, 0.8) 0%, rgba(74, 144, 226, 0.20) 50%, rgba(117, 117, 117, 0.8) 100%);
  --headline-color: var(--header-foreground);
  --chip-bg: rgba(74, 144, 226, 0.12);
  --photo-bg: linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
  --toggle-bg: rgba(255, 255, 255, 0.18);
  --toggle-border: rgba(255, 255, 255, 0.28);
  --toggle-text: white;
  /* ripple defaults for light theme */
  --ripple-1: rgba(74, 144, 226, 0.28);
  --ripple-2: rgba(74, 144, 226, 0.14);
  --ripple-size-1: 60vmax;
  --ripple-size-2: 40vmax;
  --ripple-blur-1: 28px;
  --ripple-blur-2: 40px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  background-color: var(--background);
  line-height: 1.7;
}

/* Rippling abstract background using a dedicated element (.bg-ripples) */
.bg-ripples,
.bg-ripples::before,
.bg-ripples::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-ripples::before,
.bg-ripples::after {
  content: "";
  display: block;
  mix-blend-mode: screen;
}

.bg-ripples::before {
  background: radial-gradient(circle at 30% 25%, var(--ripple-1) 0%, transparent 35%);
  background-size: var(--ripple-size-1) var(--ripple-size-1);
  filter: blur(var(--ripple-blur-1));
  opacity: 1;
  transform-origin: center;
  animation: rippleMoveA 20s ease-in-out infinite;
}

.bg-ripples::after {
  background: radial-gradient(circle at 70% 75%, var(--ripple-2) 0%, transparent 32%);
  background-size: var(--ripple-size-2) var(--ripple-size-2);
  filter: blur(var(--ripple-blur-2));
  opacity: 0.95;
  transform-origin: center;
  animation: rippleMoveB 28s ease-in-out infinite;
}

@keyframes rippleMoveA {
  0% { transform: translate(-4%, -4%) scale(0.96); opacity: 1; }
  50% { transform: translate(6%, 6%) scale(1.06); opacity: 0.55; }
  100% { transform: translate(-4%, -4%) scale(0.96); opacity: 1; }
}

@keyframes rippleMoveB {
  0% { transform: translate(5%, -5%) scale(1.02); opacity: 0.95; }
  50% { transform: translate(-6%, 6%) scale(0.94); opacity: 0.5; }
  100% { transform: translate(5%, -5%) scale(1.02); opacity: 0.95; }
}

/* Ensure content stacks above ripples */
.page-header,
main,
footer {
  position: relative;
  z-index: 2;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bg-ripples::before,
  .bg-ripples::after {
    animation: none !important;
    opacity: 0.7;
  }
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, 100% - 40px);
  margin: 0 auto;
}

.page-header {
  background: var(--header-bg);
  color: var(--header-foreground);
  padding: 56px 0 48px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 0 10px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-bg);
  color: var(--toggle-text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
  font-family: inherit;
  line-height: 1;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  transform: translateZ(0);
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
  outline: none;
  border-color: rgba(255, 255, 255, 0.42);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 28px;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--photo-bg);
  border: 2px solid rgba(255,255,255,0.25);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.17);
  display: grid;
  place-items: center;
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -2px;
  color: white;
}

.profile-photo span {
  width: 100%;
  height: 100%;
  display: block;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  opacity: 0.95;
  font-size: 0.8rem;
  margin-bottom: 18px;
  color: var(--header-foreground);
  text-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

h1 {
  font-size: clamp(2.8rem, 3vw, 4rem);
  margin-bottom: 16px;
  line-height: 1.05;
}

.headline {
  max-width: 680px;
  font-size: 1.1rem;
  color: var(--headline-color);
  margin-bottom: 24px;
}

.contact-pill {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: rgba(74, 144, 226, 0.08);
  border: 1px solid rgba(74, 144, 226, 0.18);
  border-radius: 999px;
  font-size: 0.95rem;
  color: inherit;
  text-decoration: none;
}

.contact-pill:hover,
.contact-pill:focus-visible {
  text-decoration: none;
}

main {
  padding: 64px 0 48px;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.05);
  padding: 42px;
  margin-bottom: 32px;
}

.summary-card {
  display: grid;
  gap: 22px;
}

.section-card h2 {
  color: var(--primary-color);
  font-size: 1.85rem;
  margin-bottom: 18px;
}

.section-card p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.section-card a {
  color: var(--accent-color);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 160ms ease, opacity 160ms ease;
}

.section-card a:hover,
.section-card a:focus-visible {
  color: var(--primary-color);
  opacity: 0.88;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.skill-list span {
  background: rgba(74, 144, 226, 0.12);
  color: var(--primary-color);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.timeline {
  display: grid;
  gap: 24px;
}

.timeline-item {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 22px;
  background: var(--surface-strong);
  border: 1px solid rgba(74, 144, 226, 0.12);
}

.timeline-year {
  color: var(--accent-color);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.84rem;
}

.timeline-content h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.meta {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.chip-grid span {
  background: var(--chip-bg);
  color: var(--primary-color);
  padding: 16px 22px;
  border-radius: 14px;
  font-weight: 600;
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 56px;
  text-align: center;
}

.contact-card .contact-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.contact-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.contact-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--accent-color);
  color: white;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, opacity 180ms ease;
  position: relative;
}

.contact-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.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;
}

.contact-link-button:hover,
.contact-link-button:focus-visible {
  transform: translateY(-1px);
  opacity: 0.92;
}

.contact-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.footer-inner {
  padding: 28px 10px;
}

footer {
  background: var(--footer-bg, #e6e6e6);
  color: var(--footer-text, #161616);
  text-align: center;
}

footer p {
  font-size: 0.95rem;
  opacity: 0.88;
}

.dark-mode {
  --primary-color: #e8e8e8;
  --footer-bg: #1f1f1f;
  --footer-text: #ffffff;
  --secondary-color: #c6c6c6;
  --accent-color: #b0b0b0;
  --background: #121212;
  --header-foreground: #ffffff;
  --surface: #1b1b1b;
  --surface-strong: #242424;
  --text-color: #f1f1f1;
  --muted: #9a9a9a;
  --border: rgba(255, 255, 255, 0.1);
  --header-bg: linear-gradient(135deg, rgba(18, 18, 18, 0.8) 0%, rgba(68, 68, 68, 0.8) 100%);
  --headline-color: rgba(255, 255, 255, 0.9);
  --chip-bg: rgba(255, 255, 255, 0.08);
  /* ripple overrides for dark theme (stronger so visible on near-black) */
  --ripple-1: rgba(255, 255, 255, 0.22);
  --ripple-2: rgba(255, 255, 255, 0.12);
  --ripple-size-1: 72vmax;
  --ripple-size-2: 52vmax;
  --ripple-blur-1: 40px;
  --ripple-blur-2: 54px;
  --photo-bg: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  --toggle-bg: rgba(255, 255, 255, 0.12);
  --toggle-border: rgba(255, 255, 255, 0.18);
  --toggle-text: #edf2ff;
}

/* make ripples clearly visible in dark mode */
.dark-mode .bg-ripples::before,
.dark-mode .bg-ripples::after {
  mix-blend-mode: screen;
  opacity: 1;
}

@media (max-width: 900px) {
  .header-inner,
  .two-column,
  .contact-card .contact-details {
    grid-template-columns: 1fr;
  }

  .profile-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .page-header {
    padding: 42px 0 32px;
  }

  .section-card {
    padding: 28px;
  }

  .profile-photo {
    width: 168px;
    height: 168px;
  }

  .contact-pill {
    padding: 12px 14px;
    font-size: 0.88rem;
  }
}
