:root {
  --color-bg-dark: #070707;
  --color-bg-panel: #f2eee7;
  --color-bg-card: #101010;
  --color-text-main: #ffffff;
  --color-text-dark: #121212;
  --color-text-muted: #b8b8b8;
  --color-text-muted-dark: #555555;
  --color-accent: #ff4f4f;
  --color-accent-dark: #c92e2e;
  --color-border-light: rgba(255, 79, 79, 0.35);
  --color-border-dark: rgba(255, 255, 255, 0.12);
  --color-blue: #3d81ff;
  --color-green: #46d06e;
  --color-gold: #f2bf4d;
  --container: 1180px;
  --header-height: 80px;
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--color-text-main);
  background:
    radial-gradient(circle at top, rgba(255, 79, 79, 0.08), transparent 20%),
    var(--color-bg-dark);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

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

button {
  font: inherit;
}

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

section {
  position: relative;
  padding: 112px 24px;
}

.container {
  width: min(100%, var(--container));
  margin: 0 auto;
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 95%);
}

.tech-bg {
  background:
    radial-gradient(circle at 80% 15%, rgba(255, 79, 79, 0.13), transparent 24%),
    radial-gradient(circle at 10% 90%, rgba(255, 79, 79, 0.12), transparent 20%),
    linear-gradient(180deg, #080808, #111111 55%, #090909);
}

.section-label {
  margin: 0 0 18px;
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1,
h2,
h3,
.logo,
.button,
.product-logo {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0.01em;
  line-height: 0.95;
}

h1 {
  font-size: clamp(3.8rem, 9vw, 7rem);
  max-width: 7ch;
}

h1 span,
h1 em {
  display: block;
  color: var(--color-accent);
  font-style: normal;
}

h1 em {
  color: #ff6157;
}

h2 {
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  color: var(--color-text-dark);
}

.tech-bg h2,
.hero-section h2,
.contact-section h2 {
  color: var(--color-text-main);
}

p {
  margin: 0;
  line-height: 1.75;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  backdrop-filter: blur(16px);
  background: rgba(6, 6, 6, 0.85);
  border-bottom: 1px solid var(--color-border-dark);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 100%;
}

.logo {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 900;
  line-height: 0.82;
}

.logo-boxi {
  font-size: 2.2rem;
  letter-spacing: 0.04em;
}

.logo-boxi::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 6px;
  background: linear-gradient(180deg, #ff7d6d, #e22929);
  clip-path: polygon(0 0, 100% 0, 62% 100%, 0 100%);
}

.logo-interactive {
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  color: rgba(255, 255, 255, 0.72);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav a {
  position: relative;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 28px;
  border: 1px solid transparent;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--color-text-main);
  background: linear-gradient(180deg, #ff625f, #d73737);
  box-shadow: 0 12px 30px rgba(255, 79, 79, 0.28);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

.button-primary:hover {
  box-shadow: 0 18px 40px rgba(255, 79, 79, 0.35);
}

.button-secondary {
  border-color: var(--color-border-light);
  color: var(--color-text-main);
  background: rgba(255, 255, 255, 0.04);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 52px;
  height: 52px;
  border: 1px solid var(--color-border-dark);
  background: transparent;
  color: var(--color-text-main);
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  margin: 0 auto;
  background: currentColor;
  transition: transform 220ms ease, opacity 220ms ease;
}

.menu-open .menu-toggle span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.menu-open .menu-toggle span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.hero-section {
  padding-top: 72px;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
}

.hero-grid-lines,
.hero-grid-lines::before,
.hero-grid-lines::after {
  position: absolute;
  inset: 0;
}

.hero-grid-lines::before,
.hero-grid-lines::after {
  content: "";
  pointer-events: none;
}

.hero-grid-lines::before {
  border: 1px solid rgba(255, 79, 79, 0.18);
  clip-path: polygon(0 4%, 4% 0, 96% 0, 100% 4%, 100% 96%, 96% 100%, 4% 100%, 0 96%);
  inset: 24px;
}

.hero-grid-lines::after {
  background:
    linear-gradient(90deg, transparent 10%, rgba(255, 79, 79, 0.1) 50%, transparent 90%),
    linear-gradient(transparent 10%, rgba(255, 79, 79, 0.08) 50%, transparent 90%);
  opacity: 0.5;
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 48px;
  align-items: center;
}

.hero-copy {
  max-width: 580px;
}

.hero-text {
  max-width: 560px;
  margin-top: 26px;
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

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

.hero-frame {
  position: relative;
  min-height: 640px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 79, 79, 0.22);
  background:
    radial-gradient(circle at top, rgba(62, 135, 255, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  box-shadow: var(--shadow-soft);
}

.angular-panel {
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
}

.energy-ring {
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  animation: pulse 7s ease-in-out infinite;
}

.ring-one {
  top: 8%;
  left: 10%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(55, 149, 255, 0.35), transparent 70%);
}

.ring-two {
  right: 6%;
  bottom: 10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 79, 79, 0.28), transparent 72%);
  animation-delay: -2s;
}

.character-stage {
  position: relative;
  height: 100%;
}

.character-card {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    rgba(12, 12, 12, 0.72);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.character-card::before {
  content: "";
  position: absolute;
  inset: auto -10% -35% auto;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 68%);
}

.character-card h2 {
  margin-top: 10px;
  font-size: clamp(2.2rem, 4vw, 4rem);
}

.character-card p {
  margin-top: 10px;
  max-width: 22ch;
  color: rgba(255, 255, 255, 0.78);
}

.character-tag {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.character-goblin {
  top: 11%;
  left: 4%;
  width: 42%;
  min-height: 250px;
  padding: 30px 24px;
  border-color: rgba(93, 179, 255, 0.35);
  transform: translate3d(0, 0, 0);
  animation: float 7.5s ease-in-out infinite;
}

.character-goblin h2 {
  color: #8fd0ff;
}

.character-samurai {
  right: 5%;
  top: 16%;
  width: 52%;
  min-height: 420px;
  padding: 34px 28px;
  border-color: rgba(255, 79, 79, 0.35);
  animation: float 9s ease-in-out infinite;
}

.character-samurai h2 {
  color: #fff2d6;
}

.character-vampire {
  left: 16%;
  bottom: 7%;
  width: 34%;
  min-height: 220px;
  padding: 24px 22px;
  border-color: rgba(217, 126, 255, 0.28);
  animation: float 8.2s ease-in-out infinite;
  animation-delay: -1.4s;
}

.character-vampire h2 {
  color: #ffb7ea;
}

.section-heading {
  max-width: 720px;
  text-align: center;
  margin: 0 auto 54px;
}

.services-section,
.about-section {
  color: var(--color-text-dark);
  background:
    radial-gradient(circle at top left, rgba(255, 79, 79, 0.09), transparent 22%),
    linear-gradient(180deg, #f5f0e8, #f0ebe2);
}

.services-grid,
.portfolio-grid,
.about-points {
  display: grid;
  gap: 24px;
}

.services-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.service-card,
.about-card {
  position: relative;
  padding: 30px 24px;
  border: 1px solid rgba(255, 79, 79, 0.15);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 30px rgba(24, 18, 10, 0.06);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.service-card::after,
.about-card::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 79, 79, 0.55), transparent);
}

.service-card h3,
.about-card h3 {
  margin: 18px 0 12px;
  font-size: 2rem;
  line-height: 0.95;
}

.service-card p,
.about-card p,
.about-copy p {
  color: var(--color-text-muted-dark);
}

.icon-badge {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  background: #111;
  clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%);
}

.icon-badge svg {
  width: 36px;
  height: 36px;
  fill: var(--color-accent);
}

.portfolio-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  min-height: 410px;
  padding: 34px 28px 30px;
  border: 1px solid var(--color-border-dark);
  color: var(--color-text-main);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)),
    rgba(8, 8, 8, 0.85);
  box-shadow: var(--shadow-soft);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 40%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.06), transparent 55%);
}

.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-8px);
  box-shadow: 0 24px 60px rgba(255, 79, 79, 0.18);
}

.product-blue {
  border-color: rgba(61, 129, 255, 0.44);
}

.product-green {
  border-color: rgba(70, 208, 110, 0.44);
}

.product-gold {
  border-color: rgba(242, 191, 77, 0.44);
}

.product-logo {
  position: relative;
  z-index: 1;
  font-size: clamp(3rem, 5vw, 4.4rem);
  line-height: 0.88;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}

.product-logo-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 210px;
  padding: 10px 0 2px;
}

.product-logo-image img {
  width: min(100%, 250px);
  max-height: 240px;
  object-fit: contain;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.28));
  transform: translateZ(0);
}

.product-blue .product-logo {
  color: #88b6ff;
}

.product-green .product-logo {
  color: #7ef0a0;
}

.product-gold .product-logo {
  color: #ffd26e;
}

.product-logo span {
  display: block;
}

.product-card p,
.product-cta {
  position: relative;
  z-index: 1;
}

.product-card p {
  max-width: 22ch;
  color: rgba(255, 255, 255, 0.78);
}

.product-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 170px;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid rgba(255, 79, 79, 0.38);
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 220ms ease, border-color 220ms ease;
}

.product-card:hover .product-cta,
.product-card:focus-visible .product-cta {
  background: rgba(255, 79, 79, 0.18);
  border-color: rgba(255, 79, 79, 0.8);
}

.about-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
  align-items: start;
}

.about-copy {
  max-width: 500px;
}

.about-copy p {
  margin-top: 24px;
  font-size: 1.05rem;
}

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

.contact-section {
  padding-top: 72px;
}

.contact-panel {
  padding: 72px 32px;
  text-align: center;
  border: 1px solid rgba(255, 79, 79, 0.22);
  background:
    radial-gradient(circle at top, rgba(255, 79, 79, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-soft);
}

.contact-panel p:not(.section-label) {
  max-width: 700px;
  margin: 24px auto 0;
  color: var(--color-text-muted);
}

.contact-panel .button {
  margin-top: 34px;
}

.site-footer {
  padding: 28px 24px 44px;
  background: #060606;
  border-top: 1px solid var(--color-border-dark);
}

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.footer-logo .logo-boxi {
  font-size: 1.8rem;
}

.site-footer p {
  color: rgba(255, 255, 255, 0.66);
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 12px;
}

.footer-links a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  font-weight: 700;
  text-transform: uppercase;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease;
}

.footer-links a:hover {
  transform: translateY(-2px);
  color: var(--color-accent);
  border-color: rgba(255, 79, 79, 0.6);
}

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 700ms ease,
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

.button:focus-visible,
.site-nav a:focus-visible,
.product-card:focus-visible,
.footer-links a:focus-visible,
.menu-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

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

@media (max-width: 1080px) {
  .hero-layout,
  .about-layout {
    grid-template-columns: 1fr;
  }

  .hero-frame {
    min-height: 560px;
  }

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

@media (max-width: 860px) {
  :root {
    --header-height: 72px;
  }

  section {
    padding: 88px 20px;
  }

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

  .header-cta {
    display: none;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 22px 20px 28px;
    background: rgba(8, 8, 8, 0.98);
    border-bottom: 1px solid var(--color-border-dark);
  }

  .menu-open .site-nav {
    display: flex;
  }

  .hero-copy {
    max-width: none;
  }

  .portfolio-grid,
  .about-points {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .site-footer p {
    text-align: left;
  }
}

@media (max-width: 640px) {
  h1 {
    max-width: none;
    font-size: clamp(3rem, 17vw, 4.6rem);
  }

  h2 {
    font-size: clamp(2.4rem, 12vw, 3.4rem);
  }

  .hero-section {
    padding-top: 40px;
  }

  .hero-frame {
    min-height: 620px;
    padding: 18px;
  }

  .character-goblin,
  .character-vampire,
  .character-samurai {
    position: relative;
    width: 100%;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    min-height: auto;
    margin-bottom: 16px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .contact-panel {
    padding: 56px 24px;
  }
}
