/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg: #000000;
  --bg-elevated: #0a0a0b;
  --bg-card: #0d0d0f;
  --text-primary: #f5f5f3;
  --text-secondary: #8b8b92;
  --text-tertiary: #55555c;
  --border: rgba(255, 255, 255, 0.10);
  --border-hover: rgba(255, 255, 255, 0.22);
  --accent: #5ee7ff;
  --accent-dim: rgba(94, 231, 255, 0.35);
  --accent-warm: #ffb454;
  --font-display: 'Clash Display', 'Segoe UI', sans-serif;
  --font-body: 'Switzer', 'Segoe UI', sans-serif;

  --scroll-total: 1400vh;
  --page-margin: clamp(2rem, 7vw, 7.5rem);
}

@media (max-width: 768px) {
  :root { --scroll-total: 830vh; --page-margin: 1.75rem; }
}

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

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

::selection { background: var(--accent-dim); color: var(--text-primary); }

/* ============================================================
   LOADER
   ============================================================ */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.5rem;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  color: var(--text-primary);
}
.loader-brand span { color: var(--accent); }
#loader-bar-track {
  width: 220px; height: 1px; background: var(--border); position: relative; overflow: hidden;
}
#loader-bar {
  position: absolute; left: 0; top: 0; height: 100%; width: 0%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
#loader-percent {
  font-size: 0.7rem; letter-spacing: 0.15em; color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 500;
  padding: 1.5rem var(--page-margin);
}
/* backdrop/gradient live on a pseudo-element, not .site-header itself —
   backdrop-filter on a real ancestor turns it into the containing block
   for any position:fixed descendant (like the mobile nav panel below),
   which would anchor that panel to the header bar instead of the viewport */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
}
.site-header nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1600px; margin: 0 auto;
}
.logo {
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; letter-spacing: 0.05em;
}
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2.25rem; }
.nav-links a {
  font-size: 0.8rem; letter-spacing: 0.04em; color: var(--text-secondary);
  transition: color 0.3s ease;
}
.nav-links a:hover { color: var(--text-primary); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 30px; height: 30px; background: none; border: none; padding: 0;
  cursor: pointer; z-index: 501; position: relative;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%; background: var(--text-primary);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), opacity 0.3s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
    position: fixed; inset: 0; z-index: 490;
    background: rgba(0, 0, 0, 0.97); backdrop-filter: blur(12px);
    padding: 0 clamp(2rem, 10vw, 4rem); gap: 1.75rem;
    opacity: 0; visibility: hidden; transform: translateY(-12px);
    transition: opacity 0.35s ease, visibility 0.35s, transform 0.35s cubic-bezier(0.16,1,0.3,1);
  }
  .nav-links.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-links a { font-size: 1.5rem; font-family: var(--font-display); font-weight: 500; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero-standalone {
  position: relative; z-index: 20;
  height: 100vh; width: 100%;
  background: var(--bg);
  display: flex; align-items: center;
  padding: 0 var(--page-margin);
}
.hero-text { max-width: 640px; }

.hero-portrait {
  width: 52px; height: 52px; border-radius: 50%;
  overflow: hidden; margin-bottom: 1.4rem;
  border: 1px solid var(--border-hover);
  box-shadow: 0 0 0 4px rgba(94,231,255,0.06), 0 0 24px rgba(94,231,255,0.10);
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; }

.section-label {
  display: block;
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); opacity: 0.85; margin-bottom: 1rem;
  font-weight: 500;
}

.hero-heading {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(3.2rem, 8vw, 6.4rem);
  line-height: 0.98; letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.4rem;
}
.hero-heading .word { display: inline-block; }
.hero-heading .accent { color: var(--accent); }

.hero-tagline {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  color: var(--text-secondary);
  margin-bottom: 1.1rem;
}

.hero-body {
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 2.2rem;
}

.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 0.9rem 1.8rem; font-size: 0.85rem;
  letter-spacing: 0.03em; border-radius: 999px; font-weight: 500;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}
.btn-solid {
  background: var(--text-primary); color: #000;
  box-shadow: 0 0 0 rgba(94,231,255,0);
}
.btn-solid:hover { box-shadow: 0 0 28px rgba(94,231,255,0.35); transform: translateY(-2px); }
.btn-outline {
  border: 1px solid var(--border-hover); color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.scroll-cue {
  position: absolute; bottom: 2.5rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  z-index: 20;
}
.scroll-cue span { font-size: 0.65rem; letter-spacing: 0.15em; color: var(--text-tertiary); text-transform: uppercase; white-space: nowrap; }
.scroll-cue-line { width: 1px; height: 42px; background: linear-gradient(to bottom, var(--accent), transparent); animation: cueMove 2s ease-in-out infinite; }
@keyframes cueMove { 0%,100% { opacity: 0.2; } 50% { opacity: 1; } }

@media (max-width: 768px) {
  .hero-standalone { align-items: flex-start; padding-top: 7.5rem; padding-bottom: 4rem; height: auto; min-height: 100vh; }
  .hero-text { max-width: 100%; }
  .scroll-cue { display: none; }
}

/* ============================================================
   CANVAS + OVERLAY + MARQUEE
   ============================================================ */
.canvas-wrap {
  position: fixed; top: 0; right: 0; z-index: 1;
  width: 66.667%; height: 100%;
  clip-path: circle(0% at 50% 50%);
  will-change: clip-path;
}
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

@media (max-width: 768px) {
  .canvas-wrap { width: 100%; }
}

#dark-overlay {
  position: fixed; inset: 0; z-index: 5;
  background: #000; opacity: 0; pointer-events: none;
}

.marquee-wrap {
  position: fixed; bottom: -3.5vw; left: 0; width: 100%;
  z-index: 6; overflow: hidden; pointer-events: none;
  opacity: 0;
}
.marquee-text {
  display: inline-block; white-space: nowrap;
  font-family: var(--font-display); font-weight: 600;
  font-size: 9vw; letter-spacing: -0.01em;
  color: rgba(255,255,255,0.10);
  -webkit-text-stroke: 1px rgba(255,255,255,0.20);
}

/* ============================================================
   SCROLL CONTAINER + SECTION BASE
   ============================================================ */
#scroll-container {
  position: relative; z-index: 10; height: var(--scroll-total); width: 100%;
}

.scroll-section {
  position: absolute; left: 0; width: 100%;
  transform: translateY(-50%);
  padding: 0 var(--page-margin);
}

/* Mobile: percentage-based top offsets were tuned against desktop's
   multi-column grid heights. On mobile everything stacks into single
   tall columns, so those offsets overlap unpredictably — instead let
   sections flow normally, one after another, and size the container
   to fit them rather than a fixed vh guess. */
@media (max-width: 768px) {
  #scroll-container { height: auto; }
  .scroll-section { position: static; transform: none; margin: 6rem 0; }
  #scroll-container > .scroll-section:first-child { margin-top: 2rem; }
  #scroll-container > .scroll-section:last-child { margin-bottom: 2rem; }
  .section-inner-wide { padding-top: 0; }
}

/* entrance reveals: plain CSS transitions toggled by a class, staggered via --i */
.scroll-section .reveal-item {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), clip-path 0.8s cubic-bezier(0.65, 0, 0.35, 1);
  transition-delay: calc(var(--i, 0) * 0.07s);
}
.anim-fade-up .reveal-item { transform: translateY(46px); }
.anim-stagger-up .reveal-item { transform: translateY(56px); }
.anim-scale-up .reveal-item { transform: scale(0.88); }
.anim-clip-reveal .reveal-item { clip-path: inset(100% 0 0 0); }

.is-revealed .reveal-item { opacity: 1; transform: none; clip-path: inset(0% 0 0 0); }

/* .node keeps its own permanent centering transform (translate(-50%,-50%)) —
   it's not part of the entrance animation, so the reveal system must not
   reset it to none/scale it away like a normal reveal-item */
.anim-scale-up .node.reveal-item { transform: translate(-50%, -50%) scale(0.88); }
.is-revealed .node.reveal-item { transform: translate(-50%, -50%); }

.section-inner { max-width: 560px; }
.section-inner-wide { max-width: 1500px; margin: 0 auto; padding-top: 6.5rem; }

.align-left { padding-left: var(--page-margin); padding-right: 68%; }
.align-right { padding-left: 68%; padding-right: var(--page-margin); text-align: right; margin-left: auto; }
.align-right .section-inner { margin-left: auto; }

.section-heading {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  line-height: 1.04; letter-spacing: -0.01em;
  margin-bottom: 1.4rem;
}
.section-body {
  font-size: clamp(0.95rem, 1.05vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .align-left, .align-right { padding-left: var(--page-margin); padding-right: var(--page-margin); text-align: left; margin-left: 0; }
  .section-inner { max-width: 100%; }
}

/* ============================================================
   EXPERTISE GRID
   ============================================================ */
.expertise-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  margin-top: 1rem;
}
.expertise-card {
  background: var(--bg-card); padding: 2rem 1.75rem;
  position: relative;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.expertise-card:hover { background: #121215; box-shadow: inset 0 0 0 1px var(--accent-dim); }
.card-index {
  display: block; font-size: 0.7rem; color: var(--text-tertiary); letter-spacing: 0.1em;
  margin-bottom: 1.2rem; font-variant-numeric: tabular-nums;
}
.expertise-card h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  margin-bottom: 1rem; letter-spacing: -0.01em;
}
.expertise-card ul { display: flex; flex-direction: column; gap: 0.45rem; }
.expertise-card li {
  font-size: 0.82rem; color: var(--text-secondary); line-height: 1.4;
  padding-left: 0.9rem; position: relative;
}
.expertise-card li::before {
  content: ''; position: absolute; left: 0; top: 0.55em; width: 4px; height: 1px; background: var(--accent-dim);
}
.card-note {
  font-size: 0.78rem; color: var(--accent); opacity: 0.85; margin-top: 1rem;
  border-top: 1px solid var(--border); padding-top: 0.9rem; line-height: 1.5;
}
.card-highlight { background: #0d0f0d; }
.card-stat {
  margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--border);
}
.card-stat .stat-number {
  font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; color: var(--accent-warm);
}
.card-stat .stat-suffix { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--accent-warm); }
.card-stat .stat-label { display: block; font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.3rem; }

@media (max-width: 1100px) { .expertise-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .expertise-grid { grid-template-columns: 1fr; } }

/* ============================================================
   PROCESS
   ============================================================ */
.process-track {
  position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem;
  margin-top: 2rem;
}
.process-line {
  position: absolute; top: 1.1rem; left: 4%; width: 92%; height: 4px;
  overflow: visible;
}
.process-line line {
  stroke: var(--accent-dim); stroke-width: 2; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1000; stroke-dashoffset: 1000;
}
.process-step { position: relative; }
.process-num {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  font-size: 0.85rem; color: var(--accent); background: var(--bg);
  padding-right: 0.6rem;
}
.process-step h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.3rem;
  margin: 1rem 0 0.7rem;
}
.process-step p { font-size: 0.88rem; color: var(--text-secondary); }

@media (max-width: 900px) {
  .process-track { grid-template-columns: 1fr; gap: 2rem; }
  .process-line { display: none; }
}

/* ============================================================
   SYSTEMS NETWORK
   ============================================================ */
.network {
  position: relative; width: 100%; max-width: 800px; aspect-ratio: 1/1;
  margin: 2rem auto 0;
}
.network-lines {
  position: absolute; inset: 0; width: 100%; height: 100%;
  filter: drop-shadow(0 0 3px rgba(94,231,255,0.85)) drop-shadow(0 0 8px rgba(94,231,255,0.5));
}
.network-lines line {
  stroke: var(--accent); stroke-width: 0.4; vector-effect: non-scaling-stroke;
  opacity: 0.85;
}
.node {
  position: absolute; transform: translate(-50%, -50%);
  padding: 0.5rem 0.95rem; border: 1px solid var(--border-hover);
  border-radius: 999px; background: rgba(10,10,11,0.85);
  font-size: 0.68rem; letter-spacing: 0.02em; color: var(--text-secondary);
  white-space: nowrap; backdrop-filter: blur(6px);
  transition: border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}
.node:hover { border-color: var(--accent); color: var(--text-primary); box-shadow: 0 0 18px rgba(94,231,255,0.25); }
.node-hub {
  font-family: var(--font-display); font-weight: 600; color: var(--text-primary);
  border-color: var(--accent); font-size: 0.85rem; padding: 0.9rem 1.5rem;
  box-shadow: 0 0 30px rgba(94,231,255,0.2);
}

@media (max-width: 768px) {
  .network-scroll { overflow: visible; display: flex; justify-content: center; }
  .network { width: 100%; max-width: 380px; margin: 1.5rem auto 0; }
  .node { font-size: 0.5rem; padding: 0.3rem 0.55rem; letter-spacing: 0; }
  .node-hub { font-size: 0.62rem; padding: 0.5rem 0.85rem; }
}

/* ============================================================
   CAPABILITIES
   ============================================================ */
.capability-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
  margin-top: 1rem;
}
.capability-card {
  border: 1px solid var(--border); padding: 2.2rem 1.6rem; min-height: 190px;
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: border-color 0.4s ease;
}
.capability-card:hover { border-color: var(--accent-dim); transform: translateY(-4px); }
.capability-card h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; margin-bottom: 0.6rem;
}
.capability-card p { font-size: 0.82rem; color: var(--text-secondary); }

@media (max-width: 1100px) { .capability-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .capability-grid { grid-template-columns: 1fr; } }

/* ============================================================
   TESTIMONIAL
   ============================================================ */
.testimonial-section {
  position: relative; z-index: 10; background: var(--bg);
  padding: 7rem var(--page-margin) 6rem;
}
.testimonial-inner { max-width: 1500px; margin: 0 auto; }
.testimonial-inner .section-label { display: block; }
.testimonial-inner .section-heading { margin-bottom: 0; }
.testimonial-video {
  position: relative; display: block; width: 100%; max-width: 860px; aspect-ratio: 16 / 9;
  margin: 2.75rem auto 0; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); padding: 0;
  box-shadow: 0 0 50px rgba(94, 231, 255, 0.08);
  background: var(--bg-card);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
.testimonial-video:hover { border-color: var(--accent-dim); box-shadow: 0 0 70px rgba(94, 231, 255, 0.16); }
iframe.testimonial-video { border: 0; }
button.testimonial-video { cursor: pointer; }
.testimonial-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
button.testimonial-video::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.05) 40%);
}
.testimonial-play-icon {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 76px; height: 76px; border-radius: 50%; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 11, 0.65); border: 1px solid var(--accent-dim);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 40px rgba(94, 231, 255, 0.3);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), background 0.35s ease, box-shadow 0.35s ease;
}
.testimonial-play-icon svg { width: 26px; height: 26px; fill: var(--text-primary); margin-left: 4px; }
button.testimonial-video:hover .testimonial-play-icon {
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(94, 231, 255, 0.15);
  box-shadow: 0 0 55px rgba(94, 231, 255, 0.45);
}

.testimonial-reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 0.1s);
}
.testimonial-reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 768px) {
  .testimonial-section { padding: 5rem var(--page-margin) 4rem; }
  .testimonial-video { margin-top: 2rem; border-radius: 10px; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative; z-index: 10; background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 3.5rem var(--page-margin) 2rem;
}
.footer-resume {
  max-width: 1600px; margin: 0 auto 3rem;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 2rem;
  max-width: 1600px; margin: 0 auto;
}
.footer-brand h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin-bottom: 0.4rem; }
.footer-brand p { font-size: 0.8rem; color: var(--text-secondary); }
.footer-links { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.footer-links a {
  font-size: 0.8rem; color: var(--text-secondary); position: relative;
  transition: color 0.3s ease;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
  max-width: 1600px; margin: 2.5rem auto 0; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.72rem; color: var(--text-tertiary);
}

/* ============================================================
   LEGAL PAGES
   ============================================================ */
.legal-main {
  max-width: 760px; margin: 0 auto;
  padding: 9rem var(--page-margin) 6rem;
}
.legal-main .section-label { margin-bottom: 1rem; }
.legal-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3rem);
  letter-spacing: -0.02em; color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.legal-updated { font-size: 0.8rem; color: var(--text-tertiary); margin-bottom: 3rem; }
.legal-content h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.3rem; color: var(--text-primary);
  margin: 2.75rem 0 1rem;
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { font-size: 0.95rem; line-height: 1.75; color: var(--text-secondary); margin-bottom: 1rem; }
.legal-content ul { margin: 0 0 1rem 1.25rem; padding: 0; }
.legal-content li { font-size: 0.95rem; line-height: 1.75; color: var(--text-secondary); margin-bottom: 0.4rem; }
.legal-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-content a:hover { color: var(--text-primary); }
.legal-content strong { color: var(--text-primary); font-weight: 500; }

/* ============================================================
   MOTION UTILS
   ============================================================ */
.gsap-hidden { opacity: 0; }
