/* 71 Tech — base: brand tokens, page chrome, slide deck and shared components. */

@font-face { font-family: "Overused Grotesk"; src: url("../assets/fonts/OverusedGrotesk-Roman.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Overused Grotesk"; src: url("../assets/fonts/OverusedGrotesk-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Overused Grotesk"; src: url("../assets/fonts/OverusedGrotesk-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../assets/fonts/InstrumentSerif-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../assets/fonts/InstrumentSerif-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../assets/fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Palette — deep space, starlight, and the meteor's ember-to-ion gradient. */
  --ink: #04050a;
  --ink-2: #090b13;
  --panel: rgba(14, 17, 28, .66);
  --panel-solid: #0c0f18;
  --line: rgba(226, 232, 255, .1);
  --line-strong: rgba(226, 232, 255, .22);
  --text: #eef1f8;
  --muted: rgba(226, 231, 245, .64);
  --dim: rgba(226, 231, 245, .4);
  --ember: #4a6fa5;
  --flare: #a9c1e0;
  --ion: #8c9aae;
  --ok: #5ee0a8;
  --meteor: linear-gradient(100deg, var(--ion) 0%, #e6edf7 42%, var(--flare) 70%, var(--ember) 100%);
  /* Brushed-metal banding for accent words: steel, a bright edge, cobalt, a second sheen. */
  --metal: linear-gradient(100deg, #7d8ba0 0%, #e8eef8 22%, #8fa7c9 38%, #4a6fa5 52%, #c9d7ec 68%, #6f8fbf 82%, #3f5f92 100%);
  --aurora-a: rgba(74, 111, 165, .5);
  --aurora-b: rgba(140, 154, 174, .38);

  --font-sans: "Overused Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(20px, 4.2vw, 64px);
  --header-h: clamp(68px, 9vh, 92px);
  --footer-h: clamp(64px, 9vh, 88px);
  --maxw: 1320px;
  --radius: 18px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --t-slide: 1100ms;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--ember); color: #fff; }
:focus-visible { outline: 2px solid var(--flare); outline-offset: 3px; border-radius: 6px; }

.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.glow-text {
  background: var(--metal) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: .08em;
  filter: drop-shadow(0 0 22px rgba(74, 111, 165, .35));
  animation: metal-sheen 9s ease-in-out infinite alternate;
}
@keyframes metal-sheen { from { background-position: 0% 0; } to { background-position: 100% 0; } }

/* ---------- Sky layers ---------- */
.nebula, #sky, .grain { position: fixed; inset: 0; pointer-events: none; }
.nebula { z-index: 0; overflow: hidden; }
.nebula::before, .nebula::after {
  content: "";
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(40px);
  transition: transform 2.4s var(--ease-out), opacity 2.4s var(--ease-out);
}
.nebula::before { left: -18vmax; top: -30vmax; background: radial-gradient(closest-side, rgba(30, 52, 92, .22), transparent); }
.nebula::after { right: -22vmax; bottom: -34vmax; background: radial-gradient(closest-side, rgba(74, 111, 165, .16), transparent); }
body[data-slide="mission"] .nebula::before { transform: translate(30vw, 10vh) scale(.8); }
body[data-slide="services"] .nebula::after { transform: translate(-40vw, -10vh); opacity: .7; }
body[data-slide="erp"] .nebula::before { transform: translate(52vw, 26vh) scale(.9); }
body[data-slide="erp"] .nebula::after { transform: translate(-10vw, -24vh) scale(1.1); }
body[data-slide="modules"] .nebula::before { opacity: .5; }
body[data-slide="why"] .nebula::after { transform: translate(-56vw, -6vh) scale(.9); }
body[data-slide="process"] .nebula::before { transform: translate(10vw, 50vh); }
body[data-slide="contact"] .nebula::after { transform: translate(-30vw, -8vh) scale(1.3); opacity: 1; }

/* Aurora: slow olive-to-teal curtains drifting across the upper sky. */
.aurora {
  position: fixed;
  z-index: 0;
  left: -15vw;
  right: -15vw;
  top: -12vh;
  height: 78vh;
  pointer-events: none;
  opacity: .55;
  mix-blend-mode: screen;
  filter: blur(22px) saturate(.9);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 55%, transparent 100%);
  transition: opacity 2.4s ease, transform 2.4s var(--ease-out);
}
.aurora span {
  position: absolute;
  top: 0;
  width: 46%;
  height: 100%;
  border-radius: 50% 50% 40% 40%;
  background:
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(190, 210, 240, .08) 14px 18px),
    linear-gradient(180deg, transparent 5%, var(--aurora-a) 45%, var(--aurora-b) 75%, transparent 100%);
  transform-origin: 50% 0;
  animation: aurora-drift 46s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { left: 2%; transform: skewX(-24deg) rotate(-6deg); }
.aurora span:nth-child(2) { left: 30%; width: 38%; opacity: .75; animation-duration: 62s; animation-delay: -20s; transform: skewX(18deg) rotate(4deg); }
.aurora span:nth-child(3) { left: 58%; width: 44%; opacity: .6; animation-duration: 54s; animation-delay: -36s; transform: skewX(-12deg) rotate(8deg); }
@keyframes aurora-drift {
  0% { translate: -4vw 0; scale: 1 .9; opacity: .55; }
  50% { translate: 3vw 2vh; scale: 1.08 1.05; opacity: 1; }
  100% { translate: 6vw -1vh; scale: .95 1; opacity: .7; }
}
body[data-slide="hero"] .aurora { opacity: .7; }
body[data-slide="erp"] .aurora { opacity: .4; transform: translateX(14vw); }
body[data-slide="modules"] .aurora { opacity: .22; }
body[data-slide="why"] .aurora { transform: translateX(-12vw); }
body[data-slide="contact"] .aurora { opacity: .75; transform: translateY(8vh); }

#sky { z-index: 1; width: 100%; height: 100%; transition: opacity 1.2s ease; }
body[data-slide="modules"] #sky { opacity: .45; }
.grain {
  z-index: 40;
  opacity: .06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: var(--ink);
  transition: opacity .8s ease, visibility .8s;
}
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader-logo { display: flex; align-items: center; gap: 14px; color: var(--text); transform-origin: 0 50%; }
.preloader-mark { width: clamp(84px, 12vw, 132px); height: auto; overflow: visible; filter: drop-shadow(0 0 18px rgba(74, 111, 165, .45)); }
.preloader-mark .mark-seven { stroke-dasharray: 70; stroke-dashoffset: 70; animation: mark-draw .9s var(--ease-in-out) .15s forwards; }
.preloader-mark .mark-trail { stroke-dasharray: 36; stroke-dashoffset: 36; animation: mark-draw .55s cubic-bezier(.5, 0, .2, 1) .85s forwards; }
.preloader-mark .mark-head { opacity: 0; transform-origin: 29.4px 36px; animation: mark-head .7s var(--ease-out) 1.3s forwards; }
.preloader-word {
  font-weight: 600;
  font-size: clamp(30px, 4.6vw, 52px);
  letter-spacing: .32em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(-12px);
  animation: preloader-word .8s var(--ease-out) 1.35s forwards;
}
.preloader-count {
  position: absolute;
  bottom: 36px;
  left: 0;
  right: 0;
  text-align: center;
  font: 12px/1 var(--font-mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dim);
}
.preloader-count span { color: var(--text); }
@keyframes mark-draw { to { stroke-dashoffset: 0; } }
@keyframes mark-head { 0% { opacity: 0; transform: scale(3); } 60% { opacity: 1; transform: scale(.8); } 100% { opacity: 1; transform: scale(1); } }
@keyframes preloader-word { to { opacity: 1; transform: none; } }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); opacity: 0; transition: opacity .6s ease; }
body.is-ready .brand { opacity: 1; }
.brand-mark { width: 38px; height: 38px; overflow: visible; filter: drop-shadow(0 0 10px rgba(74, 111, 165, .4)); transition: transform .5s var(--ease-out); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-word { font-weight: 600; font-size: 15px; letter-spacing: .32em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 10px; opacity: 0; transform: translateY(-8px); transition: opacity .6s ease .2s, transform .6s var(--ease-out) .2s; }
body.is-ready .header-actions { opacity: 1; transform: none; }

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font: 11px/1 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .2s ease, background-color .2s ease;
}
.sound-toggle:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.sound-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.sound-bars i { width: 2px; height: 3px; background: currentColor; border-radius: 1px; transition: height .3s ease; }
.sound-toggle[aria-pressed="true"] { color: var(--text); }
.sound-toggle[aria-pressed="true"] .sound-bars i { animation: eq 1s ease-in-out infinite alternate; }
.sound-toggle[aria-pressed="true"] .sound-bars i:nth-child(2) { animation-delay: -.3s; }
.sound-toggle[aria-pressed="true"] .sound-bars i:nth-child(3) { animation-delay: -.6s; }
.sound-toggle[aria-pressed="true"] .sound-bars i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { from { height: 3px; } to { height: 12px; } }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform .35s var(--ease-out), box-shadow .35s ease, background-color .25s ease, color .25s ease;
}
.btn span { transition: transform .35s var(--ease-out); }
.btn:hover span { transform: translateX(4px); }
.btn-solid { background: var(--text); color: var(--ink); box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 10px 40px -10px rgba(74, 111, 165, .6); }
.btn-solid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--meteor);
  opacity: 0;
  transition: opacity .35s ease;
}
.btn-solid:hover { color: #060a12; box-shadow: 0 0 0 1px rgba(169, 193, 224, .4), 0 14px 50px -8px rgba(74, 111, 165, .8); }
.btn-solid:hover::before { opacity: 1; }
.btn-ghost { color: var(--text); background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line-strong); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(169, 193, 224, .55); }
.header-cta { height: 40px; padding: 0 18px; font-size: 14px; }

/* ---------- Footer navigation ---------- */
.site-nav {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-h);
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .7s ease .35s, transform .7s var(--ease-out) .35s;
}
body.is-ready .site-nav { opacity: 1; transform: none; }
.nav-progress { display: flex; align-items: center; gap: 12px; font: 12px/1 var(--font-mono); color: var(--dim); letter-spacing: .1em; }
.nav-index { color: var(--text); min-width: 2ch; }
.nav-track { position: relative; width: clamp(60px, 9vw, 140px); height: 1px; background: var(--line-strong); }
.nav-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 1px;
  width: calc(var(--progress, 0) * 100%);
  background: linear-gradient(90deg, rgba(140, 154, 174, 0), #fff 70%, var(--flare));
  transition: width 1s var(--ease-out);
}
.nav-fill::after {
  content: "";
  position: absolute;
  right: -3px;
  top: -2.5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--flare);
  box-shadow: 0 0 10px 2px var(--ember);
}
.nav-links { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); }
.nav-links a {
  position: relative;
  padding: 8px 0;
  font-size: 13px;
  color: var(--dim);
  transition: color .3s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--flare);
  box-shadow: 0 0 8px 1px var(--ember);
  opacity: 0;
  transform: translateY(4px) scale(.4);
  transition: opacity .3s ease, transform .4s var(--ease-out);
}
.nav-links a:hover { color: var(--text); }
.nav-links a.is-active { color: var(--text); }
.nav-links a.is-active::after { opacity: 1; transform: none; }
.nav-current { justify-self: end; font: 11px/1 var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }

/* ---------- Deck & slide transitions ---------- */
.deck { position: fixed; inset: 0; z-index: 10; perspective: 1400px; pointer-events: none; }
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.slide::-webkit-scrollbar { display: none; }
.slide.is-active { visibility: visible; opacity: 1; pointer-events: auto; z-index: 2; }
/* Decorative layers live here so they never make a slide scrollable. */
.slide-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.slide-inner {
  position: relative;
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin: auto;
  padding: calc(var(--header-h) + 20px) var(--gutter) calc(var(--footer-h) + 20px);
}

.slide.in-fwd, .slide.out-fwd, .slide.in-back, .slide.out-back, .slide.in-fade, .slide.out-fade {
  visibility: visible;
  will-change: opacity, transform, filter;
  backface-visibility: hidden;
}
.slide.out-fwd, .slide.out-back, .slide.out-fade { z-index: 1; pointer-events: none; }
.slide.in-fwd { animation: slide-in-fwd var(--t-slide) var(--ease-out) both; }
.slide.out-fwd { animation: slide-out-fwd calc(var(--t-slide) * .8) cubic-bezier(.55, 0, .25, 1) both; }
.slide.in-back { animation: slide-in-back var(--t-slide) var(--ease-out) both; }
.slide.out-back { animation: slide-out-back calc(var(--t-slide) * .8) cubic-bezier(.55, 0, .25, 1) both; }
.slide.in-fade { animation: slide-fade-in .7s ease both .1s; }
.slide.out-fade { animation: slide-fade-out .4s ease both; }
@keyframes slide-in-fwd { from { opacity: 0; transform: translateZ(-600px); filter: blur(12px); } 35% { opacity: 1; } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes slide-out-fwd { from { opacity: 1; transform: none; filter: blur(0); } to { opacity: 0; transform: translateZ(520px); filter: blur(14px); } }
@keyframes slide-in-back { from { opacity: 0; transform: translateZ(480px); filter: blur(14px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes slide-out-back { from { opacity: 1; transform: none; filter: blur(0); } to { opacity: 0; transform: translateZ(-600px); filter: blur(12px); } }
@keyframes slide-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* Content entrances, replayed each time a slide becomes current. */
[data-reveal] { opacity: 0; transform: translateY(26px); filter: blur(6px); }
.slide.is-shown [data-reveal] { animation: reveal-up 1s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 1ms + 250ms); }
@keyframes reveal-up { to { opacity: 1; transform: none; filter: blur(0); } }

[data-split] .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
[data-split] .word > span { display: inline-block; transform: translateY(105%) rotate(4deg); transform-origin: 0 100%; }
.slide.is-shown [data-split] .word > span { animation: word-up 1.1s var(--ease-out) both; animation-delay: calc(var(--i) * 70ms + 250ms); }
@keyframes word-up { to { transform: none; } }

/* ---------- Shared typography ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 12px/1 var(--font-mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--flare); box-shadow: 0 0 10px 2px var(--ember); animation: pulse 2.4s ease-in-out infinite; }
.eyebrow-index { color: var(--flare); }
.eyebrow-index::after { content: ""; display: inline-block; width: 22px; height: 1px; margin-left: 12px; vertical-align: middle; background: linear-gradient(90deg, var(--flare), transparent); }
@keyframes pulse { 50% { opacity: .35; transform: scale(.7); } }
.title { font-weight: 500; font-size: clamp(34px, 5vw, 76px); line-height: 1.02; letter-spacing: -.035em; }
.title .serif { font-size: 1.06em; }
.lead { max-width: 56ch; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.55; color: var(--muted); }
.section-head { display: grid; gap: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 5px 10px; border-radius: 999px; font: 11px/1.2 var(--font-mono); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* Typewriter (letter fade and "machine" scramble). */
[data-typewriter] .typewriter-word { display: inline-block; white-space: nowrap; }
[data-typewriter] .typewriter-letter { opacity: 0; animation: tw-letter .3s ease-out both; }
[data-typewriter].is-typed .typewriter-letter { opacity: 1; animation: none; }
[data-typewriter].is-typing-machine::after {
  content: "";
  display: inline-block;
  width: .55em;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--flare);
  animation: caret .5s step-end infinite alternate;
}
@keyframes tw-letter { from { opacity: 0; filter: blur(4px); color: var(--flare); } to { opacity: 1; filter: blur(0); } }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .site-nav { grid-template-columns: 1fr auto; background: linear-gradient(0deg, rgba(4, 5, 10, .92) 40%, transparent); }
  .site-header { background: linear-gradient(180deg, rgba(4, 5, 10, .9) 30%, transparent); }
}
@media (max-width: 560px) {
  .header-cta { display: none; }
  .sound-label { display: none; }
  .sound-toggle { padding: 0 12px; }
  .brand-mark { width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora span { animation: none; }
  .slide.in-fwd, .slide.in-back { animation: slide-fade-in .5s ease both; }
  .slide.out-fwd, .slide.out-back { animation: slide-fade-out .3s ease both; }
  [data-reveal], [data-split] .word > span { opacity: 1; transform: none; filter: none; animation: none !important; }
  .eyebrow-dot, .glow-text { animation: none; }
}
