/* ============================================================
   TDY GROUP — ENGINE_00
   Techno-brutalist machine. #060708 void / acid #D8FF3E / ember #FF4D00
   ============================================================ */

:root {
  --bg: #060708;
  --acid: #D8FF3E;
  --ember: #FF4D00;
  --white: #F2F2EF;
  --gray: #7A7F87;
  --line: rgba(122, 127, 135, 0.28);
  --font-display: 'Clash Display', 'Arial Black', sans-serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --pad: clamp(20px, 4vw, 64px);
}

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

html {
  background: var(--bg);
  scrollbar-color: rgba(122,127,135,.5) var(--bg);
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body.has-cursor { cursor: none; }
body.has-cursor a, body.has-cursor button { cursor: none; }

::selection { background: var(--acid); color: var(--bg); }

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
}

/* real text for screen readers; animated twins are aria-hidden */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.split-word { white-space: nowrap; }

body.loading { overflow: hidden; }

/* ---------------- canvas ---------------- */
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ---------------- preloader ---------------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
  transition: opacity 0.6s ease 0.15s, visibility 0s linear 0.8s;
}
#preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }

.pre-log {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gray);
  text-transform: uppercase;
  min-height: 7.5em;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.pre-log .ok { color: var(--acid); }
.pre-log div { white-space: pre; }

.pre-count {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(90px, 18vw, 280px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}
.pre-pct { color: var(--acid); font-size: 0.35em; vertical-align: super; }
.pre-tag { position: absolute; top: var(--pad); left: var(--pad); }

#flash {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
#flash.go { animation: flash 0.5s ease-out; }
@keyframes flash {
  0% { opacity: 0; }
  8% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------------- nav / hud ---------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right)) 18px max(var(--pad), env(safe-area-inset-left));
  mix-blend-mode: difference;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--white);
  text-decoration: none;
}
.nav-logo sup { font-size: 9px; color: var(--acid); mix-blend-mode: normal; }

.nav-links { display: flex; gap: clamp(16px, 3vw, 42px); }
.nav-links a {
  color: var(--white);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--acid);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
@media (hover: hover) {
  .nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
}

.nav-status { display: flex; align-items: center; gap: 8px; color: var(--white); }
.nav-status .dot {
  width: 6px; height: 6px;
  background: var(--acid);
  border-radius: 50%;
  animation: blink 2.4s infinite;
}
@keyframes blink { 0%, 92% { opacity: 1; } 96% { opacity: 0.15; } 100% { opacity: 1; } }

.hud { position: fixed; z-index: 50; inset: 0; pointer-events: none; }
.hud-bl { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: var(--pad); color: var(--white); mix-blend-mode: difference; }
.hud-bl span { color: var(--acid); }
.hud-br { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); right: var(--pad); color: var(--white); mix-blend-mode: difference; }
.hud-br span { color: var(--acid); }

/* ---------------- cursor ---------------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  --bw: 0px;
  --bh: 0px;
}
body.has-cursor .cursor { opacity: 1; }

.cursor-cross { position: absolute; transform: translate(-50%, -50%); transition: opacity 0.2s; }
.cursor-cross i {
  position: absolute;
  background: var(--acid);
  display: block;
}
.cursor-cross i:first-child { width: 13px; height: 1px; left: -6.5px; top: 0; }
.cursor-cross i:last-child { width: 1px; height: 13px; top: -6.5px; left: 0; }
.cursor.is-hover .cursor-cross { opacity: 0; }

.cursor-br {
  position: absolute;
  width: 7px; height: 7px;
  border: 1px solid var(--acid);
  opacity: 0;
  transition: opacity 0.2s;
}
.cursor.is-hover .cursor-br { opacity: 1; }
.cursor-tl  { border-right: 0; border-bottom: 0; transform: translate(calc(var(--bw) / -2), calc(var(--bh) / -2)); }
.cursor-tr  { border-left: 0; border-bottom: 0; transform: translate(calc(var(--bw) / 2 - 7px), calc(var(--bh) / -2)); }
.cursor-bl  { border-right: 0; border-top: 0; transform: translate(calc(var(--bw) / -2), calc(var(--bh) / 2 - 7px)); }
.cursor-brr { border-left: 0; border-top: 0; transform: translate(calc(var(--bw) / 2 - 7px), calc(var(--bh) / 2 - 7px)); }

.cursor-xy {
  position: absolute;
  left: 14px; top: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--gray);
  white-space: nowrap;
}

/* ---------------- sections shared ---------------- */
#page { position: relative; z-index: 1; }

.sec {
  position: relative;
  padding: 0 var(--pad);
}

.sec-index { margin-bottom: 28px; }
.sec-index::before {
  content: '';
  display: inline-block;
  width: 34px; height: 1px;
  background: var(--acid);
  vertical-align: middle;
  margin-right: 12px;
}

/* giant display type */
.giant {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(44px, 13.5vw, 240px);
  line-height: 0.88;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--white);
  mix-blend-mode: difference;
}
.giant-line { display: block; overflow: hidden; }
.giant-line .split-word { display: inline-block; }
.giant-line .split-char {
  display: inline-block;
  transform: translateY(115%) rotate(4deg);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--ci) * 38ms);
}
.giant.in .split-char { transform: translateY(0) rotate(0); }

/* masked line reveals */
.reveal-lines .line-mask { display: inline-block; overflow: hidden; vertical-align: bottom; }
.reveal-lines .line-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--li) * 90ms);
}
.reveal-lines.in .line-inner { transform: translateY(0); }

/* ---------------- hero ---------------- */
.sec-hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kicker { margin-bottom: 18px; color: var(--acid); }

.hero-sub {
  max-width: 34em;
  margin-top: 28px;
  color: rgba(242, 242, 239, 0.82);
  font-size: clamp(15px, 1.25vw, 19px);
  text-shadow: 0 1px 12px rgba(6, 7, 8, 0.9), 0 0 32px rgba(6, 7, 8, 0.7);
}

.hero-corner { position: absolute; bottom: 72px; }
.hero-corner-l { left: var(--pad); }
.hero-corner-r { right: var(--pad); color: var(--acid); }

/* ---------------- marquee ---------------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 14px 0;
  position: relative;
  z-index: 1;
  background: rgba(6, 7, 8, 0.35);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.marquee-track {
  display: flex;
  white-space: nowrap;
  will-change: transform;
}
.marquee-track span {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(20px, 2.6vw, 40px);
  letter-spacing: 0.01em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(122, 127, 135, 0.75);
  padding-right: 8px;
  flex-shrink: 0;
}
.marquee-track span:nth-child(odd) { color: var(--white); -webkit-text-stroke: 0; }

/* ---------------- manifesto ---------------- */
.sec-manifesto {
  min-height: 165vh;
  padding-top: 22vh;
}
.manifesto-text {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(24px, 3.2vw, 52px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  max-width: 21em;
  color: var(--white);
  text-shadow: 0 1px 14px rgba(6, 7, 8, 0.95), 0 0 44px rgba(6, 7, 8, 0.8);
}

.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 16vh;
  max-width: 1100px;
}
.stats li {
  background: var(--bg);
  padding: clamp(18px, 2.4vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-v {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 4.4vw, 72px);
  line-height: 1;
  color: var(--white);
}
.stats li:nth-child(3) .stat-v { color: var(--acid); }

/* ---------------- ventures ---------------- */
#ventures { position: relative; }
.ventures-intro {
  padding: 0 var(--pad);
  margin-bottom: 6vh;
  color: var(--white);
}

.sec-venture { min-height: 185vh; }
.v-copy {
  position: sticky;
  top: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 560px;
}
.v-right .v-copy { margin-left: auto; }

/* strong scrim so copy stays readable over the scene */
.v-copy::after {
  content: '';
  position: absolute;
  inset: -10% -28%;
  background: radial-gradient(60% 56% at 50% 50%, rgba(6, 7, 8, 0.95), rgba(6, 7, 8, 0.6) 58%, transparent 78%);
  z-index: -1;
  pointer-events: none;
}

.v-name, .v-tag, .v-desc, .v-specs li, .sec-venture .sec-index {
  text-shadow: 0 1px 12px rgba(6, 7, 8, 0.95), 0 0 34px rgba(6, 7, 8, 0.85);
}

.v-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(44px, 6.6vw, 110px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.v-tag { color: var(--acid); margin-bottom: 26px; }
.v-desc { color: rgba(242, 242, 239, 0.8); max-width: 30em; }

.v-specs {
  list-style: none;
  margin: 34px 0 42px;
  border-top: 1px solid var(--line);
}
.v-specs li {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.v-specs li::before { content: '+ '; color: var(--acid); }

#adrefresh .v-tag { color: var(--ember); }
#adrefresh .v-specs li::before { color: var(--ember); }

/* CTA */
.cta {
  display: inline-block;
  color: var(--acid);
  text-decoration: none;
  border: 1px solid rgba(216, 255, 62, 0.45);
  padding: 14px 22px;
  position: relative;
  overflow: hidden;
  transition: color 0.25s, border-color 0.25s;
  align-self: flex-start;
}
.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--acid);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: -1;
}
@media (hover: hover) {
  .cta:hover { color: var(--bg); border-color: var(--acid); }
  .cta:hover::before { transform: scaleY(1); }
}
.cta { z-index: 0; }

.cta-big {
  font-size: 14px;
  padding: 20px 34px;
  margin-top: 40px;
}

/* ---------------- capabilities ---------------- */
.sec-caps { padding-top: 24vh; padding-bottom: 20vh; }
.caps-intro {
  font-size: clamp(22px, 2.6vw, 40px);
  font-weight: 400;
  max-width: 24em;
  margin-bottom: 8vh;
  color: var(--white);
}

.caps { list-style: none; border-top: 1px solid var(--line); max-width: 1200px; }
.cap {
  display: grid;
  grid-template-columns: 80px 1fr 1.2fr;
  gap: clamp(12px, 3vw, 48px);
  align-items: baseline;
  padding: clamp(20px, 2.6vw, 38px) 8px;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background 0.3s, padding-left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (hover: hover) {
  .cap:hover { background: rgba(216, 255, 62, 0.04); padding-left: 22px; }
}
.cap-num { color: var(--acid); }
.cap-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.cap-desc {
  color: rgba(242, 242, 239, 0.78);
  font-size: 0.95em;
  max-width: 34em;
  text-shadow: 0 1px 10px rgba(6, 7, 8, 0.9);
}
.cap-title { text-shadow: 0 1px 14px rgba(6, 7, 8, 0.9); }
.caps-intro { text-shadow: 0 1px 14px rgba(6, 7, 8, 0.95); }

/* ---------------- contact ---------------- */
.sec-contact {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 16vh;
}
.giant-contact { font-size: clamp(52px, 11vw, 200px); }
.contact-sub {
  margin-top: 30px;
  max-width: 30em;
  color: rgba(242, 242, 239, 0.8);
}

.footer {
  margin-top: auto;
  padding: 60px 0 56px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 18vh;
}
.footer .mono { color: var(--gray); }
.footer p:first-child { color: var(--white); }

/* ---------------- noscript / no-webgl ---------------- */
.noscript, .no-gl-note {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 14px var(--pad);
  background: var(--acid);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  z-index: 300;
}
body.no-gl #gl { display: none; }
body.no-gl {
  background:
    radial-gradient(120% 90% at 70% 10%, rgba(216, 255, 62, 0.08), transparent 60%),
    radial-gradient(100% 80% at 20% 90%, rgba(255, 77, 0, 0.07), transparent 55%),
    var(--bg);
}

/* ---------------- mobile ---------------- */
@media (max-width: 860px) {
  .nav-links a:not(.nav-contact) { display: none; }
  .ns-full { display: none; }
  .hud-bl { display: none; }
  .hero-corner-l { display: none; }
  .hero-corner { bottom: 44px; }

  .stats { grid-template-columns: repeat(2, 1fr); }

  .sec-venture { min-height: 150vh; }
  .v-copy, .v-right .v-copy {
    max-width: 100%;
    margin: 0;
    justify-content: flex-end;
    padding-bottom: 12vh;
  }
  .v-copy::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(6, 7, 8, 0.75) 55%);
    z-index: -1;
    margin: 0 calc(-1 * var(--pad));
  }

  .cap { grid-template-columns: 44px 1fr; }
  .cap-desc { grid-column: 2; }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .giant-line .split-char,
  .reveal-lines .line-inner {
    transition: opacity 0.4s ease;
    transform: none;
    opacity: 0;
  }
  .giant.in .split-char,
  .reveal-lines.in .line-inner { opacity: 1; transform: none; }
  .marquee-track { animation: none !important; }
  .nav-status .dot { animation: none; }
}
