/* =========================================================
   AINEXO 2D Game Development — page-only styles (g2d-)
   Mirrors erp-page.css patterns under .g2d-page
   ========================================================= */

.g2d-page .g2d-hero {
  position: relative;
  padding: calc(var(--nav-h) + 48px) 0 64px;
  overflow: hidden;
}

.g2d-page .g2d-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 45% at 12% 20%, rgba(200, 155, 60, 0.12), transparent 60%),
    radial-gradient(45% 40% at 88% 15%, rgba(159, 45, 45, 0.14), transparent 55%),
    radial-gradient(40% 40% at 70% 80%, rgba(250, 204, 21, 0.08), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.g2d-page .g2d-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}

.g2d-page .g2d-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}

.g2d-page .g2d-hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.15rem);
  line-height: 1.12;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.g2d-page .g2d-hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 14px;
  line-height: 1.35;
}

.g2d-page .g2d-hero-lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 36rem;
  margin: 0 0 28px;
}

.g2d-page .g2d-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.g2d-page .g2d-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  color: var(--faint);
  font-size: 0.86rem;
}

.g2d-page .g2d-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Game canvas mockup stage */
.g2d-stage {
  position: relative;
  min-height: 420px;
  perspective: 1400px;
}

.g2d-canvas {
  position: relative;
  width: min(100%, 440px);
  height: 300px;
  margin: 40px auto 0;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(180deg, rgba(214, 177, 90, 0.18) 0%, rgba(31, 31, 31, 0.92) 55%, rgba(159, 45, 45, 0.12) 100%);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  transform: rotateY(-6deg) rotateX(3deg);
}

.g2d-canvas-bar {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.68rem;
  color: var(--faint);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.g2d-canvas-bar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.g2d-canvas-bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.g2d-canvas-bar i:nth-child(1) { background: #ff5f57; }
.g2d-canvas-bar i:nth-child(2) { background: #febc2e; }
.g2d-canvas-bar i:nth-child(3) { background: #28c840; }

.g2d-canvas-body {
  position: relative;
  height: calc(100% - 28px);
  padding: 16px;
}

.g2d-platform {
  position: absolute;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(200, 155, 60, 0.5), rgba(214, 177, 90, 0.35));
  border: 1px solid rgba(200, 155, 60, 0.35);
  box-shadow: 0 4px 12px rgba(200, 155, 60, 0.15);
}

.g2d-platform.a { width: 120px; left: 24px; bottom: 48px; }
.g2d-platform.b { width: 90px; left: 50%; bottom: 88px; transform: translateX(-50%); }
.g2d-platform.c { width: 110px; right: 28px; bottom: 130px; }

.g2d-character {
  position: absolute;
  left: 38px;
  bottom: 58px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(145deg, #d6b15a, #c89b3c);
  border: 2px solid rgba(250, 248, 245, 0.35);
  box-shadow: 0 8px 20px rgba(200, 155, 60, 0.35);
  animation: g2dBounce 2.4s ease-in-out infinite;
}

.g2d-character::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1f1f1f;
  box-shadow: 14px 0 0 #1f1f1f;
}

.g2d-character::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 6px;
  width: 24px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  filter: blur(2px);
}

.g2d-coin {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d6b15a, #c89b3c);
  border: 2px solid rgba(250, 248, 245, 0.4);
  box-shadow: 0 0 12px rgba(200, 155, 60, 0.35);
}

.g2d-coin.a { top: 42px; right: 48px; animation: g2dCoinFloat 3s ease-in-out infinite; }
.g2d-coin.b { top: 78px; left: 55%; animation: g2dCoinFloat 3.4s ease-in-out infinite 0.6s; }
.g2d-coin.c { bottom: 100px; right: 72px; animation: g2dCoinFloat 2.8s ease-in-out infinite 1.1s; }

.g2d-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
  animation: g2dSparkle 2.6s ease-in-out infinite;
}

.g2d-particle:nth-child(1) { top: 20%; left: 18%; animation-delay: 0s; }
.g2d-particle:nth-child(2) { top: 35%; right: 22%; animation-delay: 0.4s; }
.g2d-particle:nth-child(3) { bottom: 40%; left: 42%; animation-delay: 0.8s; }
.g2d-particle:nth-child(4) { top: 55%; left: 72%; animation-delay: 1.2s; }
.g2d-particle:nth-child(5) { bottom: 28%; right: 35%; animation-delay: 1.6s; }

.g2d-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text);
}

.g2d-hud-score {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}

.g2d-hud-lives {
  display: flex;
  gap: 4px;
}

.g2d-hud-lives i {
  color: #f87171;
  font-size: 0.62rem;
}

.g2d-float-chip {
  position: absolute;
  z-index: 5;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(31, 31, 31, 0.72);
  backdrop-filter: blur(12px);
  font-size: 0.75rem;
  color: var(--text);
  box-shadow: var(--glow-accent);
  animation: g2dFloat 4s ease-in-out infinite;
}

.g2d-float-chip.a { left: 0; bottom: 48px; animation-delay: 0s; }
.g2d-float-chip.b { left: 36%; top: 8px; animation-delay: 0.8s; }
.g2d-float-chip.c { right: 0; bottom: 90px; animation-delay: 1.4s; }

@keyframes g2dFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes g2dBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes g2dCoinFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.9; }
  50% { transform: translateY(-10px) rotate(12deg); opacity: 1; }
}

@keyframes g2dSparkle {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.4); }
}

[data-theme="light"] .g2d-float-chip {
  background: rgba(255, 255, 255, 0.88);
}

/* Sections */
.g2d-section {
  padding: 64px 0;
}

.g2d-section.alt {
  background: linear-gradient(180deg, transparent, rgba(159, 45, 45, 0.04), transparent);
}

.g2d-section-head {
  max-width: 720px;
  margin: 0 auto 36px;
  text-align: center;
}

.g2d-section-head h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.g2d-section-head p {
  color: var(--muted);
  margin: 0;
  line-height: 1.7;
}

/* Game types — enterprise grid cards */
.g2d-page .g2d-types-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.g2d-type-card {
  padding: 22px 16px;
  height: 100%;
  text-align: center;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

.g2d-type-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.g2d-type-card .card-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #c89b3c 0%, #9f2d2d 100%);
  color: #faf8f5;
  box-shadow: 0 8px 20px rgba(159, 45, 45, 0.25);
}
.g2d-type-card .card-icon i {
  color: #faf8f5 !important;
  font-size: 1.15rem;
  line-height: 1;
}

.g2d-type-card h3 {
  font-size: 0.95rem;
  margin: 0 0 8px;
}

.g2d-type-card p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 0;
}

/* Why choose */
.g2d-why-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.g2d-why-item {
  padding: 18px 14px;
  text-align: center;
}

.g2d-why-item .card-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #c89b3c 0%, #9f2d2d 100%);
  color: #faf8f5;
  box-shadow: 0 8px 20px rgba(159, 45, 45, 0.25);
}
.g2d-why-item .card-icon i {
  color: #faf8f5 !important;
  font-size: 1.1rem;
  line-height: 1;
  display: inline-block;
  margin: 0;
}

.g2d-why-item h3 {
  font-size: 0.92rem;
  margin: 0 0 6px;
}

.g2d-why-item p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Process timeline */
.g2d-process {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 4px;
}

.g2d-process-step {
  min-width: 108px;
  padding: 14px 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  position: relative;
}

.g2d-process-step .n {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--grad-main);
  color: #041018;
}

.g2d-process-step span {
  font-size: 0.84rem;
  font-weight: 600;
}

.g2d-process-arrow {
  color: var(--faint);
  font-size: 0.9rem;
  padding: 0 2px;
}

/* Technologies */
.g2d-tech-wrap {
  display: flex;
  justify-content: center;
}

.g2d-tech-wrap .tech-row {
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.g2d-tech-wrap .tech-row span {
  padding: 8px 16px;
  font-size: 0.84rem;
}

/* Features grid */
.g2d-features-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.g2d-feature-item {
  padding: 18px 14px;
  text-align: center;
}

.g2d-feature-item .card-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #c89b3c 0%, #9f2d2d 100%);
  color: #faf8f5;
  box-shadow: 0 8px 20px rgba(159, 45, 45, 0.25);
}
.g2d-feature-item .card-icon i {
  color: #faf8f5 !important;
  font-size: 1.1rem;
  line-height: 1;
  display: inline-block;
  margin: 0;
}

.g2d-feature-item h3 {
  font-size: 0.92rem;
  margin: 0 0 6px;
}

.g2d-feature-item p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Portfolio showcase */
.g2d-video-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: center;
  padding: 18px;
  margin: 0 0 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.g2d-video-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: rgba(4, 16, 24, 0.78);
  box-shadow: var(--shadow-card);
}

.g2d-video-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(200, 155, 60, 0.16), transparent 42%, rgba(250, 204, 21, 0.12));
  z-index: 1;
}

.g2d-video-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.g2d-video-copy {
  padding: 10px 8px;
}

.g2d-video-copy h3 {
  margin: 0 0 10px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.25;
}

.g2d-video-copy p:last-child {
  color: var(--muted);
  margin: 0;
  line-height: 1.65;
}

.g2d-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.g2d-portfolio-card {
  padding: 0;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.g2d-portfolio-thumb {
  position: relative;
  height: 160px;
  background: linear-gradient(135deg, rgba(214, 177, 90, 0.2), rgba(159, 45, 45, 0.15));
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.g2d-portfolio-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 70%, rgba(200, 155, 60, 0.2), transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(250, 204, 21, 0.15), transparent 45%);
}

.g2d-thumb-scene {
  position: absolute;
  inset: 20px 24px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(4, 16, 24, 0.55);
}

.g2d-thumb-scene.runner .g2d-thumb-bar {
  position: absolute;
  bottom: 18px;
  left: 16px;
  right: 16px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0.6;
}

.g2d-thumb-scene.runner .g2d-thumb-dot {
  position: absolute;
  bottom: 30px;
  left: 24px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #facc15;
}

.g2d-thumb-scene.puzzle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 16px;
  background: rgba(4, 16, 24, 0.65);
}

.g2d-thumb-scene.puzzle span {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(200, 155, 60, 0.12);
}

.g2d-thumb-scene.puzzle span:nth-child(2),
.g2d-thumb-scene.puzzle span:nth-child(5) {
  background: rgba(159, 45, 45, 0.2);
}

.g2d-thumb-scene.edu {
  padding: 14px 16px;
}

.g2d-thumb-scene.edu .g2d-thumb-q {
  font-size: 0.62rem;
  color: var(--faint);
  margin-bottom: 8px;
}

.g2d-thumb-scene.edu .g2d-thumb-opt {
  height: 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}

.g2d-thumb-scene.edu .g2d-thumb-opt.active {
  background: rgba(200, 155, 60, 0.25);
}

.g2d-thumb-scene.biz {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 16px 20px;
}

.g2d-thumb-scene.biz span {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0.75;
}

.g2d-thumb-scene.biz span:nth-child(1) { height: 40%; }
.g2d-thumb-scene.biz span:nth-child(2) { height: 65%; }
.g2d-thumb-scene.biz span:nth-child(3) { height: 50%; }
.g2d-thumb-scene.biz span:nth-child(4) { height: 80%; }

.g2d-portfolio-body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.g2d-portfolio-body h3 {
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.g2d-portfolio-body p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0 0 12px;
  flex: 1;
}

.g2d-portfolio-body .tech-row {
  margin-top: auto;
}

/* Client benefits */
.g2d-benefits-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.g2d-benefit-item {
  padding: 22px 16px;
  text-align: center;
}

.g2d-benefit-item .card-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #c89b3c 0%, #9f2d2d 100%);
  color: #faf8f5;
  box-shadow: 0 8px 20px rgba(159, 45, 45, 0.25);
}
.g2d-benefit-item .card-icon i {
  color: #faf8f5 !important;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
  margin: 0;
}

.g2d-benefit-item h3 {
  font-size: 0.95rem;
  margin: 0 0 8px;
}

.g2d-benefit-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}

/* FAQ */
.g2d-faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.g2d-faq-item {
  padding: 0;
  border-radius: var(--radius-sm);
}

.g2d-faq-item summary {
  cursor: pointer;
  padding: 20px 24px;
  font-weight: 600;
  list-style: none;
}

.g2d-faq-item summary::-webkit-details-marker {
  display: none;
}

.g2d-faq-item summary::after {
  content: "+";
  float: right;
  color: var(--primary);
  font-weight: 700;
}

.g2d-faq-item[open] summary::after {
  content: "−";
}

.g2d-faq-item div {
  padding: 0 24px 22px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.93rem;
}

/* CTA band */
.g2d-cta-band {
  margin: 24px 0 72px;
  padding: 48px 28px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(159, 45, 45, 0.12), transparent 60%),
    var(--card);
}

.g2d-cta-band h2 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.g2d-cta-band p {
  color: var(--muted);
  margin: 0 0 24px;
}

.g2d-cta-band .g2d-cta-row {
  justify-content: center;
}

.g2d-founder-note {
  margin-top: 28px;
  font-size: 0.88rem;
  color: var(--faint);
  line-height: 1.7;
}

.g2d-founder-note a {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
  .g2d-page .g2d-types-grid,
  .g2d-page .g2d-features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .g2d-why-grid,
  .g2d-benefits-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .g2d-page .g2d-hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .g2d-video-showcase {
    grid-template-columns: 1fr;
  }

  .g2d-stage {
    min-height: 360px;
    max-width: 520px;
    margin: 0 auto;
  }

  .g2d-canvas {
    transform: none;
  }
}

@media (max-width: 640px) {
  .g2d-page .g2d-hero {
    padding-top: calc(var(--nav-h) + 28px);
  }

  .g2d-page .g2d-types-grid,
  .g2d-why-grid,
  .g2d-page .g2d-features-grid,
  .g2d-benefits-grid {
    grid-template-columns: 1fr;
  }

  .g2d-portfolio-grid {
    grid-template-columns: 1fr;
  }

  .g2d-process-arrow {
    display: none;
  }

  .g2d-process-step {
    flex: 1 1 calc(50% - 8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .g2d-float-chip,
  .g2d-character,
  .g2d-coin,
  .g2d-particle {
    animation: none !important;
  }
}
