/* ============================================================
   PORTFOLIO — MAIN CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..500&family=Space+Mono:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  --bg:            hsl(240 8% 7%);
  --bg-surface:    hsl(240 6% 10%);
  --bg-elevated:   hsl(240 5% 13%);
  --border:        rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --text:          hsl(240 5% 96%);
  --text-secondary:hsl(240 4% 65%);
  --text-muted:    hsl(240 4% 52%);
  --accent:        #FF6200;
  --accent-glow:   rgba(255, 98, 0, 0.10);

  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'Space Mono', monospace;

  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --max-width:  1200px;
  --nav-height: 72px;
  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;

  --ease:          cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:      cubic-bezier(0, 0, 0.2, 1);
  --duration-fast: 180ms;
  --duration-base: 300ms;
  --duration-slow: 600ms;
}

[data-theme="light"] {
  --bg:            #f5f5f0;
  --bg-surface:    #eaeae4;
  --bg-elevated:   #ffffff;
  --border:        rgba(0, 0, 0, 0.09);
  --border-subtle: rgba(0, 0, 0, 0.04);
  --text:          #0d0d10;
  --text-secondary:#3d3d46;
  --text-muted:    #686870;
  --accent:        #B84000;
  --accent-glow:   rgba(184, 64, 0, 0.08);
}

[data-theme="light"] body {
  background:
    /* top-left warm light source */
    radial-gradient(ellipse 100% 60% at 0% 0%,    hsl(40 50% 97%)  0%, transparent 58%),
    /* bottom-right cooler shadow */
    radial-gradient(ellipse 65% 50% at 100% 100%,  hsl(230 12% 87%) 0%, transparent 52%),
    /* accent glow — top right */
    radial-gradient(ellipse 50% 35% at 88% 0%,     rgba(255, 98, 0, 0.04) 0%, transparent 48%),
    /* vignette — edges slightly darker */
    radial-gradient(ellipse 85% 85% at 50% 50%,    transparent 45%, hsl(230 10% 86%) 100%),
    /* base floor */
    #f5f5f0;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background:
    /* top-left light source — primary depth driver */
    radial-gradient(ellipse 100% 60% at 0% 0%,    hsl(240 18% 14%) 0%, transparent 58%),
    /* bottom-right shadow pocket */
    radial-gradient(ellipse 65% 50% at 100% 100%,  hsl(240 15% 4%)  0%, transparent 52%),
    /* accent glow — top right */
    radial-gradient(ellipse 50% 35% at 88% 0%,     rgba(255, 98, 0, 0.05) 0%, transparent 48%),
    /* vignette — edges darken */
    radial-gradient(ellipse 85% 85% at 50% 50%,    transparent 45%, hsl(240 12% 3%) 100%),
    /* base floor */
    hsl(240 10% 7%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.032;
  pointer-events: none;
  z-index: 9999;
}

img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }
p { text-wrap: pretty; }

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

/* ── Grain ────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
[data-theme="light"] body::before { opacity: 0.015; }

/* ── Type Scale ───────────────────────────────────────────── */
.t-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.t-accent { color: var(--accent); }

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.section { padding: var(--space-32) 0; }
.section--sm { padding: var(--space-16) 0; }
.divider { width: 100%; height: 1px; background: var(--border); }

/* ── Section Label ────────────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-12);
}

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(13, 13, 16, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-base) var(--ease);
}

.nav--scrolled { background: rgba(13, 13, 16, 0.92); }
[data-theme="light"] .nav { background: rgba(245, 245, 240, 0.80); }
[data-theme="light"] .nav--scrolled { background: rgba(245, 245, 240, 0.96); }

.nav__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  transition: color var(--duration-fast) var(--ease);
}
.nav__logo:hover { color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav__link {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--duration-fast) var(--ease);
}
.nav__link:hover, .nav__link.active { color: var(--text); }

/* Let's talk — simple ghost pill, no color accent */
.nav__link--cta {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  padding: var(--space-2) var(--space-4);
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: background var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
}
.nav__link--cta:hover {
  background: var(--bg-surface);
  border-color: rgba(255, 255, 255, 0.18);
}

.nav__mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
}
.nav__mobile-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform var(--duration-base) var(--ease),
              opacity var(--duration-base) var(--ease);
}

.nav__theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease),
              background var(--duration-fast) var(--ease);
}
.nav__theme-toggle:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--bg-surface);
}
.nav__theme-toggle .material-symbols-outlined { font-size: 1.1rem; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding:
    calc(var(--nav-height) + var(--space-8))
    max(var(--space-8), calc((100vw - var(--max-width)) / 2 + var(--space-8)))
    var(--space-12);
  position: relative;
}

/* Status — no border, just two floating labels */
.hero__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  opacity: 0;
  animation: fadeUp var(--duration-slow) var(--ease) 0.1s forwards;
}

.hero__status-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero__eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: dotPulse 2.8s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 98, 0, 0.5); }
  55%       { box-shadow: 0 0 0 7px rgba(255, 98, 0, 0); }
}

/* Headline — fills vertical space but constrained by font size */
.hero__headline-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  padding: var(--space-6) 0;
}

/* Headline */
.hero__headline {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 8.5rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--text);
}

/* Each line clips its word — the overflow:hidden is the mask */
.hero__line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em; /* room for descenders so they don't clip */
}

/* Words start hidden below the line boundary */
.hero__headline .word {
  display: inline-block;
  transform: translateY(108%);
  will-change: transform;
}

/* Accent word */
.hero__headline .word--accent {
  color: var(--accent);
  font-weight: 200;
  font-style: italic;
  letter-spacing: -0.025em;
}

/* Slide up from beneath the line */
@keyframes wordReveal {
  to {
    transform: translateY(0);
  }
}

/* Cursor blink */
.hero__cursor {
  display: inline-block;
  width: 4px;
  height: 0.75em;
  background: var(--accent);
  margin-left: 6px;
  vertical-align: middle;
  border-radius: 2px;
  opacity: 0;
  animation: cursorAppear 0.3s var(--ease) 1.7s forwards,
             blink 1.1s step-end 1.7s infinite;
}

@keyframes cursorAppear { to { opacity: 1; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Footer row — no border, visible in viewport */
.hero__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-12);
  padding-top: var(--space-8);
  opacity: 0;
  animation: fadeUp var(--duration-slow) var(--ease) 1.2s forwards;
}

.hero__footer .hero__sub,
.hero__footer .hero__ctas { opacity: 1; transform: none; animation: none; }

.hero__sub {
  font-size: clamp(0.9375rem, 1.3vw, 1.1rem);
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.7;
}

.hero__ctas {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  transition: background var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease),
              opacity var(--duration-fast) var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { opacity: 0.85; }

/* Both buttons: no transform. Unified hover = color/opacity only */
.btn--primary {
  background: var(--accent);
  color: #000;
  border: 1px solid var(--accent);
}
.btn--primary:hover {
  background: #FF7A20;
  border-color: #FF7A20;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  background: var(--bg-surface);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn__arrow {
  display: inline-flex;
  align-items: center;
  transition: transform var(--duration-base) var(--ease);
}
.btn--primary:hover .btn__arrow,
.btn--ghost:hover   .btn__arrow { transform: translateX(3px); }

/* ── Material Symbols ─────────────────────────────────────── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  user-select: none;
}
.material-symbols-outlined.icon-sm { font-size: 15px; }

/* ── Project List — full-bleed editorial ─────────────────── */
.pi--1 { --pi-bg: url('../images/sfqc/cover.png'); }
.pi--2 { --pi-bg: url('../images/aqc/cover.png'); }
.pi--3 { --pi-bg: url('../images/qiddiya/cover.png'); }
.pi--4 { --pi-bg: none; }

.project-list { list-style: none; }

.project-item {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
  transition: border-color 0.5s var(--ease);
}
.project-item:last-child { border-bottom: 1px solid var(--border); }

/* Image floods the row on hover */
.project-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--pi-bg, none);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  z-index: 0;
}

/* Directional gradient — opaque left, fades right */
.project-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(10, 10, 13, 0.78) 0%,
    rgba(10, 10, 13, 0.52) 50%,
    rgba(10, 10, 13, 0.18) 100%
  );
  opacity: 0;
  transition: opacity 0.65s var(--ease);
  z-index: 1;
}

.project-item:hover { border-top-color: transparent; }
.project-item:hover::before { opacity: 1; transform: scale(1); }
.project-item:hover::after  { opacity: 1; }

/* Row wrapper sits above the image layers */
.project-item__row {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
}

.project-item__link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-6);
  color: inherit;
  min-width: 0;
}

/* Ghost index number — large, tabular, uniform across all glyphs */
.project-item__num {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 8vw, 9rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--text);
  opacity: 0.08;
  flex-shrink: 0;
  /* Fixed width so all numbers occupy identical space regardless of glyph width */
  width: clamp(80px, 11vw, 140px);
  text-align: right;
  transition: opacity 0.5s var(--ease), color 0.4s var(--ease);
  user-select: none;
}

.project-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.project-item__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-secondary);
  transition: color 0.4s var(--ease);
}

.project-item__sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
  transition: color 0.4s var(--ease);
  max-width: 500px;
}

.project-item__right {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-shrink: 0;
  padding-left: var(--space-8);
}

.project-item__role {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: color 0.4s var(--ease), opacity 0.4s var(--ease);
}

.project-item__arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-8px) scale(0.75);
  transition: transform 0.4s var(--ease), color 0.4s var(--ease), opacity 0.4s var(--ease);
}

.project-item__arrow .material-symbols-outlined {
  font-size: 32px;
  transition: font-size 0.4s var(--ease);
}

/* Hover: image floods, all text turns white */
.project-item:hover .project-item__num   { opacity: 0.25; color: #fff; }
.project-item:hover .project-item__title { color: #fff; text-shadow: 0 1px 12px rgba(0,0,0,0.6); }
.project-item:hover .project-item__sub   { color: rgba(255, 255, 255, 0.65); text-shadow: 0 1px 8px rgba(0,0,0,0.5); }
.project-item:hover .project-item__role  { opacity: 0; }
.project-item:hover .project-item__arrow {
  color: var(--accent);
  transform: translateX(0) scale(1);
  opacity: 1;
}
.project-item:hover .project-item__arrow .material-symbols-outlined {
  font-size: 72px;
}

/* Mobile + / × toggle — hidden on desktop */
.project-item__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  margin-left: var(--space-3);
  align-self: center;
  position: relative;
  z-index: 2;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.project-item__toggle::before,
.project-item__toggle::after {
  content: '';
  position: absolute;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), background 0.25s var(--ease);
}
.project-item__toggle::before { width: 11px; height: 1.5px; }
.project-item__toggle::after  { width: 1.5px; height: 11px; }

.project-item.is-open .project-item__toggle {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.project-item.is-open .project-item__toggle::before,
.project-item.is-open .project-item__toggle::after {
  background: var(--accent);
  transform: rotate(45deg);
}

/* Mobile accordion */
.project-item__preview {
  display: none;
  overflow: hidden;
  max-height: 0;
  position: relative;
  z-index: 2;
  transition: max-height 0.5s var(--ease), padding 0.3s var(--ease);
}
.project-item__preview img {
  width: 100%; aspect-ratio: 3 / 1;
  object-fit: cover; border-radius: var(--radius-md);
}
.project-item__preview-placeholder {
  width: 100%; aspect-ratio: 3 / 1;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text-muted); letter-spacing: 0.1em;
}
.project-item__preview-cta {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: 0.9rem; font-weight: 500; color: var(--accent);
  margin-top: var(--space-4);
}
.project-item.is-open .project-item__preview {
  max-height: 600px;
  padding-bottom: var(--space-6);
}

/* ── Project Card (case study pages) ─────────────────────── */
.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 200ms var(--ease), transform 200ms var(--ease), box-shadow 200ms var(--ease);
  cursor: pointer; text-decoration: none; color: inherit;
}
.project-card:hover {
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 16px 48px rgba(0,0,0,0.35);
  transform: translateY(-2px);
}
.project-card:active { transform: scale(0.99); }
.project-card--reverse { direction: rtl; }
.project-card--reverse > * { direction: ltr; }

.project-card__image { background: var(--bg-elevated); overflow: hidden; min-height: 300px; }
.project-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.project-card:hover .project-card__image img { transform: scale(1.04); }

.project-card__image-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--bg-elevated) 0%, #1e1e26 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em;
}

.project-card__content { padding: var(--space-12); display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-8); }
.project-card__meta { display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.project-card__meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }
.project-card__body { flex: 1; }
.project-card__title { font-family: var(--font-display); font-size: clamp(1.5rem, 2.5vw, 2.25rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; color: var(--text); margin-bottom: var(--space-4); }
.project-card__impact { font-size: 1rem; color: var(--text-secondary); line-height: 1.65; margin-bottom: var(--space-6); }
.project-card__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag { font-family: var(--font-mono); font-size: 0.8125rem; padding: var(--space-1) var(--space-3); border-radius: 100px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text-secondary); }
.project-card__cta { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 0.9rem; font-weight: 500; color: var(--accent); transition: gap var(--duration-fast) var(--ease); }
.project-card:hover .project-card__cta { gap: var(--space-3); }
.project-card--featured { grid-column: 1 / -1; grid-template-columns: 1.45fr 1fr; }
.project-card--stacked { display: flex; flex-direction: column; }
.project-card--stacked .project-card__image { aspect-ratio: 4 / 3; min-height: unset; }
.project-card--stacked .project-card__content { padding: var(--space-8); }
.project-card__number { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-muted); }

/* ── About Strip ──────────────────────────────────────────── */
.about-strip {
  padding: var(--space-32) 0;
}

/* Decorative quote mark behind the text */
.about-strip__quote-wrap {
  position: relative;
  padding-top: var(--space-8);
}

.about-strip__quote-wrap::before {
  content: '"';
  position: absolute;
  top: -0.15em;
  left: -0.08em;
  font-family: var(--font-display);
  font-size: clamp(10rem, 18vw, 20rem);
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* The quote itself — large, word-reveal, above the mark */
.about-strip__quote {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 4.5rem);
  font-weight: 600;
  font-style: normal;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-muted);
  max-width: 900px;
}

.about-strip__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.about-strip__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.word-reveal { display: inline; color: var(--text-muted); transition: color 0.25s ease; }
.word-reveal--lit { color: var(--text); }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  padding: var(--space-16) 0 var(--space-10);
  border-top: 1px solid var(--border);
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}
.footer__heading {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--space-3);
}
.footer__sub {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 40ch;
  margin-bottom: var(--space-6);
}
.footer__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.footer__link {
  font-size: 0.9375rem;
  color: var(--text-muted);
  transition: color var(--duration-fast) var(--ease);
}
.footer__link:hover { color: var(--text); }
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-6);
}
.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── Scroll Animations ────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease),
              transform var(--duration-slow) var(--ease);
}
.fade-up.is-visible { opacity: 1; transform: translateY(0); }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Extended type helpers (case study pages) ─────────────── */
.t-display { font-family: var(--font-display); font-size: clamp(3rem, 6vw, 6.5rem); font-weight: 650; line-height: 1.05; letter-spacing: -0.03em; }
.t-h1 { font-family: var(--font-display); font-size: clamp(2.25rem, 4vw, 4rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.025em; }
.t-h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 2.5vw, 2.25rem); font-weight: 550; line-height: 1.2; letter-spacing: -0.02em; }
.t-h3 { font-family: var(--font-display); font-size: clamp(1.125rem, 1.5vw, 1.375rem); font-weight: 550; line-height: 1.3; }
.t-body { font-family: var(--font-body); font-size: 17px; line-height: 1.75; color: var(--text-secondary); }
.t-body-lg { font-family: var(--font-body); font-size: clamp(1.0625rem, 1.25vw, 1.25rem); line-height: 1.75; color: var(--text-secondary); }
.t-muted { color: var(--text-secondary); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .project-item__arrow  { display: none; }
  .project-item__toggle { display: flex; }
  .project-item::before,
  .project-item::after  { display: none; }
  .project-item__preview { display: block; padding: 0 var(--space-5); }
  .project-item__role   { display: none; }

  .about-strip__actions { justify-content: flex-start; }
}

@media (max-width: 640px) {
  :root { --nav-height: 60px; }

  .container { padding: 0 var(--space-5); }

  /* Section spacing — 8rem is too tall on phones */
  .section    { padding: var(--space-16) 0; }
  .section--sm { padding: var(--space-10) 0; }
  .about-strip { padding: var(--space-16) 0; }
  .section-label { margin-bottom: var(--space-8); }

  .nav__links {
    display: none;
    position: fixed;
    top: var(--nav-height); left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: var(--space-6);
    gap: var(--space-4);
  }
  .nav__links.is-open { display: flex; }
  .nav__mobile-toggle { display: flex; }

  .hero__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-6);
  }
  .hero__ctas { flex-direction: column; align-items: flex-start; width: 100%; }
  .hero__ctas .btn { width: 100%; justify-content: center; }

  .project-item__num {
    font-size: clamp(3rem, 12vw, 5rem);
    width: clamp(50px, 14vw, 80px);
  }
  .project-item__title { font-size: clamp(1.4rem, 5.5vw, 2rem); }
  .project-item__link  { padding: var(--space-5) var(--space-4); }

  /* Preview accordion — tighter padding, better aspect ratio for small screens */
  .project-item__preview { padding: 0 var(--space-4); }
  .project-item.is-open .project-item__preview { padding: 0 var(--space-4) var(--space-5); }
  .project-item__preview img { aspect-ratio: 16 / 9; }

  .about-strip__quote { font-size: clamp(1.75rem, 6.5vw, 2.5rem); }
  .about-strip__quote-wrap::before { font-size: clamp(8rem, 30vw, 12rem); }

  .footer__inner { flex-direction: column; align-items: flex-start; }
  .footer__links { flex-wrap: wrap; gap: var(--space-4); }
}


/* ── Contact Modal ────────────────────────────────────────────── */

/* Strip browser button defaults from nav buttons */
button.nav__link:not(.nav__link--cta) {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

button.nav__link--cta {
  cursor: pointer;
  font: inherit;
}

/* Overlay */
.contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--ease);
}

.contact-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* Modal panel */
.contact-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-10);
  transform: translateY(16px) scale(0.98);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms var(--ease);
  opacity: 0;
}

.contact-overlay.is-open .contact-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Header */
.contact-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.contact-modal__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.contact-modal__intro {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 340px;
}

.contact-modal__close {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1);
  flex-shrink: 0;
  transition: border-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.contact-modal__close:hover {
  border-color: rgba(255,255,255,0.16);
  color: var(--text);
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.contact-form__label {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.contact-form__optional {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.contact-form__input,
.contact-form__select,
.contact-form__textarea {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  width: 100%;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.contact-form__input::placeholder,
.contact-form__textarea::placeholder {
  color: var(--text-muted);
}

.contact-form__input:focus,
.contact-form__select:focus,
.contact-form__textarea:focus {
  border-color: var(--accent);
  background: rgba(255, 98, 0, 0.04);
}

.contact-form__select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
  color: var(--text-muted);
}

.contact-form__select.has-value {
  color: var(--text);
}

.contact-form__select option {
  background: var(--bg-surface);
  color: var(--text);
}

.contact-form__textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.65;
}

/* Footer area */
.contact-form__footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.contact-form__submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--text);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}

.contact-form__submit:hover {
  opacity: 0.88;
}

.contact-form__submit:active {
  transform: scale(0.99);
}

.contact-form__submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.contact-form__fallback {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.contact-form__fallback a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease);
}

.contact-form__fallback a:hover {
  color: var(--text);
}

/* Error message */
.contact-form__error {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: #f87171;
  display: none;
}

.contact-form__error.is-visible {
  display: block;
}

/* Success state */
.contact-modal__success {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}

.contact-modal__success.is-visible {
  display: flex;
}

.contact-modal__success-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 98, 0, 0.12);
  border: 1px solid rgba(255, 98, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.contact-modal__success-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--text);
}

.contact-modal__success-body {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.contact-modal__success-close {
  margin-top: var(--space-4);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.contact-modal__success-close:hover {
  border-color: rgba(255,255,255,0.16);
  color: var(--text);
}

/* ── Password gate modal ─────────────────────────────────── */
.pw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.pw-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.pw-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-8);
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.pw-overlay.is-open .pw-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.pw-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.pw-modal__lock {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.pw-modal__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.pw-modal__sub {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.pw-modal__close {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
  flex-shrink: 0;
}

.pw-modal__close:hover {
  border-color: rgba(255,255,255,0.16);
  color: var(--text);
}

.pw-modal__input-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pw-modal__input {
  width: 100%;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
  box-sizing: border-box;
}

.pw-modal__input::placeholder { color: var(--text-muted); }

.pw-modal__input:focus {
  border-color: var(--accent);
  background: rgba(255, 98, 0, 0.04);
}

.pw-modal__input.is-error {
  border-color: #ef4444;
  animation: pwShake 0.4s var(--ease);
}

@keyframes pwShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.pw-modal__error {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: #ef4444;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}

.pw-modal__error.is-visible { opacity: 1; }

.pw-modal__submit {
  width: 100%;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease);
}

.pw-modal__submit:hover { opacity: 0.88; }

[data-theme="light"] .pw-overlay { background: rgba(0, 0, 0, 0.4); }
[data-theme="light"] .pw-modal { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15); }
[data-theme="light"] .pw-modal__input { background: rgba(0, 0, 0, 0.02); }
[data-theme="light"] .pw-modal__input:focus { background: rgba(184, 64, 0, 0.04); }

@media (max-width: 600px) {
  .pw-modal { max-width: calc(100% - var(--space-8)); }
}

/* Light mode overrides */
[data-theme="light"] .contact-overlay {
  background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .contact-modal {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255,255,255,0.8);
}

[data-theme="light"] .contact-form__input,
[data-theme="light"] .contact-form__select,
[data-theme="light"] .contact-form__textarea {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .contact-form__input:focus,
[data-theme="light"] .contact-form__select:focus,
[data-theme="light"] .contact-form__textarea:focus {
  background: rgba(184, 64, 0, 0.04);
}

/* Mobile */
@media (max-width: 600px) {
  .contact-modal {
    padding: var(--space-8) var(--space-6);
    max-height: 95vh;
  }
}
