/* ═══════════════════════════════════════════════════════════
   CARLV.SION — Shared Stylesheet
   Covers: index.html, gallery.html, about.html (and future pages)
═══════════════════════════════════════════════════════════ */

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

/* ── Custom font – Coolvetica fallback chain ── */
@font-face {
  font-family: 'Coolvetica';
  src: local('Coolvetica');
  font-display: swap;
}

/* ── Variables ── */
:root {
  --black: #000;
  --white: #fff;
  --color-zinc-400: oklch(70.5% 0.015 286.067);
  --color-zinc-500: oklch(55.2% 0.016 285.938);
  --gap: 10px;
  --nav-px: clamp(24px, 6.67vw, 96px);
  --section-px: clamp(20px, 6.67vw, 96px);
  --content-px: clamp(24px, 6.67vw, 96px); /* alias used by gallery masonry */
  --section-gap: clamp(48px, 5.56vw, 80px);
  --display-font: 'Coolvetica', 'Oswald', 'Arial Black', Impact, sans-serif;
  --sub-display-font: 'Oswald', 'Coolvetica', 'Arial Black', Impact, sans-serif;
  --body-font: 'Inter', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--body-font);
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }


/* ═══════════════════════════════════════════════════════════
   NAV
   — nav-logo-wrapper carries flex:1 so the logo <a> itself
     only wraps its text (no oversized click area).
═══════════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--nav-px);
  /* Only background transitions — nothing touching layout or position */
  transition: background 0.3s;
  /* Prevents the nav from being repainted during page-level animations,
     which causes the logo jitter when switching pages */
  will-change: background;
  transform: translateZ(0);
}
.nav.scrolled {
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(10px);
}

/* Wrapper carries the flex:1 so the <a> doesn't stretch */
.nav-logo-wrapper {
  flex: 1;
  display: flex;
  justify-content: flex-start;
}

.nav-logo {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2.3vw, 33px);
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.02em;
  width: max-content; /* only text is clickable */
}

.nav-links {
  display: flex;
  gap: clamp(16px, 2.22vw, 32px);
  list-style: none;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: clamp(11px, 0.93vw, 13.33px);
  letter-spacing: 0.08em;
}
.nav-links a {
  color: var(--white);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--white);
  transition: width 0.25s;
}
.nav-links a.active::after,
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

/* Shared outlined button */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--white);
  padding: 8px 16px;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: clamp(11px, 0.93vw, 13.33px);
  letter-spacing: 0.08em;
  color: var(--white);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover { background: var(--white); color: var(--black); }

/* ── Hamburger ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav drawer ── */
.nav-drawer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.97);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  font-family: var(--display-font);
  font-size: 48px;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(20px);
  animation: drawerIn 0.4s forwards;
}
.nav-drawer a:nth-child(2) { animation-delay: 0.05s; }
.nav-drawer a:nth-child(3) { animation-delay: 0.10s; }
.nav-drawer a:nth-child(4) { animation-delay: 0.15s; }
@keyframes drawerIn {
  to { opacity: 1; transform: translateY(0); }
}


/* ═══════════════════════════════════════════════════════════
   FOOTER
   — footer-logo uses margin-right:auto (no flex:1) so only
     the text itself is the click target, not the full row.
═══════════════════════════════════════════════════════════ */
.footer {
  width: 100%;
  background: var(--black);
  border-top: 1px solid #222;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--nav-px);
  gap: 16px;
}

.footer-logo-wrapper {
  flex: 1;
  display: flex;
  justify-content: flex-start;
}

.footer-logo {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2.3vw, 33px);
  color: var(--white);
  text-decoration: none;
}

.footer-socials {
  display: flex;
  gap: 24px;
  align-items: center;
}
.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  transition: opacity 0.2s, transform 0.2s;
}
.footer-socials a:hover { opacity: 0.7; transform: translateY(-2px); }
/* No filter:invert — local SVGs are already the correct colour */
.footer-socials img { width: 24px; height: 24px; object-fit: contain; }

.footer-copy {
  font-family: var(--body-font);
  font-weight: 700;
  font-size: clamp(10px, 0.93vw, 13.33px);
  color: var(--white);
  flex: 1;
  text-align: right;
  white-space: nowrap;
}


/* ═══════════════════════════════════════════════════════════
   LIGHTBOX  (shared — index simple version + gallery version)
═══════════════════════════════════════════════════════════ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.96);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }

/* index.html uses .lightbox-img, gallery.html uses .lb-img */
.lightbox-img,
.lb-img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  animation: lbIn 0.22s ease both;
  border: 1px solid #222;
}
@keyframes lbIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* index.html close button */
.lightbox-close {
  position: absolute;
  top: 20px; right: 28px;
  font-size: 36px;
  color: var(--white);
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  opacity: 0.75;
  transition: opacity 0.2s;
  z-index: 10;
}
.lightbox-close:hover { opacity: 1; }

/* gallery.html close / prev / next */
.lb-close {
  position: absolute;
  top: 20px; right: 28px;
  font-size: 36px;
  color: var(--white);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  opacity: 0.75;
  transition: opacity 0.2s;
  z-index: 10;
}
.lb-close:hover { opacity: 1; }

.lb-prev, .lb-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  font-size: 28px;
  padding: 12px 18px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s;
  z-index: 10;
}
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.18); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-counter {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  font-family: var(--body-font);
}


/* ═══════════════════════════════════════════════════════════
   BACK TO TOP  (gallery.html + about.html)
═══════════════════════════════════════════════════════════ */
.back-top {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 44px; height: 44px;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.7);
  color: var(--white);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, background 0.2s;
  z-index: 90;
}
.back-top.visible { opacity: 1; pointer-events: auto; }
.back-top:hover { background: rgba(255,255,255,0.15); }


/* ═══════════════════════════════════════════════════════════
   INDEX — HERO
═══════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: clamp(32px, 4.44vw, 64px);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: #404040;
}
.hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 60%, rgba(0,0,0,1) 100%);
}

.hero-content {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 0 16px 32px;
  animation: heroFadeUp 1s ease both;
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-family: var(--display-font);
  font-size: clamp(64px, 11.8vw, 170px);
  line-height: 0.95;
  letter-spacing: 0.03em;
  color: var(--white);
  text-shadow: 0 4px 40px rgba(0,0,0,0.6);
}
.hero-sub {
  font-family: var(--body-font);
  font-weight: 400;
  font-size: clamp(18px, 3.3vw, 48px);
  color: var(--white);
  margin-top: 8px;
  letter-spacing: 0.04em;
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.6;
  animation: bounce 2s infinite;
}
.scroll-cue span {
  display: block;
  width: 1px; height: 40px;
  background: var(--white);
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}


/* ═══════════════════════════════════════════════════════════
   INDEX — PAGE CONTENTS WRAPPER
═══════════════════════════════════════════════════════════ */
.page-contents {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  align-items: center;
  background: var(--black);
}

.section-title {
  font-family: var(--display-font);
  font-size: clamp(48px, 5.74vw, 82.57px);
  line-height: 1;
  color: var(--white);
  text-align: center;
  letter-spacing: 0.07em;
}


/* ═══════════════════════════════════════════════════════════
   INDEX — GALLERY PREVIEW GRID
═══════════════════════════════════════════════════════════ */
.gallery-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  overflow: hidden;
  padding-top: clamp(32px, 4vw, 56px);
}

.gallery-grid {
  width: 100%;
  padding: 0 var(--section-px);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.gallery-item {
  flex: 1 0 0;
  min-width: 220px;
  max-width: 400px;
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  background: #222;
  cursor: pointer;
}
.gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94), filter 0.4s;
  will-change: transform;
}
.gallery-item:hover img { transform: scale(1.06); filter: brightness(0.85); }
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s;
  z-index: 1;
}
.gallery-item:hover::after { background: rgba(0,0,0,0.2); }

.btn-see-all { margin-top: 8px; }


/* ═══════════════════════════════════════════════════════════
   INDEX — ABOUT SECTION
═══════════════════════════════════════════════════════════ */
.about-section {
  width: 100%;
  padding: 0 var(--section-px);
  display: flex;
  gap: clamp(40px, 6.67vw, 96px);
  align-items: center;
  justify-content: center;
}

.about-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.about-body {
  font-family: var(--body-font);
  font-weight: 400;
  font-size: clamp(14px, 1.11vw, 16px);
  line-height: 1.75;
  color: var(--color-zinc-400);
  text-align: justify;
}

.about-photo {
  flex: 1;
  min-width: 260px;
  max-width: 624px;
  aspect-ratio: 624 / 768;
  position: relative;
  overflow: hidden;
  background: #fff;
}
.about-photo img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}


/* ═══════════════════════════════════════════════════════════
   GALLERY PAGE — PAGE WRAPPER
═══════════════════════════════════════════════════════════ */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding-top: 80px;
  padding-bottom: 0;
  background: var(--black);
  min-height: 100vh;
}

/* ── Gallery page title ── */
.gallery-title {
  font-family: var(--display-font);
  font-size: clamp(48px, 5.74vw, 82.57px);
  color: var(--white);
  letter-spacing: 0.07em;
  line-height: 1;
  white-space: nowrap;
  animation: fadeUp 0.8s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ═══════════════════════════════════════════════════════════
   GALLERY PAGE — MASONRY GRID
═══════════════════════════════════════════════════════════ */
.masonry {
  width: 100%;
  padding: 0 var(--content-px);
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}

.masonry-col {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ── Individual photo tiles ── */
.photo {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.photo.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Aspect ratios */
.photo.landscape { aspect-ratio: 800 / 600; } /* 4:3  */
.photo.portrait  { aspect-ratio: 409 / 546; } /* ~3:4 */

.photo img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.4s;
  will-change: transform;
}
.photo:hover img {
  transform: scale(1.06);
  filter: brightness(0.78);
}

/* Hover overlay */
.photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.35s;
  z-index: 1;
  pointer-events: none;
}
.photo:hover::after { background: rgba(0,0,0,0.18); }

/* Expand icon on hover */
.photo-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  z-index: 2;
  width: 44px; height: 44px;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.photo-icon svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
}
.photo:hover .photo-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}


/* ═══════════════════════════════════════════════════════════
   SCROLL REVEAL  (index.html sections)
═══════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 900px) ── */
@media (max-width: 900px) {
  /* index — about stacks vertically */
  .about-section { flex-direction: column; }
  .about-photo { width: 100%; min-width: 0; max-width: 100%; aspect-ratio: 4/3; }

  /* nav collapses to hamburger */
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }

  /* gallery page — content padding narrows */
  :root { --content-px: 56px; }
}

/* ── Mobile (≤ 640px) ── */
@media (max-width: 640px) {
  :root { --content-px: 24px; }

  /* gallery page title shrinks */
  .gallery-title { font-size: clamp(40px, 15vw, 57px); }

  /* index gallery grid — 2 columns */
  .gallery-item { min-width: calc(50% - 5px); }

  /* footer stacks vertically */
  .footer { flex-direction: column; align-items: flex-start; }
  .footer-copy { text-align: left; margin-left: 0; }

  /* back-to-top repositions */
  .back-top { bottom: 16px; right: 16px; }
}

/* ── Small mobile (≤ 360px) ── */
@media (max-width: 360px) {
  .gallery-item { min-width: 100%; }
}


/* ═══════════════════════════════════════════════════════════
   ABOUT PAGE — LAYOUT WRAPPER
═══════════════════════════════════════════════════════════ */
.about-page {
  display: flex;
  flex-direction: column;
  gap: clamp(64px, 8vw, 120px);
  padding-top: clamp(80px, 10vw, 120px); /* clears fixed nav */
  padding-bottom: 0;
  background: var(--black);
  min-height: 100vh;
}


/* ═══════════════════════════════════════════════════════════
   ABOUT PAGE — SHARED DISPLAY TITLE
═══════════════════════════════════════════════════════════ */
.ap-display-title {
  font-family: var(--sub-display-font);
  font-size: clamp(40px, 5.74vw, 82.57px);
  line-height: 1;
  letter-spacing: 0em;
  color: var(--white);
}

.ap-display-title2 {
  font-family: var(--display-font);
  font-size: clamp(40px, 5.74vw, 82.57px);
  line-height: 1;
  letter-spacing: 0.07em;
  color: var(--white);
}


/* ═══════════════════════════════════════════════════════════
   ABOUT PAGE — HERO  (About Me)
═══════════════════════════════════════════════════════════ */
.ap-hero {
  display: flex;
  gap: clamp(40px, 6.67vw, 96px);
  align-items: center;
  justify-content: center;
  padding: 0 var(--section-px);
  width: 100%;
}

.ap-hero-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.ap-body {
  font-family: var(--body-font);
  font-weight: 400;
  font-size: clamp(14px, 1.11vw, 16px);
  line-height: 1.75;
  color: var(--color-zinc-400);
  text-align: justify;
}
.ap-body strong {
  font-weight: 700;
}

.ap-hero-photo {
  flex: 1;
  min-width: 240px;
  max-width: 560px;
  aspect-ratio: 640 / 679;
  position: relative;
  overflow: hidden;
  background: #fff;
}
.ap-hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
}


/* ═══════════════════════════════════════════════════════════
   ABOUT PAGE — GENERIC SECTION WRAPPER
═══════════════════════════════════════════════════════════ */
.ap-section {
  width: 100%;
  padding: 0 var(--section-px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}


/* ═══════════════════════════════════════════════════════════
   ABOUT PAGE — WHY CHOOSE ME CARDS
═══════════════════════════════════════════════════════════ */
.ap-cards {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.ap-card {
  flex: 1 0 0;
  min-width: 0;
  background: #0e0e0e;
}

.ap-card-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 40px;
  height: 100%;
}

.ap-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ap-card-num {
  font-family: var(--body-font);
  font-weight: 400;
  font-size: 13.33px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em;
}

.ap-card-title {
  font-family: var(--display-font);
  font-size: clamp(20px, 2.3vw, 33.18px);
  color: var(--white);
  line-height: 1.1;
  letter-spacing: 0.07em;
}

.ap-card-body {
  font-family: var(--body-font);
  font-weight: 400;
  font-size: clamp(14px, 1.11vw, 16px);
  line-height: 1.7;
  color: var(--color-zinc-400);
}


/* ═══════════════════════════════════════════════════════════
   ABOUT PAGE — TECH STACK
═══════════════════════════════════════════════════════════ */
.ap-tech-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ap-tech-label {
  font-family: var(--body-font);
  font-weight: 700;
  font-size: clamp(11px, 0.93vw, 13.33px);
  letter-spacing: 0.1em;
  color: var(--white);
  white-space: nowrap;
}

.ap-tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
}

.ap-tech-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  border: 1px solid var(--white);
  /* Collapse duplicate borders between cells */
  margin-top: -1px;
  margin-left: -1px;
}

.ap-tech-cat {
  font-family: var(--body-font);
  font-weight: 400;
  font-size: 13.33px;
  letter-spacing: 0.06em;
  color: var(--color-zinc-400);
}

.ap-tech-name {
  font-family: var(--display-font);
  font-size: clamp(22px, 2.77vw, 39.81px);
  color: var(--white);
  line-height: 1.1;
}


/* ═══════════════════════════════════════════════════════════
   ABOUT PAGE — NOTABLE PROJECTS  (Embla Carousel)
   Key decisions:
   - NO flex-basis size change between slides — Embla's internal
     position engine gets confused if slide widths change after
     init, causing the jitter and unreachable slides. We use
     transform:scale only, which Embla never measures.
   - NO gradient fades — they block clicks on adjacent cards.
   - loop:true + align:'center' in JS.
═══════════════════════════════════════════════════════════ */
.ap-projects {
  gap: 32px;
  /* Center the section title */
  align-items: center;
}

/* ── Embla shell ── */
.embla {
  position: relative;
  width: 100%;
  /* We remove overflow: hidden here so the gradients can sit nicely */
}

/* ── Seamless Background Gradients ── */
.embla::before,
.embla::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 15%; /* Controls how wide the fade is */
  z-index: 2;
  pointer-events: none; /* CRITICAL: This allows clicks to pass through to the cards! */
}
.embla::before {
  left: 0;
  background: linear-gradient(to right, var(--black) 0%, transparent 100%);
}
.embla::after {
  right: 0;
  background: linear-gradient(to left, var(--black) 0%, transparent 100%);
}

.embla__viewport {
  width: 100%;
  overflow: hidden; /* Viewport handles the clipping */
  padding: 10px 0; /* Gives the scaled cards breathing room so they don't crop vertically */
}

.embla__container {
  display: flex;
  touch-action: pan-y pinch-zoom;
  margin-left: calc(var(--carousel-gap) * -1);
}

/* All slides are the same flex-basis — Embla measures this once at init.
   Changing it mid-life breaks position tracking. */
.embla__slide {
  flex: 0 0 clamp(280px, 38vw, 520px);
  min-width: 0;
  padding-left: var(--carousel-gap);
  /* GPU layer so transform is compositor-only */
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

:root { --carousel-gap: 24px; }

/* ── Cards ── */
.c-card {
  background: #0e0e0e;
  display: flex;
  flex-direction: column;
  width: 100%;
  cursor: pointer;
  /* Dim state — CSS transform only, Embla never reads this */
  filter: brightness(0.35);
  transform: scale(0.93);
  transition:
    filter    0.4s ease,
    transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Selected card — full brightness, natural scale */
.embla__slide.is-selected .c-card {
  filter: brightness(1);
  transform: scale(1);
  cursor: default;
}

/* Placeholder "MORE TO COME" cards, slightly dimmer even when selected */
.embla__slide.is-selected .c-card--placeholder {
  filter: brightness(0.8);
}

/* ── Card image area ── */
.c-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
}
.c-card__image img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.c-card__image--empty {
  background: #1f1f1f;
}

/* ── Card text body ── */
.c-card__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px;
}

.c-card__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.c-card__title {
  font-family: var(--sub-display-font);
  font-size: clamp(18px, 2.77vw, 39.81px);
  color: var(--white);
  line-height: 1.1;
  letter-spacing: 0.03em;
}

.c-card__date {
  font-family: var(--body-font);
  font-weight: 400;
  font-size: 13.33px;
  color: var(--color-zinc-500);
  letter-spacing: 0.04em;
}

.c-card__desc {
  font-family: var(--body-font);
  font-weight: 400;
  font-size: clamp(13px, 1.11vw, 16px);
  line-height: 1.7;
  color: var(--color-zinc-400);
}
.c-card__desc strong { font-weight: 700; }

/* ── Dot indicators (built by JS) ── */
.embla__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-top: 20px;
}

.embla__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.embla__dot--selected {
  background: var(--white);
  transform: scale(1.35);
}


/* ═══════════════════════════════════════════════════════════
   ABOUT PAGE — RESPONSIVE
═══════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 900px) {
  .ap-hero { flex-direction: column; }
  .ap-hero-photo { width: 100%; min-width: 0; max-width: 100%; aspect-ratio: 4/3; }
  .ap-tech-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 640px) {
  .ap-cards { flex-direction: column; }
  .ap-card  { width: 100%; }
  .ap-tech-grid { grid-template-columns: 1fr; }
  .embla__slide { flex: 0 0 clamp(240px, 78vw, 320px); }
}

/* ═══════════════════════════════════════════════════════════
   CONTACT PAGE
═══════════════════════════════════════════════════════════ */
.contact-page {
  padding-top: clamp(120px, 12vw, 160px);
  padding-bottom: clamp(64px, 8vw, 120px);
  padding-left: var(--section-px);
  padding-right: var(--section-px);
  min-height: calc(100vh - 80px); /* Account for footer */
  display: flex;
  justify-content: center;
}

.contact-container {
  display: flex;
  gap: clamp(48px, 8vw, 120px);
  width: 100%;
  max-width: 1200px;
}

.contact-left, .contact-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--color-zinc-400);
}

.form-input, .form-textarea {
  background: #0e0e0e;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  padding: 16px;
  font-family: var(--body-font);
  font-size: 16px;
  transition: border-color 0.3s, background 0.3s;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--white);
  background: #151515;
}

.form-textarea {
  min-height: 180px;
  resize: vertical;
}

.btn-submit {
  align-self: flex-start;
  padding: 12px 32px;
  margin-top: 8px;
}

.contact-info-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-link {
  font-family: var(--display-font);
  font-size: clamp(24px, 3vw, 33.18px);
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
a.contact-link:hover { color: var(--color-zinc-400); }

.contact-socials {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.contact-socials a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.1em;
  transition: opacity 0.2s;
}

.contact-socials a img {
  width: 28px;
  height: 28px;
}

.contact-socials a:hover { opacity: 0.7; }

/* Responsive Contact Page */
@media (max-width: 900px) {
  .contact-container { flex-direction: column; }
  .contact-right { order: -1; margin-bottom: 32px; } /* Puts contact info above the form on mobile */
}

/* ═══════════════════════════════════════════════════════════
   404 ERROR PAGE
═══════════════════════════════════════════════════════════ */
.error-page {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--black);
  padding: 0 var(--section-px);
}

.error-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--display-font);
  font-size: clamp(150px, 35vw, 500px);
  color: rgba(255, 255, 255, 0.03);
  z-index: 0;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  white-space: nowrap;
}

.error-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.error-title {
  font-family: var(--display-font);
  font-size: clamp(48px, 8vw, 96px);
  color: var(--white);
  letter-spacing: 0.05em;
  line-height: 1;
}

.error-desc {
  font-family: var(--body-font);
  font-size: clamp(14px, 1.2vw, 18px);
  color: var(--color-zinc-400);
  max-width: 480px;
  line-height: 1.6;
}

/* ── Form Notifications ── */
.form-notification {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px var(--section-px);
  z-index: 9999;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--display-font);
  font-size: 18px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: slideDown 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* Success State */
.form-notification[data-fs-success] {
  background: var(--white);
  color: var(--black);
}

/* Error State */
.form-notification[data-fs-error] {
  background: #ff4444;
  color: var(--white);
}

/* Inline Field Errors */
[data-fs-error]:not(.form-notification) {
  font-family: var(--body-font);
  font-size: 12px;
  color: #ff4444;
  margin-top: 4px;
  display: block;
  text-transform: uppercase;
  font-weight: 700;
}

/* Styling the auto-injected error text */
[data-fs-error]:not(.form-notification) {
  font-family: var(--body-font);
  font-size: 11px;
  color: #ff4444; /* High-contrast red */
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 6px;
  display: block;
  letter-spacing: 0.05em;
}