/* Strong Way — public site design system
   ტოკენები, 3D transform-ები, keyframe-ები. */

:root {
  --sw-canvas: #FAFAF9;
  --sw-surface: #FFFFFF;
  --sw-brand: #F58220;
  --sw-brand-deep: #B45309;
  --sw-brand-tint: #FFF4EA;
  --sw-ink: #111111;
  --sw-body: #57534E;
  --sw-line: #E7E5E4;
  --sw-graphite: #1C1917;

  /* თბილი ჩრდილები — არა ნეიტრალურად შავი */
  --sw-shadow-sm: 0 1px 2px rgba(120, 90, 60, .06), 0 2px 8px rgba(120, 90, 60, .05);
  --sw-shadow-md: 0 4px 12px rgba(120, 90, 60, .08), 0 12px 32px rgba(120, 90, 60, .07);
  --sw-shadow-lg: 0 8px 24px rgba(120, 90, 60, .10), 0 24px 64px rgba(120, 90, 60, .10);
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--sw-canvas);
  color: var(--sw-body);
  -webkit-font-smoothing: antialiased;
}

/* ---------- ტიპოგრაფიის სკალა ---------- */
.sw-h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.05; letter-spacing: -.02em; color: var(--sw-ink); }
.sw-h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.15; letter-spacing: -.015em; color: var(--sw-ink); }
.sw-body { font-size: 1rem; line-height: 1.7; color: var(--sw-body); }

/* ---------- A1: hero-ის 3D სცენა ---------- */
.sw-scene { perspective: 1200px; perspective-origin: 50% 55%; }
.sw-scene__stage {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .3s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}
.sw-layer { position: absolute; inset: 0; transform-style: preserve-3d; }
.sw-layer--sky   { transform: translateZ(-260px) scale(1.28); }
.sw-layer--hills { transform: translateZ(-160px) scale(1.16); }
.sw-layer--poles { transform: translateZ(-70px)  scale(1.06); }
.sw-layer--rails { transform: translateZ(0); }
.sw-layer--train { transform: translateZ(60px); }

/* ---------- A2: მოძრავი შემადგენლობა ---------- */
@keyframes sw-train-run {
  from { transform: translate3d(-40%, 0, 0); }
  to   { transform: translate3d(125%, 0, 0); }
}
.sw-train { animation: sw-train-run 26s linear infinite; will-change: transform; }

@keyframes sw-wheel { to { transform: rotate(360deg); } }
.sw-wheel { transform-origin: center; transform-box: fill-box; animation: sw-wheel 1.1s linear infinite; }

/* ---------- A3: ბარათის 3D დახრა ---------- */
.sw-tilt {
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.22, .61, .36, 1), box-shadow .35s ease;
  box-shadow: var(--sw-shadow-sm);
}
.sw-tilt:hover { box-shadow: var(--sw-shadow-lg); }
.sw-tilt__lift { transform: translateZ(40px); transition: transform .35s cubic-bezier(.22, .61, .36, 1); }

/* ---------- A4: სქროლის ლიანდაგი ---------- */
.sw-rail__line {
  stroke-dasharray: var(--sw-rail-len, 1000);
  stroke-dashoffset: var(--sw-rail-len, 1000);
  transition: stroke-dashoffset .1s linear;
}
.sw-rail__stop { transition: transform .4s ease, fill .4s ease; transform-origin: center; transform-box: fill-box; }
.sw-rail__stop[data-active="true"] { fill: var(--sw-brand); transform: scale(1.35); }

/* ---------- A5: ოდომეტრი ---------- */
.sw-odo { display: inline-flex; overflow: hidden; height: 1em; line-height: 1; vertical-align: baseline; }
.sw-odo__col { display: flex; flex-direction: column; transition: transform 1.4s cubic-bezier(.16, 1, .3, 1); }
.sw-odo__col > span { height: 1em; line-height: 1; }

/* ---------- A6: დერეფნის მარშრუტი ---------- */
@keyframes sw-dash { to { stroke-dashoffset: -240; } }
.sw-corridor__path { stroke-dasharray: 10 14; animation: sw-dash 6s linear infinite; }

@keyframes sw-pulse { 0% { r: 5; opacity: .8; } 100% { r: 16; opacity: 0; } }
.sw-corridor__pulse { animation: sw-pulse 2.4s ease-out infinite; }

/* ---------- ტიკერი ---------- */
@keyframes sw-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.sw-ticker { overflow: hidden; }
.sw-ticker__track { display: flex; width: max-content; animation: sw-ticker 32s linear infinite; }

/* ---------- ფორმის სტატუსი ---------- */
.sw-form-status { display: none; }
.sw-form-status[data-state] { display: block; }
.sw-form-status[data-state="pending"] { color: var(--sw-body); }
.sw-form-status[data-state="success"] { color: #15803D; }
.sw-form-status[data-state="error"]   { color: #B91C1C; }

/* ---------- A7: იზომეტრიული tracking stepper ---------- */
.sw-iso { perspective: 900px; }
.sw-iso__track {
  transform: rotateX(52deg) rotateZ(-6deg);
  transform-style: preserve-3d;
}
.sw-iso__fill { transition: width .6s cubic-bezier(.22, .61, .36, 1); }
.sw-iso__node { transition: transform .3s ease, background-color .3s ease; }

/* ---------- მობილური: 3D ითიშება ---------- */
@media (max-width: 767px) {
  .sw-scene { perspective: none; }
  .sw-scene__stage { transform: none !important; }
  .sw-tilt { transform: none !important; }
  .sw-tilt__lift { transform: none !important; }
  .sw-train { animation-duration: 40s; }
  .sw-iso__track { transform: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .sw-scene__stage, .sw-tilt, .sw-tilt__lift { transform: none !important; }
  .sw-rail__line { stroke-dashoffset: 0 !important; }
  .sw-train { animation: none !important; transform: translate3d(30%, 0, 0); }
}
