@font-face {
  font-family: "Chakra Petch";
  src: url("fonts/ChakraPetch-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("fonts/ChakraPetch-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

/* ---------- Fixed brand tokens ---------- */
:root {
  --navy: #012169;
  --red: #E4002B;
  --red-dark: #b80022;
  --space: #050a1a;
  --space-2: #0a1330;
  --signal: #6f8ff0;
  --ice: #a9c0ff;
  --ok: #3ddc97;
  --warn: #ff6b7d;
  --on-dark: #e8ecf7;
  --on-dark-muted: #9ba7c7;
  --dark-border: rgba(160, 180, 255, 0.16);

  --font-display: "Chakra Petch", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;

  --wrap: 76rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Theme tokens: light ---------- */
:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --border: #d6ddeb;
  --text: #14213d;
  --muted: #4a5568;
  --heading: #012169;
  --link: #012169;
  --accent: #2c4fd1;
  --glow: rgba(44, 79, 209, 0.10);
  --label: #b80022;
  --focus: #b80022;
  --viz-fill: #e6ecfa;
  --shadow: 0 20px 50px -24px rgba(1, 33, 105, 0.25);
  --show-light: block;
  --show-dark: none;
}

/* ---------- Theme tokens: dark ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #050a1a;
    --bg-alt: #08102a;
    --surface: rgba(255, 255, 255, 0.035);
    --border: rgba(160, 180, 255, 0.14);
    --text: #e8ecf7;
    --muted: #9ba7c7;
    --heading: #ffffff;
    --link: #a9c0ff;
    --accent: #6f8ff0;
    --glow: rgba(111, 143, 240, 0.18);
    --label: #ff6b7d;
    --focus: #ff6b7d;
    --viz-fill: rgba(111, 143, 240, 0.12);
    --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
    --show-light: none;
    --show-dark: block;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050a1a;
  --bg-alt: #08102a;
  --surface: rgba(255, 255, 255, 0.035);
  --border: rgba(160, 180, 255, 0.14);
  --text: #e8ecf7;
  --muted: #9ba7c7;
  --heading: #ffffff;
  --link: #a9c0ff;
  --accent: #6f8ff0;
  --glow: rgba(111, 143, 240, 0.18);
  --label: #ff6b7d;
  --focus: #ff6b7d;
  --viz-fill: rgba(111, 143, 240, 0.12);
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  --show-light: none;
  --show-dark: block;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
html.motion-off { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  margin: 0 0 0.6em;
  color: var(--heading);
  letter-spacing: -0.01em;
}
h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); max-width: 20ch; }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--link); }
.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.dim { opacity: 0.7; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }
.for-light { display: var(--show-light); }
.for-dark { display: var(--show-dark); }

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

.skip-link {
  position: fixed; left: 1rem; top: -5rem; z-index: 100;
  background: #fff; color: var(--navy); padding: 0.7rem 1.1rem;
  border-radius: 10px; font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* ---------- Scroll progress ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--red), #ff5470, var(--signal));
  transform-origin: left; transform: scaleX(var(--p, 0));
}

/* ---------- Dark panels keep a light focus ring in both themes ---------- */
.site-header, .hero, .section-deep, .contact, .site-footer { --focus: #ff6b7d; }

/* ---------- Header (dark glass in both themes) ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background 0.4s var(--ease), border-color 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(5, 10, 26, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--dark-border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 1rem; padding-bottom: 1rem;
}
.brand img { width: 170px; height: auto; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.4rem 1.6rem; }
.nav-link a {
  position: relative; display: inline-block; padding: 0.5rem 0;
  font-family: var(--font-display); font-weight: 700; color: var(--on-dark); text-decoration: none;
}
.nav-link a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.2rem; height: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: right; transition: transform 0.35s var(--ease);
}
.nav-link a:hover::after { transform: scaleX(1); transform-origin: left; }

.icon-btn {
  display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0;
  border-radius: 50%; border: 1px solid var(--dark-border);
  background: rgba(255, 255, 255, 0.06); color: var(--on-dark); cursor: pointer;
  transition: background 0.3s, transform 0.3s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.14); transform: rotate(-15deg); }
.icon-btn svg { width: 1.15rem; height: 1.15rem; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 0.6rem;
  border-radius: 999px; font-family: var(--font-display); font-weight: 700;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.3s, box-shadow 0.3s, border-color 0.3s;
  will-change: transform;
}
.btn svg { width: 1.1em; height: 1.1em; transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.95rem; }
.btn-lg { padding: 1rem 1.6rem; font-size: 1.05rem; }
.btn-primary {
  background: var(--red); color: #fff;
  box-shadow: 0 10px 30px -10px rgba(228, 0, 43, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { background: #c80026; box-shadow: 0 14px 40px -10px rgba(228, 0, 43, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-glass {
  background: rgba(255, 255, 255, 0.07); color: var(--on-dark);
  border-color: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.5); }

.text-link {
  font-family: var(--font-display); font-weight: 700; color: var(--link);
  text-decoration: none; border-bottom: 2px solid currentColor; padding-bottom: 2px;
}
.text-link span { display: inline-block; transition: transform 0.3s var(--ease); }
.text-link:hover span { transform: translateX(4px); }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(100svh, 980px);
  display: flex; align-items: center;
  padding: 8rem 0 7rem;
  background:
    radial-gradient(1200px 600px at 75% 30%, rgba(1, 33, 105, 0.85), transparent 70%),
    radial-gradient(800px 500px at 10% 90%, rgba(228, 0, 43, 0.12), transparent 70%),
    linear-gradient(180deg, #030716 0%, var(--space) 60%, #070f2b 100%);
  color: var(--on-dark);
}
.sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-glow {
  position: absolute; z-index: -1; left: 50%; bottom: 18%; width: 140%; height: 40%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(111, 143, 240, 0.28), transparent);
  filter: blur(20px); pointer-events: none;
}
.grid-floor {
  position: absolute; z-index: -1; left: -50%; right: -50%; bottom: -2%; height: 42%;
  background-image:
    linear-gradient(rgba(111, 143, 240, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 143, 240, 0.32) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(420px) rotateX(64deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  animation: floor 2.6s linear infinite;
}
@keyframes floor { to { background-position: 0 64px; } }

.hero-inner { position: relative; width: 100%; }
.pill {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.95rem 0.4rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--dark-border); background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 0.9rem; color: var(--on-dark);
}
.pulse-dot {
  position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none;
}
.pulse-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok);
  animation: ping 2s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(3.2); opacity: 0; } }

.hero-eyebrow { color: var(--on-dark-muted); font-size: 0.95rem; margin: 1.4rem 0 0.8rem; }
.caret {
  display: inline-block; width: 0.55em; height: 1.05em; margin-left: 0.25em; vertical-align: -0.15em;
  background: var(--warn); animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero h1 {
  font-size: clamp(2.6rem, 7.4vw, 6.2rem);
  line-height: 0.98; letter-spacing: -0.025em; margin-bottom: 1.6rem; max-width: 14ch;
  color: #fff;
}
.h1-main {
  display: block;
  background: linear-gradient(100deg, #ffffff 0%, #ffffff 40%, var(--ice) 60%, #ffffff 80%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.h1-sub {
  display: block; font-size: 0.5em; line-height: 1.2; margin-top: 0.5em; color: var(--on-dark-muted);
  letter-spacing: -0.01em; max-width: none;
}
.rotator { display: inline-block; position: relative; vertical-align: bottom; overflow: hidden; }
.rotator-word {
  display: inline-block;
  background: linear-gradient(90deg, #ff5470, #ff8a9b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: transform 0.45s var(--ease), opacity 0.45s;
}
.rotator-word.out { transform: translateY(-100%); opacity: 0; }
.rotator-word.pre { transform: translateY(100%); opacity: 0; transition: none; }

.hero .lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--on-dark-muted); max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.2rem; }

.motion-toggle {
  position: absolute; left: var(--gutter); bottom: 1.6rem; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.85rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--dark-border); background: rgba(5, 10, 26, 0.6); color: var(--on-dark-muted);
  font-family: var(--font-mono); font-size: 0.8rem;
}
.motion-toggle:hover { color: var(--on-dark); border-color: rgba(255, 255, 255, 0.4); }
.mt-icon { width: 10px; height: 10px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
html.motion-off .mt-icon {
  border: 0; width: 0; height: 0;
  border-left: 9px solid currentColor; border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent;
}

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  width: 26px; height: 42px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.4);
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: #fff; animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Marquee ---------- */
.marquee {
  position: relative; overflow: hidden; padding: 1.15rem 0;
  border-block: 1px solid var(--border); background: var(--bg-alt);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee ul { list-style: none; margin: 0; padding: 0; display: flex; }
.marquee li {
  display: flex; align-items: center; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--heading); padding: 0 1.4rem;
}
.marquee li::after {
  content: ""; width: 10px; height: 10px; margin-left: 2.8rem;
  background: var(--red);
  clip-path: polygon(50% 0, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0 50%, 39% 35%);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(4.5rem, 10vw, 8rem) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.label {
  display: inline-flex; align-items: center; gap: 0.7rem;
  color: var(--label); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 1.1rem;
}
.label::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.section-lead { color: var(--muted); font-size: 1.15rem; }

/* ---------- Cards with spotlight ---------- */
.card {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem); box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease), border-color 0.4s;
}
.card p { color: var(--muted); }
.spot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 0%), var(--glow), transparent 45%);
  opacity: 0; transition: opacity 0.4s;
}
.spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), var(--accent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.4s;
}
.spot:hover::before, .spot:hover::after { opacity: 1; }
.spot:hover { transform: translateY(-4px); }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.25rem; }
.card-software, .card-web { grid-column: span 3; }
.card-auto {
  grid-column: span 6;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 2rem; align-items: center;
}
.card-visual {
  margin: -0.5rem -0.5rem 1.4rem; border-radius: 14px; overflow: hidden;
  background:
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 24px 24px;
  background-color: var(--bg-alt);
  border: 1px solid var(--border);
}
.card-auto .card-visual { margin: 0; order: 2; }
.card-visual svg { width: 100%; height: auto; }
.tags { list-style: none; margin: 1.2rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  font-family: var(--font-mono); font-size: 0.8rem; padding: 0.3rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
}
.card-auto .text-link { display: inline-block; margin-top: 1.4rem; }

/* SVG visuals */
.viz { --stroke: var(--accent); }
.viz-grid path { stroke: var(--border); stroke-width: 1; }
.viz-bars rect {
  fill: var(--viz-fill); stroke: var(--stroke); stroke-width: 1.2;
  transform-box: fill-box; transform-origin: bottom;
  animation: bar 3.6s var(--ease) infinite; animation-delay: var(--d);
}
.viz-bars rect.hot { fill: rgba(228, 0, 43, 0.18); stroke: var(--red); }
@keyframes bar { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.72); } }
.viz-line {
  fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 3.6s var(--ease) infinite;
}
@keyframes draw { 0% { stroke-dashoffset: 1; } 45%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
.viz-dot { fill: var(--red); animation: dotpulse 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes dotpulse { 50% { transform: scale(1.5); opacity: 0.6; } }

.viz-frame { fill: var(--surface); stroke: var(--stroke); stroke-width: 1.5; }
.viz-frame.phone { fill: var(--bg-alt); }
.viz-frame-bar { stroke: var(--stroke); stroke-width: 1; opacity: 0.6; }
.viz-light { fill: var(--border); }
.viz-url { fill: var(--viz-fill); }
.viz-skel { fill: var(--viz-fill); animation: skel 2.4s ease-in-out infinite; }
.viz-skel.s1 { fill: var(--stroke); opacity: 0.55; }
.viz-skel.s3 { fill: var(--red); opacity: 0.8; animation: none; }
.viz-skel.s4 { animation-delay: 0.2s; }
.viz-skel.s5 { animation-delay: 0.4s; }
.viz-skel.s6 { animation-delay: 0.6s; }
@keyframes skel { 50% { opacity: 0.35; } }
.viz-phone { animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }

.viz-water { animation: level 6s ease-in-out infinite; }
@keyframes level { 0%, 100% { transform: translateY(20px); } 50% { transform: translateY(-14px); } }
.viz-wave { fill: var(--signal); opacity: 0.55; animation: wave 2.5s linear infinite; }
@keyframes wave { to { transform: translateX(-90px); } }
.viz-pipe { fill: none; stroke: var(--stroke); stroke-width: 3; stroke-dasharray: 6 6; animation: flow 1s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -12; } }
.viz-signal .arc { fill: none; stroke: var(--stroke); stroke-width: 2.5; stroke-linecap: round; animation: arc 2s ease-in-out infinite; }
.viz-signal .a2 { animation-delay: 0.25s; }
.viz-signal .a3 { animation-delay: 0.5s; }
@keyframes arc { 0%, 100% { opacity: 0.15; } 40% { opacity: 1; } }
.viz-notify { animation: pop 6s var(--ease) infinite; transform-box: fill-box; transform-origin: left center; }
.viz-notify rect:first-child { fill: var(--surface); stroke: var(--stroke); stroke-width: 1.5; }
.viz-notify .ok { fill: var(--ok); }
.viz-notify .txt { fill: var(--stroke); opacity: 0.8; }
.viz-notify .txt.dim { opacity: 0.35; }
@keyframes pop { 0%, 30% { transform: scale(0.6); opacity: 0; } 40%, 85% { transform: scale(1); opacity: 1; } 100% { opacity: 0; } }

/* ---------- Live dashboard (dark in both themes) ---------- */
.section-deep {
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(1, 33, 105, 0.9), transparent 70%),
    radial-gradient(700px 400px at 0% 100%, rgba(228, 0, 43, 0.10), transparent 70%),
    var(--space);
  color: var(--on-dark);
  --heading: #fff; --muted: var(--on-dark-muted); --label: var(--warn); --link: var(--ice);
}
.dash {
  position: relative; border-radius: 24px; padding: 1px;
  background: linear-gradient(140deg, rgba(169, 192, 255, 0.5), rgba(169, 192, 255, 0.06) 40%, rgba(228, 0, 43, 0.45));
  box-shadow: 0 40px 120px -40px rgba(111, 143, 240, 0.45);
}
.dash > * { position: relative; }
.dash-bar, .dash-grid { background: #070d22; }
.dash-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 1rem;
  padding: 0.9rem 1.2rem; border-radius: 23px 23px 0 0; border-bottom: 1px solid var(--dark-border);
  font-size: 0.85rem; color: var(--on-dark-muted);
}
.dash-dots { display: flex; gap: 6px; }
.dash-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.dash-dots i:first-child { background: var(--red); }
.dash-title { color: var(--on-dark); font-weight: 700; }
.badge {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0.15rem 0.5rem; border-radius: 6px; border: 1px solid rgba(255, 107, 125, 0.5); color: var(--warn);
}
.dash-status { display: inline-flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.dash-pause {
  background: transparent; color: var(--on-dark-muted); cursor: pointer;
  border: 1px solid var(--dark-border); border-radius: 8px; padding: 0.3rem 0.7rem; font-size: 0.8rem;
}
.dash-pause:hover { color: var(--on-dark); border-color: rgba(255, 255, 255, 0.4); }
.dash-grid {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 1px;
  border-radius: 0 0 23px 23px; overflow: hidden;
  background: var(--dark-border);
}
.panel { background: #070d22; padding: 1.4rem; min-width: 0; }
.panel-title {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 400; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--on-dark-muted); margin-bottom: 1.1rem;
}

.tanks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tank { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; text-align: center; }
.tank-body {
  position: relative; width: 100%; max-width: 76px; height: 150px; overflow: hidden;
  border: 1.5px solid rgba(169, 192, 255, 0.4); border-radius: 12px 12px 16px 16px;
  background: rgba(255, 255, 255, 0.03);
}
.tank-body::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(to top, transparent 0 29px, rgba(255, 255, 255, 0.08) 29px 30px);
}
.tank-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--lvl, 50%);
  background: linear-gradient(180deg, #8aa5ff, #3a5bd9);
  transition: height 0.9s var(--ease), background 0.6s;
}
.tank-fill::before {
  content: ""; position: absolute; left: -50%; top: -6px; width: 200%; height: 12px;
  background: radial-gradient(12px 6px at 12px 6px, #8aa5ff 98%, transparent) 0 0 / 24px 12px repeat-x;
  animation: wave-x 1.6s linear infinite;
}
.tank.low .tank-fill { background: linear-gradient(180deg, #ff7f8f, #c8102e); }
.tank.low .tank-fill::before { background-image: radial-gradient(12px 6px at 12px 6px, #ff7f8f 98%, transparent); }
@keyframes wave-x { to { transform: translateX(24px); } }
.tank-val { font-family: var(--font-display); font-size: 1.6rem; color: #fff; line-height: 1; }
.tank.low .tank-val { color: var(--warn); }
.tank-name { font-size: 0.82rem; color: var(--on-dark-muted); line-height: 1.3; }

.pump { display: grid; gap: 1.2rem; }
.switch {
  display: inline-flex; align-items: center; gap: 0.9rem; justify-self: start;
  background: transparent; border: 0; padding: 0.3rem; cursor: pointer; color: var(--on-dark);
  font: inherit; border-radius: 999px;
}
.switch-track {
  position: relative; width: 68px; height: 36px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.35);
  transition: background 0.35s, box-shadow 0.35s;
}
.switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.35s var(--ease);
}
.switch[aria-pressed="true"] .switch-track { background: var(--ok); box-shadow: 0 0 24px rgba(61, 220, 151, 0.55); }
.switch[aria-pressed="true"] .switch-thumb { transform: translateX(32px); }
.switch-label { font-family: var(--font-display); font-size: 1.25rem; }
.switch[aria-pressed="true"] #pump-state { color: var(--ok); }
.readouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin: 0; }
.readouts div { border: 1px solid var(--dark-border); border-radius: 12px; padding: 0.7rem 0.8rem; }
.readouts dt { font-size: 0.75rem; color: var(--on-dark-muted); }
.readouts dd { margin: 0.15rem 0 0; font-family: var(--font-display); font-weight: 700; color: #fff; }

.spark { width: 100%; height: 150px; overflow: visible; }
.spark-line { fill: none; stroke: var(--ice); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-threshold { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.spark-note { display: flex; align-items: center; gap: 0.5rem; margin: 0.6rem 0 0; font-size: 0.78rem; color: var(--on-dark-muted); }
.legend-line { width: 18px; border-top: 1px dashed var(--warn); }

.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.alert {
  display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.8rem; align-items: start;
  padding: 0.7rem 0.9rem; border-radius: 12px; font-size: 0.92rem; color: var(--on-dark);
  border: 1px solid var(--dark-border); background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--signal);
  animation: slide-in 0.5s var(--ease);
}
.alert.warn { border-left-color: var(--warn); background: rgba(228, 0, 43, 0.08); }
.alert.ok { border-left-color: var(--ok); }
.alert-time { font-size: 0.75rem; color: var(--on-dark-muted); padding-top: 0.15rem; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-8px); } }
.dash-caption { margin: 1.4rem auto 0; text-align: center; font-size: 0.95rem; color: var(--on-dark-muted); }

/* ---------- Who ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.big-card { padding: clamp(1.8rem, 4vw, 3rem); }
.big-card h3 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.big-card p { font-size: 1.1rem; }
.big-icon {
  display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 1.6rem;
  border-radius: 18px; color: var(--accent);
  background: var(--viz-fill); border: 1px solid var(--border);
}
.big-icon svg { width: 34px; height: 34px; }

/* ---------- Timeline ---------- */
.timeline-wrap { position: relative; }
.timeline-line {
  position: absolute; left: 0; right: 0; top: 26px; height: 2px; background: var(--border);
}
.timeline-line span {
  display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--accent));
  transform-origin: left; transform: scaleX(var(--tp, 0)); transition: transform 0.2s linear;
}
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; position: relative; }
.timeline li { position: relative; }
.node {
  display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 1.4rem;
  border-radius: 16px; font-weight: 700; color: var(--heading);
  background: var(--bg-alt); border: 1px solid var(--border);
  transition: background 0.5s, color 0.5s, box-shadow 0.5s, border-color 0.5s;
}
.timeline li.lit .node {
  background: var(--red); color: #fff; border-color: var(--red);
  box-shadow: 0 0 0 6px rgba(228, 0, 43, 0.15), 0 10px 30px -8px rgba(228, 0, 43, 0.7);
}
.timeline p { color: var(--muted); }

/* ---------- Contact (dark in both themes) ---------- */
.contact {
  position: relative; isolation: isolate; overflow: hidden; text-align: center;
  padding: clamp(5rem, 12vw, 9rem) 0;
  background: linear-gradient(180deg, var(--space) 0%, #0a1846 100%);
  color: var(--on-dark);
  --label: var(--warn);
}
.contact-glow {
  position: absolute; z-index: -1; left: 50%; top: 50%; width: 900px; height: 900px; max-width: 160vw;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, rgba(228, 0, 43, 0.35), rgba(111, 143, 240, 0.35), rgba(1, 33, 105, 0.2), rgba(228, 0, 43, 0.35));
  border-radius: 50%; filter: blur(90px); opacity: 0.7;
  animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact h2 { color: #fff; font-size: clamp(2.2rem, 5.6vw, 4.4rem); max-width: 18ch; }
.contact p { color: var(--on-dark-muted); font-size: 1.2rem; }
.contact-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem;
  margin-top: 1.6rem; padding: 1.1rem 1.4rem; border-radius: 22px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.contact-email {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 4.4vw, 2.2rem);
  color: #fff; text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size 0.4s var(--ease);
}
.contact-email:hover { background-size: 100% 2px; }
.copy-status { min-width: 4ch; color: var(--ok); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer { background: #030716; color: var(--on-dark-muted); padding: 2.2rem 0; border-top: 1px solid var(--dark-border); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.footer-inner p { margin: 0; font-size: 0.95rem; }
.site-footer .text-link { color: var(--ice); }

/* ---------- Reveal on scroll ---------- */
html.js:not(.motion-off) [data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--rd, 0s);
}
html.js:not(.motion-off) [data-reveal].in { opacity: 1; transform: none; }
html.js:not(.motion-off) .card[data-reveal].in { transition: opacity 0.9s var(--ease), transform 0.4s var(--ease), border-color 0.4s; }

/* ---------- Motion off ---------- */
html.motion-off *, html.motion-off *::before, html.motion-off *::after {
  animation-play-state: paused !important;
}
html.motion-off .viz-line { stroke-dashoffset: 0; animation: none; }
html.motion-off .viz-notify { animation: none; }
html.motion-off .spot:hover { transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .card-auto { grid-template-columns: 1fr; }
  .card-auto .card-visual { order: 0; }
  .dash-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr 1fr; row-gap: 2.5rem; }
  .timeline-line { display: none; }
}
@media (max-width: 760px) {
  .nav-link { display: none; }
  .brand img { width: 140px; }
  .card-software, .card-web { grid-column: span 6; }
  .split { grid-template-columns: 1fr; }
  .hero { padding-top: 7rem; padding-bottom: 6rem; }
  .scroll-cue { display: none; }
  .readouts { grid-template-columns: 1fr 1fr; }
  .dash-status { margin-left: 0; }
}
@media (max-width: 520px) {
  .timeline { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .readouts { grid-template-columns: 1fr; }
}
