/* ================================================================
   STM LABS — dark-first, one electric accent, display-scale type
   ================================================================ */

:root {
  --bg: #060608;
  --bg-2: #0b0b10;
  --panel: #101018;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eaeaf0;
  --dim: #6d6d7a;
  --accent: #00f0ff;
  --accent-2: #7c3aed;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: auto; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

@media (hover: none) {
  body { cursor: auto; }
  .cursor, .cursor-dot { display: none; }
}

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

.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }
.accent { color: var(--accent); }
.dim { color: var(--dim); }

::selection { background: var(--accent); color: #060608; }

/* ============ PRELOADER ============ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.preloader__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: min(420px, 80vw);
}
.preloader__logo { font-size: 1rem; font-weight: 700; }
.preloader__count {
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}
.preloader__bar {
  height: 2px;
  background: var(--line);
  overflow: hidden;
}
.preloader__bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}
.preloader__status { font-size: 0.7rem; color: var(--dim); }
.preloader__curtain {
  position: absolute;
  inset: 0;
  background: var(--bg-2);
  transform: scaleY(0);
  transform-origin: top;
}

/* ============ GRAIN + PROGRESS ============ */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.8s steps(4) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}
.progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 60;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

/* ============ CURSOR ============ */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 36px; height: 36px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, opacity 0.25s ease, background 0.25s ease;
  mix-blend-mode: difference;
}
.cursor.is-hover { width: 64px; height: 64px; background: rgba(0, 240, 255, 0.12); }
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99;
  transform: translate(-50%, -50%);
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 2.5rem;
  mix-blend-mode: difference;
  transition: transform 0.4s ease;
}
.nav.is-hidden { transform: translateY(-110%); }
.nav__logo { font-weight: 700; font-size: 0.95rem; }
.nav__links { display: flex; gap: 2rem; }
.nav__link {
  font-size: 0.72rem;
  position: relative;
  padding-bottom: 3px;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav__link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__num { font-size: 0.6rem; vertical-align: super; }
.nav__cta {
  font-size: 0.72rem;
  border: 1px solid var(--text);
  padding: 0.6rem 1.1rem;
  border-radius: 100px;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.nav__cta:hover { background: var(--accent); border-color: var(--accent); color: #060608; }

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

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 2.5rem 6rem;
  overflow: hidden;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}
.hero__grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 90px 90px;
  mask-image: radial-gradient(ellipse at 50% 40%, black 20%, transparent 75%);
  pointer-events: none;
}
.hero__content { position: relative; z-index: 2; }
.hero__kicker {
  font-size: 0.72rem;
  color: var(--dim);
  margin-bottom: 2rem;
}
.hero__title {
  font-size: clamp(3.5rem, 13vw, 12rem);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.hero__line { display: block; overflow: hidden; }
.hero__line-inner { display: inline-block; will-change: transform; }
.accent-stroke {
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
}
.hero__meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-top: 3.5rem;
  flex-wrap: wrap;
}
.hero__sub {
  max-width: 46ch;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.5;
  color: #b9b9c6;
}
.hero__coords {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.68rem;
  color: var(--dim);
  text-align: right;
}
.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 2.5rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.68rem;
  color: var(--dim);
}
.hero__scroll-arrow { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ============ MARQUEE ============ */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.6rem 0;
  background: var(--bg-2);
}
.marquee__track {
  display: flex;
  white-space: nowrap;
  will-change: transform;
}
.marquee__item {
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.marquee__item em { font-style: normal; }
.marquee--outline .marquee__item {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.35);
}

/* ============ SECTIONS ============ */
.section {
  padding: 9rem 2.5rem;
  max-width: 1500px;
  margin: 0 auto;
}
.section--full { max-width: none; background: var(--bg-2); }
.section--full > * { max-width: 1500px; margin-left: auto; margin-right: auto; }
.section__head {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 3rem;
}
.section__num { font-size: 0.85rem; font-weight: 700; }
.section__label { font-size: 0.72rem; color: var(--dim); }
.section__title {
  font-size: clamp(2.4rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 3.5rem;
}
.section__title .dim { color: var(--dim); }

/* split-reveal lines get wrapped by JS */
.split-reveal .sr-line { display: block; overflow: hidden; }
.split-reveal .sr-inner { display: block; will-change: transform; }

/* ============ HELLO ============ */
.hello__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: 1100px;
}
.hello__text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #b9b9c6;
}
@media (max-width: 800px) {
  .hello__cols { grid-template-columns: 1fr; }
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 5rem;
}
.stat {
  background: var(--bg);
  padding: 2.2rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.stat__value {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat__label { font-size: 0.62rem; color: var(--dim); letter-spacing: 0.08em; }
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============ SERVICES ============ */
.services { border-top: 1px solid var(--line); }
.service {
  position: relative;
  display: grid;
  grid-template-columns: 90px 1fr 1.2fr 60px;
  align-items: center;
  gap: 2rem;
  padding: 3rem 1rem;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  overflow: hidden;
}
.service::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.07), transparent 60%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}
.service:hover::before { transform: scaleX(1); }
.service:hover { padding-left: 2.2rem; }
.service > * { position: relative; }
.service__index { font-size: 0.72rem; }
.service__name {
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.service__desc { color: var(--dim); font-size: 0.95rem; line-height: 1.6; max-width: 50ch; }
.service__arrow {
  font-size: 1.6rem;
  transition: transform 0.35s ease;
}
.service:hover .service__arrow { transform: translate(6px, -6px); }
@media (max-width: 900px) {
  .service { grid-template-columns: 1fr; gap: 0.8rem; }
  .service__arrow { display: none; }
}

/* ============ WORK / SHIP LOG ============ */
.worklist { border-top: 1px solid var(--line); position: relative; }
.work {
  display: grid;
  grid-template-columns: 80px 1fr auto 80px;
  align-items: center;
  gap: 2rem;
  padding: 2.6rem 1rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease;
}
.work:hover { background: rgba(255, 255, 255, 0.02); }
.work__num { font-size: 0.72rem; color: var(--dim); }
.work__name {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: color 0.3s ease, transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}
.work:hover .work__name { color: var(--accent); transform: translateX(14px); }
.work__tag { font-size: 0.68rem; color: var(--dim); }
.work__year { font-size: 0.72rem; text-align: right; }
@media (max-width: 800px) {
  .work { grid-template-columns: 50px 1fr; }
  .work__tag, .work__year { display: none; }
}

/* floating preview */
.preview {
  position: fixed;
  top: 0; left: 0;
  width: 340px;
  height: 240px;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
}
.preview__panel {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  display: none;
  align-items: flex-end;
  padding: 1rem;
  overflow: hidden;
}
.preview__panel.is-active { display: flex; }
.preview__panel span { font-size: 0.68rem; color: rgba(255,255,255,0.85); position: relative; }
.preview__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  animation: gridDrift 6s linear infinite;
}
@keyframes gridDrift { to { background-position: 28px 28px; } }
.preview-1 { background: linear-gradient(135deg, #001b1f, #003c45 60%, #00f0ff33); }
.preview-2 { background: linear-gradient(135deg, #12001f, #33005c 60%, #7c3aed44); }
.preview-3 { background: linear-gradient(135deg, #001409, #003d22 60%, #00ff8830); }
.preview-4 { background: linear-gradient(135deg, #1f1400, #4d3200 60%, #ffb70033); }
.preview-5 { background: linear-gradient(135deg, #10001a, #001b3d 60%, #0077ff33); }

/* ============ BROTHERS ============ */
.brothers__intro {
  max-width: 52ch;
  color: #b9b9c6;
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 4rem;
}
.brothers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.brother {
  border: 1px solid var(--line);
  padding: 2rem;
  background: var(--bg);
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1), border-color 0.4s ease;
}
.brother:hover { transform: translateY(-8px); border-color: rgba(0, 240, 255, 0.4); }
.brother__visual {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.8rem;
  position: relative;
  overflow: hidden;
}
.brother__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}
.brother__visual--1 { background: radial-gradient(circle at 30% 30%, #003c45, #060608 70%); }
.brother__visual--2 { background: radial-gradient(circle at 70% 30%, #33005c, #060608 70%); }
.brother__visual--3 { background: radial-gradient(circle at 50% 70%, #003d22, #060608 70%); }
.brother__letter {
  font-size: 7rem;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
  position: relative;
  z-index: 1;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}
.brother:hover .brother__letter { transform: scale(1.15) rotate(-4deg); }
.brother__role { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.8rem; }
.brother__bio { color: var(--dim); font-size: 0.95rem; line-height: 1.6; margin-bottom: 1.4rem; }
.brother__stack { font-size: 0.6rem; letter-spacing: 0.1em; }
@media (max-width: 900px) {
  .brothers { grid-template-columns: 1fr; }
}

/* ============ PRINCIPLES ============ */
.principles {
  max-width: 1500px;
  margin: 0 auto;
  padding: 7rem 2.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.principle {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.principle span { font-size: 0.72rem; }
.principle p { font-size: 1.25rem; font-weight: 500; line-height: 1.45; }
@media (max-width: 900px) {
  .principles { grid-template-columns: 1fr; }
}

/* ============ FOOTER ============ */
.footer {
  padding: 8rem 2.5rem 2.5rem;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}
.footer > * { max-width: 1500px; margin-left: auto; margin-right: auto; }
.footer__giant {
  display: block;
  font-size: clamp(4rem, 16vw, 15rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 2rem auto 5rem;
  transition: color 0.4s ease;
}
.footer__giant:hover { color: var(--accent); }
.footer__giant-line { display: block; overflow: hidden; }
.footer__giant-inner { display: inline-block; will-change: transform; }
.footer__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}
.footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.78rem;
}
.footer__col .dim { font-size: 0.62rem; letter-spacing: 0.1em; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.62rem;
  color: var(--dim);
  flex-wrap: wrap;
}
.blink { animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 800px) {
  .footer__row { grid-template-columns: 1fr; }
}

/* ============ ANIM HELPERS ============ */
.fade-up { opacity: 0; transform: translateY(40px); }
.reveal-line { opacity: 0; transform: translateY(24px); }
