/* ═══════════════════════════════════════════════════════
   NOMAD STUDIO — Site CSS
   Stack: MuseoModerno (display) + Figtree (body)
   Palette: C_VOID #0A0907 · C_SAND #F3EFE8 · C_TERRA #C24D2C
═══════════════════════════════════════════════════════ */

/* ── Fonts ──────────────────────────────────────────── */
@font-face {
  font-family: 'Museo';
  src: url('../fonts/MuseoModerno.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Museo';
  src: url('../fonts/MuseoModerno-Italic.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Fig';
  src: url('../fonts/Figtree.ttf') format('truetype');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────── */
:root {
  --void:   #0A0907;
  --ink:    #232220;
  --ink2:   #3A3836;
  --sand:   #F3EFE8;
  --terra:  #C24D2C;
  --dust:   #8A8784;
  --stone:  #D4CEC4;

  --sand-52: rgba(243,239,232,.52);
  --sand-16: rgba(243,239,232,.16);
  --sand-08: rgba(243,239,232,.08);

  --f-head: 'Museo', sans-serif;
  --f-body: 'Fig', sans-serif;

  /* spacing */
  --m:  2.4rem;   /* margin */
  --g:  1.2rem;   /* gutter */
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 10px; scroll-behavior: auto; }
body {
  background: var(--void);
  color: var(--sand);
  font-family: var(--f-body);
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a      { color: inherit; text-decoration: none; }
img    { display: block; max-width: 100%; }
button { background: none; border: none; color: inherit; cursor: pointer; font: inherit; }

/* ── Utilities ──────────────────────────────────────── */
.px-m { padding-left: var(--m); padding-right: var(--m); }
.sq {
  display: inline-block;
  width: .6rem; height: .6rem;
  background: var(--terra);   /* terra accent squares */
  flex-shrink: 0;
  margin-right: .8rem;
  transform: translateY(-.1rem);
}

/* ═══════════════════════════════════════════════════════
   LOADER
═══════════════════════════════════════════════════════ */
.loader {
  position: fixed;
  inset: 0;
  background: var(--void);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  transition: opacity .7s ease .1s, visibility .7s .1s;
}
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-logo {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 4rem;
  letter-spacing: .1em;
  color: var(--sand);
}
.loader-bar {
  width: 16rem;
  height: 1px;
  background: var(--sand-16);
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--terra);
  transition: width .6s ease;
}

/* ═══════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════ */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 500;
  /* Difference blend makes nav readable over any content */
  mix-blend-mode: difference;
  color: var(--sand);
}

.header-grid {
  display: flex;
  align-items: flex-start;
  gap: var(--g);
  padding: var(--m);
  font-family: var(--f-body);
  font-size: 1.4rem;
}

/* NOMAD wordmark */
.header-logo {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: .06em;
  flex-shrink: 0;
  line-height: 1;
}

.header-nav,
.header-contact {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-left: var(--g);
}

.hlink {
  font-size: 1.4rem;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s;
  line-height: 1.5;
}
.hlink:hover { color: var(--terra); }

.header-meta {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  text-align: right;
  opacity: .52;
  font-size: 1.3rem;
}

/* Mobile burger */
.header-burger {
  display: none;
  font-family: var(--f-body);
  font-size: 1.4rem;
  padding: .7rem 1.2rem;
  background: var(--sand-16);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  line-height: 1;
  white-space: nowrap;
}
.burger-close { display: none; }
.header-burger.open .burger-open  { display: none; }
.header-burger.open .burger-close { display: block; }

/* Mobile menu overlay */
.mob-menu {
  position: fixed;
  inset: 0;
  background: rgba(10,9,7,.85);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--m);
  z-index: -1;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s, visibility .4s;
}
.mob-menu.open { opacity: 1; visibility: visible; z-index: 490; }

.mob-nav { display: flex; flex-direction: column; gap: 1.6rem; }
.mob-link {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 4.8rem;
  text-transform: uppercase;
  letter-spacing: -.1rem;
  line-height: 1;
  transition: color .2s;
}
.mob-link:hover { color: var(--terra); }

.mob-footer {
  position: absolute;
  bottom: var(--m);
  left: var(--m); right: var(--m);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mob-links { display: flex; flex-direction: column; gap: .5rem; font-size: 1.4rem; }
.mob-cta {
  padding: .8rem 1.4rem;
  background: var(--sand-16);
  backdrop-filter: blur(20px);
  font-size: 1.4rem;
}

/* ═══════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════ */
.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--m);
}

/* Three.js particle canvas — fills hero */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;   /* let mouse events pass through to the section */
}

.hero-bottom {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: var(--g);
  padding-bottom: calc(var(--m) * .5);
}

.hero-title-clip { overflow: hidden; }
.hero-title {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: clamp(2.6rem, 4.8vw, 5.6rem);
  line-height: .92;
  letter-spacing: -.25rem;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
}
.hero-line {
  display: block;
  transform: translateY(110%);
  will-change: transform;
}
.hero-line--indent { padding-left: 8vw; }

.hero-desc {
  font-family: var(--f-body);
  font-size: 1.4rem;
  line-height: 1.75;
  color: var(--sand-52);
  opacity: 0;
  justify-self: end;
  align-self: end;
  max-width: 42rem;
}

/* ═══════════════════════════════════════════════════════
   WORKS
═══════════════════════════════════════════════════════ */
.works-wrap { position: relative; }

/* Scroll container: 6 × 100svh */
.works-scroll { height: calc(6 * 100svh); position: relative; }

/* Sticky viewport */
.works-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

/* Three.js canvas */
.works-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Dark vignette over canvas */
.works-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 35%, rgba(10,9,7,.6) 100%),
    linear-gradient(to bottom, rgba(10,9,7,.5) 0%, transparent 20%, transparent 75%, rgba(10,9,7,.8) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Top bar */
.works-bar-top {
  position: absolute;
  top: calc(var(--m) + 11rem);
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--m);
  z-index: 5;
  pointer-events: none;
  font-family: var(--f-body);
  font-size: 1.4rem;
}
.works-index {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 4.8rem;
  line-height: 1;
}
.works-label-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .8rem;
  font-size: 1.3rem;
  white-space: nowrap;
}
.works-sq {
  display: inline-block;
  width: .6rem; height: .6rem;
  background: var(--terra);
  flex-shrink: 0;
}
.works-total { opacity: .52; }

/* Bottom meta */
.works-bar-bottom {
  position: absolute;
  bottom: var(--m);
  left: 0; right: 0;
  padding: 0 var(--m);
  z-index: 5;
  pointer-events: none;
}
.works-title {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: clamp(3.2rem, 6vw, 6.4rem);
  line-height: 1;
  letter-spacing: -.15rem;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
}
.works-meta { display: flex; gap: 3.2rem; }
.works-meta-col { display: flex; flex-direction: column; gap: .3rem; }
.works-meta-label { font-size: 1.2rem; color: var(--sand-52); font-family: var(--f-body); }
.works-meta-val   { font-size: 1.4rem; font-family: var(--f-body); }
.works-meta-col--date { display: none; }

/* Full-screen click layer */
.works-hit { position: absolute; inset: 0; z-index: 6; }

/* CTA */
.works-cta-wrap { padding: 0 var(--m); }
.works-cta {
  display: block;
  width: 100%;
  text-align: center;
  font-family: var(--f-body);
  font-size: 1.4rem;
  padding: 1.4rem 0;
  background: var(--ink2);
  transition: background .25s, color .25s;
}
.works-cta:hover { background: var(--terra); color: var(--sand); }

/* ═══════════════════════════════════════════════════════
   SUPTITLE (reused)
═══════════════════════════════════════════════════════ */
.suptitle {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--m);
  margin-bottom: 8rem;
  font-family: var(--f-body);
  font-size: 1.3rem;
  color: var(--dust);
  text-transform: uppercase;
  letter-spacing: .15em;
}
.sup-left { display: flex; align-items: center; }
.sup-mid  { position: absolute; left: 50%; transform: translateX(-50%); }
.sup-right {}

/* ═══════════════════════════════════════════════════════
   IDENTITY
═══════════════════════════════════════════════════════ */
.identity {
  margin-top: 10rem;
  padding-top: 4rem;
  border-top: 1px solid var(--sand-08);
}

.identity-copy {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
  gap: var(--g);
}

.identity-headline {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: clamp(5rem, 12vw, 12rem);
  line-height: .9;
  letter-spacing: -.3rem;
  text-transform: uppercase;
}
.identity-h-row { display: block; }
.identity-h-row--push { padding-left: 10vw; }
.identity-h-em { font-style: italic; color: var(--terra); }

.identity-aside {
  font-family: var(--f-body);
  font-size: 1.3rem;
  color: var(--dust);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding-bottom: 1.5rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.identity-img-wrap { margin-bottom: 6rem; }
.identity-img-box {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--ink);
}
.identity-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.identity-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  padding-bottom: 10rem;
}
.identity-body p {
  font-size: 1.5rem;
  line-height: 1.8;
  color: var(--sand-52);
  margin-bottom: 2rem;
}
.identity-quote {
  grid-column: 2;
  font-family: var(--f-head);
  font-weight: 500;
  font-style: italic;
  font-size: 2rem;
  line-height: 1.4;
  color: var(--sand);
  border-left: 2px solid var(--terra);
  padding-left: 2rem;
  margin-top: 2rem;
}

/* ═══════════════════════════════════════════════════════
   SERVICES
═══════════════════════════════════════════════════════ */
.services {
  border-top: 1px solid var(--sand-08);
  padding-top: 4rem;
}

.services-headline {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: clamp(3rem, 5vw, 5.4rem);
  line-height: 1;
  letter-spacing: -.15rem;
  text-transform: uppercase;
  padding: 0 var(--m);
  margin-top: 8rem;
  margin-bottom: 8rem;
}

.services-body {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4rem;
  padding-bottom: 10rem;
  align-items: start;
}

.services-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--sand-08);
}

.service-row {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: var(--g);
  padding: 2.4rem 0;
  border-bottom: 1px solid var(--sand-08);
  transition: background .2s;
}
.service-row:hover { background: rgba(243,239,232,.02); }

.service-name {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-family: var(--f-body);
  font-size: 1.4rem;
}
.service-name .shuffle { cursor: default; }
.service-num  { font-size: 1.2rem; color: var(--dust); }
.service-desc {
  font-size: 1.4rem;
  color: var(--sand-52);
  line-height: 1.7;
}

/* Services visual (right column) */
.services-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.2;
  overflow: hidden;
  background: var(--ink);
}
.services-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.services-img-fallback {
  position: absolute;
  inset: 0;
  background: linear-gradient(170deg, var(--ink2) 0%, var(--void) 100%);
}

/* ═══════════════════════════════════════════════════════
   CLIENTS MARQUEE
═══════════════════════════════════════════════════════ */
.clients {
  border-top: 1px solid var(--sand-08);
  padding-bottom: 4.8rem;
}
.clients .suptitle { margin-bottom: 3.2rem; }

.clients-track-wrap {
  overflow: hidden;
  cursor: default;
  border-top: 1px solid var(--sand-08);
  border-bottom: 1px solid var(--sand-08);
  padding: 2rem 0;
}
/* Fade edges */
.clients-track-wrap::before,
.clients-track-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 12rem;
  z-index: 2;
  pointer-events: none;
}
.clients-track-wrap { position: relative; }
.clients-track-wrap::before { left: 0;  background: linear-gradient(to right,  var(--void), transparent); }
.clients-track-wrap::after  { right: 0; background: linear-gradient(to left, var(--void), transparent); }

.clients-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: marquee 36s linear infinite;
  will-change: transform;
}
.clients-track-wrap:hover .clients-track {
  animation-play-state: paused;
}

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

.client-item {
  font-family: var(--f-head);
  font-weight: 500;
  font-size: clamp(1.5rem, 1.8vw, 2.2rem);
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  padding: 0 2.8rem;
  transition: color .2s;
  cursor: default;
}
.client-item:hover { color: var(--terra); }

.client-sep {
  color: var(--terra);
  font-size: .6rem;
  flex-shrink: 0;
  opacity: .7;
}

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--sand-08);
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.footer-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.footer-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--f-head);
  font-weight: 700;
  font-size: clamp(10rem, 28vw, 28rem);
  letter-spacing: -.4rem;
  line-height: 1;
  color: var(--sand);
  opacity: .03;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.footer-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--g);
  padding-bottom: 4rem;
}

.footer-col { display: flex; flex-direction: column; gap: 1rem; font-size: 1.4rem; }
.footer-col-head {
  display: flex;
  align-items: center;
  font-family: var(--f-body);
  font-weight: 500;
}
.footer-addr { color: var(--dust); font-size: 1.3rem; }
.footer-email {
  display: block;
  transition: color .2s;
}
.footer-email:hover { color: var(--terra); }
.footer-links { display: flex; flex-direction: column; gap: .8rem; }
.footer-credit { color: var(--dust); font-size: 1.3rem; }

.footer-bottom {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--sand-08);
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.back-top {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 1.4rem;
  padding: 1.4rem 0;
  background: var(--ink2);
  transition: background .25s, color .25s;
}
.back-top:hover { background: var(--terra); color: var(--sand); }

/* ═══════════════════════════════════════════════════════
   SCANLINE
═══════════════════════════════════════════════════════ */
.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 1px,
    rgba(0,0,0,.06) 1px, rgba(0,0,0,.06) 2px
  );
}

/* ═══════════════════════════════════════════════════════
   REVEAL CLASSES (GSAP sets these)
═══════════════════════════════════════════════════════ */
.will-reveal { opacity: 0; transform: translateY(3rem); }

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

/* ≥ 1280px */
@media (min-width: 1280px) {
  :root { --m: 3.2rem; --g: 1.6rem; }
  .header-burger { display: none; }
  .works-meta-col--date { display: flex; }
}

/* 768 – 1279px */
@media (min-width: 768px) and (max-width: 1279px) {
  .header-nav, .header-contact, .header-meta { display: none; }
  .header-burger { display: block; }
  .services-body { grid-template-columns: 3fr 2fr; }
  .identity-body { grid-template-columns: 1fr; }
  .identity-quote { grid-column: 1; }
}

/* < 768px */
@media (max-width: 767px) {
  :root { --m: 1.6rem; }

  /* ── Header ── */
  .header-nav, .header-contact, .header-meta { display: none; }
  .header-burger { display: block; }

  /* ── Hero ── */
  .hero-bottom { grid-template-columns: 1fr; gap: 1.6rem; padding-bottom: 2.4rem; }
  .hero-desc { justify-self: start; font-size: 1.3rem; }
  /* Hero title was reduced desktop-first; restore readable mobile size */
  .hero-title { font-size: clamp(3rem, 9vw, 5rem); }
  .hero-line--indent { padding-left: 5vw; }

  /* ── Works ── */
  .works-bar-top { top: calc(var(--m) + 8rem); }
  .works-index { font-size: 3.2rem; }
  .works-title { font-size: clamp(2.4rem, 7vw, 4rem); }
  .works-bar-bottom { padding: 0 var(--m) calc(var(--m) * 1.5); }
  .works-meta { flex-direction: column; gap: .8rem; }
  .works-meta-col--date { display: none; }
  /* hide label, show only value on small screens */
  .works-meta-label { font-size: .9rem; }
  .works-meta-val { font-size: 1.2rem; }

  /* ── Identity ── */
  .identity-copy { flex-direction: column; align-items: flex-start; gap: 1.6rem; }
  .identity-aside { padding-bottom: 0; writing-mode: horizontal-tb; transform: none; }
  .identity-h-row--push { padding-left: 0; }
  .identity-body { grid-template-columns: 1fr; }
  .identity-quote { grid-column: 1; font-size: 1.5rem; }

  /* ── Services ── */
  .services-body { grid-template-columns: 1fr; }
  .services-visual { aspect-ratio: 3/2; }
  .services-visual { order: -1; }   /* image above list on mobile */
  .service-row { grid-template-columns: 1fr; gap: .6rem; }
  .services-headline { font-size: clamp(2.8rem, 8vw, 4rem); }

  /* ── Clients marquee ── */
  .client-item { font-size: 1.4rem; padding: 0 1.8rem; }
  .clients-track-wrap::before,
  .clients-track-wrap::after { width: 5rem; }

  /* ── Suptitle ── */
  .suptitle { flex-wrap: wrap; gap: .6rem; }
  .sup-right { display: none; }
  .sup-mid { position: static; transform: none; margin-left: auto; }

  /* ── Footer ── */
  .footer-body { grid-template-columns: 1fr; gap: 2.4rem; }
  .footer-col:last-child { grid-column: 1; }
}

/* Extra small — phones < 390px */
@media (max-width: 389px) {
  .works-title { font-size: 2rem; }
  .works-index { font-size: 2.4rem; }
  .hero-title { font-size: 2.8rem; letter-spacing: -.1rem; }
}
