/* Caucasus AI Labs
   Layout: a full-bleed sticky stage where the camera walks into the temple,
   then plain bands of type and rendered architecture on stone-black ground.
   One deliberate dark look; every colour is set explicitly below. */
:root {
  --bg: #0e0d0b;
  --bg-raised: #171512;
  --ink: #ece6da;
  --ink-2: #a2998a;
  --line: rgba(236, 230, 218, 0.14);
  --stone: #d9cfbd;
  --bronze: #b08654;
  --sky-top: #070707;
  --sky-mid: #141210;
  --horizon: #3a3027;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --fs-hero: clamp(2.6rem, 1.1rem + 4.8vw, 6.4rem);
  --fs-h2: clamp(2rem, 1.2rem + 2.6vw, 3.6rem);
  --fs-h3: clamp(1.2rem, 1.1rem + 0.35vw, 1.4rem);
  --fs-body: 1.0625rem;

  --pad-x: clamp(16px, 4.4vw, 64px);
  --max: 1440px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-body)/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--bg);
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible {
  outline: 2px solid var(--stone);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(var(--pad-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad-x), env(safe-area-inset-right, 0px));
}

/* Masthead */
.masthead {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}
.masthead.is-solid {
  background: rgba(14, 13, 11, 0.88);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}
.wordmark {
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.nav {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  font-size: 0.875rem;
}
.nav a {
  text-decoration: none;
  color: var(--ink-2);
  transition: color 0.2s ease;
}
.nav a:hover { color: var(--ink); }

/* Hero */
.hero {
  position: relative;
  height: 230vh;
  height: 230svh;
}
.hero-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--horizon) 68%, var(--bg) 100%);
}
#temple-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 2s ease;
}
.hero.is-lit #temple-canvas { opacity: 1; }
.hero-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(0deg, rgba(10, 9, 8, 0.94) 0%, rgba(10, 9, 8, 0.78) 26%, rgba(10, 9, 8, 0) 58%),
    radial-gradient(ellipse 120% 90% at 50% 40%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.45) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  align-content: end;
  align-items: end;
  gap: 32px clamp(32px, 5vw, 96px);
  padding-block: 96px clamp(32px, 7vh, 72px);
  opacity: calc(1 - var(--p, 0) * 4);
  transform: translateY(calc(var(--p, 0) * -60px));
}
.hero h1 {
  font-weight: 500;
  font-size: var(--fs-hero);
  line-height: 0.98;
  letter-spacing: -0.035em;
}
.hero h1 span {
  display: block;
  text-wrap: balance;
}
.hero-side {
  display: grid;
  gap: 28px;
  max-width: 30rem;
  padding-bottom: 0.4em;
}
.hero-side p {
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.6;
}
.hero-side .hero-stat {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9375rem;
}
.hero-stat strong {
  font-weight: 500;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.03em;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid rgba(236, 230, 218, 0.4);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { border-color: var(--ink); }
.btn-primary {
  background: var(--stone);
  border-color: var(--stone);
  color: #12100d;
}
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }
.hero-fade {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: var(--bg);
  opacity: clamp(0, (var(--p, 0) - 0.84) * 6.25, 1);
}

/* Bands */
.section { padding-block: clamp(96px, 12vw, 180px); }
.section + .section { border-top: 1px solid var(--line); }
.section h2 {
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin-bottom: clamp(40px, 6vw, 88px);
}

/* What we build */
.capabilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.2vw, 36px);
}
.capability { min-width: 0; }
.detail {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--bg-raised);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.detail.is-rendered { opacity: 1; }
.no-webgl .detail { opacity: 1; }
.capability h3 {
  margin-top: 28px;
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.capability p {
  margin-top: 12px;
  max-width: 36ch;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.6;
}

/* Contact */
.contact h2 {
  font-size: clamp(2.5rem, 1.1rem + 4.6vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 12em;
  margin-bottom: 28px;
}
.contact-lede {
  max-width: 34rem;
  color: var(--ink-2);
  font-size: 1.125rem;
}
.mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: clamp(48px, 7vw, 96px);
}
.mail a {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.25rem);
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--bronze);
}
.mail button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: 500 0.8125rem/1 var(--sans);
  cursor: pointer;
}
.mail button:hover { color: var(--ink); border-color: var(--ink-2); }
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding-block: 28px max(28px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.875rem;
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero { height: 100vh; height: 100svh; }
  #temple-canvas, .detail { transition: none; }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .capabilities { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .detail { aspect-ratio: 4 / 3; }
}
@media (max-aspect-ratio: 1/1) {
  .hero-shade {
    background:
      linear-gradient(0deg, rgba(10, 9, 8, 0.95) 0%, rgba(10, 9, 8, 0.8) 42%, rgba(10, 9, 8, 0) 70%),
      radial-gradient(ellipse 120% 90% at 50% 40%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.45) 100%);
  }
}
@media (max-width: 560px) {
  .nav a:not(:last-child) { display: none; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
}
