:root {
  --primary: #ed1c24;
  --primary-dark: #b20f18;
  --primary-soft: rgba(237, 28, 36, 0.12);
  --dark: #0f0f10;
  --deep-dark: #050505;
  --white: #ffffff;
  --muted: #666a73;
  --light: #f7f7f8;
  --light-2: #f1f1f3;
  --border: rgba(255, 255, 255, 0.22);
  --shadow: 0 24px 65px rgba(0, 0, 0, 0.08);
  --shadow-strong: 0 35px 90px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #1b1f24;
  background: #ffffff;
}
body.mobile-nav-open { overflow: hidden; }
a { text-decoration: none; }
img { max-width: 100%; display: block; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}


/* Header */
#header {
  height: 86px;
  display: flex;
  align-items: center;
  z-index: 999;
  transition: all 0.35s ease;
}
#header.header-scrolled {
  background: rgba(5, 5, 5, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.28);
}
.brand-wrap { display: inline-flex; align-items: center; }
.brand-logo {
  height: 54px;
  width: auto;
}

.navbar ul {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.navbar a {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  transition: color 0.25s ease;
}
.navbar a:hover,
.navbar a.active { color: var(--primary); }

.mobile-nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

/* Hero */
#mth-genius {
  width: 100%;
  min-height: 100vh;
  background: url("../img/hero-bg.svg") center center;
  background-size: cover;
  position: relative;
  padding: 135px 0 78px 0;
  overflow: hidden;
}
#mth-genius::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(0, 0, 0, 0.82), rgba(30, 0, 0, 0.65)),
    radial-gradient(circle at 25% 30%, rgba(237, 28, 36, 0.16), transparent 35%),
    radial-gradient(circle at 80% 70%, rgba(237, 28, 36, 0.12), transparent 35%);
  z-index: 1;
}
#mth-genius .container { position: relative; z-index: 3; }

.animated-bg {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.animated-bg::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(237, 28, 36, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 28, 36, 0.08) 1px, transparent 1px);
  background-size: 70px 70px;
  transform: rotate(-8deg);
  animation: gridMove 22s linear infinite;
  opacity: 0.32;
}
.animated-bg::after {
  content: "";
  position: absolute;
  width: 900px;
  height: 900px;
  left: 50%;
  top: 39%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(237, 28, 36, 0.18), transparent 60%);
  filter: blur(35px);
  animation: pulseHalo 7s ease-in-out infinite;
}
.tech-orb {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(237, 28, 36, 0.95);
  opacity: 0.78;
}
.orb-1 { left: 12%; top: 30%; animation: floatOrb 9s ease-in-out infinite; }
.orb-2 { right: 18%; top: 22%; animation: floatOrb 12s ease-in-out infinite reverse; }
.orb-3 { left: 72%; bottom: 18%; animation: floatOrb 10s ease-in-out infinite; }
.tech-line {
  position: absolute;
  height: 1px;
  width: 340px;
  background: linear-gradient(90deg, transparent, rgba(237, 28, 36, 0.85), transparent);
  opacity: 0.55;
}
.line-1 { top: 35%; left: -20%; animation: slideLine 10s linear infinite; }
.line-2 { top: 55%; left: -30%; animation: slideLine 14s linear infinite; }
.line-3 { top: 75%; left: -40%; animation: slideLine 18s linear infinite; }

.hero-badge {
  display: inline-block;
  color: #fff;
  border: 1px solid rgba(237, 28, 36, 0.52);
  padding: 8px 20px;
  border-radius: 50px;
  background: rgba(237, 28, 36, 0.12);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.7px;
  margin-bottom: 24px;
}
#mth-genius h1 {
  margin: 0;
  color: #ffffff;
  font-size: 74px;
  font-weight: 950;
  line-height: 1.04;
  text-transform: uppercase;
  letter-spacing: -1.5px;
}
#mth-genius h1 span { color: var(--primary); }
#mth-genius h2 {
  margin: 22px auto 0 auto;
  max-width: 1020px;
  color: #ffffff;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.32;
}
#mth-genius .mthgenius-subtitle {
  margin: 22px auto 0 auto;
  max-width: 920px;
  color: rgba(255,255,255,0.92);
  font-size: 18px;
  line-height: 1.65;
}
.hero-actions {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn-main,
.btn-outline-main {
  padding: 14px 30px;
  border-radius: 4px;
  font-weight: 800;
  transition: 0.3s;
  display: inline-block;
}
.btn-main {
  background: var(--primary);
  color: #ffffff;
  border: 2px solid var(--primary);
}
.btn-main:hover {
  background: #ffffff;
  color: var(--dark);
  border-color: #ffffff;
}
.btn-outline-main {
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.65);
}
.btn-outline-main:hover {
  background: #ffffff;
  color: var(--dark);
  border-color: #ffffff;
}

.mthgenius-boxes {
  width: 100%;
  max-width: 1500px;
  margin: 90px auto 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  align-items: stretch;
}
.mthgenius-box {
  min-height: 205px;
  padding: 30px 20px;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(0,0,0,0.22);
  color: #ffffff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.35s ease;
  backdrop-filter: blur(2px);
}
.mthgenius-box i {
  font-size: 38px;
  line-height: 1;
  color: var(--primary);
  margin-bottom: 22px;
}
.mthgenius-box h3 {
  margin: 0;
  color: #ffffff;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.35;
}
.mthgenius-box:hover {
  border-color: var(--primary);
  background: rgba(237, 28, 36, 0.14);
  transform: translateY(-8px);
}

/* Common sections */
.section-padding { padding: 95px 0; }
.bg-light-premium { background: var(--light); }
.section-title {
  text-align: center;
  margin-bottom: 55px;
}
.section-title span,
.dark-kicker,
.card-kicker {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.6px;
}
.section-title h2 {
  color: var(--dark);
  font-size: 40px;
  font-weight: 900;
  margin-bottom: 14px;
  line-height: 1.2;
}
.section-title p {
  color: var(--muted);
  font-size: 18px;
  max-width: 850px;
  margin: auto;
  line-height: 1.7;
}
.section-title-light h2 { color: #ffffff; }
.section-title-light p { color: rgba(255,255,255,0.76); }

/* Content blocks & cards */
.content-block,
.premium-card,
.service-card,
.partner-card,
.client-card {
  background: #ffffff;
  padding: 34px;
  height: 100%;
  border: 1px solid #ececef;
  box-shadow: var(--shadow);
  transition: 0.35s;
}
.content-block h3,
.premium-card h3,
.service-card h3,
.partner-card h3,
.client-card h3,
.mini-panel h4,
.sticky-content h3 {
  color: var(--dark);
  font-weight: 850;
  margin-bottom: 16px;
}
.content-block p,
.premium-card p,
.service-card p,
.partner-card p,
.client-card p,
.sticky-content p,
.mini-panel p {
  color: #4f5965;
  line-height: 1.7;
  margin-bottom: 0;
}
.content-block, .premium-card, .service-card, .partner-card, .client-card {
  border-top: 4px solid transparent;
}
.content-block:hover,
.premium-card:hover,
.service-card:hover,
.partner-card:hover,
.client-card:hover {
  transform: translateY(-8px);
  border-top-color: var(--primary);
}
.service-card i,
.partner-card i {
  color: var(--primary);
  font-size: 42px;
  margin-bottom: 20px;
}
.signature-line {
  margin-top: 24px;
  font-weight: 800;
  color: var(--primary);
}
.large-card { min-height: 100%; }

/* Floating portrait */
.floating-portrait {
  position: relative;
  max-width: 430px;
  height: 560px;
  margin: auto;
  overflow: hidden;
  box-shadow: var(--shadow-strong);
  background: #fff;
}
.floating-portrait::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(237, 28, 36, 0.45);
  z-index: 2;
}
.floating-portrait::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -40px;
  top: -40px;
  background: rgba(237, 28, 36, 0.24);
  filter: blur(45px);
  z-index: 1;
}
.floating-portrait img {
  width: 100%; height: 100%; object-fit: cover;
  animation: portraitFloat 7s ease-in-out infinite;
  position: relative; z-index: 0;
}

/* Visual story */
.visual-story-section {
  position: relative;
  padding: 110px 0;
  background: linear-gradient(180deg, #070707 0%, #120607 48%, #ffffff 100%);
  overflow: hidden;
}
.visual-story-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
  margin-top: 65px;
}
.visual-card {
  position: relative;
  height: 520px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  transition: all 0.45s ease;
}
.visual-card-offset { margin-top: 70px; }
.visual-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s ease, filter 0.6s ease;
  filter: saturate(0.85) contrast(1.05) brightness(0.8);
}
.visual-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, transparent 15%, rgba(0, 0, 0, 0.8) 100%),
    radial-gradient(circle at 50% 20%, rgba(237, 28, 36, 0.24), transparent 35%);
}
.visual-card::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  z-index: 2;
}
.visual-card-content {
  position: absolute;
  z-index: 3;
  left: 28px; right: 28px; bottom: 30px;
}
.visual-card-content span {
  display: inline-block;
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.visual-card-content h3 {
  color: #ffffff;
  font-size: 27px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 12px;
}
.visual-card-content p {
  color: rgba(255,255,255,0.84);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}
.visual-card:hover { transform: translateY(-14px); }
.visual-card:hover img {
  transform: scale(1.12);
  filter: saturate(1.0) contrast(1.1) brightness(0.9);
}

/* Dark section */
.section-dark {
  background: linear-gradient(135deg, #050505, #1a080a);
  color: #ffffff;
  padding: 100px 0;
  text-align: center;
}
.section-dark h2 {
  font-size: 40px;
  font-weight: 900;
  margin-bottom: 20px;
}
.section-dark p {
  max-width: 920px;
  margin: auto;
  font-size: 18px;
  line-height: 1.8;
  color: rgba(255,255,255,0.86);
}
.dark-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 40px;
}
.dark-metrics div,
.mini-panel {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 24px 18px;
}
.dark-metrics strong {
  display: block;
  color: var(--primary);
  font-size: 24px;
  margin-bottom: 8px;
}
.dark-metrics span {
  color: #ffffff;
  font-weight: 700;
}
.mini-panel h4 { color: #ffffff; }
.mini-panel p { color: rgba(255,255,255,0.8); }

/* Sticky / process */
.sticky-image {
  height: 620px;
  overflow: hidden;
  box-shadow: var(--shadow-strong);
  background: #fff;
}
.sticky-image img { width: 100%; height: 100%; object-fit: cover; }
.sticky-image-static { position: relative; top: 0; }
.sticky-content {
  background: #ffffff;
  min-height: 180px;
  padding: 34px;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.sticky-content span {
  color: var(--primary);
  font-weight: 900;
  letter-spacing: 2px;
}

.mini-card {
  padding: 26px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #ededf0;
  font-weight: 800;
  color: var(--dark);
  box-shadow: 0 15px 35px rgba(0,0,0,0.05);
  height: 100%;
  display: flex; align-items: center; justify-content: center;
}

.process {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
}
.process div {
  background: #ffffff;
  border-top: 4px solid var(--primary);
  padding: 24px 14px;
  text-align: center;
  font-weight: 800;
  color: var(--dark);
  box-shadow: 0 15px 35px rgba(0,0,0,0.05);
}
.process span {
  display: block;
  color: var(--primary);
  margin-bottom: 8px;
}

/* Partner & client grids */
.partner-grid,
.client-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Contact */
.contact-section {
  background: linear-gradient(180deg, #ffffff 0%, #f6f6f7 100%);
}
.contact-form {
  background: #ffffff;
  padding: 38px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid #dfe1e6;
  outline: none;
  transition: border-color .25s ease;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--primary); }
.contact-form textarea { height: 150px; resize: vertical; }
.contact-form button {
  border: none;
  background: var(--primary);
  color: #ffffff;
  padding: 14px 34px;
  font-weight: 800;
  border-radius: 4px;
}

/* Footer */
#footer {
  background: var(--deep-dark);
  color: rgba(255,255,255,0.82);
  padding: 55px 0 22px;
}
.footer-logo {
  max-width: 170px;
  margin-bottom: 18px;
  background: #fff;
  padding: 8px;
}
#footer h4 {
  color: #ffffff;
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 800;
}
#footer ul {
  list-style: none;
  padding: 0; margin: 0;
}
#footer li { margin-bottom: 10px; }
.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.10);
  text-align: center;
}

/* Mobile nav */
@media (max-width: 1199px) {
  .navbar {
    position: fixed;
    top: 86px;
    right: -100%;
    width: 320px;
    height: calc(100vh - 86px);
    background: rgba(5, 5, 5, 0.98);
    padding: 26px;
    transition: 0.35s ease;
  }
  .navbar.mobile { right: 0; }
  .navbar ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .mobile-nav-toggle { display: inline-flex; }
}

/* Responsive */
@media (max-width: 1399px) {
  .mthgenius-boxes { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 1199px) {
  #mth-genius h1 { font-size: 60px; }
  #mth-genius h2 { font-size: 30px; }
  .mthgenius-boxes { grid-template-columns: repeat(3, 1fr); }
  .visual-story-grid { grid-template-columns: repeat(2, 1fr); }
  .visual-card-offset { margin-top: 0; }
  .partner-grid, .client-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
  .dark-metrics { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); }
  .sticky-image { height: 460px; margin-bottom: 28px; }
  .brand-logo { height: 48px; }
}
@media (max-width: 768px) {
  #mth-genius {
    min-height: auto;
    padding: 120px 0 60px 0;
  }
  #mth-genius h1 { font-size: 42px; }
  #mth-genius h2 { font-size: 24px; }
  #mth-genius .mthgenius-subtitle { font-size: 16px; }
  .mthgenius-boxes {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-top: 55px;
  }
  .mthgenius-box {
    min-height: 180px;
    padding: 26px 16px;
  }
  .mthgenius-box h3 { font-size: 18px; }
  .visual-story-section { padding: 80px 0; }
  .visual-story-grid { grid-template-columns: 1fr; }
  .section-title h2,
  .section-dark h2 { font-size: 31px; }
  .partner-grid, .client-grid { grid-template-columns: 1fr; }
  .contact-form { padding: 28px; }
  .brand-logo { height: 42px; }
}
@media (max-width: 480px) {
  .mthgenius-boxes,
  .dark-metrics,
  .process { grid-template-columns: 1fr; }
  .hero-actions { gap: 12px; }
}

/* Animations */
@keyframes gridMove {
  0% { transform: rotate(-8deg) translate(0, 0); }
  100% { transform: rotate(-8deg) translate(70px, 70px); }
}
@keyframes pulseHalo {
  0%, 100% { opacity: 0.45; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.85; transform: translate(-50%, -50%) scale(1.12); }
}
@keyframes floatOrb {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-35px) translateX(18px); }
}
@keyframes slideLine {
  0% { transform: translateX(0); opacity: 0; }
  20% { opacity: 0.65; }
  100% { transform: translateX(160vw); opacity: 0; }
}
@keyframes portraitFloat {
  0%, 100% { transform: scale(1.04) translateY(0); }
  50% { transform: scale(1.08) translateY(-16px); }
}
