:root {
  color-scheme: light;
  --shp-bg: #f5f3ee;
  --shp-surface: rgba(255, 255, 255, 0.94);
  --shp-surface-strong: rgba(255, 255, 255, 0.98);
  --shp-soft: rgba(245, 243, 238, 0.72);
  --shp-purple: #845cff;
  --shp-purple-deep: #6f4de2;
  --shp-green: #9dff3b;
  --shp-green-bright: #b6ff63;
  --shp-pink: #ff2d8e;
  --shp-blue: #aff3f3;
  --shp-text: #1f2428;
  --shp-muted: rgba(31, 36, 40, 0.72);
  --shp-line: rgba(132, 92, 255, 0.12);
  --shp-border: rgba(31, 36, 40, 0.16);
  --shp-card: var(--shp-surface);
  --shp-card-strong: var(--shp-surface-strong);
  --shp-shadow: 0 18px 34px rgba(31, 36, 40, 0.06), 0 8px 18px rgba(132, 92, 255, 0.06);
  --label-tender: #9dff3b;
  --label-mid: #f7bc37;
  --label-tough: #ff5b4a;
  --max: 1360px;
  --radius-card: 28px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --shp-bg: #111116;
  --shp-surface: rgba(29, 29, 37, 0.94);
  --shp-surface-strong: rgba(35, 35, 45, 0.98);
  --shp-soft: rgba(255, 255, 255, 0.06);
  --shp-text: #f5f3ee;
  --shp-muted: rgba(245, 243, 238, 0.72);
  --shp-line: rgba(182, 255, 99, 0.16);
  --shp-border: rgba(245, 243, 238, 0.16);
  --shp-card: var(--shp-surface);
  --shp-card-strong: var(--shp-surface-strong);
  --shp-shadow: 0 18px 34px rgba(0, 0, 0, 0.28), 0 8px 18px rgba(132, 92, 255, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--shp-text);
  background: var(--shp-bg);
  font-family: Inter, "Segoe UI", Aptos, system-ui, -apple-system, sans-serif;
  overflow-x: clip;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

::selection {
  color: #fff;
  background: var(--shp-purple);
}

.app-shell {
  width: min(var(--max), calc(100% - 20px));
  margin: 14px auto 42px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  margin-bottom: 14px;
  padding: 2px 0 6px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  width: max-content;
  max-width: 38vw;
  border-radius: 14px;
  line-height: 0;
}

.brand-link:focus-visible {
  outline: 2px solid var(--shp-green);
  outline-offset: 4px;
}

.brand-logo {
  display: block;
  width: 150px;
  max-width: 100%;
  height: auto;
}

:root[data-theme="dark"] .brand-logo {
  filter: invert(1);
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.beta-pill,
.hero-pill,
.scene-chip {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 36px;
  padding: 9px 13px;
  border: 1px solid var(--shp-line);
  border-radius: 999px;
  background: var(--shp-card-strong);
  color: var(--shp-purple-deep);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.1;
}

.lang-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  gap: 2px;
  width: max-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--shp-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--shp-card-strong) 86%, transparent);
}

.lang-pill,
.segmented,
.primary-link {
  min-height: 46px;
  border: 1px solid var(--shp-border);
  border-radius: 999px;
  background: var(--shp-card);
  color: var(--shp-text);
  cursor: pointer;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.lang-pill {
  min-width: 38px;
  min-height: 34px;
  padding: 0 7px;
  border: 0;
  background: transparent;
  font-size: 0.72rem;
  line-height: 1;
}

.theme-toggle {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--shp-border);
  border-radius: 999px;
  background: var(--shp-card-strong);
  color: var(--shp-text);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.theme-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle {
  border-color: rgba(182, 255, 99, 0.28);
  color: var(--shp-green-bright);
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lang-pill:hover,
.segmented:hover,
.primary-link:hover,
.theme-toggle:hover,
.lang-pill:focus-visible,
.segmented:focus-visible,
.primary-link:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--shp-green);
  outline-offset: 2px;
  transform: translateY(-1px);
}

.lang-pill.is-active {
  background: var(--shp-text);
  color: var(--shp-bg);
  box-shadow: none;
}

.segmented.is-active {
  border-color: color-mix(in srgb, var(--shp-text) 42%, transparent);
  background: var(--shp-purple);
  color: #fff;
  box-shadow: 0 12px 24px rgba(132, 92, 255, 0.22);
}

.card {
  border: 1px solid rgba(132, 92, 255, 0.08);
  background: var(--shp-card);
  box-shadow: var(--shp-shadow);
}

.reveal {
  animation: rise-in 620ms cubic-bezier(0.2, 0.7, 0.18, 1) both;
}

.hero-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 0 30px 30px 30px;
}

.overline,
.eyebrow {
  margin: 0;
  color: var(--shp-muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  line-height: 1.45;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 8px 0 14px;
  color: var(--shp-purple);
  font-size: clamp(2.2rem, 13vw, 3.6rem);
  line-height: 0.94;
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
}

.lead {
  margin: 0;
  max-width: 62ch;
  color: var(--shp-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-pill {
  width: auto;
  color: var(--shp-text);
  font-size: 0.76rem;
}

.hero-note {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(132, 92, 255, 0.12);
  border-radius: 24px 0 24px 24px;
  background: var(--shp-card-strong);
}

.hero-note h2,
.section-heading h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.12;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-note-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--shp-muted);
  line-height: 1.48;
}

.hero-note-list strong {
  color: var(--shp-text);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-color: rgba(31, 36, 40, 0.42);
  background: var(--shp-green);
  color: var(--shp-text);
}

.control-dock {
  position: sticky;
  top: 8px;
  z-index: 10;
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 24px;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--shp-card-strong) 92%, transparent);
}

.search-control,
.select-control {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--shp-muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-control input,
.select-control select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--shp-border);
  border-radius: 16px;
  background: var(--shp-card-strong);
  color: var(--shp-text);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.search-control input {
  padding: 0 14px;
}

.select-control select {
  padding: 0 12px;
}

.search-control input:focus,
.select-control select:focus {
  outline: 2px solid var(--shp-green);
  outline-offset: 2px;
}

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

.segmented {
  min-height: 44px;
  padding: 0 10px;
  line-height: 1.15;
}

.workbench,
.lower-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.map-card,
.detail-card,
.rank-card,
.prep-card,
.compare-section,
.site-footer {
  border-radius: var(--radius-card);
  padding: 18px;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.section-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--shp-muted);
  line-height: 1.5;
}

.cow-stage {
  overflow: hidden;
  border: 1px solid rgba(132, 92, 255, 0.1);
  border-radius: 22px;
  background: var(--shp-soft);
}

#cowMap {
  display: block;
  width: 100%;
  min-height: 250px;
  aspect-ratio: 1000 / 520;
}

.cow-body,
.cow-neck,
.cow-head,
.leg,
.cow-ear,
.cow-horn,
.cow-tail-tip {
  fill: color-mix(in srgb, var(--shp-card-strong) 84%, var(--shp-bg));
  stroke: color-mix(in srgb, var(--shp-text) 72%, transparent);
  stroke-width: 3;
}

.hoof {
  fill: color-mix(in srgb, var(--shp-text) 76%, transparent);
  stroke: color-mix(in srgb, var(--shp-text) 72%, transparent);
  stroke-width: 3;
}

.cow-tail {
  fill: none;
  stroke: color-mix(in srgb, var(--shp-text) 72%, transparent);
  stroke-width: 5;
  stroke-linecap: round;
}

.cut {
  fill: var(--cut-color, var(--label-mid));
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 3;
  cursor: pointer;
  opacity: 0.9;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.16s ease, transform 0.16s ease, filter 0.16s ease, stroke-width 0.16s ease;
}

.cut:hover,
.cut.is-active {
  opacity: 1;
  filter: drop-shadow(0 8px 12px rgba(31, 36, 40, 0.22));
  stroke-width: 5;
  transform: scale(1.014);
}

.cut:focus-visible {
  outline: 3px solid var(--shp-green);
  outline-offset: 3px;
}

.cut.is-muted {
  opacity: 0.14;
}

.cut-internal {
  stroke: rgba(31, 36, 40, 0.88);
  stroke-dasharray: 8 6;
}

.map-markers text {
  fill: var(--shp-text);
  paint-order: stroke;
  stroke: var(--shp-card-strong);
  stroke-width: 5;
  stroke-linejoin: round;
  font-size: 20px;
  font-weight: 900;
  pointer-events: none;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  color: var(--shp-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 13px;
  height: 13px;
  border: 1px solid rgba(31, 36, 40, 0.18);
  border-radius: 999px;
}

.legend-dot.tender {
  background: var(--label-tender);
}

.legend-dot.mid {
  background: var(--label-mid);
}

.legend-dot.tough {
  background: var(--label-tough);
}

.legend-line {
  width: 26px;
  border-top: 3px dashed rgba(31, 36, 40, 0.76);
}

.detail-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.detail-head {
  display: grid;
  gap: 4px;
}

.detail-head h2 {
  margin: 0;
  color: var(--shp-purple-deep);
  font-size: clamp(2rem, 10vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.detail-head p:last-child {
  margin: 0;
  color: var(--shp-muted);
  font-weight: 800;
  line-height: 1.35;
}

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

.score-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(132, 92, 255, 0.1);
  border-radius: 18px;
  background: var(--shp-soft);
}

.score-card span {
  color: var(--shp-muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.score-card strong {
  font-size: 1.34rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.score-direction {
  color: var(--shp-muted);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.2;
}

meter {
  width: 100%;
  height: 8px;
}

meter::-webkit-meter-bar {
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--shp-text) 12%, transparent);
}

meter::-webkit-meter-optimum-value {
  border-radius: 999px;
  background: var(--shp-purple);
}

.explain-grid {
  display: grid;
  gap: 10px;
}

.explain-grid article {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid rgba(132, 92, 255, 0.1);
  border-radius: 18px;
  background: color-mix(in srgb, var(--shp-card-strong) 72%, transparent);
}

.explain-grid h3,
.method-block h3 {
  margin: 0;
  font-size: 0.92rem;
}

.explain-grid p {
  margin: 0;
  color: var(--shp-muted);
  font-size: 0.9rem;
  line-height: 1.48;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div {
  display: grid;
  gap: 5px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--shp-text) 8%, transparent);
}

.detail-list dt {
  color: var(--shp-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  font-weight: 700;
  line-height: 1.46;
}

.method-block {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--shp-text) 8%, transparent);
}

.method-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.method-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid rgba(132, 92, 255, 0.12);
  border-radius: 999px;
  background: rgba(132, 92, 255, 0.08);
  color: var(--shp-purple-deep);
  font-size: 0.84rem;
  font-weight: 850;
}

.rank-list {
  display: grid;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 11px;
  border: 1px solid rgba(132, 92, 255, 0.1);
  border-radius: 18px;
  background: color-mix(in srgb, var(--shp-card-strong) 76%, transparent);
  cursor: pointer;
  text-align: left;
}

.rank-row:hover,
.rank-row.is-active {
  border-color: rgba(132, 92, 255, 0.34);
  box-shadow: 0 10px 20px rgba(132, 92, 255, 0.1);
}

.rank-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--shp-purple);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 900;
}

.rank-main {
  min-width: 0;
}

.rank-main strong,
.rank-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-main strong {
  font-size: 0.98rem;
}

.rank-main span {
  margin-top: 2px;
  color: var(--shp-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.rank-score {
  display: grid;
  justify-items: end;
  color: var(--shp-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rank-score strong {
  color: var(--shp-text);
  font-size: 1.1rem;
}

.prep-steps {
  display: grid;
  gap: 10px;
}

.prep-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 13px;
  border: 1px solid rgba(132, 92, 255, 0.1);
  border-radius: 18px;
  background: var(--shp-soft);
}

.prep-step span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--shp-green);
  color: var(--shp-text);
  font-weight: 900;
}

.prep-step strong {
  display: block;
  margin-bottom: 4px;
}

.prep-step p {
  margin: 0;
  color: var(--shp-muted);
  line-height: 1.48;
}

.compare-section {
  margin-top: 16px;
}

.compare-list {
  display: grid;
  gap: 10px;
}

.compare-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(132, 92, 255, 0.1);
  border-radius: 20px;
  background: color-mix(in srgb, var(--shp-card-strong) 76%, transparent);
}

.compare-row h3 {
  margin: 0;
  color: var(--shp-purple-deep);
  font-size: 1.08rem;
}

.compare-row dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.compare-row div {
  display: grid;
  gap: 3px;
}

.compare-row dt {
  color: var(--shp-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.compare-row dd {
  margin: 0;
  font-weight: 700;
  line-height: 1.42;
}

.site-footer {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.site-footer p {
  margin: 0;
  color: var(--shp-muted);
  line-height: 1.5;
}

.site-footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.site-footer a {
  color: var(--shp-purple-deep);
  font-weight: 850;
  text-decoration: none;
}

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

  .hero-copy h1 {
    font-size: clamp(2rem, 12.5vw, 2.9rem);
  }
}

@media (max-width: 360px) {
  .site-header {
    gap: 6px;
  }

  .brand-link {
    max-width: 34vw;
  }

  .lang-pill {
    min-width: 34px;
    padding-inline: 5px;
    font-size: 0.68rem;
  }

  .theme-toggle {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }
}

@media (min-width: 720px) {
  .app-shell {
    width: min(var(--max), calc(100% - 32px));
    margin-top: 22px;
  }

  .site-header {
    min-height: 64px;
    gap: 24px;
    margin-bottom: 18px;
    padding-bottom: 10px;
  }

  .brand-logo {
    width: 199px;
    max-width: 199px;
  }

  .header-actions {
    gap: 10px;
  }

  .lang-pill {
    min-width: 58px;
    min-height: 38px;
    padding-inline: 12px;
    font-size: 0.78rem;
  }

  .theme-toggle {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .hero-card {
    grid-template-columns: 1.35fr 0.85fr;
    gap: 20px;
    padding: 28px;
    border-radius: 0 34px 34px 34px;
  }

  .primary-link {
    width: max-content;
    min-width: 190px;
    padding-inline: 18px;
  }

  .control-dock {
    grid-template-columns: minmax(240px, 1fr) minmax(360px, auto) minmax(180px, 220px);
    align-items: end;
    top: 12px;
    padding: 14px;
  }

  .segmented-group {
    grid-template-columns: repeat(4, minmax(82px, auto));
  }

  .workbench {
    grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.75fr);
    align-items: start;
  }

  .detail-card {
    position: sticky;
    top: 116px;
  }

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

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

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

@media (min-width: 1120px) {
  .rank-list,
  .compare-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
