:root {
  --bg: #08090d;
  --bg-soft: #0d1017;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.105);
  --text: #f5f2ea;
  --muted: #a7a9b3;
  --line: rgba(255, 255, 255, 0.13);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --game: #ff8a22;
  --cyber: #2de2d6;
  --marketing: #ff4f7b;
  --web: #a6ff45;
  --accent: var(--game);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(8, 9, 13, 0.45), #08090d 28rem),
    radial-gradient(circle at 22% 18%, rgba(45, 226, 214, 0.12), transparent 22rem),
    radial-gradient(circle at 78% 8%, rgba(255, 138, 34, 0.16), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

body[data-page="cyber"] {
  --accent: var(--cyber);
}

body[data-page="marketing"] {
  --accent: var(--marketing);
}

body[data-page="web"] {
  --accent: var(--web);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-shell {
  position: relative;
  overflow: hidden;
}

.site-nav {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  border-bottom: 1px solid transparent;
  transition: background 220ms ease, border-color 220ms ease, backdrop-filter 220ms ease;
}

.site-nav.is-scrolled {
  background: rgba(8, 9, 13, 0.78);
  border-color: var(--line);
  backdrop-filter: blur(18px);
}

.nav-inner {
  width: min(1180px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.065);
  color: var(--accent);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.05);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a,
.mobile-menu {
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 10px 13px;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.nav-links a:hover,
.nav-links a.is-active,
.mobile-menu:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.065);
}

.mobile-menu {
  display: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
}

.hero {
  position: relative;
  min-height: 92vh;
  padding: 140px 0 88px;
  overflow: hidden;
  isolation: isolate;
}

.hero-video,
.hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -4;
}

.hero-fallback {
  background: url("../images/bgphotoglitch.gif") center/cover no-repeat;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 9, 13, 0.96) 0%, rgba(8, 9, 13, 0.76) 48%, rgba(8, 9, 13, 0.52) 100%),
    linear-gradient(180deg, rgba(8, 9, 13, 0.22) 0%, #08090d 100%);
  z-index: -3;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 86%);
  z-index: -2;
}

.hero-inner,
.section-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.72fr);
  align-items: center;
  gap: 56px;
}

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(3.8rem, 10vw, 9.4rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 690px;
  margin: 28px 0 0;
  color: #d7d7df;
  font-size: clamp(1.05rem, 2vw, 1.34rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button.primary {
  background: var(--accent);
  border-color: transparent;
  color: #08090d;
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.32);
}

.hero-card {
  border: 1px solid var(--line);
  background: rgba(8, 9, 13, 0.56);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 22px;
}

.signal-map {
  display: grid;
  gap: 12px;
}

.signal-item {
  position: relative;
  padding: 18px;
  min-height: 104px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.088), rgba(255, 255, 255, 0.025));
  overflow: hidden;
}

.signal-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--signal);
}

.signal-item strong {
  display: block;
  margin-bottom: 7px;
  font-size: 1.05rem;
}

.signal-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.section {
  padding: 96px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section.alt {
  background: rgba(255, 255, 255, 0.025);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(280px, 0.6fr);
  gap: 44px;
  align-items: end;
  margin-bottom: 42px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.branch-tile {
  min-height: 284px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    var(--bg-soft);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 180ms ease, background 180ms ease;
}

.branch-tile:last-child {
  border-right: 0;
}

.branch-tile:hover {
  transform: translateY(-6px);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--branch) 18%, transparent), rgba(255, 255, 255, 0.035)),
    var(--bg-soft);
}

.branch-tile h3 {
  margin: 0 0 12px;
  font-size: 1.45rem;
  line-height: 1.05;
}

.branch-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.branch-line {
  width: 100%;
  height: 2px;
  margin-bottom: 20px;
  background: var(--branch);
}

.branch-link {
  margin-top: 28px;
  color: var(--branch);
  font-weight: 800;
}

.project-stack {
  display: grid;
  gap: 22px;
}

.project-card {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) auto;
  gap: 26px;
  align-items: center;
  min-height: 220px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  padding: 18px;
  overflow: hidden;
}

.project-media {
  height: 184px;
  border: 1px solid var(--line);
  background: #111;
  overflow: hidden;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
}

.project-card:hover .project-media img {
  transform: scale(1.045);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.project-card h3 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  line-height: 1.02;
}

.project-card p {
  max-width: 720px;
  margin: 0;
  color: #c4c6cf;
}

.project-link {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 1.55rem;
  transition: background 180ms ease, color 180ms ease;
}

.project-link:hover {
  background: var(--accent);
  color: #08090d;
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.compact-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 24px;
}

.compact-card h3 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.compact-card p {
  margin: 0;
  color: var(--muted);
}

.footer {
  padding: 64px 0;
  border-top: 1px solid var(--line);
  background: #050609;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
}

.footer h2 {
  max-width: 780px;
  margin: 0 0 18px;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.98;
}

.footer p {
  margin: 0;
  color: var(--muted);
}

.contact-list {
  display: grid;
  gap: 10px;
  justify-items: end;
  color: var(--text);
  font-weight: 800;
}

.reveal {
  opacity: 1;
  transform: none;
}

.js-reveal .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero-layout,
  .section-heading,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .branch-grid,
  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .project-link {
    grid-column: 2;
    justify-self: start;
  }

  .contact-list {
    justify-items: start;
  }
}

@media (max-width: 760px) {
  .nav-inner {
    height: 64px;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    right: 16px;
    left: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line);
    background: rgba(8, 9, 13, 0.96);
  }

  .site-nav.is-open .nav-links {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding: 110px 0 62px;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 11vw, 4.8rem);
    line-height: 0.94;
    overflow-wrap: anywhere;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .hero-card {
    padding: 14px;
  }

  .branch-grid,
  .compact-grid,
  .project-card {
    grid-template-columns: 1fr;
  }

  .branch-tile {
    min-height: 210px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .branch-tile:last-child {
    border-bottom: 0;
  }

  .project-media {
    height: 220px;
  }

  .project-link {
    grid-column: auto;
  }
}

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