/* ============================================================
   JUSTIN GRUPPER — PORTFOLIO DESIGN SYSTEM
   ============================================================ */

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  --bg:          #000000;
  --bg-elevated: #0d0d0d;
  --bg-card:     #111111;
  --border:      rgba(255,255,255,0.08);
  --border-hover:rgba(255,255,255,0.22);
  --text:        #f0ede8;
  --text-muted:  rgba(240,237,232,0.45);
  --text-faint:  rgba(240,237,232,0.22);
  --accent:      #e8e0d4;
  --accent-primary: #ff5a00;
  --accent-dim:     rgba(255, 90, 0, 0.12);
  --accent-glow:    0 0 24px rgba(255, 90, 0, 0.18);
  --nav-height:  64px;
  --pad-h:       5%;
  --max-text:    860px;
  --ease:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1;

  /* Standards-based scrollbar (Firefox) */
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 237, 232, 0.2) transparent;

  /* Reserve gutter so lightbox open/close never causes width shifts */
  scrollbar-gutter: stable;
}

/* WebKit scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(240, 237, 232, 0.15);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(240, 237, 232, 0.35);
}

/* ── Interactive Bokeh Background ────────────────────────────── */
.bokeh-container {
  position: fixed;
  top: -20vh;
  left: -20vw;
  width: 140vw;
  height: 140vh;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  filter: blur(140px);
  -webkit-filter: blur(140px);
  opacity: 0.6;
}

.bokeh-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

/* Enlarged blob sizes & responsive placement */
.blob-0 {
  width: 48vw;
  height: 48vw;
  top: 5%;
  left: 10%;
  animation: waveBlobOne 20s ease-in-out infinite alternate;
}

.blob-1 {
  width: 52vw;
  height: 52vw;
  bottom: 5%;
  right: 10%;
  animation: waveBlobTwo 24s ease-in-out infinite alternate;
}

.blob-2 {
  width: 42vw;
  height: 42vw;
  top: 30%;
  right: 20%;
  animation: waveBlobThree 16s ease-in-out infinite alternate;
}

.blob-3 {
  width: 44vw;
  height: 44vw;
  bottom: 15%;
  left: 15%;
  animation: waveBlobFour 28s ease-in-out infinite alternate;
}

/* Wave motions - complex shifting paths for dynamic organic flow */
@keyframes waveBlobOne {
  0% {
    top: 5%;
    left: 10%;
    transform: scale(1) rotate(0deg);
  }
  50% {
    top: 25%;
    left: 20%;
    transform: scale(1.1) rotate(180deg);
  }
  100% {
    top: -5%;
    left: -2%;
    transform: scale(0.9) rotate(360deg);
  }
}

@keyframes waveBlobTwo {
  0% {
    bottom: 5%;
    right: 10%;
    transform: scale(0.95);
  }
  50% {
    bottom: 30%;
    right: 22%;
    transform: scale(1.15);
  }
  100% {
    bottom: -8%;
    right: -2%;
    transform: scale(0.9);
  }
}

@keyframes waveBlobThree {
  0% {
    top: 30%;
    right: 20%;
    transform: scale(1.1);
  }
  50% {
    top: 10%;
    right: 5%;
    transform: scale(0.9);
  }
  100% {
    top: 45%;
    right: 35%;
    transform: scale(1.15);
  }
}

@keyframes waveBlobFour {
  0% {
    bottom: 15%;
    left: 15%;
    transform: scale(0.9);
  }
  50% {
    bottom: -5%;
    left: 30%;
    transform: scale(1.12);
  }
  100% {
    bottom: 30%;
    left: 5%;
    transform: scale(0.95);
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Page Transition ────────────────────────────────────────── */
.page-wrapper {
  opacity: 0;
  animation: pageIn 0.6s var(--ease-out) forwards;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  flex: 1;
}

main {
  flex: 1;
}

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

/* ── Scroll Animations ──────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in.delay-1 { transition-delay: 0.1s; }
.fade-in.delay-2 { transition-delay: 0.2s; }
.fade-in.delay-3 { transition-delay: 0.3s; }
.fade-in.delay-4 { transition-delay: 0.4s; }

/* ── Navigation ─────────────────────────────────────────────── */
.site-nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  background: transparent;
  pointer-events: none;
}

.nav-logo {
  font-size: 1.5em;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  transition: opacity 0.2s;
  text-align: center;
  margin: 12px 0 0; /* 12px top margin, no bottom margin */
  pointer-events: auto;
}
.nav-logo:hover { opacity: 0.7; }

.nav-links {
  position: fixed;
  top: 48px; /* Directly below the logo (12px top margin + logo height) */
  left: 0; right: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.4em;
  padding: 12px var(--pad-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  pointer-events: auto; /* Enable clicks */
}

.nav-links.scrolled {
  position: fixed;
  top: 0;
  background: rgba(0, 0, 0, 0.95);
  border-color: var(--border);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.nav-link {
  font-size: 0.78em;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  position: relative;
  padding-bottom: 4px;
  opacity: 0.75;
  transition: opacity 0.25s, color 0.25s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 1px;
  background: var(--accent-primary); /* Orange accent line */
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}

.nav-link:hover {
  opacity: 1;
  color: var(--accent-primary);
}

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link.active {
  opacity: 1;
  color: var(--accent-primary);
}

.nav-link.active::after {
  transform: scaleX(1);
  background: var(--accent-primary);
}

/* Hamburger (mobile) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--text);
  transition: all 0.3s var(--ease);
}
.nav-hamburger.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: rgba(0,0,0,0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  padding: 2em var(--pad-h) 3em;
  border-bottom: 1px solid var(--border);
  z-index: 999;
  flex-direction: column;
  gap: 1.6em;
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-link {
  font-size: 1.1em;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.8;
  transition: opacity 0.2s;
}
.nav-mobile-link:hover { opacity: 1; }

/* ── LANDING PAGE ────────────────────────────────────────────── */
.landing-page {
  position: relative;
  height: 100svh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
}

.landing-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  animation: landingFadeIn 1.4s var(--ease-out) 0.2s forwards;
}

@keyframes landingFadeIn {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}

.landing-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0.0) 40%,
    rgba(0,0,0,0.55) 100%
  );
}

.landing-cta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5em;
  opacity: 0;
  animation: landingFadeIn 0.8s var(--ease-out) 1.2s forwards;
}

.landing-name {
  font-size: clamp(2em, 5vw, 3.2em);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  text-align: center;
  line-height: 1.1;
}

.landing-tagline {
  font-size: 0.78em;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(240,237,232,0.6);
  text-align: center;
}

.landing-btn {
  display: inline-block;
  font-size: 0.78em;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  position: relative;
  padding-bottom: 3px;
  margin-top: 0.5em;
}

.landing-btn::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.landing-btn:hover::after { transform: scaleX(1); }

/* ── PORTFOLIO GRID ─────────────────────────────────────────── */
.portfolio-page {
  padding-top: 120px;
  min-height: 100vh;
}

/* Featured row (large cards) */
.portfolio-featured {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px var(--pad-h) 0;
}

/* Main grid (smaller cards) */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px var(--pad-h) 42px;
}

.portfolio-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  aspect-ratio: 16/9;
  border: 1px solid var(--border);
  transition: border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.portfolio-featured .portfolio-card {
  aspect-ratio: 16/9;
}

.portfolio-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
  z-index: 5;
}

.portfolio-card:hover {
  border-color: rgba(255, 90, 0, 0.3);
  box-shadow: var(--accent-glow);
}

.portfolio-card:hover::before {
  transform: scaleX(1);
}

.portfolio-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease), filter 0.6s var(--ease);
}

.portfolio-card:hover img {
  transform: scale(1.04);
  filter: brightness(0.55);
}

.portfolio-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.4em 1.2em;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  opacity: 0.7; /* Always partially visible for readability/mobile */
  transition: opacity 0.5s var(--ease);
}

.portfolio-card:hover .portfolio-card-overlay {
  opacity: 1;
}

.portfolio-card-title {
  font-size: 0.9em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.85;
  transform: translateY(0);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.portfolio-card:hover .portfolio-card-title {
  opacity: 1;
  color: var(--accent-primary);
}

.portfolio-card-sub {
  font-size: 0.78em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-top: 0.25em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease) 0.04s;
}
.portfolio-card:hover .portfolio-card-sub {
  opacity: 1;
  transform: translateY(0);
}

/* ── PROJECT DETAIL PAGE ────────────────────────────────────── */
.project-page {
  padding-top: 120px;
  min-height: 100vh;
}

.project-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5em;
  padding: 5vh var(--pad-h) 5vh;
  align-items: flex-start;
}

.project-meta {
  font-size: 0.78em;
  font-weight: 600;
  order: 2; /* Move details metadata to the right side */
}

.project-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15em;
  padding: 0.65em 0;
  border-bottom: 1px solid var(--border);
}
.project-meta-item:first-child { border-top: 1px solid var(--border); }

.project-meta-label {
  font-size: 0.9em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.project-meta-value {
  color: rgba(240, 237, 232, 0.72);
  font-weight: 500;
  line-height: 1.45;
  margin-top: 0.25em;
}

.project-info {
  order: 1; /* Move description to the left side */
}

.project-title {
  font-size: clamp(2.4em, 4.5vw, 3.6em);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.0;
  margin-bottom: 0.3em;
}

.project-subtitle {
  font-size: 1.1em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.2em;
}

.project-description {
  font-size: 0.78em;
  line-height: 1.4;
  font-weight: 300;
  color: rgba(240,237,232,0.85);
  max-width: var(--max-text);
}

/* Project hero image */
.project-hero {
  padding: 0 var(--pad-h);
  overflow: hidden;
  margin-bottom: 4px;
}

.project-hero img {
  width: 100%;
  height: 450px;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ── PROJECT GALLERY ────────────────────────────────────────── */
.project-gallery {
  padding: 0 var(--pad-h) 6em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 4px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  background: #111;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16/9;
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease);
}

.gallery-item:hover img {
  opacity: 0.72;
  transform: scale(1.04);
}

/* Gallery wide items disabled to keep all images equal size */
.gallery-item.wide {
  grid-column: span 1;
}

/* ── PROJECT BACK LINK ──────────────────────────────────────── */
.project-back {
  display: flex;
  justify-content: center;
  gap: 2.5em;
  padding: 0 var(--pad-h) 42px;
}

.back-link {
  font-size: 0.78em;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  position: relative;
  padding-bottom: 3px;
  opacity: 0.65;
  transition: opacity 0.25s;
}

.back-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}

.back-link:hover {
  opacity: 1;
}

.back-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ── ABOUT PAGE ─────────────────────────────────────────────── */
.about-page {
  padding-top: 120px;
  min-height: 100vh;
}

.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5em;
  padding: 5vh var(--pad-h) 8em;
  align-items: flex-start;
}

.about-left {
  order: 2; /* CV on the right side */
}

.about-section-heading {
  font-size: 0.9em;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text); /* Solid white */
  margin-bottom: 0.8em;
  margin-top: 2.5em;
}
.about-section-heading:first-child { margin-top: 0; }

.about-cv-list {
  display: flex;
  flex-direction: column;
}

.about-cv-item {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  padding: 0.8em 0;
  border-bottom: 1px solid var(--border);
}
.about-cv-item:first-child { border-top: 1px solid var(--border); }

.about-cv-title {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--text);
}

.about-cv-sub {
  font-size: 0.78em;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.about-cv-link {
  font-size: 0.78em;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  position: relative;
  padding-bottom: 1px;
}
.about-cv-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--text);
  transition: width 0.35s var(--ease);
}
.about-cv-link:hover::after { width: 100%; }

/* Right column */
.about-right {
  order: 1; /* Bio and skills on the left side */
}

.about-bio-heading {
  font-size: clamp(1.8em, 3vw, 2.6em);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin-bottom: 1.2em;
}

.about-bio-text {
  font-size: 0.78em;
  line-height: 1.4;
  font-weight: 300;
  color: rgba(240,237,232,0.85);
  max-width: 540px;
  margin-bottom: 2.5em;
}

.about-skills-group {
  margin-bottom: 2em;
}

.about-skills-label {
  font-size: 0.9em;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.75em;
}

.about-skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 0.6em;
}

.about-skill-tag {
  font-size: 0.78em; /* Adjusted minimum font size for readability */
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4em 0.9em;
  border-radius: 2px;
  background: transparent;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.about-skill-tag:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background-color: var(--accent-dim);
}

.about-lang-list {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}
.about-lang-item {
  font-size: 0.84em;
  font-weight: 400;
  color: rgba(240,237,232,0.75);
}
.about-lang-item strong {
  color: var(--text);
  font-weight: 600;
}

/* ── TITLES PAGE ─────────────────────────────────────────────── */
.titles-page {
  padding-top: 120px;
  min-height: 100vh;
}

.titles-heading {
  font-size: clamp(2em, 4vw, 3em);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  max-width: var(--max-text);
}

/* ── LIGHTBOX ────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0);
  pointer-events: none;
  transition: background 0.4s var(--ease);
}

.lightbox.active {
  background: rgba(0,0,0,0.94);
  pointer-events: all;
}

.lightbox-inner {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease-spring);
}

.lightbox.active .lightbox-inner {
  opacity: 1;
  transform: scale(1);
}

.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  border-radius: 2px;
}

.lightbox-close {
  position: absolute;
  top: -2.4em;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1em;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  font-family: inherit;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5em;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
  padding: 1em 0.8em;
  font-family: inherit;
}
.lightbox-prev { left: -3.5em; }
.lightbox-next { right: -3.5em; }
.lightbox-prev:hover, .lightbox-next:hover { opacity: 1; }

.lightbox-counter {
  position: absolute;
  bottom: -2.2em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72em;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
}

/* ── FOOTER ──────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.4em var(--pad-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
}

.footer-copy {
  font-size: 0.72em;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 2em;
}

.footer-link {
  font-size: 0.72em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-link:hover { color: var(--text); }

.footer-social {
  display: flex;
  gap: 2em;
  align-items: center;
}

.footer-social-link {
  color: var(--text-muted);
  transition: color 0.3s var(--ease), transform 0.3s var(--ease);
  display: inline-flex;
}

.footer-social-link:hover {
  color: var(--accent-primary);
  transform: translateY(-3px) scale(1.15);
}

.footer-social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ── CONTACT PAGE ────────────────────────────────────────────── */
.contact-page {
  padding-top: 120px;
  min-height: auto;
}

/* ── SCROLL TO TOP ───────────────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 2em;
  right: 2em;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  z-index: 800;
}
.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.scroll-top:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: var(--accent-glow);
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .portfolio-featured {
    grid-template-columns: repeat(2, 1fr);
  }
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  :root { --nav-height: 56px; }

  .nav-hamburger { display: none; }

  .portfolio-featured {
    grid-template-columns: 1fr;
    padding: 4px 12px 0;
  }
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 4px 12px 4em;
  }
  /* Halve paddings for the 2-column grid cards overlay */
  .portfolio-grid .portfolio-card-overlay {
    padding: 0.7em 0.6em;
  }
  .portfolio-grid .portfolio-card-title {
    font-size: 0.78em;
  }
  /* Disable subtitle on secondary grid cards to avoid text overcrowding/jumps */
  .portfolio-grid .portfolio-card-sub {
    display: none !important;
  }

  .project-header {
    grid-template-columns: 1fr;
    gap: 2em;
    padding: 3vh var(--pad-h) 2vh;
  }
  .project-info { order: -1; }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-item.wide { grid-column: span 1; }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 2.5em;
    padding: 4vh var(--pad-h) 6em;
  }
  .about-right { order: -1; }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8em;
  }

  .lightbox-prev { left: -2em; }
  .lightbox-next { right: -2em; }
}

@media (max-width: 480px) {
  .portfolio-featured {
    grid-template-columns: 1fr;
    padding: 4px 8px 0;
  }
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 4px 8px 4em;
  }
  /* Further reduce overlay padding for very small mobile screens */
  .portfolio-grid .portfolio-card-overlay {
    padding: 0.5em 0.4em;
  }
  .portfolio-grid .portfolio-card-title {
    font-size: 0.7em;
    letter-spacing: 0.05em;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-item.wide { grid-column: span 1; }
}

/* ── Custom Cursor Styles ───────────────────────────────────── */
@media (pointer: fine) {
  html, body, a, button, input, textarea, label, select, option, [role="button"], .gallery-item, .gallery-item *, .archive-row, .archive-row *, .form-group, .form-label, .form-input, .form-textarea, .contact-form * {
    cursor: none !important;
  }

  .custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    pointer-events: none;
    opacity: 0;
    will-change: transform;
    transform: translate3d(-100px, -100px, 0);
    transition: opacity 0.15s ease;
    transform-origin: 0 0;
    z-index: 10000;
  }

  .custom-cursor.hover {
    transform: scale(1.3);
  }
}

/* ── Footer Easter Egg ───────────────────────────────────────────
   The custom footer character (footer-character.js) builds itself
   entirely via inline styles — no sprite CSS needed here.
   Only the positioning context is required.               */
.site-footer {
  position: relative;
}

