:root {
  color-scheme: dark;
  --bg: #121110;
  --bg-soft: #151312;
  --panel: rgba(255, 255, 255, 0.025);
  --panel-strong: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f2eee6;
  --muted: rgba(242, 238, 230, 0.74);
  --soft: rgba(242, 238, 230, 0.52);
  --accent: #c4b18b;
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.16);
  --pattern-opacity: 0.045;
  --carousel-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0)), #11100f;
  --carousel-viewport-bg:
    radial-gradient(circle at top right, rgba(252, 76, 2, 0.07), transparent 28%),
    #11100f;
  --carousel-shot-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  --carousel-dot-idle: rgba(255, 255, 255, 0.16);
  --serif: "Newsreader", Georgia, serif;
  --sans: "Instrument Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f0e8;
  --bg-soft: #ece5da;
  --panel: rgba(34, 29, 24, 0.04);
  --panel-strong: rgba(34, 29, 24, 0.06);
  --line: rgba(34, 29, 24, 0.1);
  --line-strong: rgba(34, 29, 24, 0.18);
  --text: #1f1a15;
  --muted: rgba(31, 26, 21, 0.76);
  --soft: rgba(31, 26, 21, 0.56);
  --accent: #8d6c35;
  --shadow: 0 20px 48px rgba(42, 31, 19, 0.08);
  --pattern-opacity: 0.09;
  --carousel-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.38)), rgba(226, 216, 201, 0.52);
  --carousel-viewport-bg:
    radial-gradient(circle at top right, rgba(141, 108, 53, 0.11), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(232, 223, 209, 0.55));
  --carousel-shot-shadow: 0 18px 38px rgba(54, 40, 23, 0.12);
  --carousel-dot-idle: rgba(31, 26, 21, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: none;
}

img {
  display: block;
  max-width: 100%;
}

a,
button {
  color: inherit;
}

a {
  text-decoration: none;
}

button {
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

::selection {
  background: rgba(196, 177, 139, 0.2);
}

.site-shell {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
}

.page-case .site-shell {
  width: min(1120px, calc(100% - 56px));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-name,
.back-link {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft);
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.segment-btn {
  padding: 6px 8px;
  border-radius: 0;
  color: var(--soft);
  line-height: 1;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.segment-btn.is-active {
  color: var(--text);
}

.icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--soft);
}

.icon-toggle:hover {
  color: var(--text);
}

.icon {
  width: 16px;
  height: 16px;
}

.icon-sun {
  display: none;
}

html[data-theme="light"] .icon-moon {
  display: none;
}

html[data-theme="light"] .icon-sun {
  display: block;
}

main {
  padding-bottom: 48px;
}

.intro-section,
.case-hero {
  padding: 76px 0 38px;
}

.case-hero-single {
  display: block;
}

.case-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 42px;
  align-items: start;
}

.intro-copy,
.case-copy,
.section-block,
.site-footer {
  width: 100%;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-title,
.case-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4.2vw, 4.3rem);
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.hero-lead,
.case-lead {
  margin: 22px 0 0;
  max-width: 19ch;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.16;
  color: var(--muted);
}

.page-home .hero-title {
  font-size: clamp(1.9rem, 2.2vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.page-home .hero-lead {
  margin-top: 12px;
  max-width: none;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--text);
}

.hero-metrics {
  margin-top: 18px;
}

.hero-metrics .metric-pill {
  color: var(--accent);
}

.body-copy {
  margin-top: 26px;
  display: grid;
  gap: 14px;
}

.page-home .body-copy {
  max-width: 640px;
  gap: 16px;
  margin-top: 24px;
}

.body-copy p,
.section-note,
.project-summary,
.site-footer p,
.note-card p,
.challenge-card p,
.stack-card p,
.limit-card p,
.overview-text,
.detail-list li,
.step-copy p,
.flow-node p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.page-home .body-copy p {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text);
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-top: 26px;
}

.inline-links a,
.footer-nav a,
.text-link,
.button-link,
.back-link {
  transition: color 0.2s ease, border-color 0.2s ease;
}

.inline-links a {
  color: var(--soft);
  border-bottom: 1px solid var(--line);
}

.inline-links a:hover,
.footer-nav a:hover,
.text-link:hover,
.button-link:hover,
.back-link:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.section-block {
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.section-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 2.4vw, 2.5rem);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.page-home .section-title {
  font-size: clamp(1.35rem, 1.8vw, 1.7rem);
  line-height: 1.2;
}

.section-note {
  font-size: 0.95rem;
  color: var(--soft);
}

.project-list,
.overview-grid,
.stack-grid,
.challenges-grid,
.limits-grid,
.demo-grid {
  display: grid;
  gap: 0;
}

.project-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.project-card:first-child {
  border-top: 0;
  padding-top: 8px;
}

.project-copy {
  display: grid;
  gap: 10px;
  max-width: 580px;
}

.project-index {
  margin: 0;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.project-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 1.8vw, 1.65rem);
  font-weight: 500;
  line-height: 1.2;
}

.project-meta {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: right;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.metric-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--soft);
  font-size: 0.88rem;
}

.metric-pill {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag:not(:last-child)::after,
.metric-pill:not(:last-child)::after {
  content: "·";
  margin: 0 8px;
  color: var(--line-strong);
}

.text-link,
.button-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-link::after,
.button-link::after {
  content: "↗";
  font-size: 14px;
}

.button-link {
  min-height: 42px;
  padding: 0 12px 0 0;
  border-radius: 0;
  border: 1px solid var(--line);
  border-width: 0 0 1px 0;
  background: transparent;
}

.button-link.secondary {
  color: var(--soft);
}

.line {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.line.short {
  margin-top: 0;
  width: 56%;
}

.notes-list {
  display: grid;
  gap: 12px;
}

.notes-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.preview-block,
.stack-card,
.challenge-card,
.limit-card {
  border: 1px solid var(--line);
  background: var(--panel);
}

.preview-block {
  display: none;
}

.preview-inner,
.preview-grid,
.preview-bars {
  height: 100%;
}

.preview-youtube {
  background: linear-gradient(180deg, rgba(255, 102, 102, 0.08), transparent 70%);
}

.preview-rescue {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.preview-homebase {
  background: linear-gradient(180deg, rgba(126, 184, 129, 0.08), transparent 70%);
}

.preview-bars {
  display: flex;
  align-items: end;
  gap: 10px;
}

.preview-bars span {
  width: 22%;
  background: rgba(255, 255, 255, 0.16);
}

.preview-bars span:nth-child(1) { height: 40%; }
.preview-bars span:nth-child(2) { height: 72%; }
.preview-bars span:nth-child(3) { height: 58%; }
.preview-bars span:nth-child(4) { height: 86%; }

.stack-card,
.challenge-card,
.limit-card {
  padding: 18px 0;
  border-width: 1px 0 0 0;
  background: transparent;
}

.stack-card h3,
.challenge-card h3,
.limit-card h3,
.overview-card h3,
.step-copy h3,
.flow-node h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 500;
}

.stack-card h3,
.challenge-card h3,
.limit-card h3,
.flow-node h3 {
  font-size: 1.28rem;
}

.site-footer,
.footer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 60px;
  border-top: 1px solid var(--line);
}

.case-hero {
  padding-bottom: 26px;
}

.case-title {
  font-size: clamp(2rem, 2.8vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.case-lead {
  max-width: 28ch;
  font-family: var(--sans);
  font-size: 1.06rem;
  line-height: 1.8;
  color: var(--text);
}

.case-note {
  margin: 18px 0 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.case-status {
  margin: 14px 0 0;
  color: #fc4c02;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 22px;
}

.case-inline-link {
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.5;
  border-bottom: 1px solid rgba(252, 76, 2, 0.45);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.case-inline-link:hover {
  color: #fc4c02;
  border-color: #fc4c02;
}

.hero-carousel {
  min-width: 0;
}

.hero-carousel-card {
  border: 1px solid var(--line);
  background: var(--carousel-card-bg);
  box-shadow: var(--shadow);
}

.hero-carousel-viewport {
  position: relative;
  aspect-ratio: 1.68 / 1;
  overflow: hidden;
  background: var(--carousel-viewport-bg);
}

.hero-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide-image {
  width: 100%;
  height: 100%;
  padding: 18px;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(var(--carousel-shot-shadow));
}

.hero-carousel-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}

.hero-carousel-copy {
  min-width: 0;
}

.hero-carousel-label {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-carousel-caption {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
}

.hero-carousel-count {
  margin: 0;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-carousel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.hero-carousel-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-dot {
  width: 28px;
  height: 3px;
  padding: 0;
  background: var(--carousel-dot-idle);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.hero-dot.is-active {
  background: #fc4c02;
}

.hero-carousel-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-arrow {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.hero-arrow:hover {
  color: var(--text);
}

.hero-shot-shell {
  --shot-accent: #fc4c02;
  width: calc(100% - 36px);
  height: calc(100% - 36px);
  margin: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.hero-shot-shell.is-ykv {
  --shot-accent: #6f87ff;
}

.hero-shot-shell.is-enviroed {
  --shot-accent: #46a86b;
}

.hero-shot-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-shot-brand {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-shot-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hero-shot-dots span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.hero-shot-card,
.hero-shot-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.hero-shot-card {
  padding: 12px;
}

.hero-shot-card.is-accent,
.hero-shot-panel.is-accent {
  box-shadow: inset 0 0 0 1px var(--shot-accent);
}

.hero-shot-card.soft,
.hero-shot-panel.soft {
  background: rgba(255, 255, 255, 0.035);
}

.hero-shot-row,
.hero-shot-stack,
.hero-shot-chip-row,
.hero-shot-progress {
  display: flex;
  gap: 8px;
}

.hero-shot-progress span {
  display: block;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-shot-progress span.is-accent {
  background: var(--shot-accent);
}

.hero-shot-row.space {
  justify-content: space-between;
}

.hero-shot-stack {
  flex-direction: column;
}

.hero-shot-grid {
  display: grid;
  gap: 10px;
}

.hero-shot-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-shot-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-shot-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero-shot-line {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-shot-line.thin {
  height: 6px;
}

.hero-shot-line.short {
  width: 34%;
}

.hero-shot-line.mid {
  width: 58%;
}

.hero-shot-line.long {
  width: 82%;
}

.hero-shot-kicker {
  margin: 0;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-shot-title {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 600;
}

.hero-shot-copy {
  margin: 6px 0 0;
  color: var(--soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.hero-shot-stat {
  margin: 10px 0 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1;
}

.hero-shot-pill,
.hero-shot-tab,
.hero-shot-node,
.hero-shot-mini {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.hero-shot-pill,
.hero-shot-tab {
  min-height: 24px;
  padding: 5px 9px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-shot-pill.is-accent,
.hero-shot-tab.is-active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px var(--shot-accent);
}

.hero-shot-avatar {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px var(--shot-accent);
}

.hero-shot-mini {
  min-height: 72px;
  padding: 10px;
}

.hero-shot-chart {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 88px;
}

.hero-shot-bar {
  flex: 1;
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.12);
}

.hero-shot-bar.is-accent {
  background: var(--shot-accent);
}

.hero-shot-node {
  min-height: 52px;
  padding: 10px;
}

.hero-shot-map {
  min-height: 168px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 22% 34%, rgba(255, 255, 255, 0.05) 0 20%, transparent 22%),
    radial-gradient(circle at 70% 58%, rgba(255, 255, 255, 0.05) 0 18%, transparent 20%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px, 22px 22px;
}

.hero-shot-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: center;
}

.hero-shot-level {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-shot-level.is-accent {
  background: rgba(70, 168, 107, 0.18);
  box-shadow: inset 0 0 0 1px var(--shot-accent);
}

.hero-shot-bin-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hero-shot-bin {
  height: 78px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-shot-bin.green { background: rgba(70, 168, 107, 0.25); }
.hero-shot-bin.yellow { background: rgba(235, 183, 44, 0.25); }
.hero-shot-bin.blue { background: rgba(73, 140, 227, 0.25); }
.hero-shot-bin.brown { background: rgba(161, 109, 62, 0.25); }

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.case-actions .button-link {
  min-height: auto;
  padding: 0;
  border: 0;
  color: var(--soft);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  font-size: 1rem;
}

.case-actions .button-link::after {
  content: "";
}

.case-actions .button-link:hover {
  color: var(--text);
}

.metrics-row {
  margin-top: 16px;
}

.overview-grid {
  grid-template-columns: 1fr;
}

.overview-card {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.overview-card h3 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.demo-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.step-number {
  display: inline-block;
  width: auto;
  height: auto;
  border: 0;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  padding-top: 4px;
}

.step-copy h3 {
  font-size: 1.12rem;
  line-height: 1.35;
}

.step-visual {
  display: none;
}

.step-visual.is-video {
  background: linear-gradient(145deg, rgba(255, 102, 102, 0.22), rgba(255, 255, 255, 0.04)), var(--bg-soft);
}

.step-visual.is-summary {
  padding: 16px;
}

.step-visual.is-quiz,
.step-visual.is-export,
.step-visual.is-map,
.step-visual.is-alerts,
.step-visual.is-compare,
.step-visual.is-ranking {
  position: relative;
}

.step-visual.is-summary .line {
  margin-top: 12px;
}

.step-visual.is-quiz::before,
.step-visual.is-export::before,
.step-visual.is-map::before,
.step-visual.is-alerts::before,
.step-visual.is-compare::before,
.step-visual.is-ranking::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.step-visual.is-quiz::after {
  content: "";
  position: absolute;
  left: 30px;
  right: 30px;
  top: 36px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 28px 0 rgba(255, 255, 255, 0.12), 0 56px 0 rgba(255, 255, 255, 0.12);
}

.step-visual.is-export::after,
.step-visual.is-ranking::after {
  content: "";
  position: absolute;
  inset: 32px 56px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.step-visual.is-map::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
}

.step-visual.is-alerts::after {
  content: "";
  position: absolute;
  top: 24px;
  left: 24px;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 88px 0 0 rgba(255, 255, 255, 0.08);
}

.step-visual.is-compare::after {
  content: "";
  position: absolute;
  inset: 26px;
  background: linear-gradient(180deg, transparent 22%, rgba(255, 255, 255, 0.14) 22%, rgba(255, 255, 255, 0.14) 32%, transparent 32%, transparent 54%, rgba(255, 255, 255, 0.12) 54%, rgba(255, 255, 255, 0.12) 64%, transparent 64%);
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  display: block;
}

.stack-grid,
.challenges-grid,
.limits-grid {
  grid-template-columns: 1fr;
}

.stack-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.architecture {
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.flow-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
}

.flow-node {
  min-height: 120px;
  min-height: auto;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.flow-arrow {
  display: none;
}

.fade {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade.in-view {
  opacity: 1;
  transform: none;
}

@media (max-width: 960px) {
  .case-hero,
  .overview-grid,
  .stack-grid,
  .challenges-grid,
  .limits-grid {
    grid-template-columns: 1fr;
  }

  .case-hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .section-head,
  .site-footer,
  .footer-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .demo-step {
    grid-template-columns: 52px 1fr;
  }

  .step-visual {
    grid-column: 1 / -1;
  }

  .flow-row {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    min-height: 24px;
    transform: rotate(90deg);
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100%, calc(100% - 28px));
  }

  .page-case .site-shell {
    width: min(100%, calc(100% - 28px));
  }

  .topbar {
    flex-direction: row;
    align-items: center;
  }

  .controls {
    flex-wrap: wrap;
  }

  .hero-title,
  .case-title {
    max-width: 11ch;
  }

  .hero-lead,
  .case-lead {
    max-width: 100%;
  }

  .hero-carousel-viewport {
    aspect-ratio: 1.42 / 1;
  }

  .hero-slide-image {
    padding: 12px;
  }

  .hero-carousel-bar {
    padding: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-carousel-caption {
    font-size: 0.94rem;
  }

  .hero-carousel-footer {
    flex-wrap: wrap;
  }
}
