/* ============================================================
   TECH TACTICS — The Playbook
   Tactical ops-room aesthetic. Ink, bone, brand blue.
   ============================================================ */

:root {
  /* Brand: steel ocean blue from techtactics.us (#1e75a6) + bright signal tint */
  --ink: #07090c;
  --ink-2: #0c1016;
  --ink-3: #121823;
  --bone: #e9eef2;
  --bone-dim: #93a0ab;
  --blue: #1e75a6;
  --signal: #3fa9e8;
  --signal-soft: rgba(63, 169, 232, 0.14);
  --line: rgba(233, 238, 242, 0.10);
  --line-strong: rgba(233, 238, 242, 0.22);

  --font-display: "Archivo", sans-serif;
  --font-serif: "Instrument Serif", serif;
  --font-mono: "IBM Plex Mono", monospace;

  --pad: clamp(1.25rem, 4vw, 4rem);
  --nav-h: 4.5rem;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html:focus-within { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-display);
  font-variation-settings: "wdth" 100, "wght" 400;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body[data-loading] { overflow: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; }
::selection { background: var(--blue); color: var(--bone); }

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.serif, em.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

/* ---------- Atmosphere layers ---------- */
.grid-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: clamp(48px, 8vw, 110px) clamp(48px, 8vw, 110px);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 100%);
  opacity: 0.5;
}
.grain {
  position: fixed; inset: -100%; z-index: 90; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grain-shift 0.9s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(-1%, 2%); }
  100% { transform: translate(2%, 1%); }
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.5rem;
}
.preloader__inner {
  display: flex; align-items: baseline; gap: 1.5rem;
}
.preloader__label { color: var(--bone-dim); }
.preloader__count { color: var(--signal); font-size: 1rem; min-width: 4ch; text-align: right; }
.preloader__bar {
  width: min(320px, 60vw); height: 1px; background: var(--line-strong);
  overflow: hidden;
}
.preloader__bar span {
  display: block; height: 100%; width: 0%;
  background: var(--signal);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad);
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.nav__logo { display: flex; align-items: center; gap: 0.6rem; }
.nav__mark { width: 1.6rem; height: 1.6rem; color: var(--signal); }
.nav__wordmark {
  font-variation-settings: "wdth" 118, "wght" 800;
  font-size: 0.95rem; letter-spacing: 0.04em;
}
.nav__wordmark em { color: var(--signal); }
.nav__meta {
  display: flex; gap: 2rem;
}
.nav__clock { color: var(--signal); }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.95rem 1.6rem;
  border: 1px solid var(--line-strong);
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn--primary:hover { background: var(--signal); border-color: var(--signal); color: var(--ink); }
.btn--ghost:hover { border-color: var(--signal); color: var(--signal); }
.btn--nav { padding: 0.65rem 1.1rem; font-size: 0.7rem; }
.btn--big { padding: 1.2rem 2.2rem; font-size: clamp(0.8rem, 1.6vw, 1rem); }
.btn__arrow { width: 1.05em; height: 1.05em; transition: transform 0.3s ease; }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn__corner {
  position: absolute; top: -1px; right: -1px;
  width: 8px; height: 8px;
  border-top: 2px solid var(--signal); border-right: 2px solid var(--signal);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 2rem) var(--pad) 5rem;
  overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
.hero__vignette {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 30% 45%, transparent 0%, rgba(7, 9, 12, 0.4) 78%),
    linear-gradient(to bottom, rgba(7,9,12,0.6) 0%, transparent 22%, transparent 70%, var(--ink) 100%);
}
.hero__annotations { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hero__coord { position: absolute; opacity: 0.65; }
.hero__coord--tl { top: calc(var(--nav-h) + 1.2rem); left: var(--pad); }
.hero__coord--tr { top: calc(var(--nav-h) + 1.2rem); right: var(--pad); }
.hero__coord--bl { bottom: 1.4rem; left: var(--pad); color: var(--signal); }
.hero__coord--br { bottom: 1.4rem; right: var(--pad); }

.hero__content { position: relative; z-index: 3; max-width: 1200px; }
.hero__kicker { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.8rem; color: var(--bone-dim); }
.blink { color: var(--signal); animation: blink 1.6s steps(2) infinite; font-size: 0.6rem; }
@keyframes blink { 50% { opacity: 0.15; } }

.hero__title {
  font-size: clamp(2.5rem, 7.6vw, 6.4rem);
  line-height: 0.94;
  font-variation-settings: "wdth" 120, "wght" 850;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}
.hero__line { display: block; overflow: hidden; }
.hero__line-inner { display: inline-block; will-change: transform; }
.hero__line--accent .hero__line-inner { color: var(--signal); }
.hero__title em {
  font-family: var(--font-serif);
  font-style: italic; font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.04em;
}
.hero__sub {
  max-width: 34rem;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  color: var(--bone-dim);
  margin-bottom: 2.4rem;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero__scroll {
  position: absolute; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.hero__scroll-line {
  width: 1px; height: 38px; background: var(--line-strong);
  position: relative; overflow: hidden;
}
.hero__scroll-line::after {
  content: ""; position: absolute; inset: 0;
  background: var(--signal);
  transform: translateY(-100%);
  animation: scroll-drip 2s ease-in-out infinite;
}
@keyframes scroll-drip {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}

/* ---------- Marquee ---------- */
.marquee {
  position: relative; z-index: 4;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
  overflow: hidden;
  padding: 1.1rem 0;
}
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__item {
  font-variation-settings: "wdth" 118, "wght" 750;
  font-size: clamp(0.95rem, 2vw, 1.35rem);
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--bone);
}
.marquee__item i { color: var(--signal); font-style: normal; padding: 0 0.9rem; }

/* ---------- Sections (shared) ---------- */
.section { position: relative; z-index: 4; padding: clamp(5rem, 12vh, 9rem) var(--pad); }
.section__head {
  display: flex; align-items: center; gap: 1.4rem;
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}
.section__tag { color: var(--signal); flex-shrink: 0; }
.section__rule { flex: 1; height: 1px; background: var(--line); }

/* ---------- Problem ---------- */
.problem { background: var(--ink); }
.problem__title {
  font-size: clamp(1.7rem, 4.6vw, 3.6rem);
  line-height: 1.12;
  font-variation-settings: "wdth" 108, "wght" 700;
  max-width: 22ch;
  margin-bottom: clamp(3rem, 8vh, 5.5rem);
}
.problem__title em {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  color: var(--signal);
}
.problem__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.problem__stat {
  background: var(--ink);
  padding: clamp(1.6rem, 3vw, 2.8rem);
  position: relative;
}
.problem__stat::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 10px; height: 10px;
  border-top: 2px solid var(--blue); border-left: 2px solid var(--blue);
}
.problem__num {
  display: block;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  font-variation-settings: "wdth" 120, "wght" 850;
  color: var(--signal);
  line-height: 1;
  margin-bottom: 1rem;
}
.problem__desc { color: var(--bone-dim); font-size: 0.95rem; max-width: 30ch; }
.problem__desc em.serif { color: var(--bone); }

/* ---------- Playbook ---------- */
.playbook { background: var(--ink-2); border-top: 1px solid var(--line); }
.playbook__title {
  font-size: clamp(2rem, 5.5vw, 4.4rem);
  font-variation-settings: "wdth" 115, "wght" 820;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: clamp(3rem, 8vh, 5rem);
}
.playbook__title em.serif { color: var(--signal); text-transform: none; font-size: 1.05em; }

.plays {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2rem);
}
.play {
  position: relative;
  border: 1px solid var(--line);
  background: var(--ink);
  padding: clamp(1.6rem, 3vw, 2.6rem);
  transition: border-color 0.35s ease, transform 0.35s ease;
}
.play:hover { border-color: var(--blue); transform: translateY(-4px); }
.play::after {
  content: ""; position: absolute; bottom: 0; right: 0;
  width: 12px; height: 12px;
  border-bottom: 2px solid var(--line-strong); border-right: 2px solid var(--line-strong);
  transition: border-color 0.35s ease;
}
.play:hover::after { border-color: var(--signal); }
.play__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.6rem; gap: 1rem;
}
.play__num { color: var(--signal); }
.play__diagram { width: clamp(80px, 10vw, 120px); flex-shrink: 0; }
.pd-node { fill: none; stroke: var(--signal); stroke-width: 2; }
.pd-dot { fill: var(--bone-dim); }
.pd-route {
  fill: none; stroke: var(--bone-dim); stroke-width: 1.5;
  stroke-dasharray: 0.06 0.04;
}
.play__name {
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  font-variation-settings: "wdth" 112, "wght" 780;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}
.play__desc { color: var(--bone-dim); font-size: 0.97rem; margin-bottom: 1.4rem; max-width: 44ch; }
.play__list { list-style: none; display: grid; gap: 0.55rem; }
.play__list li {
  position: relative; padding-left: 1.2rem;
  text-transform: none; letter-spacing: 0.02em; font-size: 0.78rem;
  color: var(--bone);
}
.play__list li::before {
  content: "▸"; position: absolute; left: 0; color: var(--signal);
}

/* ---------- Process (pinned) ---------- */
.process { position: relative; z-index: 4; background: var(--ink); border-top: 1px solid var(--line); }
.process__pin {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + 1rem) var(--pad) 3rem;
}
.process__stage {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  flex: 1;
}
.process__steps { position: relative; min-height: 16rem; }
.process__step {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  display: flex; flex-direction: column; justify-content: center;
}
.process__step.is-active { opacity: 1; visibility: visible; }
.process__index { color: var(--signal); margin-bottom: 1.1rem; }
.process__name {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-variation-settings: "wdth" 118, "wght" 840;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 1.3rem;
}
.process__desc { color: var(--bone-dim); max-width: 42ch; font-size: clamp(0.95rem, 1.3vw, 1.05rem); }
.process__counter {
  display: flex; align-items: baseline; gap: 0.6rem;
  justify-content: flex-end;
}
.process__big {
  font-size: clamp(6rem, 16vw, 13rem);
  font-variation-settings: "wdth" 125, "wght" 880;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--blue);
}
.process__total { color: var(--bone-dim); font-size: 1rem; }
.process__progress {
  height: 1px; background: var(--line); margin-top: 2rem;
}
.process__progress span { display: block; height: 100%; width: 0%; background: var(--signal); }

/* ---------- Manifesto ---------- */
.manifesto {
  background: var(--blue);
  color: var(--ink);
}
.manifesto__text {
  font-size: clamp(1.6rem, 4.2vw, 3.4rem);
  line-height: 1.18;
  font-variation-settings: "wdth" 110, "wght" 740;
  max-width: 28ch;
  margin: 0 auto;
  text-align: center;
  color: #f4f8fb;
}
.manifesto__text em {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  color: var(--ink);
}

/* ---------- Contact ---------- */
.contact { background: var(--ink); }
.contact__inner { text-align: center; padding: clamp(2rem, 6vh, 4rem) 0; }
.contact__title {
  font-size: clamp(3rem, 11vw, 9.5rem);
  line-height: 0.95;
  font-variation-settings: "wdth" 122, "wght" 860;
  text-transform: uppercase;
  margin-bottom: 1.8rem;
}
.contact__title em {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  text-transform: none; color: var(--signal);
}
.contact__sub {
  color: var(--bone-dim);
  max-width: 38rem;
  margin: 0 auto 3rem;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
}
.contact__actions {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 1.4rem;
}
.contact__or { opacity: 0.5; }

/* ---------- Footer ---------- */
.footer {
  position: relative; z-index: 4;
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  padding: 3rem var(--pad) 2rem;
  overflow: hidden;
}
.footer__wordmark {
  display: block;
  font-size: clamp(2.2rem, 9.6vw, 9rem);
  font-variation-settings: "wdth" 125, "wght" 880;
  line-height: 0.9;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  user-select: none;
  white-space: nowrap;
}
.footer__meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  margin-top: 2.5rem;
}
.footer__meta a:hover { color: var(--signal); }

/* ---------- Reveal helpers (JS adds motion; safe without it) ---------- */
.reveal-line { opacity: 1; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .nav__meta { display: none; }
  .problem__grid { grid-template-columns: 1fr; }
  .plays { grid-template-columns: 1fr; }
  .process__stage { grid-template-columns: 1fr; gap: 1.5rem; }
  .process__counter { justify-content: flex-start; order: -1; }
  .process__big { font-size: clamp(4rem, 18vw, 7rem); }
  .process__steps { min-height: 19rem; }
}
@media (max-width: 600px) {
  :root { --nav-h: 3.8rem; }
  .process__step { margin-bottom: 3rem; }
  .process__pin { min-height: 0; padding-top: 5rem; }
  .btn--nav .btn__label { font-size: 0.62rem; }
  .hero__coord--tr, .hero__coord--bl { display: none; }
  .hero__cta .btn { width: 100%; justify-content: center; }
  .contact__actions { flex-direction: column; }
  .footer__meta { flex-direction: column; align-items: center; text-align: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .blink, .hero__scroll-line::after { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
