/* Cuper — How it works walkthrough (marketing) */

.hiw-root[hidden] { display: none !important; }

.hiw-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgb(11 12 15 / 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hiw-dialog {
  background: var(--surface);
  border-color: var(--border);
}

.hiw-visual {
  background: var(--bg);
  border-color: var(--border);
}

.hiw-copy h2 {
  color: var(--text);
}

.hiw-copy p {
  color: var(--text-sec);
}

.hiw-progress-node.is-active {
  border-color: var(--cuper-blue);
  background: rgba(10, 132, 255, 0.12);
  color: var(--text);
}

.hiw-progress-line.is-done {
  background: var(--cuper-blue);
}

.hiw-pill {
  border-color: rgba(10, 132, 255, 0.28);
  background: var(--silver);
  color: var(--text-sec);
}

.hiw-mock {
  background: var(--surface-2);
  border-color: var(--border);
}

.hiw-install-done,
.hiw-done {
  color: #34c759;
}

.hiw-approval-primary {
  background: rgba(10, 132, 255, 0.2);
  color: var(--text);
}

.hiw-arrow {
  background: var(--cuper-blue);
}

.hiw-chip {
  border-color: rgba(10, 132, 255, 0.35);
  background: var(--silver);
  color: var(--text-sec);
}

.hiw-caps li.is-on {
  color: var(--text);
}

body.hiw-open { overflow: hidden; }

.hiw-dialog {
  position: relative;
  width: min(100%, 52rem);
  max-height: min(92vh, 52rem);
  overflow: auto;
  border-radius: 1.25rem;
  border: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(26 31 38);
  box-shadow: 0 24px 64px -28px rgb(0 0 0 / 0.65);
  padding-bottom: 1.25rem;
}

.hiw-close,
.hiw-back {
  position: absolute;
  top: 1rem;
  z-index: 2;
  border-radius: 9999px;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(255 255 255 / 0.04);
  color: rgb(203 213 225);
  font-weight: 600;
  cursor: pointer;
}

.hiw-close {
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.25rem;
  line-height: 1;
}

.hiw-back {
  left: 1rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
}

.hiw-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem 1rem 0.5rem;
  overflow-x: auto;
}

.hiw-progress-step { display: flex; align-items: center; }

.hiw-progress-node {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  color: rgb(148 163 184 / 0.75);
  border: 1.5px solid rgb(255 255 255 / 0.14);
}

.hiw-progress-node.is-done {
  border-color: rgb(59 130 246 / 0.55);
  color: rgb(191 219 254);
}

.hiw-progress-node.is-active {
  border-color: rgb(59 130 246 / 0.9);
  background: rgb(59 130 246 / 0.22);
  color: rgb(241 245 249);
}

.hiw-progress-line {
  width: 1.25rem;
  height: 2px;
  margin: 0 0.1rem;
  background: rgb(255 255 255 / 0.1);
  border-radius: 9999px;
}

.hiw-progress-line.is-done { background: rgb(59 130 246 / 0.55); }

.hiw-visual {
  margin: 0 1.25rem;
  min-height: 14rem;
  border-radius: 1rem;
  border: 1px solid rgb(255 255 255 / 0.06);
  background: rgb(17 20 24);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.hiw-copy {
  text-align: center;
  padding: 1.25rem 1.5rem 0.5rem;
}

.hiw-copy h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: rgb(241 245 249);
}

.hiw-copy p {
  margin-top: 0.65rem;
  font-size: 1rem;
  line-height: 1.5;
  color: rgb(148 163 184);
}

.hiw-final {
  margin: 0.85rem auto 0;
  padding: 0;
  list-style: none;
  max-width: 18rem;
  text-align: left;
  font-size: 0.875rem;
  color: rgb(148 163 184);
}

.hiw-final li { padding: 0.2rem 0 0.2rem 1rem; position: relative; }
.hiw-final li::before { content: "·"; position: absolute; left: 0; color: rgb(59 130 246); }

.hiw-caps {
  border-top: 1px solid rgb(255 255 255 / 0.06);
  margin: 0.75rem 1.25rem 0;
  padding-top: 0.65rem;
}

.hiw-caps-title {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(148 163 184 / 0.8);
  margin-bottom: 0.4rem;
}

.hiw-caps ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  margin: 0;
  padding: 0 0 0.5rem;
  list-style: none;
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgb(100 116 139 / 0.75);
}

.hiw-caps li.is-on { color: rgb(203 213 225); }

.hiw-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem 0;
}

.hiw-actions .btn { min-width: 14rem; }

/* Scene mocks */
.hiw-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.hiw-devices {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
}

.hiw-mock {
  border-radius: 0.85rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(22 27 34);
  padding: 0.75rem;
}

.hiw-mock--desktop { width: min(100%, 16rem); }
.hiw-mock--phone { width: 4.5rem; border-radius: 1rem; text-align: center; font-size: 0.75rem; font-weight: 700; color: rgb(203 213 225); }

.hiw-providers { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; }

.hiw-pill {
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  color: rgb(191 219 254);
  border: 1px solid rgb(59 130 246 / 0.35);
  background: rgb(59 130 246 / 0.1);
  animation: hiw-pill-in 0.45s ease both;
}

.hiw-install-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(203 213 225);
  animation: hiw-row-in 0.5s ease both;
}

.hiw-install-btn { font-size: 0.625rem; opacity: 0; animation: hiw-fade-out 0.3s ease 0.5s forwards; }
.hiw-install-done { font-size: 0.625rem; color: rgb(74 222 128); opacity: 0; animation: hiw-fade-in 0.35s ease 0.75s forwards; }

.hiw-bubble {
  margin: 0;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.5625rem;
  font-weight: 600;
  color: rgb(241 245 249);
  background: rgb(59 130 246 / 0.35);
}

.hiw-arrow {
  width: 2px;
  height: 0.85rem;
  background: rgb(59 130 246 / 0.55);
  border-radius: 9999px;
  animation: hiw-pulse 1.2s ease-in-out infinite;
}

.hiw-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgb(191 219 254);
  border: 1px solid rgb(59 130 246 / 0.45);
  background: rgb(59 130 246 / 0.15);
}

.hiw-glow { animation: hiw-glow 1.4s ease-in-out; }
.hiw-glow-d1 { animation: hiw-glow 1.4s ease-in-out 0.45s both; }
.hiw-glow-d2 { animation: hiw-glow 1s ease-in-out 0.9s both; }

.hiw-dim { opacity: 0.35; filter: grayscale(0.6); }
.hiw-warn { font-size: 0.625rem; font-weight: 700; color: rgb(251 191 36); }
.hiw-arrow-label { font-size: 0.5625rem; color: rgb(148 163 184); }

.hiw-chip.hiw-step-1 { opacity: 0; animation: hiw-fade-in 0.4s ease 1.1s forwards, hiw-glow 0.8s ease 1.1s; }
.hiw-chip.hiw-step-2 { opacity: 0; animation: hiw-fade-in 0.4s ease 1.6s forwards, hiw-glow 0.8s ease 1.6s; }
.hiw-chip.hiw-step-3 { opacity: 0; animation: hiw-fade-in 0.4s ease 2.1s forwards, hiw-glow 0.8s ease 2.1s; }

.hiw-done { margin: 0; font-size: 0.75rem; font-weight: 700; color: rgb(74 222 128); opacity: 0; animation: hiw-fade-in 0.4s ease 1.4s forwards; }
.hiw-done-late { animation-delay: 2.5s; }

.hiw-approval {
  width: min(100%, 14rem);
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(26 31 38);
  text-align: center;
  animation: hiw-slide-up 0.45s ease both;
}

.hiw-approval p { margin: 0 0 0.5rem; font-size: 0.8125rem; font-weight: 700; color: rgb(241 245 249); }
.hiw-approval div { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.6875rem; color: rgb(148 163 184); }
.hiw-approval-primary { padding: 0.35rem; border-radius: 0.45rem; color: rgb(241 245 249); background: rgb(59 130 246 / 0.35); }

.hiw-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.hiw-tags li {
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
  color: rgb(203 213 225);
  border: 1px solid rgb(255 255 255 / 0.1);
}

.hiw-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  width: min(100%, 16rem);
}

.hiw-project {
  padding: 0.55rem;
  border-radius: 0.65rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  font-size: 0.6875rem;
  color: rgb(148 163 184);
}

.hiw-project strong { display: block; font-size: 0.75rem; color: rgb(226 232 240); }

.hiw-org { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; max-width: 16rem; }
.hiw-org-extra { font-size: 0.625rem; font-weight: 600; color: rgb(148 163 184); margin-top: 0.35rem; }

.hiw-stack-row {
  width: min(100%, 12rem);
  padding: 0.35rem 0.65rem;
  border-radius: 0.45rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
  color: rgb(203 213 225);
  border: 1px solid rgb(255 255 255 / 0.08);
  animation: hiw-row-in 0.35s ease both;
}

@keyframes hiw-pill-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes hiw-row-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes hiw-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes hiw-fade-out { to { opacity: 0; } }
@keyframes hiw-glow { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 2px rgb(59 130 246 / 0.35); } }
@keyframes hiw-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes hiw-slide-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .hiw-pill, .hiw-install-row, .hiw-glow, .hiw-glow-d1, .hiw-glow-d2,
  .hiw-chip, .hiw-done, .hiw-stack-row, .hiw-approval, .hiw-arrow {
    animation: none !important;
    opacity: 1 !important;
  }
}
