/* ============================================
   TSLTD — Base tokens (dark / neon-circuit theme)
   ============================================ */
:root {
  --color-bg: #0a0e17;
  --color-bg-alt: #0d1320;
  --color-surface: #131a29;
  --color-surface-2: #161f31;
  --color-ink: #eef2f8;
  --color-ink-soft: #c4cddb;
  --color-muted: #8b98ac;
  --color-border: rgba(255, 255, 255, 0.09);
  --color-border-strong: rgba(255, 255, 255, 0.16);

  --color-cyan: #3fc7ff;
  --color-purple: #a06cdb;
  --gradient-accent: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  --glow-cyan: rgba(70, 225, 255, 0.28);
  --glow-purple: rgba(157, 107, 255, 0.28);

  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 1120px;
  --radius: 8px;

  --circuit-bg: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIj4KPHBhdGggZD0iTTAgNjAgSDQ1IE03NSA2MCBIMTIwIE02MCAwIFY0NSBNNjAgNzUgVjEyMCBNNDUgNjAgTDYwIDQ1IE02MCA3NSBMNzUgNjAiIHN0cm9rZT0icmdiYSgxMjAsMjI1LDI1NSwwLjE2KSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIi8+CjxjaXJjbGUgY3g9IjYwIiBjeT0iNjAiIHI9IjIuNSIgZmlsbD0icmdiYSgxNTcsMTA3LDI1NSwwLjM1KSIvPgo8Y2lyY2xlIGN4PSI0NSIgY3k9IjYwIiByPSIxLjYiIGZpbGw9InJnYmEoMTIwLDIyNSwyNTUsMC4zKSIvPgo8Y2lyY2xlIGN4PSI3NSIgY3k9IjYwIiByPSIxLjYiIGZpbGw9InJnYmEoMTIwLDIyNSwyNTUsMC4zKSIvPgo8Y2lyY2xlIGN4PSI2MCIgY3k9IjQ1IiByPSIxLjYiIGZpbGw9InJnYmEoMTIwLDIyNSwyNTUsMC4zKSIvPgo8Y2lyY2xlIGN4PSI2MCIgY3k9Ijc1IiByPSIxLjYiIGZpbGw9InJnYmEoMTIwLDIyNSwyNTUsMC4zKSIvPgo8L3N2Zz4=");
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  color: var(--color-ink);
}

h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--color-ink-soft); }

a { color: var(--color-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}
.logo:hover { text-decoration: none; }

.logo-badge {
  display: block;
  flex-shrink: 0;
}

.logo-suffix {
  color: var(--color-muted);
  font-size: 0.7em;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  color: var(--color-ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
}

.main-nav a:hover { color: var(--color-cyan); text-decoration: none; }

.nav-cta {
  padding: 8px 18px;
  border-radius: var(--radius);
  background: var(--gradient-accent);
  color: #05070c !important;
  font-weight: 700;
}
.nav-cta:hover { opacity: 0.9; text-decoration: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-ink);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  position: relative;
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

/* Cursor-tracking glow — --mx/--my are set by js/main.js on mousemove;
   falls back to a centered glow with no JS. */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(140px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.45), transparent 62%);
  opacity: 0;
  transition: opacity 0.25s ease;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.btn:hover::before { opacity: 1; }

.btn-primary {
  background: var(--gradient-accent);
  color: #05070c;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 8px 24px -8px var(--glow-cyan);
}
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 12px 34px -6px var(--glow-purple); }

.btn-secondary {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-border-strong);
}
.btn-secondary:hover { border-color: var(--color-cyan); color: var(--color-cyan); background: rgba(70,225,255,0.06); }

.btn-block { display: block; width: 100%; }

/* ============================================
   Hero
   ============================================ */
.hero {
  padding: 100px 0 84px;
  position: relative;
  overflow: hidden;
  background-color: var(--color-bg);
  background-image: var(--circuit-bg);
  background-repeat: repeat;
  background-size: 120px 120px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 400px at 15% 0%, rgba(157,107,255,0.14), transparent 60%),
              radial-gradient(600px 380px at 85% 30%, rgba(70,225,255,0.12), transparent 60%);
  pointer-events: none;
}

/* One-time animated circuit trace-in, layered on top of the static tiled
   background above. preserveAspectRatio="slice" so it crops on narrow /
   tall viewports instead of stretching and distorting the lines. */
.hero-trace {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero-trace .trace-lines path {
  stroke: rgba(120,225,255,0.28);
  stroke-width: 1.4;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: draw-in 2.2s cubic-bezier(0.4,0,0.2,1) forwards;
}

/* Travelling signal pulses — a short bright dash swept along each trace, so
   the board reads as powered rather than decorative. Each path is ONE
   continuous subpath on purpose: SVG restarts the dash pattern at every new
   subpath, so an "M ... M ..." path would fire several pulses at once. */
.hero-trace .trace-pulses path {
  stroke: var(--color-cyan);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--glow-cyan));
  stroke-dasharray: 26 1200;
  stroke-dashoffset: 26;
  opacity: 0.9;
  animation: pulse-travel 7.5s linear infinite;
}
@keyframes pulse-travel {
  0%   { stroke-dashoffset: 26; }
  55%  { stroke-dashoffset: -1200; }
  100% { stroke-dashoffset: -1200; }
}

.hero-trace .trace-nodes circle {
  fill: rgba(157,107,255,0.55);
  opacity: 0;
  animation: node-pulse 3.4s ease-in-out infinite;
  animation-delay: 1.3s;
}
@keyframes draw-in { to { stroke-dashoffset: 0; } }
@keyframes node-pulse { 0%, 100% { opacity: 0.35; transform: scale(1); } 50% { opacity: 0.85; transform: scale(1.6); } }

/* Cursor-reactive circuit: the same board at full brightness, revealed only
   through a soft radius that follows the pointer (--hx/--hy set in main.js).
   Defaults to invisible, so no-JS and touch devices simply never see it. */
.hero-spotlight {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  -webkit-mask-image: radial-gradient(210px circle at var(--hx, 50%) var(--hy, 50%), #000 0%, rgba(0,0,0,0.45) 45%, transparent 72%);
  mask-image: radial-gradient(210px circle at var(--hx, 50%) var(--hy, 50%), #000 0%, rgba(0,0,0,0.45) 45%, transparent 72%);
}
.hero-spotlight path {
  stroke: rgba(140,232,255,0.85);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
}
.hero-spotlight circle { fill: rgba(180,140,255,0.95); }
.hero.pointer-active .hero-spotlight { opacity: 1; }

@media (hover: none) {
  .hero-spotlight { display: none; }
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}
.aurora-cyan { width: 480px; height: 480px; background: rgba(70,225,255,0.15); top: -160px; left: -100px; animation: drift-a 16s ease-in-out infinite alternate; }
.aurora-purple { width: 540px; height: 540px; background: rgba(157,107,255,0.15); top: -60px; right: -160px; animation: drift-b 19s ease-in-out infinite alternate; }
@keyframes drift-a { from { transform: translate(0,0) scale(1); } to { transform: translate(50px,40px) scale(1.1); } }
@keyframes drift-b { from { transform: translate(0,0) scale(1); } to { transform: translate(-60px,30px) scale(1.06); } }

.hero .wrap { position: relative; z-index: 1; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-cyan);
  margin-bottom: 14px;
  opacity: 0;
  animation: rise-in 0.6s ease forwards;
  animation-delay: 0.1s;
}

.hero h1 { max-width: 760px; }

.hero h1 .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(16px);
  animation: rise-in 0.6s cubic-bezier(0.2,0.7,0.2,1) forwards;
}
.hero h1 .shimmer {
  background: linear-gradient(100deg, var(--color-ink) 30%, var(--color-cyan) 45%, var(--color-purple) 55%, var(--color-ink) 70%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rise-in 0.6s cubic-bezier(0.2,0.7,0.2,1) forwards, shimmer-sweep 5s ease-in-out 2.4s infinite;
}
@keyframes rise-in { to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer-sweep { 0% { background-position: 0% 0; } 100% { background-position: -160% 0; } }

.hero-sub {
  max-width: 620px;
  font-size: 1.1rem;
  color: var(--color-muted);
  opacity: 0;
  animation: rise-in 0.6s ease forwards;
  animation-delay: 0.75s;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
  opacity: 0;
  animation: rise-in 0.6s ease forwards;
  animation-delay: 0.9s;
}

/* ============================================
   Status strip (looping ticker, hero → services)
   ============================================ */
.status-strip {
  position: relative;
  height: 52px;
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}
.status-track {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: marquee 26s linear infinite;
  width: max-content;
}
.status-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px;
  font-size: 0.85rem;
  color: var(--color-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-cyan);
  box-shadow: 0 0 8px 1px var(--glow-cyan);
  animation: blink 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================
   Sections shared
   ============================================ */
section { padding: 72px 0; }

.section-lede {
  color: var(--color-muted);
  font-size: 1.05rem;
  max-width: 620px;
  margin-bottom: 40px;
}

/* ============================================
   Services
   ============================================ */
.services { background: var(--color-bg-alt); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }

/* ============================================
   Services bus wire ("three lanes, one shop")
   ============================================ */
.grid-wire {
  height: 48px;
  margin: -8px 0 0;
  pointer-events: none;
}
.grid-wire svg { display: block; width: 100%; height: 48px; }

.grid-wire .wire-lines path {
  stroke: rgba(120,225,255,0.22);
  stroke-width: 1.2;
  fill: none;
}
.grid-wire .wire-pulses path {
  stroke: var(--color-cyan);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px var(--glow-cyan));
  stroke-dasharray: 18 700;
  stroke-dashoffset: 18;
  opacity: 0;
}
.grid-wire.in-view .wire-pulses path {
  opacity: 0.95;
  animation: wire-travel 4.6s linear infinite;
}
@keyframes wire-travel {
  0%   { stroke-dashoffset: 18; }
  45%  { stroke-dashoffset: -700; }
  100% { stroke-dashoffset: -700; }
}
.grid-wire .wire-node { fill: rgba(157,107,255,0.7); }

@media (max-width: 880px) {
  .grid-wire { display: none; }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 30px 28px 28px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  border-color: rgba(70,225,255,0.35);
  box-shadow: 0 16px 40px -18px var(--glow-cyan);
}

/* Reveal + tilt only apply once js/main.js has confirmed JS is running
   (the <html> element gets a "js" class in the head) — with JS off or
   failing, cards are simply visible and static. See main.js. */
.js .card,
.js .work-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.2,0.7,0.2,1), transform 0.6s cubic-bezier(0.2,0.7,0.2,1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.js .card.in-view,
.js .work-item.in-view {
  opacity: 1;
  transform: translateY(0);
}
.js .card-grid .card:nth-child(1),
.js .work-grid .work-item:nth-child(1) { transition-delay: 0s; }
.js .card-grid .card:nth-child(2),
.js .work-grid .work-item:nth-child(2) { transition-delay: 0.1s; }
.js .card-grid .card:nth-child(3),
.js .work-grid .work-item:nth-child(3) { transition-delay: 0.2s; }

.card-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-accent);
  overflow: hidden;
}
.card-accent::after {
  content: "";
  position: absolute;
  top: 0; left: -40%;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card:hover .card-accent::after,
.work-item:hover .card-accent::after {
  opacity: 1;
  animation: accent-sweep 1.1s ease forwards;
}
@keyframes accent-sweep { from { left: -40%; } to { left: 110%; } }

.card-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.card-corner.tl { top: 10px; left: 10px; border-top: 2px solid var(--color-cyan); border-left: 2px solid var(--color-cyan); }
.card-corner.br { bottom: 10px; right: 10px; border-bottom: 2px solid var(--color-purple); border-right: 2px solid var(--color-purple); }
.card:hover .card-corner,
.work-item:hover .card-corner {
  opacity: 0.8;
  transform: scale(1);
}

.card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-cyan);
  margin-bottom: 12px;
}

.card p { margin-bottom: 0; }

/* ============================================
   Services divider banner (CSS-only, no photo)
   ============================================ */
.services-banner {
  height: 110px;
  background-color: var(--color-bg-alt);
  background-image: var(--circuit-bg);
  background-size: 120px 120px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}
.services-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 160px at 50% 50%, rgba(157,107,255,0.10), transparent 70%);
}

/* ============================================
   Proof of work
   ============================================ */
.work {
  background-color: var(--color-bg);
  background-image: var(--circuit-bg);
  background-size: 120px 120px;
  background-repeat: repeat;
  background-blend-mode: normal;
  position: relative;
}
.work::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-bg);
  opacity: 0.94;
  pointer-events: none;
}
.work .wrap { position: relative; z-index: 1; }

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.work-item {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 30px 28px 28px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.work-item:hover {
  border-color: rgba(70,225,255,0.35);
  box-shadow: 0 16px 40px -18px var(--glow-cyan);
}

.work-item p { margin-bottom: 0; color: var(--color-muted); }

/* ============================================
   About
   ============================================ */
.about { background: var(--color-surface); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.about-inner { max-width: 720px; }
.about p { color: var(--color-ink-soft); }

/* ============================================
   Contact
   ============================================ */
.contact { background: var(--color-bg-alt); }

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: start;
}

.contact-alt { margin-top: 16px; font-size: 0.95rem; color: var(--color-muted); }

.contact-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
}

.form-row { margin-bottom: 18px; }

.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-ink);
  margin-bottom: 6px;
}

.form-row .optional { font-weight: 400; color: var(--color-muted); }

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-ink);
  background: var(--color-bg);
}

.form-row input::placeholder,
.form-row textarea::placeholder { color: var(--color-muted); }

/* background-COLOR carries the fill; background-IMAGE is a gradient trace
   that draws itself along the bottom edge on focus. No extra markup needed. */
.form-row input,
.form-row textarea {
  background-color: var(--color-bg);
  background-image: var(--gradient-accent);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  transition: background-size 0.35s cubic-bezier(0.2,0.7,0.2,1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-cyan);
  box-shadow: 0 0 0 3px var(--glow-cyan);
  background-size: 100% 2px;
}

.form-status {
  margin: 14px 0 0;
  font-size: 0.9rem;
  min-height: 1.2em;
}
.form-status.success { color: #4ee08a; }
.form-status.error { color: #ff8a6a; }


/* Honeypot — must be genuinely invisible to people but still fillable by a
   bot, so no display:none (some bots skip those). Off-screen instead. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-privacy {
  margin: 14px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--color-muted);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 28px 0;
  background: var(--color-bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.footer-sep { opacity: 0.5; }

.footer-legal {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--color-muted);
  opacity: 0.8;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 880px) {
  .card-grid, .work-grid { grid-template-columns: 1fr; }
  .contact-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 24px;
    gap: 16px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .hero { padding: 64px 0 56px; }
}
