/* ==========================================================================
   Base: design tokens, reset, and hand-written component classes
   (ported 1:1 from the original app/globals.css)
   ========================================================================== */

/* Self-hosted font (no Google Fonts CDN request from the visitor's browser -
   avoids transmitting the visitor's IP to Google; see LG München ruling). */
@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-variable-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: #07131b;
  --surface: #0b1d28;
  --surface-strong: #102936;
  --brand: #133e57;
  --brand-light: #1d5b79;
  --accent: #65b9e6;
  --accent-soft: #b9ddf3;
  --foreground: #f4f8fa;
  --muted: #a9bac4;
  --line: rgba(180, 218, 231, 0.16);
  --danger: #ff9b9b;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(19, 62, 87, 0.58), transparent 30rem),
    radial-gradient(circle at 92% 22%, rgba(32, 122, 127, 0.18), transparent 28rem),
    var(--background);
  color: var(--foreground);
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
svg { display: block; }

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }

::selection { background: var(--accent); color: #071a24; }

.container-shell { width: min(100% - 2rem, 76rem); margin-inline: auto; }
.section-pad { padding-block: clamp(4.5rem, 8vw, 8rem); }
.display-font { font-family: "Montserrat", "Segoe UI", Arial, sans-serif; }

.grid-bg {
  background-image:
    linear-gradient(rgba(128, 190, 208, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 190, 208, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 90%);
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.glass-card {
  background: linear-gradient(145deg, rgba(16, 41, 54, 0.85), rgba(7, 19, 27, 0.9));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 22px 70px rgba(0,0,0,.16);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--accent-soft);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 1.6rem; height: 1px; background: var(--accent); }

.text-balance { text-wrap: balance; }

.focus-ring:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed; top: .75rem; left: .75rem; z-index: 100;
  transform: translateY(-180%); background: var(--accent); color: #071a24;
  padding: .7rem 1rem; border-radius: .5rem; font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

details summary::-webkit-details-marker { display: none; }

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-light), var(--accent), var(--accent-soft));
  box-shadow: 0 0 16px rgba(101, 185, 230, .55);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.pointer-glow {
  position: fixed;
  z-index: 80;
  top: 0;
  left: 0;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(101, 185, 230, .105), rgba(101, 185, 230, .025) 40%, transparent 70%);
  mix-blend-mode: screen;
  transition: width .25s ease, height .25s ease, opacity .25s ease;
  will-change: transform;
}

.pointer-glow[data-active="true"] { opacity: 1; }
body:has(a:hover, button:hover, summary:hover) .pointer-glow {
  width: 23rem;
  height: 23rem;
  opacity: .82;
}

.effects-ready main > .scroll-reveal {
  opacity: 0;
  transform: translateY(3rem);
  transition: opacity .85s cubic-bezier(.22, 1, .36, 1), transform .85s cubic-bezier(.22, 1, .36, 1);
}

.effects-ready main > .scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tilt-surface {
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transform-style: preserve-3d;
  transition: transform .18s ease-out, border-color .3s ease;
  will-change: transform;
}

.tech-map::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 3%;
  pointer-events: none;
  border-radius: 1.75rem .45rem 1.75rem .45rem;
  opacity: 0;
  background: radial-gradient(circle at var(--light-x, 50%) var(--light-y, 50%), rgba(101, 185, 230, .17), transparent 32%);
  transition: opacity .3s ease;
}
.tech-map:hover::before { opacity: 1; }
.tech-map:hover .tilt-surface { border-color: rgba(101, 185, 230, .48); }

.map-line {
  stroke: rgba(101, 185, 230, .34);
  stroke-width: 1;
  stroke-dasharray: 7 8;
  vector-effect: non-scaling-stroke;
  animation: data-flow 11s linear infinite;
}
.map-line-2 { animation-duration: 14s; animation-direction: reverse; }
.map-line-3 { opacity: .45; animation-duration: 18s; }

.map-node {
  display: flex;
  min-width: 7.75rem;
  align-items: center;
  gap: .65rem;
  border: 1px solid var(--line);
  background: rgba(9, 27, 37, .94);
  padding: .55rem;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .2);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), border-color .3s ease, background .3s ease;
}
.map-node:hover {
  z-index: 30;
  transform: translateY(-4px);
  border-color: rgba(101, 185, 230, .45);
  background: rgba(14, 45, 60, .97);
}

.status-pulse { animation: status-pulse 2s ease-in-out infinite; }
.scan-line { animation: scan-line 3.8s ease-in-out infinite alternate; }

@keyframes data-flow {
  to { stroke-dashoffset: -150; }
}
@keyframes status-pulse {
  50% { opacity: .3; box-shadow: 0 0 0 5px rgba(101, 185, 230, .08); }
}
@keyframes scan-line {
  from { transform: translateX(-100%); }
  to { transform: translateX(200%); }
}

@media (hover: hover) and (pointer: fine) {
  .glass-card {
    transition: transform .35s cubic-bezier(.22, 1, .36, 1), border-color .35s ease, box-shadow .35s ease;
  }
  .glass-card:hover {
    border-color: rgba(101, 185, 230, .32);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 25px 75px rgba(0,0,0,.24), 0 0 0 1px rgba(101,185,230,.04);
  }
  a:hover svg { transition: transform .25s ease; }
  a:hover > svg:last-child { transform: translate(2px, -2px); }
}

@media (hover: none), (pointer: coarse) {
  .pointer-glow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
  .pointer-glow, .scroll-progress { display: none; }
  .effects-ready main > .scroll-reveal { opacity: 1; transform: none; }
}
