/* =========================================================================
   GIAST AHMAD — PORTFOLIO
   Design tokens + base + components
   ========================================================================= */

:root {
  /* ---- Color ---- */
  --bg:            #FFFFFF;
  --bg-raised:     #F7F7F7;
  --ink:           #171717;
  --ink-dim:       #525252;
  --ink-faint:     #737373;
  --accent:        #800020;
  --accent-hover:  #660019;
  --accent-ink:    #FFFFFF;
  --accent-wash:   rgba(128, 0, 32, 0.06);
  --accent-wash-2: rgba(128, 0, 32, 0.12);
  --line:          #E5E5E5;
  --line-strong:   #A3A3A3;

  /* ---- Type ---- */
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* ---- Layout ---- */
  --nav-h: 76px;
  --rail-w: 56px;
  --gutter: clamp(20px, 5vw, 64px);
  --max-w: 1360px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
}

/* =========================================================================
   RESET
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  isolation: isolate;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Document-anchored ASCII waves; never participate in the pin layout. */
.ascii-waves {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}

.ascii-waves canvas {
  position: absolute;
  left: 0;
  width: 100%;
}

/* Hide the scrollbar everywhere while keeping scroll functional */
html {
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* legacy Edge / IE */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;               /* Chrome, Safari, Chromium Edge */
}

h1, h2, h3, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; background: none; border: none; cursor: pointer; color: inherit; }
img { max-width: 100%; display: block; }

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 18px;
  z-index: 999;
  font-size: 13px;
}
.skip-link:focus {
  left: var(--gutter);
  top: 12px;
}

/* =========================================================================
   TYPE UTILITIES
   ========================================================================= */

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.dim { color: var(--ink-dim); }

/* =========================================================================
   NAVBAR
   ========================================================================= */

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  z-index: 200;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(7px);
}

.navbar__mark {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.navbar__mark-glyph {
  color: var(--accent);
  font-weight: 700;
}

.navbar__nav { display: block; }
.navbar__list {
  display: flex;
  gap: clamp(20px, 2.4vw, 40px);
}

.navbar__link {
  position: relative;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 6px 2px;
  transition: color 0.25s var(--ease);
}
.navbar__link::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transition: right 0.3s var(--ease);
}
.navbar__link:hover { color: var(--ink); }
.navbar__link:hover::after { right: 0; }
.navbar__link[aria-current="true"] {
  color: var(--ink);
}
.navbar__link[aria-current="true"]::after { right: 0; }

.navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
}
.navbar__toggle span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  top: var(--nav-h);
  background: var(--bg);
  z-index: 190;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  padding: 24px var(--gutter);
}
.mobile-menu[data-open="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.mobile-menu__list { display: flex; flex-direction: column; }
.mobile-menu__link {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 22px;
  letter-spacing: 0.01em;
}
.mobile-menu__index {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
}

/* =========================================================================
   SIDE RAILS (decorative meta info — desktop only)
   ========================================================================= */

.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  width: var(--rail-w);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.rail--left { left: 0; }
.rail--right { right: 0; }

.rail__text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  white-space: nowrap;
}
.rail--right .rail__text { color: var(--ink-dim); }

.rail__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-bottom: 10px;
  box-shadow: 0 0 0 3px var(--accent-wash);
}

/* =========================================================================
   HERO
   ========================================================================= */

.section {
  position: relative;
  padding-left: var(--rail-w);
  padding-right: var(--rail-w);
}

.hero {
  height: 100svh;
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--nav-h) + 148px);
  border-bottom: 1px solid var(--line);
}

.hero__ascii-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.hero__grid {
  position: relative;
  z-index: 3;
  display: block;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.hero__text-col { max-width: 640px; }

.ascii-portrait {
  margin: 0;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1;
  white-space: pre;
  transform-origin: center center;
  user-select: none;
}

.hero__text-col .eyebrow { margin-bottom: 18px; }

.hero__name {
  font-size: clamp(48px, 7.4vw, 104px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.98;
  display: flex;
  flex-direction: column;
}

.hero__caption {
  margin-top: 28px;
  font-size: clamp(19px, 2.2vw, 26px);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.005em;
  max-width: 16ch;
}

.hero__subcaption {
  margin-top: 14px;
  font-size: 14.5px;
  color: var(--ink-dim);
  max-width: 42ch;
}

.hero__tags {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag {
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  background: var(--accent);
  color: var(--bg);
}

.hero__scroll {
  margin-top: 56px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.hero__scroll-line {
  width: 28px;
  height: 1px;
  background: var(--ink-faint);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: scrollLine 2.4s var(--ease) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .hero__scroll-line::after { animation: none; transform: translateX(0); }
}
@keyframes scrollLine {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* =========================================================================
   ABOUT — STATEMENT (particle-in text)
   ========================================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.about-statement {
  margin: 0 auto;
  max-width: 100%;
}

.about-statement__visual {
  font-size: clamp(28px, 4.5vw, 100px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-align: center;
}

.about-statement__dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin: 0 23px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
  position: relative;
}

.particle-char {
  display: inline-block;
  will-change: transform, opacity, filter;
}

/* =========================================================================
   TECH STACK (About section)
   ========================================================================= */

.tech-stack {
  margin-top: 64px;
}

.tech-stack__title {
  text-align: center;
}

.tech-stack__rows {
  margin-top: 36px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.tech-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}

.tech-marquee__track {
  display: flex;
  width: max-content;
  animation: techMarquee 46s linear infinite;
}

.tech-marquee--reverse .tech-marquee__track {
  animation-direction: reverse;
}

.tech-marquee:hover .tech-marquee__track {
  animation-play-state: paused;
}

.tech-marquee__group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.tech-marquee__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  width: 128px;
  margin: 0 28px;
}

.tech-marquee__item img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.tech-marquee__label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}

@keyframes techMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .tech-marquee__track { animation: none; }
}

/* =========================================================================
   CERTIFICATIONS (About section)
   ========================================================================= */

.certs {
  margin-top: 72px;
  opacity: 0; /* GSAP entrance handles the reveal */
}

.certs__title {
  text-align: center;
}

.certs-carousel {
  margin: 40px auto 0;
  max-width: 980px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.certs-carousel__viewport {
  flex: 1;
  overflow: hidden;
}

.certs-carousel__track {
  display: flex;
  align-items: center;
  will-change: transform;
}

.certs-carousel__slide {
  position: relative;
  flex: 0 0 min(640px, 78vw);
  aspect-ratio: 4 / 3;
  margin: 0 18px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.32;
  transform: scale(0.86);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), border-color 0.3s var(--ease);
}

.certs-carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.certs-carousel__slide.is-active {
  opacity: 1;
  transform: scale(1);
}
.certs-carousel__slide.is-active:hover {
  transform: scale(1.02);
  border-color: var(--accent);
}
.certs-carousel__slide:not(.is-active):hover {
  opacity: 0.55;
}

.certs-carousel__slide.is-active::before,
.certs-carousel__slide.is-active::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--accent);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
}
.certs-carousel__slide.is-active::before { top: 4px; left: 4px; border-width: 1.5px 0 0 1.5px; }
.certs-carousel__slide.is-active::after { bottom: 4px; right: 4px; border-width: 0 1.5px 1.5px 0; }

.certs-info {
  margin: 22px auto 0;
  max-width: 560px;
  text-align: center;
}

.certs-info__title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.certs-info__link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.certs-info__link:hover,
.certs-info__link:focus-visible {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ---- Lightbox ---- */

.certs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.certs-lightbox[hidden] { display: none; }
.certs-lightbox[data-open="true"] { opacity: 1; }

.certs-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.82);
  backdrop-filter: blur(2px);
}

.certs-lightbox__img {
  position: relative;
  max-width: min(920px, 92vw);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--line-strong);
  background: var(--bg);
}

.certs-lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 26px;
  line-height: 1;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  color: var(--bg);
  z-index: 2;
}
.certs-lightbox__close:hover { border-color: var(--accent); color: var(--accent); }

/* =========================================================================
   PLACEHOLDER SECTIONS (About / Project / Contact)
   ========================================================================= */

.placeholder-section {
  min-height: 70svh;
  display: flex;
  align-items: center;
}
.placeholder-section--last { min-height: 60svh; }

.placeholder-section__inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 96px var(--gutter);
}

.placeholder-section__title {
  margin-top: 14px;
  font-size: clamp(36px, 5.2vw, 64px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.placeholder-section__rule {
  margin: 28px 0 22px;
  width: 64px;
  height: 2px;
  background: var(--accent);
}

.placeholder-section__note {
  font-size: 14px;
  color: var(--ink-dim);
  max-width: 46ch;
}

.journey-section {
  padding-left: 0;
  padding-right: 0;
}

.journey-pin {
  position: relative;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 var(--rail-w);
}

.journey-head {
  flex-shrink: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding: 92px var(--gutter) 0;
  text-align: center;
}
.journey-head__title {
  font-size: clamp(32px, 4.4vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.journey-head__rule {
  margin: 20px auto 0;
  width: 64px;
  height: 2px;
  background: var(--accent);
}

.journey-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding: 20px var(--gutter) 10px;
  display: grid;
  grid-template-columns: minmax(0, 560px) 1fr;
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}

.journey-stage__index {
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.journey-stage__period {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

.journey-stage__title {
  margin-top: 12px;
  font-size: clamp(30px, 3.6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  min-height: 2.3em;
}

.decrypt-char { color: var(--accent); }

.journey-stage__role {
  margin-top: 8px;
  font-size: 16px;
  color: var(--ink-dim);
  min-height: 1.4em;
}

.journey-stage__list {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  max-width: 48ch;
}
.journey-stage__list li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.6;
  min-height: 1.6em;
  color: var(--ink);
}
.journey-stage__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 9px;
  height: 1.5px;
  background: var(--accent);
}

.journey-stage__media {
  max-width: 600px;
  margin-left: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.journey-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
}

.journey-carousel__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.journey-carousel__img[data-loaded="true"] { opacity: 1; }

.journey-carousel__count {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  background: rgba(23, 23, 23, 0.55);
  padding: 3px 8px;
  z-index: 2;
}

.journey-carousel::before,
.journey-carousel::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--accent);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
}
.journey-carousel::before { top: 4px; left: 4px; border-width: 1.5px 0 0 1.5px; }
.journey-carousel::after { bottom: 4px; right: 4px; border-width: 0 1.5px 1.5px 0; }

.journey-nav-btn {
  width: 34px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--ink-dim);
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.journey-nav-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.journey-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.journey-nav-btn:disabled:hover {
  color: var(--ink-dim);
  border-color: var(--line-strong);
}

.journey-progress {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--gutter) 44px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.journey-progress__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.journey-progress__dot[data-active="true"] {
  background: var(--accent);
  transform: scale(1.3);
}
.journey-progress__bar {
  flex: 1;
  max-width: 160px;
  height: 1px;
  background: var(--line);
  position: relative;
  margin-left: 6px;
}
.journey-progress__fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--accent);
}

/* =========================================================================
   PROJECT — SECTION HEAD
   ========================================================================= */

.project-section { min-height: auto; padding-top: 96px; padding-bottom: 96px; }
.project-section__inner { padding-top: 0; padding-bottom: 0; }

.project-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.project-head .eyebrow { display: block; }
.project-head__title {
  margin-top: 14px;
  font-size: clamp(36px, 5.2vw, 64px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.project-head .placeholder-section__rule { margin-left: auto; margin-right: auto; }
.project-head__note {
  font-size: 14px;
  color: var(--ink-dim);
  max-width: 46ch;
  margin: 0 auto;
}
.project-head__note span { color: var(--ink); font-weight: 500; }

/* =========================================================================
   PROJECT — CATALOG GRID + CARDS
   ========================================================================= */

.project-catalog {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 32px);
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.project-card:hover,
.project-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-5px);
}

.project-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(35%) contrast(1.04);
  transition: transform 0.6s var(--ease), filter 0.5s var(--ease);
}
.project-card:hover .project-card__media img,
.project-card:focus-visible .project-card__media img {
  transform: scale(1.06);
  filter: grayscale(0%) contrast(1);
}

.project-card__media::before,
.project-card__media::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--accent);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.project-card__media::before { top: 4px; left: 4px; border-width: 1.5px 0 0 1.5px; }
.project-card__media::after { bottom: 4px; right: 4px; border-width: 0 1.5px 1.5px 0; }
.project-card:hover .project-card__media::before,
.project-card:hover .project-card__media::after,
.project-card:focus-visible .project-card__media::before,
.project-card:focus-visible .project-card__media::after {
  opacity: 1;
}

.project-card__index {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  background: rgba(23, 23, 23, 0.6);
  padding: 3px 8px;
  z-index: 2;
}

.project-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 22px 22px 24px;
}

.project-card__period {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
}

.project-card__title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.project-card__summary {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-dim);
  flex: 1;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.project-card__tag {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
}

.project-card__cta {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.project-card__cta::after {
  content: '\2192';
  transition: transform 0.25s var(--ease);
}
.project-card:hover .project-card__cta::after,
.project-card:focus-visible .project-card__cta::after {
  transform: translateX(4px);
}

.project-more-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 28px auto 0;
  padding: 13px 24px;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.project-more-btn:hover,
.project-more-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.project-more-btn__icon { width: 14px; height: 14px; }

/* =========================================================================
   PROJECT MODAL
   ========================================================================= */

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}
.project-modal[hidden] { display: none; }

.project-modal[data-open="true"] .project-modal__panel {
  transform: translateY(0);
  opacity: 1;
}
.project-modal__panel {
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.project-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.55);
  backdrop-filter: blur(2px);
}

.project-modal__panel {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  max-width: 760px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 40px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.project-modal__panel::-webkit-scrollbar { display: none; }

.project-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 22px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  z-index: 3;
}
.project-modal__close:hover { border-color: var(--accent); color: var(--accent); }

.project-modal__image {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  margin-bottom: 24px;
  overflow: hidden;
}
.project-modal__image::before,
.project-modal__image::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--accent);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
}
.project-modal__image::before { top: 4px; left: 4px; border-width: 1.5px 0 0 1.5px; }
.project-modal__image::after { bottom: 4px; right: 4px; border-width: 0 1.5px 1.5px 0; }

.project-modal__image-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.project-modal__image-img[data-loaded="true"] { opacity: 1; }

.project-modal__image-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 34px;
  height: 34px;
}
.project-modal__image-nav--prev { left: 10px; }
.project-modal__image-nav--next { right: 10px; }
.project-modal__image[data-multi="false"] .project-modal__image-nav,
.project-modal__image[data-multi="false"] .project-modal__image-count {
  display: none;
}

.project-modal__image-count {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  background: rgba(23, 23, 23, 0.55);
  padding: 3px 8px;
  z-index: 2;
}

.project-modal__title { font-size: 28px; font-weight: 700; margin-top: 10px; }
.project-modal__meta {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}
.project-modal__overview { margin-top: 14px; color: var(--ink-dim); font-size: 14px; line-height: 1.65; }
.project-modal__stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.project-modal__stack li {
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
}
.project-modal__description { margin-top: 18px; font-size: 14px; line-height: 1.7; }
.project-modal__description p + p,
.project-modal__description p + ul,
.project-modal__description ul + p {
  margin-top: 12px;
}
.project-modal__bullets { display: flex; flex-direction: column; gap: 10px; }
.project-modal__bullets li {
  position: relative;
  padding-left: 20px;
}
.project-modal__bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 9px;
  height: 1.5px;
  background: var(--accent);
}
.project-modal__links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.project-modal__links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 8px 14px;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.project-modal__links a svg { flex-shrink: 0; }
.project-modal__links a:hover,
.project-modal__links a:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}

/* =========================================================================
   CONTACT
   ========================================================================= */

.contact-section--last { min-height: 60svh; }

.contact-section__inner .placeholder-section__note { max-width: 52ch; }

.contact-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 720px;
}

.contact-tag {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.contact-tag:hover,
.contact-tag:focus-visible {
  background: var(--bg);
  color: var(--accent);
  transform: translateY(-3px);
}

.contact-tag__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-tag__icon svg { width: 100%; height: 100%; }

.contact-tag__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.contact-tag__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
}
.contact-tag__value {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================================
   FOOTER
   ========================================================================= */

.footer {
  display: flex;
  justify-content: space-between;
  padding: 28px var(--gutter);
  padding-left: calc(var(--rail-w) + var(--gutter));
  padding-right: calc(var(--rail-w) + var(--gutter));
  font-size: 11.5px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
}

/* =========================================================================
   SCROLL-REVEAL BASE STATE (JS/GSAP will animate from this)
   ========================================================================= */

[data-animate] { will-change: transform, opacity; }
