/* ============================================
   ASTRAUM INFRASTRUCTURE — REDESIGN
   Design system + base styles
   ============================================ */

:root {
  /* Palette — warm architectural neutrals */
  --bone: #f4f1ec;
  --paper: #ebe6dd;
  --ink: #0e0e0c;
  --ink-soft: #1a1a17;
  --stone: #6b6760;
  --stone-light: #a8a39a;
  --accent: #b8472b; /* terracotta — used sparingly */
  --line: rgba(14, 14, 12, 0.12);

  /* Type */
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "DM Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing scale */
  --gutter: clamp(1.25rem, 3vw, 2.5rem);
  --section-pad: clamp(5rem, 12vw, 10rem);

  /* Motion */
  --ease-editorial: cubic-bezier(0.16, 1, 0.3, 1); /* fast-out, slow-settle */
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  font-family: var(--sans);
  background: var(--bone);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  overflow-x: hidden;
  cursor: none; /* custom cursor takes over */
}

@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
}

img {
  display: block;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--ink);
  color: var(--bone);
}

/* ============================================
   TYPOGRAPHY UTILITIES
   ============================================ */

.display {
  font-family: var(--serif);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.025em;
  font-style: normal;
}

.display--italic {
  font-style: italic;
  font-weight: 300;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
}

.body-lead {
  font-family: var(--sans);
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.65;
  color: var(--ink-soft);
  font-weight: 400;
}

/* Character/word split — used by GSAP reveals */
.split-line { overflow: hidden; display: block; }
.split-word { display: inline-block; will-change: transform; }
.split-char { display: inline-block; will-change: transform; }

/* ============================================
   GLOBAL LAYOUT
   ============================================ */

.container {
  width: 100%;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}

.cursor__dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--bone);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.cursor__ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid var(--bone);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
  transition: width 0.4s var(--ease-editorial),
    height 0.4s var(--ease-editorial),
    background 0.4s var(--ease-editorial);
}

.cursor.is-hover .cursor__ring {
  width: 64px;
  height: 64px;
  background: rgba(244, 241, 236, 0.08);
}

@media (hover: none), (pointer: coarse) {
  .cursor { display: none; }
}

/* ============================================
   NAV
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  mix-blend-mode: difference;
  color: var(--bone);
}

.nav__brand {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.nav__brand sup {
  font-size: 0.55rem;
  margin-left: 0.25em;
  letter-spacing: 0;
  opacity: 0.7;
}

.nav__links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}

.nav__link {
  position: relative;
  padding: 0.25rem 0;
  transition: opacity 0.3s var(--ease-soft);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.5s var(--ease-editorial);
}

.nav__link:hover::after { width: 100%; }

.nav__cta {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 0.6rem 1.1rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  transition: background 0.4s var(--ease-editorial),
    color 0.4s var(--ease-editorial);
}

.nav__cta:hover {
  background: var(--bone);
  color: var(--ink);
}

/* ============================================
   HERO
   ============================================ */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  width: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--bone);
}

.hero__layers {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero__layer {
  position: absolute;
  inset: 0;
  will-change: transform;
  overflow: hidden;
}

.hero__layer img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.4s var(--ease-editorial);
}

.hero__layer img.is-active {
  opacity: 1;
}

.hero__layer--bg {
  filter: brightness(0.55) contrast(1.05);
}

.hero__layer--mid img {
  width: 70%;
  height: 70%;
  left: 15%;
  top: 18%;
  object-fit: cover;
  box-shadow: 0 60px 120px -20px rgba(0, 0, 0, 0.6);
}

.hero__layer--fg img {
  width: 28%;
  height: 38%;
  left: auto;
  right: 8%;
  top: auto;
  bottom: 14%;
  object-fit: cover;
  box-shadow: 0 40px 80px -10px rgba(0, 0, 0, 0.7);
}

.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
      ellipse at center,
      transparent 30%,
      rgba(0, 0, 0, 0.55) 100%
    ),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent 30%, rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--gutter) clamp(2rem, 5vh, 4rem);
}

.hero__eyebrow-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: clamp(1.5rem, 3vh, 2.5rem);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(244, 241, 236, 0.7);
  font-weight: 500;
}

.hero__eyebrow-row span { display: block; }

.hero__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3.5rem, 11vw, 9.5rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
  margin-bottom: clamp(1.5rem, 3vh, 2.5rem);
  max-width: 14ch;
}

.hero__title em {
  font-style: italic;
  font-weight: 300;
  color: var(--paper);
}

.hero__footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(244, 241, 236, 0.18);
}

.hero__meta {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 241, 236, 0.7);
  line-height: 1.7;
}

.hero__meta strong {
  display: block;
  color: var(--bone);
  font-weight: 500;
}

.hero__counter {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.05em;
  color: rgba(244, 241, 236, 0.85);
  white-space: nowrap;
}

.hero__counter .current {
  font-size: 1.6rem;
  color: var(--bone);
  margin-right: 0.5rem;
}

.hero__scroll-cue {
  justify-self: end;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(244, 241, 236, 0.7);
}

.hero__scroll-cue::after {
  content: "";
  display: block;
  width: 1px;
  height: 36px;
  background: rgba(244, 241, 236, 0.7);
  animation: scrollPulse 2.2s var(--ease-editorial) infinite;
}

@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.4); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
}

/* ============================================
   SECTION: CREDIBILITY — HORIZONTAL PROJECT REEL
   ============================================ */

.reel {
  position: relative;
  background: var(--bone);
  color: var(--ink);
}

.reel__intro {
  padding: var(--section-pad) var(--gutter) 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: end;
}

.reel__intro-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.reel__intro-title em {
  font-style: italic;
  color: var(--stone);
}

.reel__intro-meta {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
  max-width: 38ch;
  line-height: 1.8;
}

.reel__track-wrap {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.reel__track {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 4vw;
  padding: 0 8vw;
  will-change: transform;
}

.reel__card {
  position: relative;
  flex: 0 0 auto;
  width: 36vw;
  height: 72vh;
  overflow: hidden;
  background: var(--paper);
}

.reel__card:nth-child(even) {
  width: 28vw;
  height: 58vh;
  align-self: flex-end;
  margin-bottom: 6vh;
}

.reel__card:nth-child(3n) {
  width: 32vw;
  height: 78vh;
  align-self: flex-start;
  margin-top: 4vh;
}

.reel__card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
  transition: transform 0.8s var(--ease-editorial);
}

.reel__card:hover .reel__card-img {
  transform: scale(1.05);
}

.reel__card-meta {
  position: absolute;
  left: 0;
  bottom: -3rem;
  width: 100%;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}

.reel__card-meta strong {
  font-weight: 500;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: none;
}

.reel__progress {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 2.5rem;
  height: 1px;
  background: var(--line);
  z-index: 2;
}

.reel__progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--ink);
}

/* ============================================
   SECTION: IDENTITY — SPLIT ABOUT
   ============================================ */

.identity {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  padding: var(--section-pad) 0;
  overflow: hidden;
}

.identity__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: 0 var(--gutter);
}

.identity__text {
  max-width: 32em;
}

.identity__text .eyebrow { margin-bottom: 2rem; display: block; }

.identity__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.25rem, 4.5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

.identity__title em {
  font-style: italic;
  color: var(--stone);
}

.identity__body p {
  font-size: clamp(1rem, 1.15vw, 1.1rem);
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.identity__body p:last-child { margin-bottom: 0; }

.identity__signature {
  margin-top: 3rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--stone);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.identity__signature::before {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--stone);
}

.identity__collage {
  position: relative;
  height: 70vh;
  min-height: 480px;
}

.identity__collage-img {
  position: absolute;
  overflow: hidden;
  will-change: transform;
  box-shadow: 0 30px 60px -20px rgba(14, 14, 12, 0.25);
}

.identity__collage-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity__collage-img--1 {
  width: 58%;
  height: 68%;
  top: 0;
  right: 8%;
}

.identity__collage-img--2 {
  width: 42%;
  height: 50%;
  bottom: 0;
  left: 0;
  z-index: 2;
}

.identity__collage-img--3 {
  width: 28%;
  height: 30%;
  bottom: 12%;
  right: 0;
  z-index: 3;
}

/* ============================================
   SECTION: PROOF — CASE STUDIES
   ============================================ */

.cases {
  background: var(--ink);
  color: var(--bone);
  padding: var(--section-pad) 0;
}

.cases__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 var(--gutter);
  margin-bottom: 5rem;
  border-bottom: 1px solid rgba(244, 241, 236, 0.15);
  padding-bottom: 2rem;
}

.cases__head h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.25rem, 4.5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.cases__head h2 em { font-style: italic; color: var(--stone-light); }

.cases__index {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone-light);
}

.case {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  padding: 6rem var(--gutter);
  align-items: center;
  border-bottom: 1px solid rgba(244, 241, 236, 0.08);
}

.case:nth-child(even) .case__media { order: 2; }
.case:nth-child(even) .case__copy  { order: 1; }

.case__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  will-change: transform;
}

.case__media img {
  width: 100%;
  height: 110%;
  object-fit: cover;
  will-change: transform;
}

.case__index {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--stone-light);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.case__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 3.8vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.case__title em { font-style: italic; color: var(--stone-light); }

.case__desc {
  color: rgba(244, 241, 236, 0.75);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 42ch;
  margin-bottom: 2.5rem;
}

.case__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(244, 241, 236, 0.15);
  max-width: 28rem;
}

.case__meta-item .eyebrow { color: var(--stone-light); margin-bottom: 0.4rem; }
.case__meta-item strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

/* ============================================
   SECTION: INVITATION — CLOSING
   ============================================ */

.invitation {
  position: relative;
  background: var(--bone);
  color: var(--ink);
  padding: var(--section-pad) 0;
  overflow: hidden;
}

.invitation__inner {
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: end;
}

.invitation__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  max-width: 9ch;
}

.invitation__title em { font-style: italic; color: var(--stone); }

.invitation__right {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.invitation__lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 40ch;
}

.invitation__contact {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.invitation__email {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
  width: fit-content;
  padding-bottom: 0.25rem;
}

.invitation__email::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform-origin: right;
  transform: scaleX(1);
  transition: transform 0.6s var(--ease-editorial);
}

.invitation__email:hover::after {
  transform-origin: left;
  transform: scaleX(0);
}

.invitation__channels {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
}

.invitation__channels a {
  position: relative;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
  transition: color 0.3s var(--ease-soft),
    border-color 0.3s var(--ease-soft);
}

.invitation__channels a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  padding: 2.5rem var(--gutter);
  background: var(--bone);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
}

.footer__cols {
  display: flex;
  gap: 2rem;
}

/* ============================================
   RESPONSIVE — down to 375px
   ============================================ */

@media (max-width: 1024px) {
  .nav__links { gap: 1.5rem; }
  .hero__layer--mid img { width: 84%; height: 64%; left: 8%; }
  .hero__layer--fg img { width: 38%; height: 32%; }
  .reel__intro { grid-template-columns: 1fr; gap: 2rem; }
  .identity__grid { grid-template-columns: 1fr; gap: 3rem; }
  .identity__collage { height: 60vh; }
  .case { grid-template-columns: 1fr; gap: 2.5rem; padding: 4rem var(--gutter); }
  .case:nth-child(even) .case__media { order: 0; }
  .case:nth-child(even) .case__copy  { order: 0; }
  .invitation__inner { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 720px) {
  .nav { padding: 1rem var(--gutter); }
  .nav__links { display: none; }
  .nav__cta { padding: 0.5rem 0.9rem; font-size: 0.65rem; }

  .hero__title { font-size: clamp(2.75rem, 13vw, 5rem); }
  .hero__layer--mid img { width: 92%; height: 58%; left: 4%; top: 22%; }
  .hero__layer--fg img { width: 50%; height: 28%; right: 4%; bottom: 22%; }
  .hero__footer {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    text-align: left;
  }
  .hero__scroll-cue { justify-self: start; }

  .reel__card,
  .reel__card:nth-child(even),
  .reel__card:nth-child(3n) {
    width: 78vw;
    height: 65vh;
    align-self: center;
    margin: 0;
  }

  .case__meta { grid-template-columns: repeat(2, 1fr); }
  .cases__head { flex-direction: column; align-items: flex-start; gap: 1rem; }

  .footer { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (max-width: 420px) {
  :root { --gutter: 1.1rem; }
  .hero__title { font-size: 2.5rem; }
  .reel__card { width: 84vw; height: 60vh; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .cursor { display: none; }
  body { cursor: auto; }
}
