/* ============================================================
   Nimrav B2B Beauty Ingredients — Global Styles
   Palette: deep gray, navy blue, off-white
   Supports LTR (EN/ZH) and RTL (AR) layouts
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --color-navy: #1a2744;
  --color-navy-light: #243356;
  --color-navy-dark: #111b30;
  --color-gray: #4a5568;
  --color-gray-light: #718096;
  --color-gray-muted: #a0aec0;
  --color-off-white: #f7f5f0;
  --color-white: #ffffff;
  --color-accent: #c8a96e;
  --color-accent-hover: #b8944f;
  --color-border: #e2e0da;
  --color-success: #276749;

  --font-sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Segoe UI", "Tahoma", "Arial", sans-serif;

  --header-height: 72px;
  --header-height-mobile: 60px;
  --container-max: 1200px;
  --radius: 4px;
  --shadow: 0 2px 12px rgba(26, 39, 68, 0.08);
  --transition: 0.2s ease;

  /* H5 touch target minimum (Apple HIG / WCAG) */
  --touch-min: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  /* Prevent horizontal page scroll on mobile */
  max-width: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-gray);
  background-color: var(--color-off-white);
  overflow-x: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
}

/* Lock background scroll when mobile nav is open (no modal popups) */
body.nav-open {
  overflow: hidden;
  touch-action: none;
}

/* Arabic typography */
html[lang="ar"] body {
  font-family: var(--font-ar);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  /* Lightweight loading — use loading="lazy" on markup when images are added */
}

picture,
video,
iframe,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-navy);
  text-decoration: none;
  transition: color var(--transition);
  touch-action: manipulation;
}

a:hover {
  color: var(--color-accent);
}

ul {
  list-style: none;
}

h1, h2, h3, h4 {
  color: var(--color-navy);
  line-height: 1.3;
  font-weight: 600;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p {
  margin-bottom: 1rem;
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: max(24px, var(--safe-left));
  padding-right: max(24px, var(--safe-right));
}

.section {
  padding: 72px 0;
}

.section-alt {
  background-color: var(--color-white);
}

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

.section-header h2 {
  margin-bottom: 12px;
}

.section-header p {
  color: var(--color-gray-light);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-align: center;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.btn-primary {
  background-color: var(--color-navy);
  color: var(--color-white);
  border-color: var(--color-navy);
}

.btn-primary:hover {
  background-color: var(--color-navy-light);
  border-color: var(--color-navy-light);
  color: var(--color-white);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-navy);
  border-color: var(--color-navy);
}

.btn-outline:hover {
  background-color: var(--color-navy);
  color: var(--color-white);
}

.btn-outline-dark {
  background-color: transparent;
  color: var(--color-navy);
  border-color: var(--color-navy);
}

.btn-outline-dark:hover {
  background-color: var(--color-navy);
  color: var(--color-white);
}

.btn-light {
  background-color: var(--color-white);
  color: var(--color-navy);
  border-color: var(--color-white);
}

.btn-light:hover {
  background-color: var(--color-off-white);
  color: var(--color-navy);
}

.btn-full {
  width: 100%;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  padding-top: var(--safe-top);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  order: 1;
  text-decoration: none;
  cursor: pointer;
  min-height: var(--touch-min);
}

.logo:hover .logo-img {
  opacity: 0.82;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  text-decoration: none;
  cursor: pointer;
}

.footer-logo:hover .logo-img--footer {
  opacity: 0.88;
}

.logo-img--footer {
  height: 36px;
  max-width: 168px;
  filter: brightness(0) invert(1);
  transition: opacity 0.2s ease;
}

.logo-img {
  display: block;
  height: 34px;
  width: auto;
  max-width: min(168px, 42vw);
  object-fit: contain;
  image-rendering: auto;
  background: transparent;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Desktop: center nav between logo and lang switcher */
.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  order: 2;
}

.lang-switcher {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  order: 3;
}

.nav-toggle {
  order: 4;
}

.nav-backdrop {
  order: 5;
}

/* Navigation list */
.nav-list {
  display: flex;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-gray);
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  touch-action: manipulation;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-navy);
  background-color: var(--color-off-white);
}

/* Language switcher buttons */
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-min);
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-gray-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  touch-action: manipulation;
}

.lang-btn:hover {
  border-color: var(--color-navy);
  color: var(--color-navy);
}

.lang-btn.active {
  background-color: var(--color-navy);
  color: var(--color-white);
  border-color: var(--color-navy);
}

/* Mobile nav toggle — 44×44px minimum touch area */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: var(--touch-min);
  height: var(--touch-min);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius);
  touch-action: manipulation;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-navy);
  transition: transform var(--transition), opacity var(--transition);
}

/* Hamburger → X animation when open */
.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);
}

/* Mobile nav backdrop — inline overlay, not a blocking popup */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: calc(var(--header-height) + var(--safe-top));
  background: rgba(26, 39, 68, 0.35);
  z-index: 98;
  touch-action: none;
}

.nav-backdrop.visible {
  display: block;
}

/* --- Hero --- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-navy-dark) 0%, var(--color-navy) 60%, var(--color-navy-light) 100%);
  color: var(--color-white);
  padding: 100px 0 88px;
  min-height: clamp(520px, 85vh, 720px);
  display: flex;
  align-items: center;
}

/* MotionSites Aetheris Voyage — cinematic ambient media stack */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Animated gradient mesh — primary dynamic layer (works on index.html without video) */
.hero-mesh {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(200, 169, 110, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(36, 51, 86, 0.9) 0%, transparent 45%),
    radial-gradient(ellipse at 60% 80%, rgba(26, 39, 68, 0.85) 0%, transparent 50%),
    linear-gradient(135deg, #111b30 0%, #1a2744 40%, #243356 100%);
  background-size: 100% 100%;
  animation: heroMeshShift 14s ease-in-out infinite alternate;
}

@keyframes heroMeshShift {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { transform: translate(-3%, -2%) rotate(2deg) scale(1.04); }
}

/* Rotating light beam — subtle cinematic sweep */
.hero-beam {
  position: absolute;
  top: -40%;
  left: -20%;
  width: 60%;
  height: 180%;
  background: linear-gradient(105deg, transparent 40%, rgba(200, 169, 110, 0.07) 50%, transparent 60%);
  transform: rotate(-15deg);
  animation: heroBeamSweep 10s ease-in-out infinite;
}

@keyframes heroBeamSweep {
  0%, 100% { transform: rotate(-15deg) translateX(-10%); opacity: 0.5; }
  50% { transform: rotate(-15deg) translateX(120%); opacity: 1; }
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.75;
}

/* Slow-drifting aurora orbs — navy + gold */
.hero-aurora {
  position: absolute;
  inset: 0;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
  animation: auroraDrift 18s ease-in-out infinite;
}

.aurora-blob-1 {
  width: min(60vw, 560px);
  height: min(60vw, 560px);
  background: radial-gradient(circle, rgba(200, 169, 110, 0.45) 0%, transparent 68%);
  top: -15%;
  right: -5%;
}

.aurora-blob-2 {
  width: min(50vw, 480px);
  height: min(50vw, 480px);
  background: radial-gradient(circle, rgba(56, 78, 120, 0.6) 0%, transparent 68%);
  bottom: -18%;
  left: -10%;
  animation-delay: -6s;
  animation-duration: 22s;
}

.aurora-blob-3 {
  width: min(40vw, 380px);
  height: min(40vw, 380px);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 68%);
  top: 30%;
  left: 38%;
  animation-delay: -12s;
  animation-duration: 16s;
}

.aurora-blob-4 {
  width: min(35vw, 320px);
  height: min(35vw, 320px);
  background: radial-gradient(circle, rgba(200, 169, 110, 0.22) 0%, transparent 68%);
  bottom: 10%;
  right: 15%;
  animation-delay: -9s;
  animation-duration: 20s;
}

@keyframes auroraDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(4%, 6%) scale(1.1); }
  66% { transform: translate(-5%, 3%) scale(0.92); }
}

/* Subtle film grain — adds depth without heavy assets */
.hero-grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(17, 27, 48, 0.72) 0%, rgba(26, 39, 68, 0.55) 50%, rgba(36, 51, 86, 0.68) 100%),
    linear-gradient(to top, rgba(17, 27, 48, 0.45) 0%, transparent 35%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-content {
  max-width: 680px;
}

/* MotionSites Visual Hero — staggered fade-up reveal */
.hero--motion .hero-reveal > * {
  opacity: 0;
  transform: translateY(28px);
  animation: heroFadeUp 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero--motion .hero-reveal > *:nth-child(1) { animation-delay: 0.12s; }
.hero--motion .hero-reveal > *:nth-child(2) { animation-delay: 0.28s; }
.hero--motion .hero-reveal > *:nth-child(3) { animation-delay: 0.44s; }
.hero--motion .hero-reveal > *:nth-child(4) { animation-delay: 0.6s; }

@keyframes heroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll hint — links to scrolly narrative */
.hero-scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color var(--transition);
}

.hero-scroll-hint:hover {
  color: var(--color-accent);
}

.hero-scroll-text {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-scroll-line {
  display: block;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--color-accent));
  animation: scrollPulse 2.4s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.6); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 0.9; }
}

/* Home cards — scroll reveal (Visual Hero pattern) */
.card-grid--reveal .card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease, box-shadow var(--transition);
}

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

.card-grid--reveal .card:nth-child(1) { transition-delay: 0.05s; }
.card-grid--reveal .card:nth-child(2) { transition-delay: 0.1s; }
.card-grid--reveal .card:nth-child(3) { transition-delay: 0.15s; }
.card-grid--reveal .card:nth-child(4) { transition-delay: 0.2s; }
.card-grid--reveal .card:nth-child(5) { transition-delay: 0.25s; }
.card-grid--reveal .card:nth-child(6) { transition-delay: 0.3s; }

/* Disable motion effects when user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero--motion .hero-reveal > *,
  .card-grid--reveal .card {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }

  .aurora-blob,
  .hero-scroll-line,
  .hero-mesh,
  .hero-beam,
  .hero-badge {
    animation: none;
  }

  .hero-canvas {
    display: none;
  }
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background-color: rgba(200, 169, 110, 0.15);
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(200, 169, 110, 0.25);
  animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(200, 169, 110, 0); }
  50% { box-shadow: 0 0 20px rgba(200, 169, 110, 0.2); }
}

.hero h1 {
  color: var(--color-white);
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.hero-desc {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero .btn-outline {
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.5);
}

.hero .btn-outline:hover {
  background-color: var(--color-white);
  color: var(--color-navy);
  border-color: var(--color-white);
}

/* --- Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

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

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow var(--transition);
}

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

.card-icon {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.card h3 {
  margin-bottom: 10px;
}

.card p {
  font-size: 0.92rem;
  color: var(--color-gray-light);
  margin-bottom: 16px;
}

.card-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-navy);
}

.card-highlight {
  border-top: 3px solid var(--color-accent);
}

/* --- Features --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.feature h4 {
  margin-bottom: 8px;
}

.feature p {
  font-size: 0.92rem;
  color: var(--color-gray-light);
  margin-bottom: 0;
}

/* --- CTA Banner --- */
.cta-banner {
  background-color: var(--color-navy);
  padding: 64px 0;
  text-align: center;
}

.cta-inner h2 {
  color: var(--color-white);
  margin-bottom: 12px;
}

.cta-inner p {
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 28px;
}

/* --- Page Header --- */
.page-header {
  background: linear-gradient(135deg, var(--color-navy-dark), var(--color-navy));
  padding: 56px 0 48px;
  text-align: center;
}

.page-header h1 {
  color: var(--color-white);
  margin-bottom: 10px;
}

.page-header p {
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Products --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
  /* Contained horizontal scroll on small screens — no page-level overflow */
  max-width: 100%;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-gray);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
  touch-action: manipulation;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--color-navy);
  color: var(--color-white);
  border-color: var(--color-navy);
}

.product-count {
  margin: -20px 0 28px;
  font-size: 0.85rem;
  color: var(--color-gray-light);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.product-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.product-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.product-desc {
  font-size: 0.88rem;
  color: var(--color-gray-light);
  flex: 1;
  margin-bottom: 16px;
}

.product-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.product-meta span {
  color: var(--color-gray-light);
}

.product-meta strong {
  color: var(--color-navy);
}

.coa-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--touch-min);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: auto;
  touch-action: manipulation;
}

.coa-link:hover {
  color: var(--color-accent-hover);
}

.loading-text,
.empty-text {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-gray-muted);
  padding: 48px 0;
}

.info-box {
  background: var(--color-off-white);
  border-left: 4px solid var(--color-accent);
  padding: 24px 28px;
  border-radius: var(--radius);
}

html[dir="rtl"] .info-box {
  border-left: none;
  border-right: 4px solid var(--color-accent);
}

.info-box h3 {
  margin-bottom: 8px;
}

.info-box p {
  font-size: 0.92rem;
  color: var(--color-gray-light);
  margin-bottom: 0;
}

/* --- Split Layout --- */
.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.split-content h2 {
  margin-bottom: 16px;
}

.split-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-block {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-navy);
}

.stat-label {
  font-size: 0.88rem;
  color: var(--color-gray-light);
}

.about-visual .about-value {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
}

.about-value h4 {
  margin-bottom: 6px;
}

.about-value p {
  font-size: 0.88rem;
  color: var(--color-gray-light);
  margin-bottom: 0;
}

/* --- Process Steps --- */
.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.step {
  text-align: center;
  padding: 24px 16px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--color-navy);
  color: var(--color-accent);
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 14px;
}

.step h4 {
  margin-bottom: 8px;
}

.step p {
  font-size: 0.88rem;
  color: var(--color-gray-light);
  margin-bottom: 0;
}

/* --- Contact --- */
.contact-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-form-wrap h2,
.contact-info h2 {
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  min-height: var(--touch-min);
  padding: 12px 14px;
  font-size: 16px; /* ≥16px prevents iOS auto-zoom on focus */
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-gray);
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-navy);
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.5;
}

/* Mobile form wrapper — full-width inputs within container */
.contact-form-wrap {
  width: 100%;
  min-width: 0;
}

.inquiry-form {
  width: 100%;
}

.form-note {
  font-size: 0.82rem;
  color: var(--color-gray-muted);
  margin-top: 12px;
  margin-bottom: 0;
}

.form-success {
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

.form-success h3 {
  color: var(--color-success);
  margin-bottom: 8px;
}

.contact-info {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
}

.info-item {
  margin-bottom: 24px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-item h4 {
  margin-bottom: 4px;
}

.info-item h4 a {
  color: inherit;
  text-decoration: none;
}

.info-item h4 a:hover {
  color: var(--color-accent);
}

.info-item p {
  font-size: 0.92rem;
  color: var(--color-gray-light);
  margin-bottom: 0;
}

.contact-info a {
  color: var(--color-navy);
  text-decoration: none;
}

.contact-info a:hover {
  color: var(--color-accent);
}

/* --- Footer --- */
.site-footer {
  background: linear-gradient(180deg, #111b30 0%, var(--color-navy-dark) 100%);
  color: rgba(255, 255, 255, 0.72);
  padding-bottom: var(--safe-bottom);
  border-top: 1px solid rgba(200, 169, 110, 0.12);
}

.footer-main {
  padding: clamp(56px, 8vw, 80px) 0 clamp(40px, 6vw, 56px);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) 1fr 1fr;
  gap: clamp(40px, 6vw, 72px);
  align-items: start;
}

.footer-brand {
  max-width: 22rem;
}

.footer-tagline {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.58);
  letter-spacing: 0.01em;
}

.footer-col-title {
  margin: 0 0 1.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.footer-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-meta-label {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.45);
}

.footer-meta-value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  transition: color 0.2s ease;
}

a.footer-meta-value:hover {
  color: var(--color-accent);
}

.footer-meta-value--text {
  font-weight: 400;
  line-height: 1.5;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-nav a {
  display: inline-block;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 0.125rem 0;
}

.footer-nav a:hover {
  color: #fff;
}

.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
}

.footer-legal-inner {
  padding: 1.5rem 0 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-disclaimer {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.38);
  max-width: 52rem;
}

.footer-copy {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.45);
}

/* --- RTL Overrides --- */
html[dir="rtl"] {
  text-align: right;
}

html[dir="rtl"] .card-link::after {
  content: " ←";
}

html[dir="rtl"] .coa-link,
html[dir="rtl"] .card-link {
  direction: rtl;
}

/* RTL mobile: nav, forms, cards align right */
html[dir="rtl"] .nav-list,
html[dir="rtl"] .product-card,
html[dir="rtl"] .product-meta,
html[dir="rtl"] .contact-form-wrap,
html[dir="rtl"] .form-group label,
html[dir="rtl"] .info-box,
html[dir="rtl"] .card,
html[dir="rtl"] .feature {
  text-align: right;
}

html[dir="rtl"] .footer-brand,
html[dir="rtl"] .footer-meta,
html[dir="rtl"] .footer-nav {
  text-align: right;
}

html[dir="rtl"] .footer-nav a:hover {
  transform: translateX(-2px);
}

html[dir="ltr"] .footer-nav a:hover {
  transform: translateX(2px);
}

html[dir="rtl"] .filter-bar {
  direction: rtl;
}

html[dir="rtl"] .hero-actions .btn,
html[dir="rtl"] .hero-actions {
  direction: rtl;
}

/* --- Responsive: Tablet (touch-friendly) --- */
@media (max-width: 1024px) {
  .card-grid,
  .card-grid-3,
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .process-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-layout,
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px 48px;
  }

  .footer-brand {
    grid-column: 1 / -1;
    max-width: none;
  }

  .section {
    padding: 56px 0;
  }
}

/* --- Responsive: Mobile H5 (≤768px) --- */
@media (max-width: 768px) {
  :root {
    --header-height: var(--header-height-mobile);
  }

  h1 { font-size: clamp(1.5rem, 5vw, 1.75rem); }
  h2 { font-size: clamp(1.25rem, 4vw, 1.4rem); }
  h3 { font-size: clamp(1.05rem, 3.5vw, 1.15rem); }

  .hero {
    padding: clamp(48px, 12vw, 64px) 0 clamp(56px, 10vw, 72px);
    min-height: clamp(460px, 78vh, 600px);
  }

  .hero-scroll-hint {
    bottom: 16px;
  }

  /* Mobile: lighter blur, keep aurora + mesh animation visible */
  .aurora-blob {
    filter: blur(50px);
  }

  .hero-canvas {
    opacity: 0.45;
  }

  .hero h1 {
    font-size: clamp(1.6rem, 6vw, 1.85rem);
  }

  .hero-desc {
    font-size: clamp(0.95rem, 3.5vw, 1.05rem);
  }

  .section {
    padding: clamp(36px, 8vw, 48px) 0;
  }

  .section-header {
    margin-bottom: clamp(28px, 6vw, 36px);
  }

  .card {
    padding: clamp(20px, 5vw, 28px);
  }

  .card-grid,
  .card-grid-2,
  .card-grid-3,
  .product-grid,
  .features-grid,
  .process-steps {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Mobile header: logo | lang | hamburger */
  .header-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    height: var(--header-height-mobile);
  }

  .logo {
    flex: 1;
    min-width: 0;
  }

  .lang-switcher {
    flex-shrink: 0;
    gap: 4px;
  }

  .lang-btn {
    min-width: 40px;
    min-height: var(--touch-min);
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .nav-toggle {
    display: flex;
  }

  /* Slide-down nav panel — not a popup modal */
  .main-nav {
    position: fixed;
    top: calc(var(--header-height-mobile) + var(--safe-top));
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--header-height-mobile) - var(--safe-top));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 8px max(16px, var(--safe-left)) 16px max(16px, var(--safe-right));
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
    z-index: 99;
    box-shadow: var(--shadow);
  }

  html[dir="rtl"] .main-nav {
    left: 0;
    right: 0;
    text-align: right;
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .nav-link {
    width: 100%;
    padding: 12px 8px;
    font-size: 1rem;
  }

  html[dir="rtl"] .nav-link {
    justify-content: flex-start;
  }

  .nav-backdrop {
    top: calc(var(--header-height-mobile) + var(--safe-top));
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-brand {
    grid-column: auto;
    padding-bottom: 0.5rem;
  }

  .footer-main {
    padding-top: 48px;
    padding-bottom: 36px;
  }

  .footer-legal-inner {
    padding: 1.25rem 0 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  /* Filter bar: horizontal scroll inside container, no page overflow */
  .filter-bar {
    flex-wrap: wrap;
    overflow: visible;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
    gap: 8px;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    font-size: 0.82rem;
    padding: 10px 14px;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .page-header {
    padding: clamp(40px, 10vw, 56px) 0 clamp(32px, 8vw, 48px);
  }

  .contact-info {
    padding: clamp(20px, 5vw, 32px);
  }

  .contact-layout {
    gap: 32px;
  }

  /* Prevent any child from causing horizontal scroll */
  .site-main,
  .hero-inner,
  .split-layout,
  .cta-inner,
  .product-grid,
  .card-grid {
    min-width: 0;
    max-width: 100%;
  }
}

/* --- Small phones --- */
@media (max-width: 480px) {
  .container {
    padding-left: max(16px, var(--safe-left));
    padding-right: max(16px, var(--safe-right));
  }

  .logo-img {
    height: 30px;
    max-width: 132px;
  }

  .lang-btn {
    min-width: 38px;
    padding: 8px 8px;
    font-size: 0.72rem;
  }
}

/* --- Landscape phones & small tablets --- */
@media (max-width: 896px) and (orientation: landscape) {
  .hero {
    padding: 32px 0 28px;
  }

  .hero h1 {
    font-size: clamp(1.4rem, 4vw, 1.65rem);
  }

  .section {
    padding: 32px 0;
  }

  .main-nav {
    max-height: calc(100vh - var(--header-height-mobile) - var(--safe-top));
  }

  .page-header {
    padding: 28px 0 24px;
  }

  /* Two-column cards in landscape for better space use */
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

/* --- Tablet portrait (768–1024) touch polish --- */
@media (min-width: 769px) and (max-width: 1024px) {
  .nav-link,
  .lang-btn,
  .filter-btn,
  .btn {
    min-height: var(--touch-min);
  }
}

/* --- Reduced motion: no heavy animations for performance --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Cinematic hero — emblem + scroll fade reveal
   ============================================================ */

.hero-cinematic {
  position: relative;
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  color: var(--color-white);
}

.hero-cinematic__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: none;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 6px 16px 10px;
  gap: 8px;
}

.hero-cinematic__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-cinematic__bg .hero-canvas {
  opacity: 0.55;
  mix-blend-mode: screen;
}

.hero-cinematic__emblem {
  flex-shrink: 0;
  width: min(34vmin, 210px);
  height: min(34vmin, 210px);
  animation: emblemFloat 8s ease-in-out infinite;
  will-change: transform;
}

.hero-cinematic__copy {
  text-align: center;
  max-width: 580px;
  animation: heroCopyIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

@keyframes heroCopyIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.hero-cinematic__desc {
  font-size: 1.08rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 14px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

.hero-cinematic .hero-actions {
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-cinematic .btn-outline-dark {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.42);
}

.hero-cinematic .btn-outline-dark:hover {
  background: #fff;
  color: var(--color-navy);
}

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

.hero-emblem {
  width: 100%;
  height: 100%;
}

.emblem-diamond {
  fill: none;
  stroke: rgba(200, 169, 110, 0.28);
  stroke-width: 0.8;
}

.emblem-link {
  stroke: rgba(200, 169, 110, 0.2);
  stroke-width: 0.6;
}

.emblem-orbit {
  fill: none;
  stroke: rgba(100, 200, 170, 0.15);
  stroke-width: 0.5;
  stroke-dasharray: 4 8;
  animation: orbitSpin 24s linear infinite;
  transform-origin: 200px 200px;
}

@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}

.emblem-bond {
  stroke: rgba(120, 210, 180, 0.35);
  stroke-width: 0.8;
}

.emblem-node {
  fill: rgba(200, 169, 110, 0.85);
}

.hero-cinematic .hero-scroll-hint {
  position: static;
  transform: none;
  margin-top: 8px;
  margin-bottom: 0;
  gap: 4px;
  color: rgba(200, 169, 110, 0.55);
}

.hero-cinematic .hero-scroll-line {
  display: block;
  height: 20px;
}

.hero-cinematic.is-scrolled .hero-scroll-hint {
  opacity: 0.4;
  transition: opacity 0.4s ease;
}

/* Tech lab atmosphere (hero + CTA bookend) */
.tech-scene {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, #141e32 0%, #0a0f18 45%, #060a10 100%);
  overflow: hidden;
}

.tech-ambient {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.tech-ambient--purple {
  width: 50%;
  height: 45%;
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(100, 80, 160, 0.22) 0%, transparent 70%);
  animation: ambientDrift 12s ease-in-out infinite;
}

.tech-ambient--teal {
  width: 45%;
  height: 40%;
  bottom: 5%;
  right: 10%;
  background: radial-gradient(circle, rgba(70, 180, 150, 0.18) 0%, transparent 68%);
  animation: ambientDrift 10s ease-in-out infinite reverse;
}

@keyframes ambientDrift {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  50% { transform: translate(3%, 2%) scale(1.08); opacity: 1; }
}

.tech-grid {
  position: absolute;
  inset: -40%;
  width: 180%;
  height: 180%;
  background-image:
    linear-gradient(rgba(200, 169, 110, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 169, 110, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(800px) rotateX(62deg) translateY(-6%);
  transform-origin: center 85%;
  opacity: 0.35;
  animation: gridFlow 20s linear infinite;
}

@keyframes gridFlow {
  to { background-position: 0 64px; }
}

.tech-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 44%, transparent 15%, rgba(6, 10, 16, 0.82) 100%);
}

/* Homepage — solid dark bridge (no white fade band on scroll) */
.site-main:has(.hero-cinematic) {
  background-color: #0c1520;
}

.home-body {
  position: relative;
  z-index: 1;
  background: #0c1520;
}

.fade-section {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-section.is-visible {
  opacity: 1;
  transform: none;
}

.story-stats {
  background: transparent;
  border-bottom: 1px solid rgba(200, 169, 110, 0.12);
  padding: 56px 0;
}

.story-stats-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}

.story-stat {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(200, 169, 110, 0.15);
  border-radius: 6px;
  padding: 24px 16px;
  backdrop-filter: blur(8px);
}

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

.story-stat-num {
  display: block;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.2;
}

.story-stat-label {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
}

/* CTA bookend — echoes hero tech scene */
.cta-banner--echo {
  position: relative;
  overflow: hidden;
  background: transparent;
}

.tech-scene--echo {
  opacity: 0.55;
}

.cta-banner--echo .cta-inner {
  position: relative;
  z-index: 1;
}

html[dir="rtl"] .hero-cinematic__copy {
  text-align: right;
}

html[dir="rtl"] .hero-cinematic .hero-actions {
  direction: rtl;
}

@media (min-width: 769px) {
  .hero-cinematic {
    min-height: calc(100vh - var(--header-height) - var(--safe-top));
  }

  .hero-cinematic__inner {
    justify-content: center;
    flex: 1;
    padding: clamp(16px, 3vh, 32px) 24px clamp(24px, 4vh, 40px);
    gap: clamp(12px, 2.5vh, 28px);
  }

  .hero-cinematic__emblem {
    width: min(50vmin, 360px);
    height: min(50vmin, 360px);
  }

  .hero-cinematic__desc {
    font-size: clamp(0.88rem, 2.1vw, 1.06rem);
    line-height: 1.72;
    margin-bottom: clamp(18px, 3vh, 26px);
  }

  .hero-cinematic .hero-scroll-hint {
    margin-top: clamp(16px, 3vh, 28px);
  }

  .hero-cinematic .hero-scroll-line {
    display: block;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-cinematic__emblem { animation: none; }
  .hero-cinematic__copy { animation: none; }
  .emblem-orbit { animation: none; }
  .tech-ambient, .tech-grid { animation: none; }
  .fade-section { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   Scroll Narrative (Scrollytelling) — index.html only
   ============================================================ */

/* Scrolly container */
.scrolly {
  position: relative;
  background: var(--color-off-white);
  padding-bottom: 80px;
}

.scrolly-intro {
  text-align: center;
  padding: 80px 24px 48px;
  max-width: 640px;
}

.scrolly-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.scrolly-intro h2 {
  margin-bottom: 16px;
}

.scrolly-intro p {
  color: var(--color-gray-light);
  margin-bottom: 0;
}

/* Vertical progress bar */
.scrolly-progress {
  position: absolute;
  left: max(12px, var(--safe-left));
  top: 280px;
  bottom: 80px;
  width: 2px;
  background: var(--color-border);
  z-index: 2;
  display: none;
}

.scrolly-progress-fill {
  width: 100%;
  height: 0%;
  background: var(--color-accent);
  transition: height 0.15s ease-out;
}

/* Story chapters — fixed alternating rows (visual + copy) */
.scrolly-track {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 max(24px, var(--safe-right)) 48px max(24px, var(--safe-left));
}

.scrolly-narrative {
  padding-bottom: 0;
}

.scrolly-step {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding: clamp(56px, 8vh, 88px) 0;
  border-bottom: 1px solid var(--color-border);
}

.scrolly-step:last-child {
  border-bottom: none;
}

.scrolly-step-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Odd: visual left, copy right */
.scrolly-step:nth-child(odd) .scrolly-step-visual {
  order: 1;
}

.scrolly-step:nth-child(odd) .scrolly-step-body {
  order: 2;
}

/* Even: copy left, visual right */
.scrolly-step:nth-child(even) .scrolly-step-visual {
  order: 2;
}

.scrolly-step:nth-child(even) .scrolly-step-body {
  order: 1;
  align-items: flex-end;
  text-align: right;
}

.scrolly-step:nth-child(even) .scrolly-tags {
  justify-content: flex-end;
}

.scrolly-step:nth-child(even) .scrolly-step-actions {
  justify-content: flex-end;
}

.scrolly-step-visual {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(26, 39, 68, 0.14);
}

.scrolly-step-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Chapter nav dots */
.scrolly-nav {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 40px;
}

.scrolly-nav-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  min-height: 10px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-white);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.scrolly-nav-dot.is-active {
  background: var(--color-navy);
  border-color: var(--color-navy);
  transform: scale(1.2);
}

/* Narrative copy */
.scrolly-chapter {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.scrolly-step h3 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  margin-bottom: 16px;
  max-width: 520px;
}

.scrolly-step p {
  font-size: 1.02rem;
  color: var(--color-gray-light);
  max-width: 520px;
  line-height: 1.7;
}

.scrolly-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 16px;
}

.scrolly-tags li {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-navy);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 20px;
}

.scrolly-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-navy);
}

.scrolly-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* --- Abstract visual art per chapter --- */
.scrolly-art {
  position: relative;
  width: 70%;
  height: 70%;
}

/* Ch1: Market — orbital rings */
.scrolly-art--market .art-ring {
  position: absolute;
  border: 1px solid rgba(200, 169, 110, 0.35);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.art-ring-1 { width: 80%; height: 80%; animation: artSpin 24s linear infinite; }
.art-ring-2 { width: 55%; height: 55%; animation: artSpin 18s linear infinite reverse; }

.scrolly-art--market .art-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
}

.art-dot-center { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 12px; height: 12px; }
.art-dot-1 { top: 12%; left: 50%; transform: translateX(-50%); }
.art-dot-2 { bottom: 18%; left: 20%; }
.art-dot-3 { bottom: 22%; right: 18%; }

@keyframes artSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Ch2: Molecule */
.scrolly-art--molecule .mol-node {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(200, 169, 110, 0.4);
}

.mol-n1 { top: 20%; left: 30%; animation: molFloat 4s ease-in-out infinite; }
.mol-n2 { top: 35%; right: 22%; animation: molFloat 5s ease-in-out infinite -1s; }
.mol-n3 { bottom: 28%; left: 25%; animation: molFloat 4.5s ease-in-out infinite -2s; }
.mol-n4 { bottom: 22%; right: 28%; animation: molFloat 3.8s ease-in-out infinite -0.5s; }
.mol-n5 { top: 48%; left: 48%; width: 18px; height: 18px; animation: molFloat 6s ease-in-out infinite; }

.scrolly-art--molecule .mol-line {
  position: absolute;
  height: 1px;
  background: rgba(200, 169, 110, 0.35);
  transform-origin: left center;
}

.mol-l1 { width: 35%; top: 28%; left: 32%; transform: rotate(25deg); }
.mol-l2 { width: 40%; top: 42%; left: 28%; transform: rotate(-15deg); }
.mol-l3 { width: 30%; bottom: 32%; left: 30%; transform: rotate(40deg); }

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

/* Ch3: Quality — COA badge */
.scrolly-art--quality .qual-badge {
  position: absolute;
  inset: 18%;
  border: 2px solid rgba(200, 169, 110, 0.4);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.scrolly-art--quality .qual-line {
  position: absolute;
  left: 24%;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1px;
}

.qual-line-1 { top: 32%; width: 52%; }
.qual-line-2 { top: 44%; width: 40%; }
.qual-line-3 { top: 56%; width: 48%; }

.scrolly-art--quality .qual-check {
  position: absolute;
  bottom: 28%;
  right: 26%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
  border-radius: 50%;
}

/* Ch4: Region — route map */
.scrolly-art--region .route-node {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 50%;
  z-index: 2;
}

.route-n1 { top: 25%; left: 20%; }
.route-n2 { top: 45%; right: 22%; }
.route-n3 { bottom: 22%; left: 35%; }

.scrolly-art--region .route-path {
  position: absolute;
  inset: 15%;
  border: 1px dashed rgba(200, 169, 110, 0.35);
  border-radius: 40% 60% 50% 50%;
  animation: routePulse 3s ease-in-out infinite;
}

@keyframes routePulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Ch5: Partner — stacked blocks */
.scrolly-art--partner .partner-block {
  position: absolute;
  background: rgba(200, 169, 110, 0.12);
  border: 1px solid rgba(200, 169, 110, 0.3);
  border-radius: 4px;
}

.partner-b1 { width: 55%; height: 18%; top: 22%; left: 18%; animation: partnerSlide 5s ease-in-out infinite; }
.partner-b2 { width: 48%; height: 18%; top: 44%; left: 28%; animation: partnerSlide 5s ease-in-out infinite -1.5s; }
.partner-b3 { width: 42%; height: 18%; top: 66%; left: 22%; animation: partnerSlide 5s ease-in-out infinite -3s; }

@keyframes partnerSlide {
  0%, 100% { transform: translateX(0); opacity: 0.7; }
  50% { transform: translateX(8px); opacity: 1; }
}

/* RTL scrolly */
html[dir="rtl"] .scrolly-track {
  direction: rtl;
}

html[dir="rtl"] .scrolly-intro {
  text-align: right;
}

html[dir="rtl"] .scrolly-step:nth-child(odd) .scrolly-step-body {
  align-items: flex-end;
  text-align: right;
}

html[dir="rtl"] .scrolly-step:nth-child(even) .scrolly-step-body {
  align-items: flex-start;
  text-align: left;
}

html[dir="rtl"] .scrolly-step:nth-child(odd) .scrolly-tags {
  justify-content: flex-end;
}

html[dir="rtl"] .scrolly-step:nth-child(even) .scrolly-tags {
  justify-content: flex-start;
}

html[dir="rtl"] .scrolly-progress {
  left: auto;
  right: max(12px, var(--safe-right));
}

html[dir="rtl"] .scrolly-tags {
  direction: rtl;
}

/* Tablet */
@media (min-width: 1025px) {
  .scrolly-progress {
    display: block;
  }
}

@media (max-width: 1024px) {
  .story-stats-inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .scrolly-step {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 48px 0;
  }

  .scrolly-step-visual,
  .scrolly-step-body {
    order: unset !important;
    text-align: left;
    align-items: flex-start !important;
  }

  .scrolly-step:nth-child(even) .scrolly-tags,
  .scrolly-step:nth-child(even) .scrolly-step-actions {
    justify-content: flex-start;
  }

  .scrolly-step-visual {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .story-stats {
    padding: 36px 0;
  }

  .story-stats-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .scrolly-intro {
    padding: 56px 16px 32px;
  }

  .scrolly-step h3 {
    font-size: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .art-ring-1, .art-ring-2,
  .mol-n1, .mol-n2, .mol-n3, .mol-n4, .mol-n5,
  .route-path, .partner-b1, .partner-b2, .partner-b3 {
    animation: none;
  }
}
