/* ============================================================
   TECHTAKES — redesign
   Dark immersive, scroll-driven. Inspired by activetheory.net
   ============================================================ */

:root {
  --bg: #060709;
  --bg-soft: #0b0d11;
  --fg: #eef1f4;
  --fg-dim: #8a93a0;
  --accent: #4d7cff;
  --accent-2: #6ef3c5;
  --line: rgba(238, 241, 244, 0.1);
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

html { scroll-behavior: initial; }

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.mono {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--fg-dim);
}

.accent { color: var(--accent); }

/* ---------- preloader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease, visibility 0.7s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader__inner { text-align: center; }
.loader__logo {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.4em;
  margin-bottom: 1.4rem;
  font-size: 0.9rem;
}
.loader__count {
  font-family: var(--font-mono);
  font-size: 2.6rem;
  color: var(--accent);
  margin-bottom: 1rem;
}
.loader__bar {
  width: 180px;
  height: 1px;
  background: var(--line);
  margin: 0 auto;
  overflow: hidden;
}
.loader__bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

/* ---------- webgl bg + grain ---------- */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.grain {
  position: fixed;
  inset: -100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  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%); }
}

/* ---------- cursor ---------- */
.cursor, .cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(238, 241, 244, 0.35);
  transition: width 0.25s, height 0.25s, border-color 0.25s, background 0.25s;
}
.cursor.is-hover {
  width: 64px;
  height: 64px;
  border-color: var(--accent);
  background: rgba(77, 124, 255, 0.08);
}
.cursor-dot {
  width: 4px;
  height: 4px;
  background: var(--accent);
}
@media (hover: none) {
  .cursor, .cursor-dot { display: none; }
}

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 3rem;
  transition: transform 0.45s ease, background 0.45s ease;
}
.site-header.is-hidden { transform: translateY(-110%); }
.site-header.is-solid {
  background: rgba(6, 7, 9, 0.72);
  backdrop-filter: blur(14px);
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.28em;
  color: var(--fg);
  text-decoration: none;
}
.brand span { color: var(--accent); }
.top-nav { display: flex; gap: 2.4rem; }
.top-nav a {
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.25s;
}
.top-nav a:hover { color: var(--fg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.95rem 2.2rem;
  border-radius: 999px;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s;
}
.btn--fill {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.btn--fill:hover { background: #6890ff; transform: translateY(-2px); }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid rgba(238, 241, 244, 0.28);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--big { padding: 1.25rem 3.2rem; font-size: 0.95rem; }

/* ---------- dots nav ---------- */
.dots {
  position: fixed;
  right: 2.2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.dots a {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(238, 241, 244, 0.25);
  transition: background 0.3s, transform 0.3s;
}
.dots a.is-active {
  background: var(--accent);
  transform: scale(1.5);
}
.dots a span {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-dim);
  opacity: 0;
  transition: opacity 0.25s;
  white-space: nowrap;
}
.dots a:hover span { opacity: 1; }

/* ---------- layout ---------- */
main { position: relative; z-index: 2; }

.section {
  position: relative;
  padding: 12vh 8vw;
}

.section-head { margin-bottom: 6vh; }
.section-index {
  display: block;
  margin-bottom: 1.2rem;
  color: var(--accent);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.section-lede {
  margin-top: 1.6rem;
  max-width: 34rem;
  color: var(--fg-dim);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* line reveal */
.line { display: block; overflow: hidden; }
.line__inner {
  display: block;
  transform: translateY(110%);
}

/* generic reveal */
.reveal { opacity: 0; transform: translateY(40px); }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero__meta {
  display: flex;
  gap: 2.4rem;
  margin-bottom: 3vh;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 8.25vw, 7.1rem);
  line-height: 0.98;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.hero__sub {
  margin-top: 3.4vh;
  max-width: 32rem;
  color: var(--fg-dim);
  font-size: 1.08rem;
  line-height: 1.75;
}
.hero__cta {
  margin-top: 4.5vh;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.hero__scroll {
  position: absolute;
  bottom: 4vh;
  left: 8vw;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hero__scroll-line {
  display: block;
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  animation: scrollpulse 2s ease-in-out infinite;
  transform-origin: left;
}
@keyframes scrollpulse {
  0%, 100% { transform: scaleX(0.3); opacity: 0.4; }
  50% { transform: scaleX(1); opacity: 1; }
}

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden;
  padding: 3.2rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.marquee__track {
  display: inline-flex;
  will-change: transform;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.4vw, 2.6rem);
  font-weight: 500;
  text-transform: uppercase;
  color: rgba(238, 241, 244, 0.16);
  -webkit-text-stroke: 1px rgba(238, 241, 244, 0.22);
}

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.stat {
  background: var(--bg);
  padding: 3.4rem 2.4rem;
  transition: background 0.4s;
}
.stat:hover { background: var(--bg-soft); }
.stat__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 1;
}
.stat__value em {
  font-style: normal;
  color: var(--accent);
  font-size: 0.55em;
}
.stat__label { margin-top: 1rem; }

/* ---------- horizontal system section ---------- */
.hsec { position: relative; }
.hsec__pin {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 0 0 0 8vw;
}
.hsec__head { margin-bottom: 5vh; }
.htrack {
  display: flex;
  gap: 2rem;
  will-change: transform;
  width: max-content;
  padding-right: 8vw;
}
.card {
  width: min(380px, 74vw);
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: rgba(11, 13, 17, 0.65);
  backdrop-filter: blur(6px);
  padding: 2.6rem 2.2rem 3rem;
  border-radius: 4px;
  transition: border-color 0.35s, transform 0.35s;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-8px);
}
.card__num {
  display: block;
  color: var(--accent);
  margin-bottom: 3.5rem;
}
.card h3 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 1.2rem;
}
.card p { color: var(--fg-dim); line-height: 1.7; font-size: 0.95rem; }
.hsec__progress {
  margin-top: 6vh;
  width: 32vw;
  height: 1px;
  background: var(--line);
}
.hsec__progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
}

/* ---------- protocol ---------- */
.steps {
  list-style: none;
  counter-reset: step;
  border-top: 1px solid var(--line);
}
.step {
  display: grid;
  grid-template-columns: 8rem 1fr 2fr;
  gap: 2rem;
  align-items: baseline;
  padding: 3rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.4s ease;
}
.step:hover { padding-left: 1.4rem; }
.step__num { color: var(--accent); }
.step h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
}
.step p { color: var(--fg-dim); line-height: 1.7; }

/* ---------- voices ---------- */
.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.quote {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2.6rem 2.2rem;
  background: rgba(11, 13, 17, 0.65);
  transition: border-color 0.35s, transform 0.35s;
}
.quote:hover { border-color: var(--accent-2); transform: translateY(-6px); }
.quote p {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.5;
  margin-bottom: 2rem;
}
.quote footer { color: var(--accent-2); }

/* ---------- CTA ---------- */
.cta {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.cta__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 12vw, 10rem);
  line-height: 0.98;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.cta__actions { margin-top: 5vh; }

.site-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.2rem 8vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}
.site-footer__links { display: flex; gap: 2rem; flex-wrap: wrap; }
.site-footer__links a {
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.25s;
}
.site-footer__links a:hover { color: var(--fg); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .site-header { padding: 1.2rem 1.4rem; }
  .top-nav { display: none; }
  .dots { display: none; }
  .section { padding: 8vh 6vw; }
  .hero__scroll { left: 6vw; }
  .step { grid-template-columns: 1fr; gap: 0.8rem; }
  .hsec__pin { padding-left: 6vw; }
  .site-footer { justify-content: center; text-align: center; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain, .hero__scroll-line { animation: none; }
  .line__inner { transform: none; }
  .reveal { opacity: 1; transform: none; }
}
