:root {
  --nav-height: 88px;
  --bone: #F5F1EA;
  --paper: #EDE7DB;
  --ink: #1E1A10;
  --warm-dk: #261F0E;
  --ash: #5E5A52;
  --sand: #E0D6C5;
  --stone: #C9BEAC;
  --clay: #C4654D;
  --terra: #B8553D;
  --sage: #8B9B7C;
  --sky: #8FA7B8;
  --dune: #D4B896;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
img { max-width: 100%; }
body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--bone);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Typography utility classes */
.font-display { font-family: 'Space Grotesk', system-ui, sans-serif; }
.font-mono    { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.eyebrow {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 13px;
  font-weight: 500;
}

.h-display {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.98;
  text-wrap: balance;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Page wrapper — keep content below the fixed nav */
.page-wrap {
  padding-top: calc(var(--nav-height) + 56px);
}
@media (max-width: 768px) {
  .page-wrap { padding-top: calc(var(--nav-height) + 32px); }
}
[id], section { scroll-margin-top: calc(var(--nav-height) + 32px); }

/* Hero exception — content starts under transparent nav */
.hero-wrap {
  padding-top: 0;
}

/* Nav active underline — animated slide-in */
.nav-link {
  position: relative;
  padding-bottom: 4px;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1.5px;
  background: var(--terra);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-link.on-dark::after {
  background: var(--clay);
}
.nav-link.active::after {
  transform: scaleX(1);
}
.nav-link.on-dark.active::after {
  background: var(--clay);
}

/* Buttons */
.btn {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  padding: 16px 28px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(.2,.7,.2,1);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--warm-dk);
  color: var(--bone);
}
.btn-primary:hover {
  background: var(--clay);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196,101,77,.24);
}
.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--bone);
}
.btn-light {
  background: transparent;
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.btn-light:hover {
  background: #fff;
  color: var(--ink);
}
.btn-fill-light {
  background: #fff;
  color: var(--ink);
}
.btn-fill-light:hover {
  background: var(--clay);
  color: #fff;
}

/* Subtle trailing dot — only appears on hover over interactive elements */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 5px; height: 5px;
  border-radius: 999px;
  background: var(--terra);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity .18s ease;
}
.cursor-dot.hover-show { opacity: 1; }

@media (max-width: 900px) {
  .cursor-dot { display: none; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .16s; }
.reveal.delay-3 { transition-delay: .24s; }
.reveal.delay-4 { transition-delay: .32s; }

/* Image clip reveal */
.clip-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.1s cubic-bezier(.7,0,.2,1);
}
.clip-reveal.in {
  clip-path: inset(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .clip-reveal { clip-path: inset(0 0 0 0) !important; }
  .page-fade { animation: none !important; }
}

/* ---------- Language switch ---------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0,0,0,0.14);
  overflow: hidden;
}
.lang-switch button {
  padding: 3px 9px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: none; border: none; cursor: pointer;
  color: inherit; opacity: 0.38;
  transition: opacity 0.2s ease, background 0.22s ease;
}
.lang-switch button.on {
  opacity: 1;
  background: rgba(0,0,0,0.08);
}
.lang-switch button:hover:not(.on) { opacity: 0.65; }

/* Placeholder image */
.ph {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  background-image:
    repeating-linear-gradient(135deg,
      transparent 0,
      transparent 14px,
      rgba(26,24,22,0.04) 14px,
      rgba(26,24,22,0.04) 15px);
}
.ph[data-tone="sand"]   { background-color: #E8DCC4; }
.ph[data-tone="clay"]   { background-color: #D89A82; }
.ph[data-tone="terra"]  { background-color: #C4654D; }
.ph[data-tone="sage"]   { background-color: #B5C2A6; }
.ph[data-tone="sky"]    { background-color: #B5C6D2; }
.ph[data-tone="ink"]    { background-color: #2A2826; }
.ph[data-tone="paper"]  { background-color: #EDE7DB; }
.ph[data-tone="stone"]  { background-color: #C9BEAC; }
.ph[data-tone="dune"]   { background-color: #D4B896; }
.ph[data-tone="bw"]     {
  background-color: #2A2826;
  background-image:
    radial-gradient(ellipse at 50% 35%, rgba(220,220,220,0.4), transparent 55%),
    repeating-linear-gradient(135deg,
      transparent 0, transparent 14px,
      rgba(255,255,255,0.05) 14px, rgba(255,255,255,0.05) 15px);
}
.ph[data-tone="ink"] .ph-label,
.ph[data-tone="bw"] .ph-label,
.ph[data-tone="terra"] .ph-label { color: rgba(255,255,255,0.7); }

.ph-label {
  position: absolute;
  left: 16px; bottom: 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: rgba(26,24,22,0.55);
  letter-spacing: 0.04em;
  pointer-events: none;
  max-width: calc(100% - 32px);
}
.ph-corner {
  position: absolute;
  right: 16px; top: 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: rgba(26,24,22,0.35);
  letter-spacing: 0.04em;
  z-index: 2;
}
.ph-corner-on-img {
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.35);
  padding: 2px 6px;
  backdrop-filter: blur(4px);
}
.ph[data-tone="ink"] .ph-corner,
.ph[data-tone="bw"] .ph-corner,
.ph[data-tone="terra"] .ph-corner { color: rgba(255,255,255,0.4); }

/* Normal cursor retained — subtle dot only appears on hover */

/* Smooth page transition — longer + more movement for visibility */
.page-fade {
  animation: pageFade 0.65s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes pageFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Launch screen logo entrance */
@keyframes launchLogoIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Form inputs */
.field {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--stone);
  padding: 14px 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color .25s ease;
}
.field:focus { border-bottom-color: var(--terra); }
.field::placeholder { color: rgba(26,24,22,0.4); }
.field-label {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  color: var(--ash);
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}

/* Hide scrollbars for thumb strips */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* ---------- Viewport-aware image sizing ---------- */
/* Cap heights so cards fit comfortably on common laptops (1366×768 / 1440×900). */
.img-thinking  { height: clamp(180px, 22vh, 270px); }
.img-pipeline  { height: clamp(160px, 20vh, 230px); }
.img-difference{ height: clamp(220px, 30vh, 340px); }
.img-service   { height: clamp(200px, 30vh, 320px); }
.img-project   { height: clamp(280px, 42vh, 460px); }
.img-stage     { height: clamp(240px, 40vh, 400px); }
.img-who       { height: clamp(300px, 44vh, 480px); }
.img-side      { height: clamp(240px, 36vh, 360px); }

/* Force placeholder children to fill their height when sized by parent */
.img-thinking > .ph, .img-thinking > .ph-img,
.img-pipeline > .ph, .img-pipeline > .ph-img,
.img-difference > .ph, .img-difference > .ph-img,
.img-service > .ph, .img-service > .ph-img,
.img-project > .ph, .img-project > .ph-img,
.img-stage > .ph, .img-stage > .ph-img,
.img-who > .ph, .img-who > .ph-img,
.img-side > .ph, .img-side > .ph-img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto !important;
}

/* ---------- Climate Lens button (signature UI) ---------- */
.lens-btn.pill { border-radius: 999px; padding: 10px 20px 10px 16px; font-size: 11px; }
.lens-btn {
  position: absolute;
  top: 18px; right: 18px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 11px 14px;
  background: rgba(26,24,22,0.78);
  backdrop-filter: blur(8px);
  color: #fff;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  transition: background .25s ease, transform .25s ease, border-color .25s ease;
}
.lens-btn:hover { background: rgba(196,101,77,0.92); border-color: rgba(255,255,255,0.4); transform: translateY(-1px); }
.lens-btn.on { background: var(--clay); border-color: rgba(255,255,255,0.5); }

.lens-eye {
  position: relative;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
}
.lens-eye::before {
  content: '';
  width: 18px; height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 12px / 10px;
}
.lens-eye::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--clay);
}
.lens-btn.on .lens-eye::after { background: #fff; }
.lens-btn .lens-ring-1 {
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(196,101,77,0.65);
  border-radius: 999px;
  animation: pulseRing 2.4s ease-out infinite;
  pointer-events: none;
}
.lens-btn .lens-ring-2 {
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(196,101,77,0.45);
  border-radius: 999px;
  animation: pulseRing 2.4s ease-out infinite;
  animation-delay: 1.2s;
  pointer-events: none;
}
.lens-btn.on .lens-ring-1,
.lens-btn.on .lens-ring-2 { display: none; }

.lens-microcopy {
  position: absolute;
  top: 14px; left: 18px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(26,24,22,0.55);
  padding: 6px 10px;
  z-index: 10;
}

/* Image darken when lens active */
.lens-darken { position: relative; }
.lens-darken::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(15,13,12,0);
  transition: background .5s ease;
  pointer-events: none;
}
.lens-darken.on::after { background: rgba(15,13,12,0.28); }

/* ---------- Before/After scrubber ---------- */
.ba-wrap {
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: ew-resize;
}
.ba-before, .ba-after {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.ba-mask {
  position: absolute; inset: 0;
  clip-path: inset(0 var(--ba-cut, 50%) 0 0);
  -webkit-clip-path: inset(0 var(--ba-cut, 50%) 0 0);
}
.ba-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: #fff;
  left: calc(100% - var(--ba-cut, 50%));
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.ba-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px; height: 44px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 14px; font-weight: 600;
  color: var(--ink);
  pointer-events: none;
}
.ba-label {
  position: absolute;
  bottom: 16px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: #fff;
  padding: 6px 10px;
  background: rgba(26,24,22,0.7);
}
.ba-label.left  { left: 16px; }
.ba-label.right { right: 16px; }

/* Hero progress */
.hero-progress {
  height: 1px;
  background: rgba(255,255,255,0.25);
  position: relative;
  overflow: hidden;
}
.hero-progress-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(255,255,255,0.95);
  transform-origin: left center;
  animation: heroFill 5.2s linear forwards;
}
@keyframes heroFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Process snake connector ---------- */
.process-snake {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.process-snake .proc-line {
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, var(--terra), var(--clay));
  opacity: 0.35;
  transform-origin: left center;
  transform: translateY(-50%) scaleX(0);
}
.process-snake.active .proc-line {
  transform: translateY(-50%) scaleX(1);
  transition: transform 1.8s cubic-bezier(.4,0,.2,1) .3s;
}
.process-snake .proc-dot {
  position: absolute;
  top: 50%;
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--terra);
  transform: translate(-50%, -50%);
  opacity: 0;
}
.process-snake.active .proc-dot {
  opacity: 0.65;
  transition: opacity .3s ease var(--d, 1.6s);
}

/* ---------- Rounded flow pills (Who We Are) ---------- */
.flow-pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 999px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid;
  transition: transform .2s ease, box-shadow .2s ease;
}
.flow-pill:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.flow-pill-sand  { background: oklch(93% 0.03 80);  color: oklch(42% 0.08 75);  border-color: oklch(80% 0.05 80); }
.flow-pill-blue  { background: oklch(91% 0.025 220); color: oklch(35% 0.07 220); border-color: oklch(74% 0.04 220); }
.flow-pill-terra { background: oklch(90% 0.05 30);  color: oklch(40% 0.1 28);   border-color: oklch(70% 0.08 30); }
.flow-pill-green { background: oklch(90% 0.04 145); color: oklch(36% 0.08 145); border-color: oklch(71% 0.05 145); }

/* Video placeholder */
.video-ph { position: relative; background: var(--ink); overflow: hidden; }
.video-ph-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
  background: rgba(15,13,12,0.32); color: #fff;
}
.video-ph-play {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--ink);
  cursor: pointer;
  transition: transform .25s ease;
}
.video-ph-play:hover { transform: scale(1.1); }

/* Climate lens annotation pulse */
@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}
.lens-ring {
  animation: pulseRing 2s ease-out infinite;
}

/* ---------- Spatial Rhythm tweaks ---------- */
[data-rhythm="tight"] .py-32    { padding-top: 4rem !important;  padding-bottom: 4rem !important; }
[data-rhythm="tight"] .py-24    { padding-top: 3rem !important;  padding-bottom: 3rem !important; }
[data-rhythm="tight"] .pb-24    { padding-bottom: 3rem !important; }
[data-rhythm="tight"] .pb-32    { padding-bottom: 4rem !important; }
[data-rhythm="tight"] .pt-16    { padding-top: 2rem !important; }
[data-rhythm="tight"] .md\:py-40 { padding-top: 4rem !important; padding-bottom: 4rem !important; }
[data-rhythm="tight"] .md\:py-32 { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }
[data-rhythm="tight"] .md\:pb-32 { padding-bottom: 3.5rem !important; }

[data-rhythm="editorial"] .py-32    { padding-top: 9rem !important;  padding-bottom: 9rem !important; }
[data-rhythm="editorial"] .py-24    { padding-top: 7rem !important;  padding-bottom: 7rem !important; }
[data-rhythm="editorial"] .pb-24    { padding-bottom: 7rem !important; }
[data-rhythm="editorial"] .pb-32    { padding-bottom: 9rem !important; }
[data-rhythm="editorial"] .md\:py-40 { padding-top: 11rem !important; padding-bottom: 11rem !important; }
[data-rhythm="editorial"] .md\:py-32 { padding-top: 9rem !important;  padding-bottom: 9rem !important; }
[data-rhythm="editorial"] .md\:pb-32 { padding-bottom: 9rem !important; }
[data-rhythm="editorial"] .mb-16    { margin-bottom: 5rem !important; }
[data-rhythm="editorial"] .mb-12    { margin-bottom: 4rem !important; }

/* ---------- Marquee row for hero eyebrow ---------- */
.dot-sep {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 999px;
  background: currentColor;
  vertical-align: middle;
  margin: 0 14px;
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════════
   PREMIUM UI SPRINKLES — subtle architectural motion
═══════════════════════════════════════════════════ */

/* Project / image card hover — very gentle scale */
.img-stage,
.img-project,
.img-difference,
.img-side,
.img-who { overflow: hidden; }

.img-stage img,
.img-project img,
.img-difference img,
.img-side img,
.img-who img {
  transition: transform 1.1s cubic-bezier(0.22,1,0.36,1);
}
.group:hover .img-stage img,
.group:hover .img-project img,
article:hover .img-stage img,
article:hover .img-project img { transform: scale(1.025); }

/* Scroll reveal — snappier easeOut */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity  0.75s cubic-bezier(0.22,1,0.36,1),
    transform 0.75s cubic-bezier(0.22,1,0.36,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: .07s; }
.reveal.delay-2 { transition-delay: .14s; }
.reveal.delay-3 { transition-delay: .21s; }
.reveal.delay-4 { transition-delay: .28s; }

/* Nav link hover — subtle dim */
.nav-link { transition: opacity 0.18s ease; }
.nav-link:hover { opacity: 0.6; }
.nav-link.active { opacity: 1 !important; }

/* Focus visible (accessibility) */
:focus-visible {
  outline: 2px solid var(--clay, #C4654D);
  outline-offset: 3px;
}

/* ── Touch targets (coarse pointer = mobile) ── */
@media (pointer: coarse) {
  .btn { min-height: 48px; }
  .lang-switch button { min-height: 40px; min-width: 36px; }
  .nav-link { padding-top: 6px; padding-bottom: 6px; }
}

/* ── Arabic readability ── */
html[dir="rtl"] p,
html[dir="rtl"] li,
html[dir="rtl"] .h-display {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── Mobile typography baseline ── */
@media (max-width: 640px) {
  body { font-size: 15px; line-height: 1.62; }
  .eyebrow { font-size: 11px; }
}
