*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-dark: #faf5ff;
  --bg-card: rgba(255, 255, 255, 0.82);
  --border: rgba(157, 0, 255, 0.14);
  --gold: #e87800;
  --gold-light: #c45a00;
  --accent: #e91e7a;
  --accent2: #7c3aed;
  --purple: #7700ff;
  --cyan: #e91e7a;
  --magenta: #a855f7;
  --text: #1e1035;
  --text-muted: #6b5b8a;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(124, 58, 237, 0.1);
  --neon-cyan: 0 4px 24px rgba(233, 30, 122, 0.18), 0 0 0 1px rgba(233, 30, 122, 0.08);
  --neon-gold: 0 4px 24px rgba(232, 120, 0, 0.22), 0 0 0 1px rgba(232, 120, 0, 0.1);
  --neon-pink: 0 4px 24px rgba(124, 58, 237, 0.18), 0 0 0 1px rgba(124, 58, 237, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Background Layers ===== */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 130% 70% at 50% 115%, rgba(255, 180, 100, 0.4) 0%, transparent 55%),
    radial-gradient(ellipse 90% 60% at 85% 5%, rgba(180, 130, 255, 0.28) 0%, transparent 52%),
    radial-gradient(ellipse 75% 55% at 5% 35%, rgba(255, 130, 180, 0.22) 0%, transparent 50%),
    radial-gradient(ellipse 60% 45% at 50% -5%, rgba(200, 160, 255, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 70% 60%, rgba(255, 220, 150, 0.2) 0%, transparent 50%),
    linear-gradient(160deg, #faf5ff 0%, #fff5f9 40%, #fff8f2 100%);
  animation: aurora-shift 12s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes aurora-shift {
  0% { filter: hue-rotate(0deg) brightness(1); transform: scale(1); }
  50% { filter: hue-rotate(20deg) brightness(1.1); }
  100% { filter: hue-rotate(-15deg) brightness(1); transform: scale(1.05); }
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(157, 0, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 30, 122, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black 15%, transparent 82%);
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(255, 180, 100, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 50% 0%, rgba(180, 130, 255, 0.15) 0%, transparent 55%);
  pointer-events: none;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(157, 0, 255, 0.015) 2px,
    rgba(157, 0, 255, 0.015) 4px
  );
  pointer-events: none;
  opacity: 0.5;
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(24px) saturate(1.5);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(157, 0, 255, 0.12);
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.08), inset 0 -1px 0 rgba(255, 255, 255, 0.8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 8px rgba(255, 158, 0, 0.6));
}

.logo-text {
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.nav {
  display: flex;
  gap: 6px;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 42, 109, 0.1), rgba(157, 0, 255, 0.1));
  opacity: 0;
  transition: opacity 0.3s;
}

.nav a:hover {
  color: var(--accent);
  border-color: rgba(233, 30, 122, 0.25);
  box-shadow: var(--neon-cyan);
  text-shadow: none;
}

.nav a:hover::before {
  opacity: 1;
}

/* ===== Language Switch ===== */
.lang-switch {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 8px;
  flex-shrink: 0;
}

.lang-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.25s;
}

.lang-btn:hover {
  color: var(--accent);
  background: rgba(233, 30, 122, 0.08);
}

.lang-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.25);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
}

.hero-content {
  text-align: center;
  flex: 1;
}

.hero-wrap {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-visual {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  max-width: 320px;
  height: 280px;
  margin: 0 auto;
  display: block;
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse at center, rgba(255, 42, 109, 0.15) 0%, rgba(157, 0, 255, 0.1) 40%, transparent 70%);
  border-radius: 50%;
  animation: hero-orb 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hero-orb {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

.hero-model {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 220px;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 8px 20px rgba(124, 58, 237, 0.2)) drop-shadow(0 4px 12px rgba(233, 30, 122, 0.15));
  animation: hero-float 3s ease-in-out infinite, img-glow-pulse 3s ease-in-out infinite;
  will-change: transform, filter;
}

.hero-model-sm {
  width: 130px;
  right: 140px;
  bottom: 16px;
  z-index: 1;
  animation: hero-float 3s ease-in-out infinite 0.5s, img-glow-pulse 3s ease-in-out infinite 0.8s;
  opacity: 0.95;
}

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

@media (min-width: 900px) {
  .hero-wrap {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .hero-visual {
    width: 320px;
    max-width: none;
    height: 420px;
    margin: 0;
  }

  .hero-model {
    width: 280px;
    max-height: 400px;
  }

  .hero-model-sm {
    width: 160px;
    right: 180px;
    bottom: 20px;
  }

  .hero-content {
    text-align: left;
  }

  .hero-stats {
    justify-content: flex-start;
  }
}

.hero-badge {
  display: inline-block;
  padding: 6px 20px;
  background: rgba(233, 30, 122, 0.1);
  border: 1px solid rgba(233, 30, 122, 0.35);
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 24px;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: badge-pulse 2s ease-in-out infinite;
  box-shadow: var(--neon-cyan);
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(233, 30, 122, 0.15); }
  50% { box-shadow: 0 4px 20px rgba(233, 30, 122, 0.3); }
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  text-shadow: 0 2px 12px rgba(233, 30, 122, 0.15);
}

.gradient-text {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--gold) 40%, var(--accent) 80%, var(--accent2) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-flow 4s linear infinite;
}

@keyframes gradient-flow {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  letter-spacing: 4px;
  position: relative;
  display: inline-block;
}

.hero-subtitle::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--gold), transparent);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 28px;
  min-width: 120px;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: stat-scan 3s ease-in-out infinite;
}

@keyframes stat-scan {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--neon-cyan);
  border-color: rgba(233, 30, 122, 0.3);
}

.stat-card.highlight {
  border-color: rgba(232, 120, 0, 0.35);
  background: rgba(255, 158, 0, 0.08);
  box-shadow: var(--neon-gold);
}

.stat-card.highlight::before {
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  text-shadow: none;
}

.stat-card.highlight .stat-value {
  color: var(--gold);
  text-shadow: none;
  background: none;
  -webkit-text-fill-color: var(--gold);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 1px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  letter-spacing: 1px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s;
}

.btn:hover::after {
  left: 120%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #ff9500 100%);
  color: #0a0500;
  box-shadow: var(--neon-gold);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  box-shadow: var(--neon-pink);
}

.btn-glow {
  animation: btn-glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes btn-glow-pulse {
  from { box-shadow: 0 4px 16px rgba(232, 120, 0, 0.25), 0 0 0 1px rgba(232, 120, 0, 0.1); }
  to { box-shadow: 0 6px 28px rgba(232, 120, 0, 0.4), 0 0 0 1px rgba(232, 120, 0, 0.15); }
}

.btn:hover {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.15);
}

.btn-block {
  width: 100%;
}

.btn.loading .btn-text { display: none; }
.btn.loading .btn-loading { display: inline; }
.btn .btn-loading { display: none; }

/* ===== Sections ===== */
.section {
  position: relative;
  z-index: 1;
  padding: 80px 0;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 900;
  text-align: center;
  margin-bottom: 48px;
  position: relative;
  display: inline-block;
  width: 100%;
  background: linear-gradient(180deg, #1e1035 0%, var(--accent) 60%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--gold));
  border-radius: 2px;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 40px;
  letter-spacing: 3px;
}

/* ===== Glass Cards ===== */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.07), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 42, 109, 0.3), transparent 40%, rgba(157, 0, 255, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.gold {
  color: var(--gold);
  text-shadow: none;
  font-weight: 600;
}

/* ===== Intro ===== */
.intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.intro-card {
  padding: 28px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

.intro-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--neon-cyan), 0 16px 48px rgba(124, 58, 237, 0.1);
}

.intro-img-wrap {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(255, 42, 109, 0.15);
}

.intro-img-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 42, 109, 0.1) 45%,
    rgba(255, 158, 0, 0.3) 50%,
    rgba(255, 42, 109, 0.1) 55%,
    transparent 100%
  );
  z-index: 2;
  pointer-events: none;
  animation: img-shine-sweep 3.5s ease-in-out infinite;
}

.intro-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.5) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.intro-card.visible .intro-img-wrap {
  animation: img-border-glow 3s ease-in-out infinite;
}

.intro-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.intro-card.visible .intro-img {
  animation: img-float-soft 5s ease-in-out infinite, img-enter-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.intro-card:nth-child(1).visible .intro-img { animation-delay: 0s, 0.1s; }
.intro-card:nth-child(2).visible .intro-img { animation-delay: 0.8s, 0.25s; }
.intro-card:nth-child(3).visible .intro-img { animation-delay: 1.6s, 0.4s; }

.intro-card:hover .intro-img {
  transform: scale(1.1);
  animation-play-state: paused;
}

.intro-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: var(--accent2);
  text-shadow: none;
}

.intro-card p {
  color: var(--text-muted);
  font-size: 0.93rem;
}

/* ===== Panel ===== */
.panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
}

.panel.reverse {
  direction: rtl;
}

.panel.reverse > * {
  direction: ltr;
}

.panel-visual {
  padding: 40px;
  background: linear-gradient(160deg, rgba(233, 30, 122, 0.06) 0%, rgba(124, 58, 237, 0.08) 50%, rgba(255, 180, 100, 0.06) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.panel-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 40px,
    rgba(255, 42, 109, 0.02) 40px,
    rgba(255, 42, 109, 0.02) 41px
  );
  pointer-events: none;
}

.panel-visual-img {
  position: relative;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.panel-model {
  width: 100%;
  max-width: 220px;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 4px 16px rgba(124, 58, 237, 0.2)) drop-shadow(0 2px 8px rgba(233, 30, 122, 0.1));
  border-radius: 8px;
  border: 1px solid rgba(124, 58, 237, 0.15);
  animation: img-float-soft 4.5s ease-in-out infinite, img-glow-pulse 3s ease-in-out infinite;
  will-change: transform, filter;
}

.panel.reverse .panel-model {
  animation-delay: 0.6s, 0.3s;
}

.panel.visible .panel-model {
  animation: img-float-soft 4.5s ease-in-out infinite, img-glow-pulse 3s ease-in-out infinite,
    img-enter-pop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.panel:hover .panel-model {
  animation-duration: 2.5s, 1.5s;
  filter: drop-shadow(0 8px 24px rgba(124, 58, 237, 0.3)) drop-shadow(0 4px 16px rgba(232, 120, 0, 0.2)) brightness(1.04);
}

.panel-visual-img .example-box {
  width: 100%;
  position: relative;
  z-index: 1;
}

.panel-form {
  padding: 40px;
}

.panel-form.full {
  max-width: 600px;
  margin: 0 auto;
}

.panel-form h3 {
  font-size: 1.35rem;
  margin-bottom: 8px;
  color: var(--gold-light);
}

.form-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* ===== Example Box ===== */
.example-box {
  width: 100%;
}

.example-title {
  font-size: 1rem;
  color: var(--accent2);
  margin-bottom: 16px;
  font-weight: 600;
  text-shadow: none;
}

.example-box p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.calc-line {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Orbitron', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 20px;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: inset 0 0 20px rgba(124, 58, 237, 0.04);
}

.calc-line .equals {
  color: var(--text-muted);
}

.calc-line .result {
  color: var(--gold);
  font-size: 2rem;
  text-shadow: none;
}

.example-note {
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.rule-item {
  padding: 10px 14px;
  background: rgba(124, 58, 237, 0.05);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-left: 3px solid var(--accent2);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.rule-item:hover {
  border-left-color: var(--gold);
  box-shadow: inset 4px 0 12px rgba(124, 58, 237, 0.08);
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--accent2);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1), var(--neon-pink);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* ===== Resource Section ===== */
.resource-intro {
  padding: 32px;
  margin-bottom: 32px;
  text-align: center;
}

.model-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
  perspective: 1000px;
}

.gallery-item {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
  border: 1px solid rgba(124, 58, 237, 0.15);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85) translateY(20px);
  will-change: transform, opacity, filter;
}

.model-gallery.visible .gallery-item {
  animation: gallery-flip-in 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    img-float-soft 5.5s ease-in-out infinite,
    img-glow-pulse 3.5s ease-in-out infinite;
}

.model-gallery.visible .gallery-item:nth-child(1) { animation-delay: 0.05s, 0s, 0s; }
.model-gallery.visible .gallery-item:nth-child(2) { animation-delay: 0.15s, 0.7s, 0.5s; }
.model-gallery.visible .gallery-item:nth-child(3) { animation-delay: 0.25s, 1.4s, 1s; }
.model-gallery.visible .gallery-item:nth-child(4) { animation-delay: 0.35s, 2.1s, 1.5s; }

.gallery-item:hover {
  transform: translateY(-10px) scale(1.05) rotateY(5deg);
  box-shadow: var(--neon-cyan), 0 16px 40px rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.35);
  animation-play-state: paused;
  filter: brightness(1.05);
}

.resource-lead {
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.resource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.resource-tags span {
  padding: 6px 16px;
  background: rgba(124, 58, 237, 0.07);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--accent2);
  transition: all 0.3s;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.resource-tags span:hover {
  background: rgba(124, 58, 237, 0.14);
  transform: scale(1.08) translateY(-2px);
  box-shadow: var(--neon-pink);
}

.benefit-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.benefit-card {
  padding: 28px;
  transition: transform 0.4s, box-shadow 0.3s;
}

.benefit-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--neon-pink);
}

.benefit-num {
  font-family: 'Orbitron', monospace;
  font-size: 2.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 12px;
  opacity: 0.8;
}

.benefit-card h4 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--accent2);
}

.benefit-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.examples-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.example-card {
  padding: 24px;
  transition: box-shadow 0.3s;
}

.example-card:hover {
  box-shadow: var(--neon-gold);
}

.example-label {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(232, 120, 0, 0.1);
  border: 1px solid rgba(232, 120, 0, 0.3);
  border-radius: 4px;
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.example-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.example-result {
  padding: 12px 16px;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 6px;
  font-size: 0.93rem;
  font-weight: 600;
}

.example-result span {
  color: var(--gold);
  font-family: 'Orbitron', monospace;
  font-size: 1.05rem;
  text-shadow: none;
}

.resource-panel {
  padding: 0;
}

.resource-panel .panel-form.full {
  max-width: none;
  margin: 0;
  width: 100%;
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 1;
  padding: 40px 0;
  border-top: 1px solid rgba(124, 58, 237, 0.12);
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(124, 58, 237, 0.04));
}

.footer p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-note {
  margin-top: 8px;
  font-size: 0.8rem !important;
  opacity: 0.5;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 4px;
  padding: 12px 28px;
  font-size: 0.9rem;
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(16px);
  white-space: nowrap;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.12);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: rgba(233, 30, 122, 0.4);
  color: #c2185b;
  box-shadow: 0 8px 32px rgba(233, 30, 122, 0.15);
}

.toast.success {
  border-color: rgba(124, 58, 237, 0.35);
  color: var(--accent2);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.12);
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(250, 245, 255, 0.65);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  padding: 24px;
}

.modal.show {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  transform: scale(0.85) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--neon-pink), 0 20px 60px rgba(124, 58, 237, 0.15);
}

.modal.show .modal-content {
  transform: scale(1) translateY(0);
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(124, 58, 237, 0.25));
}

.modal-content h3 {
  font-size: 1.35rem;
  margin-bottom: 12px;
  color: var(--accent2);
}

.modal-content p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

/* ===== Scroll Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Image Animations ===== */
@keyframes img-float-soft {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-8px) rotate(0.5deg); }
  66% { transform: translateY(-4px) rotate(-0.5deg); }
}

@keyframes img-glow-pulse {
  0%, 100% {
    filter: drop-shadow(0 4px 12px rgba(124, 58, 237, 0.15))
      drop-shadow(0 0 6px rgba(233, 30, 122, 0.1));
  }
  50% {
    filter: drop-shadow(0 8px 20px rgba(124, 58, 237, 0.25))
      drop-shadow(0 0 16px rgba(233, 30, 122, 0.15));
  }
}

@keyframes img-enter-pop {
  from { opacity: 0; transform: scale(0.88) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes img-shine-sweep {
  0% { left: -100%; opacity: 0; }
  10% { opacity: 1; }
  50% { left: 150%; opacity: 1; }
  60% { opacity: 0; }
  100% { left: 150%; opacity: 0; }
}

@keyframes img-border-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(124, 58, 237, 0.12), inset 0 0 0 1px rgba(124, 58, 237, 0.1); }
  50% { box-shadow: 0 0 24px rgba(233, 30, 122, 0.2), 0 0 12px rgba(124, 58, 237, 0.15); }
}

@keyframes gallery-flip-in {
  from { opacity: 0; transform: scale(0.85) translateY(24px) rotateY(-15deg); }
  to { opacity: 1; transform: scale(1) translateY(0) rotateY(0); }
}

.hero-visual.visible .hero-model,
.hero-visual.visible .hero-model-sm {
  animation: hero-float 3s ease-in-out infinite, img-glow-pulse 3s ease-in-out infinite;
}

.hero-visual.visible .hero-model-sm {
  animation-delay: 0.5s, 0.8s;
}

@media (prefers-reduced-motion: reduce) {
  .hero-model, .hero-model-sm, .intro-img, .intro-img-wrap::before,
  .intro-card.visible .intro-img-wrap, .panel-model, .gallery-item,
  .model-gallery.visible .gallery-item, .bg-aurora, .gradient-text,
  .hero-badge, .btn-glow, .stat-card::before {
    animation: none !important;
  }

  .gallery-item, .model-gallery.visible .gallery-item {
    opacity: 1;
    transform: none;
  }

  .intro-card:hover .intro-img, .gallery-item:hover {
    transform: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav { display: none; }

  .lang-switch {
    margin-left: auto;
  }

  .lang-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .panel { grid-template-columns: 1fr; }
  .panel.reverse { direction: ltr; }

  .panel-visual, .panel-form { padding: 28px; }

  .hero-wrap { flex-direction: column; gap: 24px; }
  .hero-visual { height: 240px; max-width: 280px; }
  .hero-model { width: 200px; max-height: 220px; }
  .hero-model-sm { width: 115px; right: 125px; bottom: 12px; }

  .hero-stats { gap: 12px; }
  .stat-card { padding: 16px 20px; min-width: 100px; }
  .stat-value { font-size: 1.5rem; }

  .model-gallery { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .intro-img-wrap { height: 140px; }
  .panel-model { max-width: 160px; max-height: 200px; }

  .float-nav { right: 0; gap: 6px; }
  .float-nav-btn {
    width: 36px;
    padding: 12px 0;
    font-size: 0.7rem;
    letter-spacing: 1px;
  }
}

/* ===== Form Anchors ===== */
#agent-form-anchor,
#invitee-form-anchor,
#resource-form-anchor {
  scroll-margin-top: 88px;
}

/* ===== Float Nav ===== */
.float-nav {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  transform: translateY(-50%);
}

.float-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 40px;
  padding: 14px 0;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 1px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(180deg, var(--gold) 0%, #d46000 100%);
  border-radius: 8px 0 0 8px;
  box-shadow: -4px 0 20px rgba(232, 120, 0, 0.3), inset 1px 0 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  clip-path: polygon(0 6px, 6px 0, 100% 0, 100% 100%, 0 100%);
}

.float-nav-btn:hover {
  transform: translateX(-4px);
  box-shadow: -8px 0 30px rgba(232, 120, 0, 0.45);
}

.float-nav-btn-accent {
  color: #fff;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent2) 100%);
  box-shadow: -4px 0 20px rgba(124, 58, 237, 0.3);
}

.float-nav-btn-accent:hover {
  box-shadow: -8px 0 30px rgba(124, 58, 237, 0.4);
}

.float-nav-btn.is-active {
  transform: translateX(-6px);
  box-shadow: -10px 0 35px rgba(232, 120, 0, 0.4);
}

.float-nav-btn-accent.is-active {
  box-shadow: -10px 0 35px rgba(124, 58, 237, 0.45);
}

/* English layout tweaks */
html.lang-en .float-nav-btn {
  writing-mode: vertical-lr;
  text-orientation: mixed;
  width: 44px;
  font-size: 0.68rem;
  letter-spacing: 0.3px;
}

html.lang-en .hero-subtitle {
  letter-spacing: 2px;
}

html.lang-en .section-subtitle {
  letter-spacing: 1px;
}
