:root {
  --bg: #05070b;
  --panel: #090d13;
  --panel-2: #0d121a;
  --line: rgba(255,255,255,0.1);
  --line-2: rgba(0, 168, 255, 0.25);
  --text: #f4f7fb;
  --muted: #b9c2cf;
  --blue: #00a8ff;
  --blue-deep: #058eff;
  --blue-soft: #62d3ff;
  --silver: #d9dee7;
  --shadow: 0 24px 60px rgba(0,0,0,0.42);
  --container: 1320px;
  --radius: 20px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tech-font: "Arial Black", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 10%, rgba(0, 168, 255, 0.10), transparent 34%),
    radial-gradient(circle at 15% 26%, rgba(255,255,255,0.035), transparent 28%),
    radial-gradient(circle at 85% 76%, rgba(0, 168, 255, 0.055), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    linear-gradient(rgba(255,255,255,0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.024) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 18%, black 0%, transparent 72%);
  opacity: 0.26;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent 34%, rgba(0,0,0,0.24));
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0; line-height: 1.65; color: var(--muted); }
h1, h2, h3 { margin: 0; text-transform: uppercase; letter-spacing: 0.02em; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  background: #fff;
  color: #000;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  transform: translateY(-150%);
  z-index: 100;
  font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

.container { width: min(calc(100% - 32px), var(--container)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 7, 11, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-row {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-width: 220px;
}
.brand img { height: 58px; width: auto; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.site-nav a {
  color: #f3f6fa;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.6rem 0.8rem;
  transition: color 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.site-nav a:hover { color: var(--blue-soft); }
.cta-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid rgba(0,168,255,0.85);
  border-radius: 10px;
  padding: 0.82rem 1rem !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 0 18px rgba(0,168,255,0.12);
}
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 0.4rem;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  margin: 5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hero { padding: 0 0 24px; }
.hero-frame {
  display: grid;
  grid-template-columns: minmax(130px, 280px) minmax(0, 1fr) minmax(130px, 280px);
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.trace-panel {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  border-left: 1px solid rgba(255,255,255,0.04);
  border-right: 1px solid rgba(255,255,255,0.04);
  background:
    radial-gradient(circle at center, rgba(0,168,255,0.13), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.012), rgba(255,255,255,0));
}
.trace-panel[data-game-trigger] { cursor: default; }
.trace-panel::before,
.trace-panel::after,
.contact-bg::before,
.contact-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: repeat;
}
.trace-panel::before,
.contact-bg::before {
  background-image: url('../assets/trace-diagonal-a.svg');
  background-size: 280px 680px;
  opacity: 0.74;
}
.trace-panel::after,
.contact-bg::after {
  background-image: url('../assets/trace-diagonal-b.svg');
  background-size: 260px 680px;
  opacity: 0.31;
}
.trace-left { box-shadow: inset -18px 0 38px rgba(0,168,255,0.09); }
.trace-right { box-shadow: inset 18px 0 38px rgba(0,168,255,0.09); }

.hero-core {
  min-height: 720px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 78px 24px 72px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255,255,255,0.04), transparent 25%),
    radial-gradient(circle at 50% 48%, rgba(0,168,255,0.06), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
}
.hero-brand-wrap { width: min(100%, 900px); }
.hero-house {
  width: min(100%, 520px);
  margin-inline: auto;
  margin-bottom: -4px;
  filter: drop-shadow(0 0 22px rgba(0,168,255,0.18));
}
.hero-title {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.03em;
  font-family: var(--tech-font);
  font-size: clamp(3.1rem, 10vw, 6.9rem);
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: -0.055em;
}
.hero-title span:first-child { color: #f7fbff; }
.hero-title span:last-child { color: var(--blue); }
.hero-slogan {
  margin-top: 10px;
  color: var(--silver);
  font-size: clamp(1rem, 1.6vw, 1.45rem);
  letter-spacing: 0.03em;
}
.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 22px auto 28px;
}
.hero-divider::before,
.hero-divider::after {
  content: "";
  width: min(36vw, 255px);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
}
.hero-divider span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 16px rgba(0,168,255,0.82);
  margin: 0 10px;
}
.hero-headline {
  font-size: clamp(1.45rem, 3vw, 3rem);
  font-weight: 800;
  line-height: 1.16;
  max-width: 860px;
  color: #f5f8fc;
  text-transform: uppercase;
}
.hero-copy {
  margin-top: 18px;
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  max-width: 820px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}
.button-primary,
.button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.button-primary {
  background: linear-gradient(180deg, var(--blue-soft), var(--blue-deep));
  color: #00111b;
  box-shadow: 0 0 22px rgba(0,168,255,0.24);
}
.button-ghost {
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  background: rgba(255,255,255,0.02);
}
.button-primary:hover,
.button-ghost:hover { transform: translateY(-1px); }

.section-panel {
  margin-top: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.024), rgba(255,255,255,0.01));
  box-shadow: var(--shadow);
}
.section-label {
  text-align: center;
  color: var(--blue);
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  padding: 16px 18px 6px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.service-card {
  padding: 30px 22px 28px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s ease, transform 0.2s ease;
}
.service-card:hover {
  background: rgba(0,168,255,0.035);
  transform: translateY(-2px);
}
.service-card:last-child { border-right: 0; }
.service-icon {
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.service-icon img { filter: drop-shadow(0 0 12px rgba(0,168,255,0.20)); }
.service-card h3 {
  font-size: 1.03rem;
  margin-bottom: 12px;
}
.service-card p { max-width: 22ch; margin-inline: auto; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 16px 14px 14px;
}
.project-card {
  display: grid;
  grid-template-columns: 146px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.024), rgba(255,255,255,0.014));
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,168,255,0.38);
  box-shadow: 0 12px 24px rgba(0,0,0,0.25);
}
.project-thumb {
  width: 146px;
  height: 146px;
  object-fit: cover;
  border-radius: 10px;
  background: #0b0f15;
}
.project-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.project-body h3 {
  font-size: 1.38rem;
  line-height: 1.1;
}
.project-body a {
  color: var(--blue);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.about { padding: 28px 0 14px; }
.about-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 26px;
  align-items: start;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(0,168,255,0.055), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.024), rgba(255,255,255,0.012));
  padding: 28px;
}
.mini-label {
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  font-size: 0.95rem;
  font-weight: 800;
}
.about-panel h2 {
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.1;
  margin-bottom: 16px;
}
.about-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.about-points li {
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
}
.about-points li::before {
  content: "•";
  color: var(--blue);
  margin-right: 10px;
}

.contact-strip {
  position: relative;
  display: grid;
  grid-template-columns: 78px 1.25fr 1fr 0.9fr 1fr 0.75fr 1.1fr 78px;
  align-items: stretch;
  margin-top: 14px;
  margin-bottom: 26px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0.01));
  box-shadow: var(--shadow);
}
.contact-bg {
  position: relative;
  min-height: 152px;
  background: radial-gradient(circle at center, rgba(0,168,255,0.14), transparent 52%);
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px;
  border-left: 1px solid rgba(255,255,255,0.08);
}
a.contact-card:hover { background: rgba(0,168,255,0.035); color: var(--blue-soft); }
.contact-card span,
.contact-card strong { color: var(--text); }
.qr-card strong,
.slogan-card strong { letter-spacing: 0.04em; }
.qr-card p { margin-top: 6px; }
.slogan-card {
  gap: 10px;
  justify-content: center;
}
.slogan-card strong {
  font-size: 1.35rem;
  line-height: 1.05;
}
.slogan-card strong span { color: var(--blue); }

.site-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 18px 0 28px;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.94rem;
}
.footer-row p { max-width: 60ch; }

.not-found-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.not-found-wrap {
  width: min(100% - 32px, 700px);
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  background: rgba(255,255,255,0.02);
  padding: 36px 24px;
}
.not-found-wrap img { margin: 0 auto 24px; }
.not-found-wrap h1 { font-size: clamp(2.4rem, 7vw, 4.8rem); margin-bottom: 10px; }

.trace-orb {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--size, 7px);
  height: var(--size, 7px);
  margin-left: calc(var(--size, 7px) * -0.5);
  margin-top: calc(var(--size, 7px) * -0.5);
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #dff8ff 20%, #80dcff 48%, rgba(0,168,255,0.28) 75%, rgba(0,168,255,0) 100%);
  box-shadow:
    0 0 7px rgba(220, 248, 255, 0.65),
    0 0 15px rgba(98, 211, 255, 0.45),
    0 0 26px rgba(0, 168, 255, 0.22);
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}
.trace-orb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--size, 7px) * 3.8);
  height: calc(var(--size, 7px) * 0.85);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(98,211,255,0), rgba(98,211,255,0.22), rgba(98,211,255,0));
  transform: translate(-92%, -50%) rotate(var(--angle, 0deg));
  filter: blur(3px);
  opacity: 0.55;
}
.trace-orb.pulse {
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #f3fdff 18%, #8fe6ff 42%, rgba(0,168,255,0.35) 78%, rgba(0,168,255,0) 100%);
  box-shadow:
    0 0 11px rgba(255,255,255,0.75),
    0 0 24px rgba(98, 211, 255, 0.62),
    0 0 42px rgba(0, 168, 255, 0.35);
}

.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(5px);
}
.game-overlay.open { display: flex; }
.game-window {
  width: min(100%, 440px);
  border: 1px solid rgba(0,168,255,0.52);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0,168,255,0.16), transparent 40%),
    rgba(5, 8, 13, 0.96);
  box-shadow: 0 24px 80px rgba(0,0,0,0.55), 0 0 36px rgba(0,168,255,0.14);
  overflow: hidden;
}
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: var(--silver);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 800;
}
.game-topbar button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}
.game-canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #02050a;
  image-rendering: pixelated;
}
.game-help {
  padding: 10px 14px 14px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (max-width: 1160px) {
  .hero-frame { grid-template-columns: 180px minmax(0, 1fr) 180px; }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .service-card:nth-child(3n) { border-right: 0; }
  .service-card:nth-child(n + 4) { border-top: 1px solid rgba(255,255,255,0.08); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-strip { grid-template-columns: 52px 1.35fr 1fr 0.9fr 1fr 0.75fr 1.15fr 52px; }
  .slogan-card strong { font-size: 1.12rem; }
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    right: 16px;
    top: calc(100% + 8px);
    width: min(320px, calc(100vw - 32px));
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    background: rgba(5,8,13,0.98);
    overflow: hidden;
    box-shadow: 0 24px 40px rgba(0,0,0,0.35);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.95rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .site-nav a:last-child { border-bottom: 0; }
  .brand img { height: 50px; }

  .hero-frame { grid-template-columns: 1fr; }
  .trace-panel {
    min-height: 154px;
    border-left: 0;
    border-right: 0;
  }
  .hero-core { min-height: auto; padding: 52px 20px; }
  .hero-house { width: min(100%, 400px); }

  .services-grid { grid-template-columns: 1fr 1fr; }
  .service-card { border-right: 1px solid rgba(255,255,255,0.08); }
  .service-card:nth-child(2n) { border-right: 0; }
  .service-card:nth-child(n + 3) { border-top: 1px solid rgba(255,255,255,0.08); }

  .projects-grid { grid-template-columns: 1fr; }
  .about-panel { grid-template-columns: 1fr; }

  .contact-strip { grid-template-columns: 1fr; }
  .contact-bg { min-height: 84px; }
  .contact-card {
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
}

@media (max-width: 620px) {
  .header-row { min-height: 70px; }
  .brand { min-width: 0; }
  .brand img { height: 42px; max-width: 210px; object-fit: contain; object-position: left center; }
  .hero-title { font-size: clamp(2.35rem, 14vw, 3.4rem); }
  .hero-house { width: min(100%, 320px); }
  .hero-actions { flex-direction: column; width: 100%; }
  .button-primary, .button-ghost { width: 100%; }
  .services-grid { grid-template-columns: 1fr; }
  .service-card,
  .service-card:nth-child(2n),
  .service-card:nth-child(3n) { border-right: 0; }
  .service-card + .service-card { border-top: 1px solid rgba(255,255,255,0.08); }
  .project-card { grid-template-columns: 1fr; }
  .project-thumb { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  .footer-row { flex-direction: column; }
}

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