:root {
  --bg: #2c3044;
  --panel: #11162b;
  --panel-soft: #171d34;
  --panel-alt: #1b213c;
  --text: #f5f7ff;
  --muted: #9fa7c8;
  --line: rgba(255, 255, 255, 0.08);
  --cyan: #31d6ff;
  --cyan-soft: rgba(49, 214, 255, 0.2);
  --magenta: #d86bff;
  --magenta-soft: rgba(216, 107, 255, 0.22);
  --teal: #58f0d5;
  --shadow: 0 28px 55px rgba(7, 10, 20, 0.45);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(164, 111, 255, 0.26) 0, rgba(164, 111, 255, 0.26) 14%, transparent 15%),
    radial-gradient(circle at bottom right, rgba(49, 214, 255, 0.16) 0, rgba(49, 214, 255, 0.16) 13%, transparent 14%),
    linear-gradient(180deg, #323851, #2a3044);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(30px);
  opacity: 0.65;
}

body::before {
  top: -160px;
  left: -120px;
  background: rgba(143, 83, 232, 0.28);
}

body::after {
  right: -180px;
  bottom: -180px;
  background: rgba(47, 192, 214, 0.16);
}

.page-shell {
  position: relative;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  width: min(1280px, calc(100vw - 48px));
  margin: 44px auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: rgba(10, 14, 28, 0.88);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.topbar {
  width: min(1280px, calc(100vw - 48px));
  margin: 24px auto -28px;
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
}

.sidebar {
  padding: 32px 24px 28px;
  background: linear-gradient(180deg, rgba(18, 22, 40, 0.96), rgba(15, 19, 34, 0.98));
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.language-switcher {
  display: flex;
  gap: 8px;
}

.lang-button {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 17, 32, 0.78);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.lang-button.is-active {
  border-color: rgba(49, 214, 255, 0.35);
  background: linear-gradient(135deg, rgba(49, 214, 255, 0.16), rgba(216, 107, 255, 0.14));
}

.brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  padding: 9px;
}

.brand h1,
.hero-copy h2,
.panel h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.brand h1 {
  font-size: 1.35rem;
}

.eyebrow,
.sidebar-label,
.stat-label,
.mini-label,
.meta-label,
.timeline-date {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: #c27aff;
}

.nav {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.nav-item {
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid transparent;
  transition: 0.25s ease;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--text);
  border-color: rgba(216, 107, 255, 0.18);
  background: linear-gradient(90deg, rgba(216, 107, 255, 0.3), rgba(216, 107, 255, 0.08));
}

.sidebar-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  margin-top: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.sidebar-card span,
.hero-text,
.panel-copy,
.timeline-item p,
.face-meta p,
.hint-list,
.feature-list {
  color: var(--muted);
}

.text-link {
  color: var(--text);
  text-decoration: none;
}

.text-link:hover {
  color: var(--cyan);
}

.dashboard {
  padding: 28px;
  background: linear-gradient(180deg, rgba(13, 17, 31, 0.98), rgba(12, 17, 32, 0.95));
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 22px;
  margin-bottom: 22px;
}

.hero-copy,
.hero-visual,
.panel,
.makerworld-card,
.line-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.hero-copy {
  padding: 30px;
}

.hero-copy h2 {
  font-size: clamp(2rem, 3.2vw, 3.4rem);
  line-height: 1.03;
  max-width: 13ch;
  margin-top: 10px;
}

.hero-text {
  max-width: 60ch;
  font-size: 1rem;
  line-height: 1.75;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0;
}

.primary-cta,
.secondary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
}

.primary-cta {
  color: #ffffff;
  background: linear-gradient(135deg, #d86bff, #7f7eff);
  box-shadow: 0 18px 26px rgba(160, 92, 255, 0.26);
}

.secondary-cta {
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.install-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  margin-bottom: 18px;
  border-radius: 20px;
  border: 1px solid rgba(49, 214, 255, 0.22);
  background:
    radial-gradient(circle at top right, rgba(49, 214, 255, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(30, 168, 207, 0.12), rgba(216, 107, 255, 0.1)),
    rgba(255, 255, 255, 0.03);
}

.install-spotlight strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.install-spotlight p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.mini-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 20px;
  min-height: 140px;
}

.stat-card {
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 3rem;
}

.stat-card .stat-label,
.stat-card strong,
.stat-card .stat-note {
  color: #ffffff;
}

.stat-note {
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}

.accent-magenta {
  background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.13), transparent 20%),
    linear-gradient(135deg, rgba(216, 107, 255, 0.95), rgba(130, 112, 255, 0.92));
}

.accent-cyan {
  background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.18), transparent 20%),
    linear-gradient(135deg, rgba(54, 235, 219, 0.92), rgba(79, 153, 255, 0.92));
}

.mini-stack {
  display: grid;
  gap: 14px;
}

.mini-card {
  min-height: auto;
  background: rgba(20, 26, 47, 0.96);
  border: 1px solid var(--line);
}

.mini-card strong {
  font-size: 1.1rem;
}

.hero-visual {
  display: grid;
  gap: 22px;
  background: transparent;
  border: 0;
}

.makerworld-card,
.line-card {
  padding: 24px;
}

.makerworld-head,
.line-card-head,
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.face-status,
.panel-tag,
.face-chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.face-status,
.panel-tag {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.face-chip {
  background: rgba(216, 107, 255, 0.18);
  color: #ffd4ff;
}

.makerworld-card {
  display: grid;
  gap: 18px;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.makerworld-card:hover {
  transform: translateY(-4px);
  border-color: rgba(49, 214, 255, 0.28);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

.makerworld-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.makerworld-copy p {
  margin: 10px 0 0;
  line-height: 1.6;
  color: var(--muted);
}

.component-panel {
  padding-bottom: 6px;
  background:
    radial-gradient(circle at top right, rgba(216, 107, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(21, 26, 46, 0.98), rgba(17, 22, 39, 0.98));
}

.micro-note {
  margin-left: 8px;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
  vertical-align: middle;
}

.component-list {
  margin-top: 18px;
  margin-bottom: 4px;
  padding-left: 18px;
}

.component-list li {
  margin-bottom: 4px;
  color: var(--muted);
}

.component-list a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.component-list a:hover {
  color: var(--cyan);
}

.video-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  background: #000000;
}

.face-tags,
.expression-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}

.expression-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.expression-tag.animated {
  background: rgba(49, 214, 255, 0.16);
  color: #9fedff;
  border: 1px solid rgba(49, 214, 255, 0.28);
}

.expression-tag.static {
  background: rgba(255, 255, 255, 0.06);
  color: #d8def6;
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.expression-tag.tap {
  background: rgba(216, 107, 255, 0.16);
  color: #f3beff;
  border: 1px solid rgba(216, 107, 255, 0.24);
}

.expression-tag.longpress {
  background: rgba(88, 240, 213, 0.14);
  color: #b7fff2;
  border: 1px solid rgba(88, 240, 213, 0.22);
}

.expression-tag.neutral {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.line-card-head {
  margin-bottom: 16px;
}

.line-card-head span {
  color: var(--muted);
}

.chart-svg {
  width: 100%;
  height: auto;
}

.chart-grid path {
  stroke: rgba(255, 255, 255, 0.08);
}

.area-a {
  fill: url(#lineFillA);
}

.area-b {
  fill: url(#lineFillB);
}

.line {
  fill: none;
  stroke-width: 3;
}

.line-a {
  stroke: var(--cyan);
}

.line-b {
  stroke: var(--magenta);
  stroke-dasharray: 4 6;
}

.chart-bars rect {
  fill: rgba(49, 214, 255, 0.78);
}

.chart-labels text {
  fill: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.chart-point {
  fill: var(--cyan);
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 3;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.panel {
  padding: 24px;
}

.wide-panel {
  grid-column: 1 / -1;
}

.expression-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.expression-card {
  width: 100%;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  appearance: none;
  display: flex;
  flex-direction: column;
}

.expression-card.active {
  border-color: rgba(49, 214, 255, 0.38);
  background: linear-gradient(180deg, rgba(49, 214, 255, 0.1), rgba(255, 255, 255, 0.03));
}

.expression-card:hover,
.expression-card:focus-visible {
  outline: none;
  border-color: rgba(216, 107, 255, 0.38);
  background: linear-gradient(180deg, rgba(216, 107, 255, 0.1), rgba(255, 255, 255, 0.03));
}

.expression-card h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  min-height: 2.4em;
  display: flex;
  align-items: flex-end;
}

.expression-preview-wrap {
  min-height: 64px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
}

.expression-preview {
  display: block;
  width: 128px;
  max-width: 100%;
  max-height: 64px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  image-rendering: pixelated;
  object-fit: contain;
}

.expression-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.feature-list,
.hint-list {
  margin: 18px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.install-box {
  margin-top: 18px;
  margin-bottom: 16px;
}

.install-panel {
  border-color: rgba(49, 214, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(49, 214, 255, 0.06);
  background:
    radial-gradient(circle at top right, rgba(49, 214, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(18, 28, 49, 0.98), rgba(16, 23, 41, 0.98));
}

esp-web-install-button {
  --esp-tools-button-color: #0e1428;
  --esp-tools-button-background-color: linear-gradient(135deg, #d86bff, #7f7eff);
  --esp-tools-button-border-radius: 14px;
}

button.install-trigger,
esp-web-install-button .install-trigger,
esp-web-install-button > .install-trigger {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 20px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #d86bff, #7f7eff) !important;
  color: #ffffff !important;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 18px 26px rgba(160, 92, 255, 0.26);
}

button.install-trigger:hover,
esp-web-install-button .install-trigger:hover,
esp-web-install-button > .install-trigger:hover {
  filter: brightness(1.03);
}

.inline-link {
  display: inline-block;
  margin-top: 8px;
}

.assembly-image {
  width: 100%;
  margin-top: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.assembly-cta {
  margin-top: 16px;
}

.timeline {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.timeline-item strong {
  display: block;
  margin-bottom: 6px;
}

@media (max-width: 1120px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .topbar {
    width: min(1280px, calc(100vw - 48px));
    margin-bottom: -12px;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-panel,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .expression-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    width: min(100vw - 18px, 100%);
    margin: 10px auto -2px;
  }

  .page-shell {
    width: min(100vw - 18px, 100%);
    margin: 10px auto;
    border-radius: 22px;
  }

  .dashboard,
  .sidebar {
    padding: 18px;
  }

  .hero-copy,
  .makerworld-card,
  .line-card,
  .panel {
    padding: 18px;
  }

  .stats-grid,
  .expression-grid {
    grid-template-columns: 1fr;
  }

  .install-spotlight {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
