/* ==========================================================================
   SUNFUNCENT STUDIO // Obsidian-Gold Core Design System
   ========================================================================== */

:root {
  --bg-obsidian: #090b10;
  --bg-elevated: rgba(12, 15, 23, 0.78);
  --hairline: rgba(255, 255, 255, 0.06);
  --hairline-strong: rgba(255, 255, 255, 0.14);
  --gold-1: #d4a34a;
  --gold-2: #f3d9a4;
  --gold-3: #fff7e6;
  --gold-grad: linear-gradient(110deg, #d4a34a 0%, #f3d9a4 42%, #fff7e6 52%, #d4a34a 100%);
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: "Cinzel Decorative", "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html {
  background: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--bg-obsidian);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

body.is-embedded .top-nav { display: none; }
body.is-embedded .hero-section { padding-top: 28px; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-obsidian); }
::-webkit-scrollbar-thumb { background: rgba(212, 163, 74, 0.32); }

#sfc-ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.rs-cursor-mist {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle, rgba(212, 163, 74, 0.055) 0%, transparent 68%);
  transform: translate3d(-999px, -999px, 0);
}

#pageWrapper {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Header */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 500;
  height: 60px;
  padding: 0 clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(9, 11, 16, 0.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--hairline);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold-2);
  white-space: nowrap;
}
.brand-logo svg { color: var(--gold-1); flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a,
.nav-member-btn {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease-apple), border-color 0.25s var(--ease-apple);
  white-space: nowrap;
}
.nav-links a:hover,
.nav-member-btn:hover,
.nav-member-btn.is-active {
  color: var(--gold-2);
  border-bottom-color: var(--gold-1);
}

.nav-right { display: flex; align-items: center; gap: 10px; }

.rs-lang-switcher {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
}
.rs-lang-btn {
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  border-radius: 2px;
  transition: background 0.2s ease, color 0.2s ease;
}
.rs-lang-btn.is-active {
  background: rgba(212, 163, 74, 0.18);
  color: var(--gold-2);
}

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  color: var(--text-primary);
}

/* Buttons */
.btn-gold, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background 0.25s var(--ease-apple), border-color 0.25s var(--ease-apple), color 0.25s ease;
}
.btn-gold {
  border: 1px solid rgba(212, 163, 74, 0.55);
  background: rgba(212, 163, 74, 0.16);
  color: var(--gold-2);
}
.btn-gold:hover { background: rgba(212, 163, 74, 0.28); border-color: var(--gold-1); color: var(--gold-3); }
.btn-ghost {
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}
.btn-ghost:hover { border-color: var(--gold-1); color: var(--gold-2); }

/* Hero */
.hero-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 72px) clamp(16px, 4vw, 48px) 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

.hero-visual-col { position: relative; min-width: 0; }
.hero-tilt-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-top: 1px solid rgba(212, 163, 74, 0.35);
  border-radius: 2px;
  background: #0b0e14;
  transform-style: preserve-3d;
  transition: transform 220ms var(--ease-apple);
}
.hero-tilt-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(212, 163, 74, 0.14);
  background:
    radial-gradient(ellipse 84% 78% at 50% 46%, transparent 52%, rgba(9, 11, 16, 0.56) 100%),
    linear-gradient(180deg, transparent 62%, rgba(9, 11, 16, 0.84) 100%);
}
.hero-slide-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.65s var(--ease-apple);
}
.hero-slide-item.is-active { opacity: 1; }
.hero-slide-item img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.92) contrast(1.04); }

.hero-progress-bars {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.hero-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(212, 163, 74, 0.22);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.hero-bar.is-active { background: rgba(212, 163, 74, 0.35); }
.hero-bar.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold-1);
  transform-origin: left center;
  animation: sfcHeroBar 4.5s linear forwards;
}
@keyframes sfcHeroBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero-info-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gold-1);
  text-transform: uppercase;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 44px);
  line-height: 1.18;
  font-weight: 700;
}
.hero-title-accent {
  display: block;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { font-size: 14.5px; color: var(--text-muted); line-height: 1.65; }
.hero-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

/* Bento */
.bento-portal-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 48px;
}
.bento-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bento-card {
  padding: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-top: 1px solid rgba(212, 163, 74, 0.25);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s var(--ease-apple);
}
.bento-card:hover { border-color: var(--gold-1); transform: translateY(-2px); }
.bento-card svg { color: var(--gold-1); }
.bento-card h3 { font-size: 16px; font-weight: 600; }
.bento-card p { font-size: 13px; color: var(--text-muted); }

/* Product Carousel */
.scroll-showcase-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 48px) 56px;
  border-top: 1px solid var(--hairline);
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.section-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--gold-1);
  margin-bottom: 6px;
}
.section-head h2 { font-family: var(--font-display); font-size: clamp(22px, 2.8vw, 32px); }
.section-sub { font-size: 13.5px; color: var(--text-muted); max-width: 640px; margin-top: 6px; }
.carousel-controls { display: flex; gap: 8px; }
.carousel-viewport { overflow: hidden; width: 100%; }
.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(33.333% - 12px);
  gap: 18px;
  transition: transform 0.45s var(--ease-apple);
}

.product-show-card {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-top: 1px solid rgba(212, 163, 74, 0.25);
  border-radius: 2px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-img-stage {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: #090b10;
}
.card-img-stage img { width: 100%; height: 100%; object-fit: cover; }
.product-category-tag { font-family: var(--font-mono); font-size: 10.5px; color: var(--gold-1); letter-spacing: 0.1em; }
.product-spec-list { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); margin-bottom: auto; }
.btn-card-ozon { width: 100%; margin-top: 8px; }

/* B2B Story Section */
.apple-story-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px clamp(16px, 4vw, 48px) 56px;
  border-top: 1px solid var(--hairline);
}
.apple-story-list { display: flex; flex-direction: column; gap: 36px; }
.apple-story-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: 2px;
}
.apple-story-row.reverse .story-img-col { order: 2; }
.scroll-reveal-card { opacity: 0.15; transform: translateY(18px); transition: opacity 0.6s var(--ease-apple), transform 0.6s var(--ease-apple); }
.scroll-reveal-card.in-view { opacity: 1; transform: translateY(0); }
.story-img-wrap { aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--hairline); }
.story-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.story-text-col { display: flex; flex-direction: column; gap: 10px; }
.story-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--gold-1); }
.story-heading { font-size: 20px; font-weight: 600; }
.story-desc { font-size: 13px; color: var(--text-muted); }
.story-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.story-stat-card { padding: 12px; border: 1px solid var(--hairline); background: rgba(9, 11, 16, 0.72); }
.stat-number { display: block; font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--gold-2); }
.stat-label { font-size: 11.5px; color: var(--text-muted); }

/* Contacts & Footer */
.b2b-cta-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 56px;
}
.b2b-cta-card {
  padding: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-top: 1px solid rgba(212, 163, 74, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}
.b2b-cta-card h2 { font-size: 20px; margin-bottom: 6px; }
.b2b-cta-card p { font-size: 13px; color: var(--text-muted); max-width: 560px; }
.b2b-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.site-footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 48px) 40px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
}
.footer-brand { font-family: var(--font-display); color: var(--gold-2); letter-spacing: 0.12em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a:hover, .footer-links button:hover { color: var(--gold-2); }
.footer-copy { font-size: 11.5px; }

@media (max-width: 960px) {
  .hero-section, .apple-story-row { grid-template-columns: 1fr; }
  .apple-story-row.reverse .story-img-col { order: 0; }
  .carousel-track { grid-auto-columns: calc(50% - 9px); }
}

@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px 24px;
    background: rgba(9, 11, 16, 0.96);
    border-bottom: 1px solid var(--hairline-strong);
    z-index: 490;
  }
  .nav-links.is-open { display: flex; }
  .bento-grid, .story-stats-grid { grid-template-columns: 1fr; }
  .carousel-track { grid-auto-columns: 100%; }
}
