/* =========================================
   Design System — Tokens
   ========================================= */

:root {
  --bg: #F4F3F0;
  --surface: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-muted: #9B9B9B;
  --divider: #E0E0E0;
  --accent: #3D5AFE;
  --accent-hover: #2A3FDB;

  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --sidebar-width: 240px;
  --content-max: 680px;
  --spacing-section: 96px;
  --spacing-inner: 40px;
  --radius-card: 28px;
  --radius-pill: 24px;
}

/* Shiny text hover effect */
@keyframes shiny-sweep {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}

.shiny-hover {
  background-image: linear-gradient(
    120deg,
    var(--text-primary) 0%,
    var(--text-primary) 35%,
    var(--accent) 50%,
    var(--text-primary) 65%,
    var(--text-primary) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: var(--text-primary);
  transition: -webkit-text-fill-color 0.3s ease;
}

.shiny-hover:hover {
  -webkit-text-fill-color: transparent;
  animation: shiny-sweep 1.5s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .shiny-hover:hover {
    -webkit-text-fill-color: var(--accent);
    animation: none;
  }
}



/* =========================================
   Reset & Base
   ========================================= */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg);
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

strong {
  font-weight: 600;
}

ul {
  list-style: none;
  padding: 0;
}

img {
  max-width: 100%;
  display: block;
}


/* =========================================
   Mobile Header
   ========================================= */

.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  transition: background 0.3s ease;
}

.mobile-logo {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: -8px;
}

.menu-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

[aria-expanded="true"] .menu-bar:first-child {
  transform: translateY(4px) rotate(45deg);
}

[aria-expanded="true"] .menu-bar:last-child {
  transform: translateY(-4px) rotate(-45deg);
}


/* =========================================
   Mobile Menu Overlay
   ========================================= */

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.mobile-menu-link {
  font-size: 24px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.mobile-menu-link:hover {
  color: var(--accent);
}

.mobile-menu-divider {
  width: 40px;
  height: 1px;
  background: var(--divider);
  margin: 8px 0;
}

.mobile-menu-link .arrow {
  font-size: 18px;
  color: var(--text-muted);
}


/* =========================================
   Sidebar (Desktop)
   ========================================= */

.sidebar {
  display: none;
}

.sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  margin-bottom: 32px;
}

.sidebar-name:hover {
  color: var(--text-primary);
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--text-primary);
}

.nav-link.external {
  color: var(--text-muted);
}

.nav-link.external:hover {
  color: var(--accent);
}

.nav-link .arrow {
  font-size: 13px;
}

.sidebar-divider {
  width: 32px;
  height: 1px;
  background: var(--divider);
  margin-bottom: 16px;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


/* =========================================
   Main Content
   ========================================= */

.content {
  padding: 80px 24px 48px;
  max-width: var(--content-max);
  margin: 0 auto;
}


/* =========================================
   Sections
   ========================================= */

.section {
  padding-top: var(--spacing-section);
}

.section--hero {
  padding-top: 0;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin-top: var(--spacing-section);
}

.section-heading {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: var(--spacing-inner);
}


/* =========================================
   Hero / About
   ========================================= */

.hero-name-wrap {
  position: relative;
  display: inline-block;
}

.hero-name {
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.shape-blur {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
}

.hero-name-wrap:hover .shape-blur {
  opacity: 0.18;
}

@media (prefers-reduced-motion: reduce) {
  .shape-blur { display: none; }
}

.hero-tagline {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.hero-location {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 40px;
}

.hero-bio {
  margin-bottom: 32px;
}

.hero-bio p {
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero-bio p:last-child {
  margin-bottom: 0;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.skill-tag {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--divider);
  white-space: nowrap;
}

.languages {
  font-size: 14px;
  color: var(--text-secondary);
}

.languages-label {
  font-weight: 600;
  color: var(--text-primary);
}

.languages-learning {
  color: var(--text-muted);
  font-style: italic;
}


/* =========================================
   Work Tiles (Homepage)
   ========================================= */

.work-tiles {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.work-tile {
  display: block;
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--divider);
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  --glow-x: 50%;
  --glow-y: 50%;
  --glow-opacity: 0;
}

.work-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: var(--glow-opacity);
  transition: opacity 0.3s ease;
  background: radial-gradient(
    400px circle at var(--glow-x) var(--glow-y),
    rgba(61, 90, 254, 0.12),
    transparent 60%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1px;
}

.work-tile:hover {
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(26, 26, 26, 0.05), 0 16px 48px rgba(26, 26, 26, 0.04);
  color: inherit;
}

.tile-illustration {
  overflow: hidden;
}

.tile-illustration img {
  width: 100%;
  height: auto;
  display: block;
}

.tile-content {
  padding: 24px;
}

.tile-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(18px, 2.5vw, 22px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.tile-summary {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.tile-cta {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

.work-tile:hover .tile-cta {
  color: var(--accent-hover);
}


/* =========================================
   Case Studies (Project Pages)
   ========================================= */

.case-study {
  margin-bottom: 0;
}

.back-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--text-primary);
}

.project-page {
  padding-top: 0;
}

.project-illustration {
  margin: 32px 0;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.project-illustration img {
  width: 100%;
  height: auto;
  display: block;
}

.project-section-heading {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  color: var(--text-primary);
  margin-top: 36px;
  margin-bottom: 12px;
}

.project-list {
  margin: 12px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-list li {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-primary);
  padding-left: 16px;
  position: relative;
}

.project-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 48px;
  margin-top: 48px;
  border-top: 1px solid var(--divider);
}

.project-nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.project-nav-link:hover {
  color: var(--accent);
}


/* =========================================
   Experience Groups
   ========================================= */

.experience-group {
  margin-bottom: 40px;
}

.experience-group:last-child {
  margin-bottom: 0;
}

.experience-group-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}


.case-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.case-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.case-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.case-body p {
  margin-bottom: 16px;
  color: var(--text-primary);
}

.case-contributions {
  margin: 28px 0;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--divider);
}

.case-contributions-label,
.case-outcome-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.case-contributions ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-contributions li {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-primary);
  padding-left: 16px;
  position: relative;
}

.case-contributions li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.case-outcome {
  margin-top: 28px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--divider);
}

.case-outcome p:last-child {
  margin-bottom: 0;
}

.case-outcome ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.case-outcome li {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-primary);
  padding-left: 16px;
  position: relative;
}

.case-outcome li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.case-divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 56px 0;
}

/* Case study figures */

.case-figure {
  margin: 32px 0;
}

.case-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--divider);
}

.case-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* Mobile screen figures (narrower, side by side) */

.case-figure--mobile {
  margin: 0;
}

.case-figure--mobile img {
  border-radius: 16px;
  border: 1px solid var(--divider);
  background: var(--surface);
}

.case-figure-group {
  margin: 32px 0;
  display: flex;
  gap: 16px;
  align-items: start;
}

.case-figure-group .case-figure--mobile {
  flex: 1 1 0;
  min-width: 0;
  cursor: pointer;
}

.case-figure-group .case-figure--mobile img {
  width: 100%;
  height: auto;
  transition: opacity 0.2s ease;
}

.case-figure-group .case-figure--mobile:hover img {
  opacity: 0.85;
}

/* Research figures (wider than mobile screenshots) */
.case-figure--research {
  margin: 0;
  flex: 1 1 100%;
}

.case-figure--research img {
  border-radius: var(--radius-card);
  border: 1px solid var(--divider);
  background: var(--surface);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.case-figure--research:hover img {
  opacity: 0.85;
}

/* Lightbox overlay */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(26, 26, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: pointer;
}

.lightbox-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
  transform: scale(0.95);
}

.lightbox-overlay.is-open .lightbox-img {
  transform: scale(1);
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-btn--prev { left: 20px; }
.lightbox-btn--next { right: 20px; }

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  font-family: var(--font-sans);
}



/* =========================================
   Experience Timeline
   ========================================= */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--divider);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-date {
  font-size: 14px;
  color: var(--text-muted);
  min-width: 110px;
  flex-shrink: 0;
  padding-top: 2px;
}

.timeline-content {
  flex: 1;
}

.timeline-role {
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 2px;
}

.timeline-company {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.timeline-divider {
  height: 1px;
  background: var(--divider);
  margin: 8px 0;
  opacity: 0.5;
}


/* =========================================
   Contact
   ========================================= */

.contact-text {
  font-size: 17px;
  color: var(--text-primary);
  margin-bottom: 32px;
  max-width: 520px;
}

.contact-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 32px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cta-button:hover {
  background: var(--accent-hover);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.contact-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-link:hover {
  color: var(--accent);
}

.contact-link .arrow {
  font-size: 13px;
}

.contact-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}



/* =========================================
   Footer
   ========================================= */

.footer {
  padding: 48px 0 0;
  margin-top: var(--spacing-section);
}

.footer p {
  font-size: 13px;
  color: var(--text-muted);
}


/* =========================================
   Responsive — Tablet (768px+)
   ========================================= */

@media (min-width: 768px) {
  .content {
    padding: 80px 48px 48px;
    max-width: 720px;
  }

  .timeline-item {
    gap: 32px;
  }

  .timeline-date {
    min-width: 130px;
  }
}


/* =========================================
   Responsive — Desktop (1024px+)
   ========================================= */

@media (min-width: 1024px) {
  .mobile-header {
    display: none;
  }

  .sidebar {
    display: block;
  }

  .content {
    margin-left: var(--sidebar-width);
    padding: 48px 48px 48px 80px;
    max-width: calc(var(--content-max) + 80px + 48px);
  }

  .section--hero {
    padding-top: 0;
  }

  .hero-name {
    font-size: 64px;
  }
}


/* =========================================
   Reduced Motion
   ========================================= */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cta-button:hover {
    transform: none;
  }
}


/* =========================================
   Print
   ========================================= */

@media print {
  .sidebar,
  .mobile-header,
  .mobile-menu {
    display: none;
  }

  .content {
    margin: 0;
    padding: 0;
    max-width: 100%;
  }


  .cta-button {
    color: var(--accent);
    background: none;
    border: 1px solid var(--accent);
  }
}
