/*
|=============================================================================|
              CSS Stylesheet for Personal Portfolio Website
              Clean light layout with blue accents
|=============================================================================|
*/

/* ===== FONTS ===== */
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ===== CSS VARIABLES ===== */
:root {
  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f6f8;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-elevated: #ffffff;
  --bg-ink: #141413;
  --bg-icon: #eff3ff;

  /* Borders */
  --border-primary: #e0e4e8;
  --border-secondary: #c8ced6;
  --border-strong: #141413;

  /* Text */
  --text-primary: #141413;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-on-ink: #faf9f5;
  --text-on-ink-muted: rgba(250, 249, 245, 0.65);

  /* Accent — primary blue */
  --accent-blue: #2251ff;
  --accent-blue-hover: #1a3fd4;
  --accent-blue-muted: rgba(34, 81, 255, 0.1);

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(20, 20, 19, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 20, 19, 0.08);

  /* Radius — soft corners */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 12px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", "Arial",
    system-ui, sans-serif;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 17px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* ===== UTILITY CLASSES ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
  position: relative;
  border-top: 1px solid var(--border-primary);
}

.section-title {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  margin-bottom: 12px;
  text-align: left;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-subtitle {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  color: var(--text-secondary);
  text-align: left;
  max-width: 560px;
  margin: 0 0 56px;
  line-height: 1.65;
  font-weight: 400;
}

/* ===== ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children .fade-in:nth-child(1) {
  transition-delay: 0s;
}
.stagger-children .fade-in:nth-child(2) {
  transition-delay: 0.1s;
}
.stagger-children .fade-in:nth-child(3) {
  transition-delay: 0.2s;
}
.stagger-children .fade-in:nth-child(4) {
  transition-delay: 0.3s;
}
.stagger-children .fade-in:nth-child(5) {
  transition-delay: 0.4s;
}

/* ===== NAVIGATION ===== */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-primary);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo img {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
  align-items: center;
}

.nav-links a {
  font-family: "Space Grotesk", system-ui, sans-serif;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.25s var(--ease-out);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

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

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

/* Connect as pill CTA — last nav item */
.nav-links li:last-child a {
  background: var(--accent-blue);
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-weight: 500;
  margin-left: 8px;
  transition:
    background 0.25s var(--ease-out),
    transform 0.25s var(--ease-out);
}

.nav-links li:last-child a:hover,
.nav-links li:last-child a.active {
  background: var(--accent-blue-hover);
  color: #fff;
}

/* ===== MOBILE MENU TOGGLE ===== */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1002;
  -webkit-tap-highlight-color: transparent;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 1px;
  transition:
    transform 0.3s var(--ease-spring),
    opacity 0.2s var(--ease-out);
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
}

.menu-icon::before {
  top: -6px;
}

.menu-icon::after {
  top: 6px;
}

.menu-toggle.active .menu-icon {
  background: transparent;
}

.menu-toggle.active .menu-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle.active .menu-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
  padding-top: 56px;
  border-top: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 72px;
  width: 100%;
}

.hero-text {
  flex: 1;
}

.hero-image {
  flex-shrink: 0;
}

.profile-picture {
  width: 280px;
  height: 280px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  object-fit: cover;
  transition:
    transform 0.5s var(--ease-spring),
    box-shadow 0.3s var(--ease-out);
  box-shadow: var(--shadow-sm);
}

.profile-picture:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.hero h1 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  font-weight: 600;
  line-height: 1.05;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.hero-subtitle {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  margin-bottom: 20px;
  color: var(--accent-blue);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-description {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  max-width: 520px;
  margin-bottom: 36px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--accent-blue);
  color: #fff;
  text-decoration: none;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 500;
  border-radius: var(--radius-full);
  transition:
    background 0.25s var(--ease-out),
    transform 0.25s var(--ease-out);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  border: none;
}

.cta-button::after {
  content: "\2192";
  transition: transform 0.25s var(--ease-out);
  font-weight: 400;
}

.cta-button:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-2px);
}

.cta-button:hover::after {
  transform: translateX(4px);
}

.cta-button:active {
  transform: translateY(0);
}

.text-link {
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.2s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.text-link::after {
  content: "\2192";
  font-size: 1em;
  line-height: 1;
  transition: transform 0.2s var(--ease-out);
}

.text-link:hover {
  color: var(--accent-blue-hover);
}

.text-link:hover::after {
  transform: translateX(4px);
}

/* ===== PROJECTS SECTION ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.4s var(--ease-spring),
    border-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-md);
}

.project-image {
  height: 140px;
  background: var(--bg-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-primary);
}

.project-image svg {
  width: 48px;
  height: 48px;
  stroke: var(--accent-blue);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-content {
  padding: 24px;
}

.project-title {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.project-description {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.65;
  font-size: 0.95rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.project-tag {
  background: var(--accent-blue-muted);
  color: var(--accent-blue);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family:
    -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

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

@property --border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes project-link-ring {
  to {
    --border-angle: 360deg;
  }
}

.project-link {
  padding: 8px 16px;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    conic-gradient(
      from var(--border-angle),
      #2de2ac,
      #00a3ff,
      #7000ff,
      #2de2ac
    )
    border-box;
  border: 1.5px solid transparent;
  border-radius: var(--radius-full);
  box-shadow: 0 0 0 3px rgba(0, 163, 255, 0.12);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: "Space Grotesk", system-ui, sans-serif;
  animation: project-link-ring 3s linear infinite;
  transition:
    color 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out);
}

.project-link:hover {
  color: #fff;
  background:
    linear-gradient(var(--accent-blue), var(--accent-blue)) padding-box,
    conic-gradient(
      from var(--border-angle),
      #2de2ac,
      #00a3ff,
      #7000ff,
      #2de2ac
    )
    border-box;
  box-shadow: 0 0 0 3px rgba(112, 0, 255, 0.12);
}

/* ===== GALLERY SECTION ===== */
.gallery {
  background: var(--bg-secondary);
}

/* Home preview: compact snap strip */
.gallery-preview-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 4px;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.gallery-preview-track::-webkit-scrollbar {
  display: none;
}

.gallery-preview-track .gallery-card {
  flex: 0 0 min(78vw, 300px);
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
}

/* Full gallery page */
.gallery-page {
  background: var(--bg-secondary);
  overflow: hidden;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.gallery-filter {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-primary);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background 0.2s var(--ease-out),
    color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out);
}

.gallery-filter:hover {
  color: var(--text-primary);
  border-color: var(--border-secondary);
}

.gallery-filter.is-active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

.gallery-empty {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 48px 0 24px;
}

.gallery-empty[hidden] {
  display: none;
}

.gallery-carousel.is-empty {
  display: none;
}

.gallery-carousel {
  position: relative;
}

.gallery-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 4px 24px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-track.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
  user-select: none;
}

.gallery-card {
  position: relative;
  flex: 0 0 min(85vw, 340px);
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  scroll-snap-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    opacity 0.35s var(--ease-out),
    transform 0.35s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.gallery-card.is-hidden {
  display: none;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.gallery-card-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 48px 18px 18px;
  background: linear-gradient(transparent, rgba(20, 20, 19, 0.92));
  color: var(--text-on-ink);
}

.gallery-card-caption h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-on-ink);
  line-height: 1.3;
}

.gallery-card-caption p {
  margin: 0;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
  color: var(--text-on-ink-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-chevron {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-primary);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    background 0.2s var(--ease-out),
    color 0.2s var(--ease-out);
}

.gallery-chevron:hover {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.gallery-chevron--prev {
  left: -8px;
}

.gallery-chevron--next {
  right: -8px;
}

@media (min-width: 769px) {
  .gallery-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .gallery-track {
    padding-inline: 28px;
  }
}

/* ===== FOOTER / CONTACT (dark ink) ===== */
.site-footer,
.contact {
  width: 100%;
  background: var(--bg-ink);
  position: relative;
  padding: 80px 0 40px;
  border-top: none;
  margin-left: 0;
}

.site-footer .container,
.contact .container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}

.footer-intro .section-title {
  color: var(--text-on-ink);
  margin-bottom: 16px;
}

.footer-intro .section-subtitle {
  color: var(--text-on-ink-muted);
  margin-bottom: 0;
  max-width: 360px;
}

.footer-col h4 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-on-ink);
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  color: var(--text-on-ink-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.2s var(--ease-out);
}

.footer-col a:hover {
  color: var(--accent-blue);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid rgba(250, 249, 245, 0.12);
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-on-ink-muted);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  transition:
    background 0.2s var(--ease-out),
    transform 0.2s var(--ease-out);
}

.footer-social a:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.footer-social img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
  opacity: 0.75;
  transition:
    opacity 0.2s var(--ease-out),
    filter 0.2s var(--ease-out);
}

.footer-social a:hover img {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(32%) sepia(98%) saturate(2878%)
    hue-rotate(226deg) brightness(101%) contrast(101%);
}

/* Legacy contact helpers (kept for safety) */
.contact .section-title {
  color: var(--text-on-ink);
}

.contact .section-subtitle {
  color: var(--text-on-ink-muted);
}

.contact-content {
  max-width: 100%;
  margin: 0;
  text-align: left;
}

/* ===== PAGE HEADER ===== */
.page-header {
  background: var(--bg-primary);
  padding: 140px 0 72px;
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
  position: relative;
  overflow: hidden;
}

.header-content {
  position: relative;
  z-index: 2;
}

.header-content h1 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  margin-bottom: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.08;
}

.header-subtitle {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0;
  line-height: 1.65;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  font-family: "Space Grotesk", system-ui, sans-serif;
  transition: color 0.2s var(--ease-out);
  font-size: 0.95rem;
}

.back-link:hover {
  color: var(--accent-blue-hover);
}

/* ===== SECTION CTA ===== */
.section-cta {
  text-align: left;
  margin-top: 56px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* ===== IMAGE MODAL / LIGHTBOX ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  inset: 0;
  background-color: rgba(20, 20, 19, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 72px 16px 32px;
  overflow: auto;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.modal[hidden] {
  display: none !important;
}

.modal.active {
  display: block;
  opacity: 1;
}

.lightbox-stage {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.modal-content {
  margin: 0 auto;
  display: block;
  width: 100%;
  max-width: 900px;
  max-height: min(70vh, 640px);
  object-fit: contain;
  border-radius: var(--radius-md);
  transform: scale(0.96);
  transition: transform 0.3s var(--ease-spring);
}

.modal.active .modal-content {
  transform: scale(1);
}

.lightbox-meta {
  text-align: center;
  max-width: 640px;
  color: var(--text-on-ink);
}

.lightbox-counter {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 8px;
}

.lightbox-meta h3 {
  font-size: 1.2rem;
  color: var(--text-on-ink);
  margin-bottom: 8px;
}

.lightbox-meta p:last-child {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  color: var(--text-on-ink-muted);
  line-height: 1.6;
  margin: 0;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease-out);
}

.lightbox-nav:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.close,
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: var(--text-on-ink-muted);
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  z-index: 2002;
  transition:
    background 0.2s var(--ease-out),
    color 0.2s var(--ease-out);
}

.close:hover,
.lightbox-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

/* ===== PROJECTS / GALLERY / JOURNEY PAGES ===== */
.projects-page,
.journey-page {
  background: var(--bg-primary);
}

/* ===== JOURNEY / TIMELINE ===== */
.timeline {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-secondary);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  display: flex;
  margin-bottom: 48px;
  width: 50%;
}

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

.timeline-item:nth-child(odd) {
  margin-left: auto;
  padding-left: 40px;
}

.timeline-item:nth-child(even) {
  padding-right: 40px;
  justify-content: flex-end;
}

.timeline-dot {
  position: absolute;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid var(--bg-primary);
  z-index: 2;
  box-shadow: 0 0 0 3px var(--accent-blue-muted);
}

.timeline-item:nth-child(odd) .timeline-dot {
  left: -6px;
}

.timeline-item:nth-child(even) .timeline-dot {
  right: -6px;
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.timeline-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-md);
}

.timeline-date {
  display: inline-block;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timeline-title {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.timeline-description {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 968px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 48px;
  }

  .hero-image {
    order: -1;
  }

  .profile-picture {
    width: 200px;
    height: 200px;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-subtitle {
    text-align: center;
  }

  .section-title,
  .section-subtitle,
  .header-content h1,
  .header-subtitle,
  .section-cta {
    text-align: center;
  }

  .section-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .header-subtitle {
    margin: 0 auto;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .footer-intro {
    grid-column: 1 / -1;
  }

  .footer-intro .section-title,
  .footer-intro .section-subtitle {
    text-align: left;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: flex;
    position: fixed;
    top: 56px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(40px);
    -webkit-backdrop-filter: saturate(180%) blur(40px);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.3s var(--ease-out),
      visibility 0.3s var(--ease-out);
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
  }

  .nav-links li {
    opacity: 0;
    transform: translateY(12px);
    transition:
      opacity 0.3s var(--ease-out),
      transform 0.3s var(--ease-out);
  }

  .nav-links.open li {
    opacity: 1;
    transform: translateY(0);
  }

  .nav-links.open li:nth-child(1) {
    transition-delay: 0.05s;
  }
  .nav-links.open li:nth-child(2) {
    transition-delay: 0.1s;
  }
  .nav-links.open li:nth-child(3) {
    transition-delay: 0.15s;
  }
  .nav-links.open li:nth-child(4) {
    transition-delay: 0.2s;
  }
  .nav-links.open li:nth-child(5) {
    transition-delay: 0.25s;
  }

  .nav-links a {
    font-size: 1.4rem;
    font-weight: 600;
    padding: 14px 32px;
    color: var(--text-primary);
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: var(--accent-blue);
    background: none;
  }

  .nav-links li:last-child a {
    margin-left: 0;
    margin-top: 12px;
    padding: 12px 28px;
    font-size: 1.1rem;
  }

  .nav-links li:last-child a:hover,
  .nav-links li:last-child a.active {
    background: var(--accent-blue-hover);
    color: #fff;
  }

  body.menu-open {
    overflow: hidden;
  }

  .section {
    padding: 72px 0;
  }

  .section-title {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
  }

  .hero h1 {
    font-size: clamp(2.25rem, 9vw, 3rem);
  }

  .site-footer,
  .contact {
    padding: 64px 0 32px;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 36px;
    margin-bottom: 48px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

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

  .timeline-item,
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    width: 100%;
    padding-left: 36px;
    padding-right: 0;
    margin-left: 0;
    justify-content: flex-start;
  }

  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: 0;
    right: auto;
  }

  .timeline-item {
    margin-bottom: 32px;
  }

  .profile-picture {
    width: 160px;
    height: 160px;
  }

  .page-header {
    padding: 120px 0 56px;
  }

  .header-content h1 {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }

  .header-subtitle {
    font-size: 1rem;
    padding: 0 8px;
  }

  .section-cta {
    margin-top: 40px;
  }

  .modal-content {
    width: 95%;
  }

  .close {
    right: 12px;
    top: 12px;
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  .project-links {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .nav-container {
    padding: 0 16px;
  }

  .logo {
    font-size: 15px;
  }

  .profile-picture {
    width: 140px;
    height: 140px;
  }

  .cta-button {
    padding: 12px 22px;
    font-size: 0.88rem;
  }

  .project-content {
    padding: 20px;
  }

  .project-title {
    font-size: 1rem;
  }
}

/* ===== LOADING ANIMATION ===== */
body.loaded {
  animation: pageIn 0.5s var(--ease-out);
}

@keyframes pageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== PERFORMANCE: REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }

  .gallery-track {
    scroll-snap-type: none;
  }

  .gallery-card:hover,
  .gallery-card:focus-visible {
    transform: none;
  }
}

/* ===== SELECTION STYLING ===== */
::selection {
  background: rgba(34, 81, 255, 0.2);
  color: var(--text-primary);
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: #c8ced6;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ===== FOCUS STATES FOR ACCESSIBILITY ===== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
  border-radius: 4px;
}
