/* =============================================
   SteefMade — Feature Demos (v1)
   Small, restrained, looping demonstrations of
   "what this feature is". Used on Tariffs.
   ============================================= */

.demos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
  margin-top: clamp(36px, 4vw, 56px);
}
@media (max-width: 820px) { .demos-grid { grid-template-columns: 1fr; } }

/* ---- card shell (reuses the depth language) ---- */
.demo-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(130% 90% at 50% -20%, rgba(255, 255, 255, 0.05), transparent 58%),
    linear-gradient(180deg, var(--surface2), var(--surface));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 20px 44px -26px rgba(0, 0, 0, 0.9);
  padding: clamp(18px, 2vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1), border-color 300ms ease, box-shadow 300ms ease;
}
.demo-card::before {
  content: '';
  position: absolute; left: 12%; right: 12%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-olive), transparent);
  opacity: 0.6; pointer-events: none;
}
.demo-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-olive);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 32px 64px -28px rgba(0, 0, 0, 0.98);
}

.demo-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    repeating-linear-gradient(135deg, transparent, transparent 22px, rgba(255, 255, 255, 0.012) 22px, rgba(255, 255, 255, 0.012) 23px),
    var(--bg);
  overflow: hidden;
}

.demo-meta { display: flex; align-items: flex-start; gap: 14px; }
.demo-ic {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-olive);
  background: var(--olive-dim);
  color: var(--olive-bright);
  display: flex; align-items: center; justify-content: center;
}
.demo-text { display: flex; flex-direction: column; gap: 3px; }
.demo-title {
  font-family: 'Golos Text', sans-serif;
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--text);
  display: flex; align-items: center; gap: 9px;
}
.demo-tier {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 100px;
  border: 1px solid var(--border); color: var(--text-muted);
}
.demo-caption { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; }

.demo-tag {
  position: absolute; top: 10px; left: 10px; z-index: 4;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.04em; color: var(--olive-bright);
  background: rgba(11, 11, 10, 0.72); backdrop-filter: blur(4px);
  border: 1px solid var(--border); border-radius: 100px;
  padding: 4px 11px;
}

/* ============================================================
   1 · ADAPTIVE — a browser whose viewport resizes & reflows
   ============================================================ */
.d-adapt { display: flex; align-items: center; justify-content: center; }
.d-adapt-screen {
  position: relative;
  width: 86%;
  height: 80%;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9);
  animation: dAdaptResize 7.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.d-adapt-bar {
  height: 16px; display: flex; align-items: center; gap: 4px;
  padding: 0 8px; background: var(--surface2); border-bottom: 1px solid var(--border);
}
.d-adapt-bar i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.d-adapt-body {
  padding: 10px; display: flex; flex-direction: column; gap: 7px; height: calc(100% - 16px);
}
.d-adapt-h { height: 7px; width: 60%; border-radius: 3px; background: var(--text); opacity: 0.7; }
.d-adapt-cards {
  flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  animation: dAdaptReflow 7.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.d-adapt-cards div { border-radius: 5px; background: var(--surface2); border: 1px solid var(--border); }
@keyframes dAdaptResize {
  0%, 22%   { width: 86%; }
  38%, 55%  { width: 56%; }
  70%, 88%  { width: 33%; }
  100%      { width: 86%; }
}
@keyframes dAdaptReflow {
  0%, 22%   { grid-template-columns: repeat(3, 1fr); }
  38%, 55%  { grid-template-columns: repeat(2, 1fr); }
  70%, 100% { grid-template-columns: repeat(1, 1fr); }
}
.d-adapt-readout {
  position: absolute; bottom: 10px; right: 12px; z-index: 4;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--text-dim);
}
.d-adapt-readout b { color: var(--olive-bright); font-weight: 500; }

/* ============================================================
   2 · ANIMATIONS — staggered reveal of blocks, looping
   ============================================================ */
.d-anim { padding: 16px 18px; display: flex; flex-direction: column; gap: 9px; justify-content: center; }
.d-anim-row { border-radius: 5px; background: var(--surface2); border: 1px solid var(--border); opacity: 0; transform: translateY(14px); }
.d-anim-row.r1 { height: 11px; width: 52%; }
.d-anim-row.r2 { height: 8px;  width: 78%; }
.d-anim-row.r3 { height: 8px;  width: 66%; }
.d-anim-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 3px; }
.d-anim-cards div { height: 30px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); opacity: 0; transform: translateY(14px); }
.d-anim.run .d-anim-row,
.d-anim.run .d-anim-cards div { animation: dReveal 620ms cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.d-anim.run .r1 { animation-delay: 60ms; }
.d-anim.run .r2 { animation-delay: 170ms; }
.d-anim.run .r3 { animation-delay: 270ms; }
.d-anim.run .d-anim-cards div:nth-child(1) { animation-delay: 390ms; }
.d-anim.run .d-anim-cards div:nth-child(2) { animation-delay: 480ms; }
.d-anim.run .d-anim-cards div:nth-child(3) { animation-delay: 570ms; }
@keyframes dReveal { to { opacity: 1; transform: none; } }

/* ============================================================
   3 · PARALLAX — layers drift at different rates on pointer
   ============================================================ */
.d-para { perspective: 600px; }
.d-para-layer { position: absolute; inset: 0; transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1); will-change: transform; }
.d-para-back { background: radial-gradient(80% 120% at 50% 120%, rgba(168, 194, 79, 0.16), transparent 60%); }
.d-para-blob {
  position: absolute; left: 18%; top: 26%; width: 38%; height: 50%;
  border-radius: 40% 60% 55% 45%; border: 1px solid var(--border-olive);
  background: rgba(168, 194, 79, 0.06);
}
.d-para-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 26px 26px; opacity: 0.4;
}
.d-para-card {
  position: absolute; left: 50%; top: 50%; width: 54%; height: 46%;
  transform: translate(-50%, -50%);
  border-radius: 8px; border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, var(--surface2), var(--surface));
  box-shadow: 0 20px 44px -20px rgba(0, 0, 0, 0.95);
  display: flex; flex-direction: column; gap: 6px; padding: 12px;
}
.d-para-card .b { height: 6px; border-radius: 3px; background: var(--text); opacity: 0.7; }
.d-para-card .b.s { width: 50%; opacity: 0.4; }
.d-para-card .p { width: 40%; height: 13px; border-radius: 100px; background: var(--olive); margin-top: auto; }
.d-para-hint {
  position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; z-index: 5;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted);
  transition: opacity 240ms ease;
}
.d-para:hover .d-para-hint { opacity: 0; }

/* ============================================================
   4 · TELEGRAM — form submit -> notification slides in
   ============================================================ */
.d-tg { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.d-tg-field { height: 22px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface2); display: flex; align-items: center; padding: 0 10px; }
.d-tg-field span { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); }
.d-tg-field .car { width: 1px; height: 11px; background: var(--olive-bright); margin-left: 1px; opacity: 0; }
.d-tg-btn {
  height: 26px; border-radius: 6px; background: var(--olive); color: #10110c;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: 'Golos Text', sans-serif; font-size: 12px; font-weight: 600;
  transition: background 200ms ease;
}
.d-tg-btn.sending { background: var(--olive-hover); }
.d-tg-btn .spin { width: 11px; height: 11px; border: 2px solid rgba(16,17,12,0.35); border-top-color: #10110c; border-radius: 50%; display: none; animation: dSpin 700ms linear infinite; }
.d-tg-btn.sending .spin { display: block; }
.d-tg-btn.sending .lbl { display: none; }
@keyframes dSpin { to { transform: rotate(360deg); } }
.d-tg-toast {
  position: absolute; top: 12px; right: 12px; left: 12px; z-index: 6;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  background: linear-gradient(180deg, #1f2630, #151b22);
  border: 1px solid rgba(80, 150, 220, 0.4);
  box-shadow: 0 16px 36px -16px rgba(0, 0, 0, 0.9);
  opacity: 0; transform: translateY(-16px); pointer-events: none;
  transition: opacity 320ms ease, transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}
.d-tg-toast.show { opacity: 1; transform: none; }
.d-tg-toast .tg-ic { width: 24px; height: 24px; border-radius: 50%; background: #2aabee; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.d-tg-toast .tg-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.d-tg-toast .tg-title { font-size: 11.5px; font-weight: 700; color: #f4f3ee; }
.d-tg-toast .tg-msg { font-size: 11px; color: rgba(244, 243, 238, 0.66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (prefers-reduced-motion: reduce) {
  .d-adapt-screen, .d-adapt-cards { animation: none !important; width: 86% !important; }
  .d-anim-row, .d-anim-cards div { opacity: 1 !important; transform: none !important; }
}
