/* ClearStack ai — photoreal city + Studio Monograph overlay */
:root {
  --night: #050609;
  --night-alt: #0c0f16;
  --paper: #ede6d3;
  --paper-dim: rgba(237, 230, 211, 0.58);
  --paper-faint: rgba(237, 230, 211, 0.45);
  --line: rgba(237, 230, 211, 0.12);
  --orange: #e2823d;
  --pewter: #9c9280;
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "Instrument Sans", Arial, Helvetica, sans-serif;
  --header-h: 4.25rem;
  --plate: rgba(5, 6, 9, 0.55);
  --plate-strong: rgba(5, 6, 9, 0.78);
  --max: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--paper);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(226, 130, 61, 0.35);
  color: var(--paper);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* --- 3D layer --- */
#webgl {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#webgl canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

#vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5,6,9,0.72) 0%, rgba(5,6,9,0.25) 38%, rgba(5,6,9,0.1) 62%, rgba(5,6,9,0.55) 100%),
    linear-gradient(180deg, rgba(5,6,9,0.45) 0%, transparent 22%, transparent 48%, rgba(5,6,9,0.82) 100%),
    radial-gradient(ellipse 90% 70% at 55% 45%, transparent 30%, rgba(5,6,9,0.5) 100%);
}

#grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#scrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  z-index: 50;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s ease, background 0.35s ease;
}

.site-header.scrolled {
  background: rgba(5, 6, 9, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
}
.brand-full {
  height: 1.55rem;
  width: auto;
}
@media (min-width: 640px) {
  .brand-full { height: 1.85rem; }
}

.nav {
  display: none;
  align-items: center;
  gap: clamp(1.1rem, 2.2vw, 1.85rem);
  font-size: 0.9rem;
  font-weight: 500;
}
.nav a {
  color: var(--paper-dim);
  transition: color 0.2s ease;
}
.nav a:hover,
.nav a:focus-visible,
.nav a.active {
  color: var(--paper);
  outline: none;
}
.nav-cta {
  color: var(--paper) !important;
  font-weight: 600;
}
.nav-cta:hover { color: var(--orange) !important; }
.nav-cta span {
  display: inline-block;
  transition: transform 0.25s ease;
}
.nav-cta:hover span { transform: translateX(4px); }

.nav-toggle {
  width: 44px; height: 44px;
  border: 0;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  padding: 10px;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--paper);
  transition: transform 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(4.25px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-4.25px) rotate(-45deg);
}

.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 35;
  background: rgba(5, 6, 9, 0.96);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  gap: 0;
  font-size: 1.2rem;
}
.mobile-nav a {
  color: var(--paper);
  padding: 0.95rem 0;
  border-bottom: 1px dashed var(--line);
}
.mobile-nav[hidden] { display: none; }

@media (min-width: 900px) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
}

/* --- Main --- */
main {
  position: relative;
  z-index: 5;
}

/* HERO — open over the city, asymmetric */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding:
    calc(var(--header-h) + 2rem)
    clamp(1.25rem, 5vw, 4.5rem)
    clamp(2.5rem, 7vh, 4.5rem);
  transition: opacity 0.15s linear;
  will-change: opacity, transform;
}

.hero-grid {
  width: min(100%, var(--max));
  display: grid;
  gap: 1.75rem;
  align-items: end;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr 15rem;
    gap: 2rem;
  }
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pewter);
}
.eyebrow.accent {
  color: var(--orange);
  margin-bottom: 0.45rem;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 450;
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: pretty;
  text-shadow: 0 2px 40px rgba(5, 6, 9, 0.55);
}

h1 {
  font-size: clamp(2.75rem, 7.2vw, 5.75rem);
  max-width: 14ch;
}

h2 {
  font-size: clamp(1.65rem, 3.2vw, 2rem);
  max-width: 18ch;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  margin: 0 0 0.45rem;
}

.em {
  font-style: italic;
  color: var(--orange);
  font-weight: 450;
}

.scope-line {
  margin: 0;
  color: var(--paper-dim);
  font-size: 0.95rem;
  line-height: 1.45;
  text-shadow: 0 1px 18px rgba(5, 6, 9, 0.8);
}

.hero-below {
  width: min(100%, var(--max));
  margin-top: clamp(1.75rem, 4vh, 2.75rem);
  padding-top: clamp(1.25rem, 3vh, 1.75rem);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 900px) {
  .hero-below {
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: end;
  }
}

.lede {
  max-width: 38rem;
  color: var(--paper-dim);
  font-size: clamp(1rem, 1.35vw, 1.1rem);
  margin: 0;
  text-shadow: 0 1px 18px rgba(5, 6, 9, 0.8);
}
.lede.tight { margin-bottom: 0; max-width: 32rem; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--paper);
  position: relative;
  padding-bottom: 0.12rem;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.text-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.text-link:hover::after,
.text-link:focus-visible::after { transform: scaleX(1); }
.text-link:focus-visible {
  outline: 1px solid var(--orange);
  outline-offset: 4px;
}
.text-link span { transition: transform 0.25s ease; }
.text-link:hover span { transform: translateX(4px); }
.text-link.muted { color: var(--paper-dim); font-weight: 500; }
.text-link:hover { color: var(--orange); }

/* --- Content stack: one continuous plate --- */
.content-stack {
  position: relative;
  margin-top: -1rem;
  padding:
    clamp(2.5rem, 6vh, 4rem)
    clamp(1.25rem, 5vw, 4.5rem)
    1.5rem;
  background:
    linear-gradient(180deg, transparent 0%, var(--plate) 6%, var(--plate-strong) 22%, rgba(5,6,9,0.94) 100%);
  border-top: 1px solid rgba(237, 230, 211, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translate3d(0, calc(var(--stack-shift, 0px) * -1), 0);
  will-change: transform;
}

.band {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.25rem, 5vh, 3.5rem) 0;
}

.band + .band {
  border-top: 1px solid var(--line);
}

.band-head {
  margin-bottom: clamp(1.35rem, 3vh, 2rem);
}
.band-head.split {
  display: grid;
  gap: 0.85rem;
}
.band-head .aside {
  margin: 0;
  color: var(--paper-dim);
  max-width: 28rem;
  font-size: 0.95rem;
}
@media (min-width: 900px) {
  .band-head.split {
    grid-template-columns: 1fr 0.95fr;
    align-items: end;
  }
}

/* Approach pillars */
.pillars {
  display: grid;
  gap: 0;
}
.pillar {
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
}
.pillar:last-child { border-bottom: 1px solid var(--line); }
.num {
  display: block;
  font-size: clamp(2.35rem, 4vw, 2.75rem);
  font-family: var(--font-display);
  font-weight: 450;
  color: rgba(226, 130, 61, 0.55);
  line-height: 1;
  margin-bottom: 0.65rem;
  font-variant-numeric: tabular-nums;
}
.pillar p {
  margin: 0;
  color: var(--paper-dim);
  max-width: 34ch;
  font-size: 0.9rem;
  line-height: 1.55;
}
@media (min-width: 900px) {
  .pillars {
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .pillar {
    padding: 1.5rem 1.35rem 1.5rem 0;
    border-top: 0;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .pillar:last-child {
    border-right: 0;
    padding-right: 0;
  }
  .pillar:not(:first-child) {
    padding-left: 1.35rem;
  }
}

/* Industries — hairline card grid */
.industry-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  overflow: hidden;
  border-radius: 2px;
}
.industry-grid .ind-card {
  background: rgba(5, 6, 9, 0.62);
  padding: 1.15rem 1.15rem 1.25rem;
  display: grid;
  gap: 0.2rem;
  min-height: 0;
}
.industry-grid .ind-card span {
  color: var(--orange);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
}
.industry-grid .ind-card strong {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.25;
}
.industry-grid .ind-card em {
  font-style: normal;
  color: var(--paper-faint);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.industry-grid .ind-card p {
  margin: 0.35rem 0 0;
  color: var(--paper-dim);
  font-size: 0.82rem;
  line-height: 1.5;
}
@media (min-width: 640px) {
  .industry-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .industry-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Services — dashed diamond list */
.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 52rem;
}
.service-list li {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 1rem;
  padding: 1.15rem 0;
  border-top: 1px dashed rgba(156, 146, 128, 0.35);
  align-items: start;
}
.service-list li:last-child {
  border-bottom: 1px dashed rgba(156, 146, 128, 0.35);
}
.service-list img {
  margin-top: 0.15rem;
  opacity: 0.92;
  width: 1.35rem;
  height: 1.35rem;
}
.svc-row {
  display: grid;
  gap: 0.3rem;
}
@media (min-width: 720px) {
  .svc-row {
    grid-template-columns: minmax(0, 15rem) 1fr;
    gap: 1.25rem;
    align-items: baseline;
  }
}
.service-list strong {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
}
.service-list p {
  margin: 0;
  color: var(--paper-dim);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* Process — top-rule four-up */
.process-grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 700px) {
  .process-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1.75rem; }
}
@media (min-width: 1000px) {
  .process-grid { grid-template-columns: repeat(4, 1fr); }
}
.process-step {
  border-top: 2px solid rgba(226, 130, 61, 0.4);
  padding-top: 0.95rem;
}
.process-step span {
  display: block;
  color: var(--paper-faint);
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
  font-variant-numeric: tabular-nums;
}
.process-step strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.08rem;
  margin-bottom: 0.4rem;
}
.process-step p {
  margin: 0;
  color: var(--paper-dim);
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 28ch;
}

/* Contact */
.contact-band { padding-bottom: clamp(2.5rem, 6vh, 3.5rem); }
.contact-grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: 0.95fr 1.05fr;
    gap: 3rem;
    align-items: start;
  }
}
.contact-copy h2 {
  max-width: 14ch;
  font-size: clamp(1.9rem, 3.5vw, 2.65rem);
  margin-bottom: 1rem;
}
.contact-copy .lede {
  margin-bottom: 1.35rem;
}
.fine {
  margin: 0 0 0.4rem;
  color: var(--paper-dim);
  font-size: 0.9rem;
}
.fine.dim { color: var(--paper-faint); font-size: 0.85rem; }

.contact-form {
  display: grid;
  gap: 0.95rem;
  padding: clamp(1.15rem, 2.5vw, 1.65rem);
  border: 1px solid var(--line);
  background: rgba(5, 6, 9, 0.35);
  border-radius: 2px;
}
.contact-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pewter);
  font-weight: 600;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--paper);
  font: inherit;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  padding: 0.5rem 0;
  border-radius: 0;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-bottom-color: var(--orange);
}
.contact-form .full { grid-column: 1 / -1; }
.contact-form .submit {
  justify-self: start;
  margin-top: 0.35rem;
}
.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}
.form-note {
  min-height: 1.25rem;
  margin: 0;
  font-size: 0.9rem;
  color: var(--orange);
}

/* Loader */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--night);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-inner {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  text-align: center;
}
.loader-inner span {
  font-weight: 500;
  letter-spacing: 0.02em;
}
.loader-inner em {
  font-style: normal;
  color: var(--orange);
}
.loader-bar {
  width: 120px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}
.loader-bar i {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--orange);
  animation: load 1.1s ease-in-out infinite;
}
@keyframes load {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}

/* Section dots */
.dots {
  display: none;
  position: fixed;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  flex-direction: column;
  gap: 0.7rem;
}
.dots a {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(237, 230, 211, 0.35);
  background: transparent;
  transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.dots a.active,
.dots a:hover {
  background: var(--orange);
  border-color: var(--orange);
  transform: scale(1.25);
}
@media (min-width: 1000px) {
  .dots { display: flex; }
}

.site-footer {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem clamp(1.25rem, 5vw, 4.5rem) 2.25rem;
  border-top: 1px solid var(--line);
  background: rgba(5, 6, 9, 0.95);
  color: var(--paper-dim);
  font-size: 0.86rem;
}
.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--paper);
  font-weight: 500;
}
.foot-brand em {
  font-style: normal;
  color: var(--orange);
}
.foot-tag {
  margin: 0;
  color: var(--paper-faint);
}

/* Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

body.no-webgl {
  background:
    linear-gradient(180deg, rgba(5,6,9,0.55), rgba(5,6,9,0.85)),
    url("./assets/night-city.jpg") center / cover fixed;
}
body.no-webgl #webgl { display: none; }
