/* ============================================================
   Abarsazan — interactive schematic (elevator / columnless)
   Dark luxury industrial UI. No dashboard look.
   ============================================================ */

.s3d-page {
  --s3d-gold: #c9a227;
  --s3d-gold-soft: rgba(201, 162, 39, 0.16);
  --s3d-line: rgba(201, 162, 39, 0.28);
  --s3d-ink: #f3efe4;
  --s3d-muted: rgba(229, 229, 229, 0.62);
  --s3d-glass: rgba(12, 12, 14, 0.72);
  position: relative;
  min-height: calc(100vh - 88px);
  background:
    radial-gradient(1200px 520px at 50% 0%, rgba(201, 162, 39, 0.08), transparent 58%),
    linear-gradient(180deg, #0a0a0b 0%, #101011 42%, #080809 100%);
  overflow: hidden;
}

.s3d-stage {
  position: relative;
  height: calc(100vh - 88px);
  min-height: 640px;
  perspective: 1600px;
  perspective-origin: 50% 46%;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.s3d-stage.is-dragging { cursor: grabbing; }

.s3d-world {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  transform: rotateX(var(--pitch, -18deg)) rotateY(var(--yaw, -32deg)) scale(var(--zoom, 1));
  transform-origin: 50% 48%;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.s3d-stage.is-dragging .s3d-world { transition: none; }

.s3d-floor {
  position: absolute;
  width: 720px;
  height: 720px;
  background:
    radial-gradient(circle at 50% 50%, rgba(201, 162, 39, 0.12), transparent 42%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 48px);
  transform: translate3d(0, 210px, 0) rotateX(90deg);
  pointer-events: none;
}

.s3d-safe {
  position: relative;
  width: 260px;
  height: 320px;
  transform-style: preserve-3d;
  transform: translate3d(var(--pan-x, 0px), var(--pan-y, 12px), 0);
}

.s3d-anchor {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
  pointer-events: none;
}

.s3d-box {
  position: absolute;
  width: var(--w);
  height: var(--h);
  left: calc(var(--w) / -2);
  top: calc(var(--h) / -2);
  transform-style: preserve-3d;
}

.s3d-face {
  position: absolute;
  background: var(--face, #1c1c20);
  border: 1px solid rgba(201, 162, 39, 0.14);
  backface-visibility: hidden;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.28);
  transition: filter 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.45s ease;
}
.s3d-face.front,
.s3d-face.back {
  width: var(--w);
  height: var(--h);
  left: 0;
  top: 0;
}
.s3d-face.front { transform: translateZ(calc(var(--d) / 2)); }
.s3d-face.back  { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.s3d-face.left,
.s3d-face.right {
  width: var(--d);
  height: var(--h);
  left: calc((var(--w) - var(--d)) / 2);
  top: 0;
}
.s3d-face.left  { transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); }
.s3d-face.right { transform: rotateY(90deg) translateZ(calc(var(--w) / 2)); }
.s3d-face.top,
.s3d-face.bottom {
  width: var(--w);
  height: var(--d);
  left: 0;
  top: calc((var(--h) - var(--d)) / 2);
}
.s3d-face.top    { transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); }
.s3d-face.bottom { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2)); }

.s3d-mat-steel { --face: linear-gradient(165deg, #2c2c32 0%, #16161a 55%, #0f0f12 100%); }
.s3d-mat-steel .s3d-face { background: linear-gradient(165deg, #2c2c32 0%, #16161a 55%, #0f0f12 100%); }
.s3d-mat-gold .s3d-face {
  background: linear-gradient(160deg, #f2dd8f 0%, #c9a227 46%, #8a6d18 100%);
  border-color: rgba(242, 221, 143, 0.45);
}
.s3d-mat-inner .s3d-face { background: #121214; }
.s3d-mat-concrete .s3d-face {
  background: repeating-linear-gradient(135deg, #6f6d68 0 8px, #5c5a56 8px 16px);
}
.s3d-mat-panel .s3d-face { background: #0d1114; }
.s3d-mat-lock .s3d-face { background: linear-gradient(#2a2a22, #141410); }

.s3d-anchor.is-hot .s3d-face,
.s3d-anchor.is-active .s3d-face {
  box-shadow:
    inset 0 0 0 2px var(--s3d-gold),
    0 0 22px rgba(201, 162, 39, 0.35);
  filter: brightness(1.28);
}
.s3d-page.is-cutaway .s3d-shell .s3d-face { opacity: 0.22; }
.s3d-page.is-ghost .s3d-shell .s3d-face { opacity: 0.18; }

.s3d-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.s3d-hud > * { pointer-events: auto; }

.s3d-intro {
  position: absolute;
  top: 22px;
  right: 24px;
  max-width: 380px;
  padding: 18px 20px 16px;
  background: var(--s3d-glass);
  border: 1px solid var(--s3d-line);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.s3d-intro-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--s3d-gold);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.s3d-intro h1 {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--s3d-ink);
  margin: 0 0 8px;
  line-height: 1.45;
}
.s3d-intro p {
  margin: 0;
  color: var(--s3d-muted);
  font-size: 0.86rem;
  line-height: 1.75;
}

.s3d-toolbar {
  position: absolute;
  bottom: 22px;
  right: 24px;
  left: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.s3d-tool {
  appearance: none;
  border: 1px solid var(--s3d-line);
  background: var(--s3d-glass);
  color: var(--s3d-ink);
  border-radius: 999px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.s3d-tool:hover,
.s3d-tool.is-on {
  border-color: var(--s3d-gold);
  background: var(--s3d-gold-soft);
  color: #f7e7a1;
}
.s3d-tool i { margin-left: 8px; color: var(--s3d-gold); }

.s3d-legend {
  position: absolute;
  top: 22px;
  left: 24px;
  width: min(280px, calc(100vw - 48px));
  max-height: calc(100% - 120px);
  overflow: auto;
  padding: 14px 10px 12px 12px;
  background: var(--s3d-glass);
  border: 1px solid var(--s3d-line);
  border-radius: 16px;
  backdrop-filter: blur(16px);
}
.s3d-legend h2 {
  font-size: 0.78rem;
  color: var(--s3d-gold);
  margin: 0 8px 10px;
  font-weight: 700;
}
.s3d-legend-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.s3d-legend-list button {
  width: 100%;
  text-align: right;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--s3d-ink);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.s3d-legend-list button:hover,
.s3d-legend-list button.is-on {
  background: var(--s3d-gold-soft);
  color: #f7e7a1;
}

.s3d-tip {
  position: fixed;
  z-index: 20;
  display: block;
  transform: translate(-50%, -120%);
  padding: 6px 12px;
  border-radius: 999px;
  background: #111114;
  border: 1px solid var(--s3d-gold);
  color: #f7e7a1;
  font-size: 0.78rem;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}
.s3d-tip.is-on { opacity: 1; }

.s3d-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}
.s3d-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.s3d-card,
.s3d-drawer {
  position: absolute;
  z-index: 10;
  display: none !important;
  opacity: 0;
  pointer-events: none;
  background: #141418;
  border: 1px solid var(--s3d-line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--s3d-ink);
  user-select: text;
  touch-action: auto;
}
.s3d-card[hidden],
.s3d-drawer[hidden] {
  display: none !important;
}

.s3d-card.is-open,
.s3d-drawer.is-open {
  display: block !important;
  opacity: 1;
  pointer-events: auto;
}

.s3d-card {
  top: 50%;
  right: 24px;
  width: min(380px, calc(100vw - 48px));
  transform: translateY(-50%) translateX(24px);
  padding: 22px 22px 18px;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.s3d-card.is-open {
  transform: translateY(-50%);
}
.s3d-card-kicker {
  font-size: 0.7rem;
  color: var(--s3d-gold);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.s3d-card h3 {
  margin: 0 0 14px;
  font-size: 1.18rem;
  font-weight: 800;
}
.s3d-card h4 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--s3d-gold);
  font-weight: 700;
}
.s3d-card p,
.s3d-card li {
  color: var(--s3d-muted);
  font-size: 0.88rem;
  line-height: 1.85;
}
.s3d-card ul {
  margin: 0 0 14px;
  padding-right: 18px;
}
.s3d-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(201, 162, 39, 0.08);
  border: 1px dashed rgba(201, 162, 39, 0.35);
  color: #e8d48a;
  font-size: 0.78rem;
  line-height: 1.7;
}
.s3d-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.s3d-card-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--s3d-line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--s3d-ink);
  font-size: 1.35rem;
  font-family: inherit;
  font-weight: 400;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  pointer-events: auto;
  touch-action: manipulation;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.s3d-card-close:hover,
.s3d-card-close:focus-visible {
  background: rgba(201, 162, 39, 0.25);
  border-color: var(--s3d-gold);
  color: #fff;
  transform: scale(1.08);
  outline: none;
}
.s3d-card-close:active {
  transform: scale(0.94);
}

.s3d-drawer {
  top: 50%;
  left: 50%;
  width: min(720px, calc(100vw - 40px));
  max-height: min(78vh, 720px);
  overflow: auto;
  transform: translate(-50%, -46%);
  padding: 28px 28px 22px;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.s3d-drawer.is-open {
  transform: translate(-50%, -50%);
}
.s3d-drawer h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}
.s3d-drawer > p {
  color: var(--s3d-muted);
  margin: 0 0 18px;
  font-size: 0.9rem;
  line-height: 1.8;
}
.s3d-benefits {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.s3d-benefits li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(201, 162, 39, 0.12);
  color: var(--s3d-ink);
  font-size: 0.9rem;
  line-height: 1.7;
}
.s3d-benefits li::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--s3d-gold);
  flex: 0 0 auto;
}
.s3d-benefits li.is-unconfirmed {
  border-style: dashed;
}
.s3d-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.s3d-timeline li {
  position: relative;
  padding: 0 0 16px 22px;
  border-right: 1px solid var(--s3d-line);
  margin-right: 10px;
  color: var(--s3d-ink);
  font-size: 0.9rem;
}
.s3d-timeline li:last-child { border-right-color: transparent; padding-bottom: 0; }
.s3d-timeline li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  right: -11px;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #111;
  border: 1px solid var(--s3d-gold);
  color: var(--s3d-gold);
  font-size: 0.65rem;
  display: grid;
  place-items: center;
}
.s3d-company-grid {
  display: grid;
  gap: 10px;
}
.s3d-company-grid p {
  margin: 0;
  color: var(--s3d-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}
.s3d-phones {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.s3d-phones a {
  color: #f7e7a1;
  text-decoration: none;
  border: 1px solid var(--s3d-line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.88rem;
  direction: ltr;
}
.s3d-phones a:hover { border-color: var(--s3d-gold); }

.s3d-hint {
  position: absolute;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--s3d-muted);
  font-size: 0.75rem;
  pointer-events: none;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .s3d-intro { display: none; }
  .s3d-legend {
    top: auto;
    bottom: 78px;
    left: 12px;
    max-height: 180px;
    width: 200px;
  }
  .s3d-card {
    top: auto;
    bottom: 78px;
    right: 12px;
    left: 12px;
    width: auto;
    transform: translateY(16px);
  }
  .s3d-card.is-open { transform: none; }
  .s3d-toolbar { bottom: 12px; right: 12px; left: 12px; }
  .s3d-hint { display: none; }
  .s3d-page { min-height: calc(100vh - 72px); }
  .s3d-stage { min-height: 560px; height: calc(100vh - 72px); }
}
