:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #526074;
  --paper: #f8faf7;
  --surface: #ffffff;
  --navy: #173a5e;
  --teal: #087f75;
  --teal-soft: #dff5ef;
  --coral: #e65a3f;
  --coral-soft: #fff0eb;
  --gold: #f5b940;
  --gold-soft: #fff7d6;
  --line: #d9e1e8;
  --shadow: 0 18px 45px rgba(20, 33, 61, 0.09);
  --radius: 22px;
  font-family: Inter, ui-rounded, "Avenir Next", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(245, 185, 64, 0.2), transparent 22rem),
    radial-gradient(circle at 94% 12%, rgba(8, 127, 117, 0.13), transparent 28rem),
    var(--paper);
  font-size: 17px;
  line-height: 1.68;
}

a {
  color: var(--teal);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--coral);
}

code {
  padding: 0.12em 0.38em;
  border: 1px solid #d8e2e8;
  border-radius: 7px;
  background: #edf3f5;
  color: #173a5e;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(217, 225, 232, 0.85);
  background: rgba(248, 250, 247, 0.9);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1160px, calc(100% - 36px));
  min-height: 68px;
  margin: 0 auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 850;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--teal);
  color: white;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 19px;
  font-size: 0.88rem;
  font-weight: 700;
}

.top-links a {
  color: var(--muted);
  text-decoration: none;
}

.top-links a:hover,
.top-links a[aria-current="page"] {
  color: var(--teal);
}

.language {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

.github-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  gap: 7px;
}

.top-links .github-link:hover {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.github-mark {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex: 0 0 auto;
}

.github-label {
  color: var(--ink);
  font-size: 0.8rem;
}

.github-link:focus-visible,
.language:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

main,
.footer-inner {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  min-height: 650px;
  padding: 84px 0 74px;
  gap: 60px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(3rem, 6.8vw, 5.7rem);
}

h1 span {
  color: var(--teal);
}

.lede {
  max-width: 640px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 32px;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 13px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
  box-shadow: 0 10px 24px rgba(8, 127, 117, 0.22);
}

.button:hover {
  transform: translateY(-1px);
}

.hero-visual {
  position: relative;
  min-height: 470px;
}

.camera-card,
.result-card {
  position: absolute;
  border: 1px solid rgba(217, 225, 232, 0.95);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.camera-card {
  top: 6px;
  right: 32px;
  width: min(100%, 390px);
  padding: 15px;
  border-radius: 28px;
  transform: rotate(2deg);
}

.camera-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1px 4px 11px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.live-dot::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.camera-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(145deg, #173a5e, #0c6971);
  background-size: 32px 32px, 32px 32px, auto;
}

.camera-frame svg {
  width: 100%;
  height: 100%;
}

.pose-line {
  stroke: #fff;
  stroke-width: 7;
  stroke-linecap: round;
  opacity: 0.92;
}

.pose-joint {
  fill: var(--gold);
  stroke: white;
  stroke-width: 3;
}

.pose-box {
  fill: none;
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 2;
  stroke-dasharray: 7 7;
}

.result-card {
  right: 0;
  bottom: 6px;
  width: 250px;
  padding: 18px 20px;
  border-radius: 18px;
  transform: rotate(-2deg);
}

.result-label {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 3px;
  font-size: 1.6rem;
  font-weight: 900;
}

.result-value small {
  color: var(--teal);
  font-size: 1rem;
}

.meter {
  overflow: hidden;
  height: 9px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e7edf0;
}

.meter > span {
  display: block;
  width: 91%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #24a893);
}

.data-arrow {
  position: absolute;
  bottom: 90px;
  left: 12px;
  display: grid;
  width: 138px;
  height: 138px;
  place-items: center;
  border: 1px dashed rgba(8, 127, 117, 0.48);
  border-radius: 50%;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 900;
  text-align: center;
  transform: rotate(-8deg);
}

.section {
  padding: 94px 0;
  scroll-margin-top: 68px;
}

.section.tint {
  position: relative;
}

.section.tint::before {
  position: absolute;
  z-index: -1;
  inset: 18px calc((100vw - 100%) / -2);
  background: #edf6f2;
  content: "";
}

.section-heading {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  align-items: end;
  margin-bottom: 40px;
  gap: 36px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4.3vw, 3.4rem);
}

.section-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.flow-step {
  position: relative;
  min-width: 0;
  min-height: 222px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(20, 33, 61, 0.05);
}

.flow-step:not(:last-child)::after {
  position: absolute;
  z-index: 2;
  top: 45px;
  right: -29px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  content: "→";
  font-size: 1.2rem;
  font-weight: 900;
}

.step-number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 900;
}

.flow-step h3 {
  margin: 18px 0 10px;
  font-size: 1.18rem;
}

.flow-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.block-stack {
  display: grid;
  min-width: 0;
  max-width: 790px;
  margin: 38px auto 0;
  gap: 9px;
}

.block {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #9966ff;
  color: white;
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.14);
  font-weight: 800;
}

.block.control {
  background: #ffab19;
}

.block.sensing {
  background: #5cb1d6;
}

.block-value {
  max-width: 55%;
  overflow: hidden;
  padding: 4px 9px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note {
  display: grid;
  grid-template-columns: auto 1fr;
  margin-top: 26px;
  padding: 18px 20px;
  border: 1px solid #f1d17a;
  border-radius: 15px;
  background: var(--gold-soft);
  gap: 14px;
}

.note-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  font-weight: 900;
}

.note p {
  margin: 0;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  justify-content: center;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  gap: 14px;
}

.pipeline-node {
  display: grid;
  min-width: 145px;
  min-height: 132px;
  padding: 17px;
  place-items: center;
  border-radius: 18px;
  background: #edf3f5;
  text-align: center;
}

.pipeline-node strong {
  display: block;
  margin-top: 9px;
}

.pipeline-node small {
  color: var(--muted);
}

.pipeline-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  background: white;
  color: var(--teal);
  font-size: 1.35rem;
  font-weight: 900;
}

.pipeline-arrow {
  color: var(--coral);
  font-size: 1.4rem;
  font-weight: 900;
}

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

.detail-card,
.score-card,
.reference-card {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.detail-card h3,
.score-card h3,
.reference-card h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.detail-card p,
.score-card p,
.reference-card p {
  margin: 0;
  color: var(--muted);
}

.mini-stage {
  display: grid;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin: 22px 0;
  padding: 10px;
  border: 7px solid var(--navy);
  border-radius: 16px;
  background: linear-gradient(145deg, #f5c66a, #ffefe2);
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.preview-window {
  display: grid;
  min-width: 74px;
  padding: 5px;
  place-items: center;
  border: 2px solid white;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--navy), var(--teal));
  color: white;
  font-size: 0.67rem;
  font-weight: 800;
  grid-column: 3;
  grid-row: 3;
}

.position-list {
  display: flex;
  flex-wrap: wrap;
  margin-top: 14px;
  gap: 8px;
}

.position-list span,
.tag {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
}

.score-card.current {
  border-top: 5px solid var(--coral);
}

.score-card.accumulated {
  border-top: 5px solid var(--teal);
}

.score-chart {
  width: 100%;
  height: auto;
  margin: 22px 0 14px;
}

.chart-grid {
  stroke: #d9e1e8;
  stroke-width: 1;
}

.chart-threshold {
  stroke: var(--gold);
  stroke-width: 3;
  stroke-dasharray: 7 5;
}

.chart-current {
  fill: none;
  stroke: var(--coral);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-accumulated {
  fill: none;
  stroke: var(--teal);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.legend span::before {
  display: inline-block;
  width: 18px;
  height: 4px;
  margin: 0 7px 2px 0;
  border-radius: 999px;
  background: var(--legend-color);
  content: "";
}

.formula {
  overflow-x: auto;
  margin: 20px 0 0;
  padding: 18px;
  border-radius: 14px;
  background: var(--navy);
  color: white;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.86rem;
  white-space: nowrap;
}

.reference-card ul,
.checklist {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.reference-card li,
.checklist li {
  position: relative;
  margin: 9px 0;
  padding-left: 24px;
  color: var(--muted);
}

.reference-card li::before,
.checklist li::before {
  position: absolute;
  left: 0;
  color: var(--teal);
  content: "✓";
  font-weight: 900;
}

.reference-card.wide {
  grid-column: 1 / -1;
}

.troubleshooting {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

details {
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

details:last-child {
  border-bottom: 0;
}

summary {
  padding: 20px 0;
  cursor: pointer;
  font-weight: 850;
}

details p {
  margin: -6px 0 22px;
  color: var(--muted);
}

footer {
  margin-top: 50px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 125px;
  gap: 20px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-inner p {
  margin: 0;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    width: min(560px, 100%);
    margin: 0 auto;
  }

  .flow {
    grid-template-columns: repeat(2, 1fr);
  }

  .flow-step:not(:last-child)::after {
    display: none;
  }

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

  .pipeline-arrow {
    transform: rotate(90deg);
    text-align: center;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 16px;
  }

  .topbar-inner,
  main,
  .footer-inner {
    width: min(100% - 24px, 1160px);
  }

  .top-links a:not(.language):not(.github-link) {
    display: none;
  }

  .top-links {
    gap: 8px;
  }

  .github-link {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
    border-color: var(--line);
    background: white;
  }

  .github-label {
    display: none;
  }

  .hero {
    min-height: 0;
    padding-top: 58px;
    gap: 28px;
  }

  .hero-visual {
    min-height: 410px;
  }

  .camera-card {
    right: 0;
  }

  .data-arrow {
    bottom: 10px;
    left: 0;
    width: 112px;
    height: 112px;
  }

  .result-card {
    width: 215px;
  }

  .section {
    padding: 70px 0;
  }

  .section-heading,
  .flow,
  .split-grid,
  .score-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .block {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .block-value {
    max-width: 100%;
  }

  .reference-card.wide {
    grid-column: auto;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button:hover {
    transform: none;
  }
}
