:root {
  --surface: #ffffff;
  --muted: #f7f7f8;
  --ink: #111318;
  --ink-muted: #626772;
  --line: #d9dce3;
  --blue: #002fa7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body,
button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
label:focus-within {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

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

::selection {
  background: var(--blue);
  color: white;
}

.shell {
  width: min(calc(100% - 32px), 1280px);
  margin-inline: auto;
}

.grid-lines {
  background-image:
    linear-gradient(to right, rgba(17, 19, 24, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17, 19, 24, 0.055) 1px, transparent 1px);
  background-size: 80px 80px;
}

#site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  letter-spacing: -0.04em;
}

.brand strong {
  font-size: 21px;
}

.brand span {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

.nav nav,
.footer-grid nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav nav a {
  padding: 22px 20px;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 700;
}

.nav nav a:hover,
.footer-grid a:hover,
.breadcrumb a:hover,
.section-head > a:hover {
  color: var(--blue);
}

.breadcrumb {
  border-bottom: 1px solid var(--line);
}

.breadcrumb-list {
  display: flex;
  min-height: 48px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 10px;
  padding-bottom: 10px;
  list-style: none;
}

.breadcrumb-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 12px;
}

.breadcrumb-list a {
  font-weight: 700;
}

.breadcrumb-list [aria-current="page"] {
  color: var(--ink);
}

.crumb-line {
  width: 16px;
  height: 1px;
  background: #aeb3be;
}

.eyebrow,
.knowledge > p,
.section-head > div > p,
.step {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow.muted {
  color: var(--ink-muted);
}

.page-intro {
  display: grid;
  min-height: 360px;
  grid-template-columns: 180px 1fr;
  align-items: start;
  padding: 64px 48px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  gap: 32px;
}

.giant-index {
  color: var(--blue);
  font-size: clamp(72px, 8vw, 116px);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.08em;
}

.page-intro h1,
.detail-copy h1,
.studio-intro h1,
.result-copy-panel h1,
.not-found h1 {
  max-width: 900px;
  margin: 18px 0 0;
  font-size: clamp(52px, 7vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.lede {
  max-width: 680px;
  margin: 28px 0 0;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero {
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  min-height: 680px;
  grid-template-columns: 1.12fr 0.88fr;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
}

.hero-folio {
  display: flex;
  justify-content: space-between;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 48px 0 0;
  font-size: clamp(64px, 8.2vw, 124px);
  line-height: 0.91;
  letter-spacing: -0.075em;
}

.hero-copy > div:nth-child(2) > p {
  max-width: 600px;
  margin: 30px 0 0;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1.7;
}

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

.hero .button-row {
  margin-top: 36px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  padding: 0 22px;
  background: white;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.button.secondary:hover {
  background: var(--ink);
  color: white;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.button.full {
  width: 100%;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 42px 0 0;
  border-top: 1px solid var(--line);
}

.stats > div {
  padding: 22px 0 0;
}

.stats dt {
  color: var(--ink-muted);
  font-size: 12px;
}

.stats dd {
  margin: 8px 0 0;
  font-size: 26px;
  font-weight: 700;
}

.hero-image,
.detail-image,
.card-image {
  position: relative;
  overflow: hidden;
  background: var(--muted);
}

.hero-image {
  min-height: 580px;
  border-left: 1px solid var(--line);
}

.hero-image img,
.detail-image img,
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image > span,
.image-label {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 14px 18px;
  background: white;
  font-size: 12px;
  font-weight: 700;
}

.section {
  padding-top: 80px;
  padding-bottom: 80px;
}

.muted-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--muted);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 36px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
  gap: 24px;
}

.section-head h2 {
  margin: 8px 0 0;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.section-head > a {
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.section-head > span {
  color: var(--ink-muted);
  font-size: 13px;
}

.section-head.simple {
  align-items: start;
}

.section-head.simple h2 {
  font-size: 38px;
}

.cards {
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.cards.three {
  grid-template-columns: repeat(3, 1fr);
}

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

.listing {
  padding-top: 1px;
  padding-bottom: 64px;
}

.category-directory {
  padding-top: 28px;
  padding-bottom: 72px;
}

.directory-meta,
.category-product-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.directory-meta {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 13px;
}

.category-product-count {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}

.category-product-count strong {
  color: var(--blue);
}

.card {
  display: block;
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: white;
}

.card:hover {
  border-color: var(--blue);
}

.card:hover .card-image img {
  transform: scale(1.025);
}

.card-image {
  aspect-ratio: 4 / 3;
}

.ratio-landscape {
  aspect-ratio: 4 / 3;
}

.ratio-square {
  aspect-ratio: 1;
}

.card-image img {
  transition: transform 420ms ease;
}

.image-index,
.mock-badge {
  position: absolute;
  z-index: 2;
  top: 18px;
  padding: 10px 12px;
  background: white;
  font-size: 12px;
  font-weight: 700;
}

.image-index {
  left: 18px;
  color: var(--blue);
}

.mock-badge {
  right: 18px;
}

.mock-badge.real-badge {
  background: var(--blue);
  color: white;
}

.card-body {
  padding: 22px;
}

.card-body h2,
.indexed-body h2 {
  margin: 8px 0 0;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.card-body > p:last-child,
.indexed-body p:last-child {
  margin: 14px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.65;
}

.indexed-body {
  display: grid;
  grid-template-columns: 56px 1fr;
  border-top: 1px solid var(--line);
}

.indexed-body > span {
  padding: 18px;
  border-right: 1px solid var(--line);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.indexed-body > div {
  padding: 18px;
}

.product-heading,
.product-meta,
.option-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.product-heading > strong {
  flex: 0 0 auto;
  font-size: 14px;
}

.product-meta {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}

.detail-hero,
.product-hero {
  display: grid;
  min-height: 620px;
  grid-template-columns: 1fr 1fr;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.detail-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 48px;
}

.detail-copy .giant-index {
  margin-top: 64px;
}

.record-count {
  width: 100%;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 13px;
}

.detail-image {
  min-height: 620px;
  border-left: 1px solid var(--line);
}

.product-hero > .detail-image:first-child {
  border-right: 1px solid var(--line);
  border-left: 0;
}

.detail-image.structure-plate {
  background: #f7f7f8;
}

.detail-image.structure-plate img {
  object-fit: contain;
}

.reference-photo {
  position: relative;
}

.reference-badge {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 18px;
  padding: 10px 12px;
  background: white;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.structure-section {
  display: grid;
  grid-template-columns: 0.38fr 0.62fr;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.structure-intro {
  padding: 40px;
}

.structure-intro > p {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.structure-intro h2 {
  margin: 18px 0 0;
  font-size: clamp(28px, 4vw, 40px);
}

.structure-image {
  min-height: 480px;
  border-left: 1px solid var(--line);
  background: #f7f7f8;
}

.structure-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-hero .detail-copy .button {
  margin-top: 42px;
}

.blue-title {
  margin: 18px 0 0;
  color: var(--blue);
  font-size: 28px;
}

.price {
  margin: 28px 0 0;
  font-size: 28px;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-left: 1px solid var(--line);
}

.knowledge {
  min-height: 280px;
  padding: 34px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.knowledge.wide {
  grid-column: span 2;
}

.knowledge.full {
  grid-column: 1 / -1;
}

.muted-card {
  background: var(--muted);
}

.knowledge h2 {
  margin: 20px 0 0;
  font-size: 28px;
  letter-spacing: -0.035em;
}

.knowledge-copy {
  max-width: 820px;
  margin-top: 20px;
  color: var(--ink-muted);
  line-height: 1.8;
}

.tag-list,
.swatches,
.variant-buttons {
  display: flex;
  flex-wrap: wrap;
  margin-top: 24px;
  gap: 10px;
}

.tag-list > span {
  border: 1px solid var(--line);
  padding: 10px 14px;
  font-size: 13px;
}

.listing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 13px;
}

.option-section {
  width: 100%;
  margin-top: 42px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.option-head {
  align-items: center;
}

.option-head h3 {
  margin: 0;
  font-size: 17px;
}

.option-head span {
  color: var(--ink-muted);
  font-size: 12px;
}

.variant-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.variant-buttons a {
  display: flex;
  min-height: 58px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 0 18px;
  font-size: 13px;
  font-weight: 700;
  gap: 12px;
}

.variant-buttons a:hover {
  border-color: var(--blue);
}

.variant-buttons i,
.swatch::before {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  background: var(--swatch);
  content: "";
}

.source-note {
  margin: 36px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
}

.source-note a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.source-subheading {
  margin: 28px 0 0;
  font-size: 20px;
}

.source-card {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color 160ms ease, transform 160ms ease;
}

.source-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.source-card span {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.source-card strong {
  color: var(--blue);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: underline;
  text-decoration-color: #b9c8f3;
  text-underline-offset: 4px;
}

.knowledge-hero {
  display: grid;
  min-height: 620px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.knowledge-hero > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 48px;
}

.knowledge-hero h1 {
  max-width: 860px;
  margin: 24px 0 0;
  font-size: clamp(58px, 7vw, 104px);
  line-height: 0.94;
  letter-spacing: -0.07em;
}

.knowledge-hero .button-row {
  margin-top: 38px;
}

.knowledge-stats {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  border-left: 1px solid var(--line);
  background: white;
}

.knowledge-stats > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px;
  border-bottom: 1px solid var(--line);
}

.knowledge-stats > div:last-child {
  border-bottom: 0;
}

.knowledge-stats strong {
  color: var(--blue);
  font-size: clamp(48px, 6vw, 76px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.knowledge-stats span {
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.portal-section,
.data-section {
  scroll-margin-top: 88px;
  padding: 72px 40px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.ability-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.ability-grid article {
  min-height: 230px;
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: white;
}

.ability-grid span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.ability-grid h3 {
  margin: 54px 0 0;
  font-size: 21px;
  letter-spacing: -0.035em;
}

.ability-grid p {
  margin: 14px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.directory-note {
  padding: 72px 40px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.directory-note > p {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.directory-note h2 {
  max-width: 760px;
  margin: 16px 0 0;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.directory-links {
  display: flex;
  flex-wrap: wrap;
  margin-top: 34px;
  border-top: 1px solid var(--line);
}

.directory-links a {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 17px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 700;
}

.directory-links a:hover {
  background: var(--blue);
  color: white;
}

.data-section .section-head {
  margin-bottom: 0;
}

.encyclopedia-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 32px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.encyclopedia-grid article {
  min-height: 250px;
  padding: 30px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: white;
}

.encyclopedia-grid article:nth-child(2),
.encyclopedia-grid article:nth-child(3) {
  background: var(--muted);
}

.encyclopedia-grid h3,
.legacy-plate h3 {
  margin: 0;
  font-size: 20px;
}

.encyclopedia-grid p {
  margin: 18px 0 0;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.85;
}

.encyclopedia-grid .subheading {
  margin-top: 34px;
}

.detail-actions {
  margin-top: 36px;
}

.section-link {
  margin-top: 24px;
}

.table-scroll {
  margin-top: 30px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: white;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border: 1px solid var(--line);
  padding: 15px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--muted);
  color: var(--ink-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.table-note {
  margin: 12px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.empty-data,
.estimate-panel {
  margin-top: 30px;
  border: 1px solid var(--line);
  padding: 28px;
  background: white;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.7;
}

.technical-diagram {
  margin-top: 30px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: white;
}

.technical-diagram svg {
  display: block;
  width: max(100%, 980px);
  height: auto;
}

.legacy-plate {
  display: grid;
  grid-template-columns: 0.3fr 0.7fr;
  align-items: start;
  margin-top: 22px;
  border: 1px solid var(--line);
  background: white;
}

.legacy-plate h3 {
  padding: 26px;
}

.legacy-plate img {
  width: 100%;
  max-height: 580px;
  border-left: 1px solid var(--line);
  object-fit: contain;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 30px 0 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.spec-grid > div {
  min-height: 126px;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.spec-grid dt {
  color: var(--ink-muted);
  font-size: 12px;
}

.spec-grid dd {
  margin: 14px 0 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.estimate-panel {
  background: white;
}

.estimate-panel strong {
  color: var(--ink);
}

.estimate-panel p {
  margin: 14px 0 0;
}

.embedded-studio {
  margin-top: 30px;
}

.embedded-studio .upload-zone {
  min-height: 260px;
}

.embedded-studio .upload-zone > img {
  height: 260px;
}

.embedded-studio .result-placeholder {
  min-height: 460px;
}

.related-row {
  margin-top: 28px;
}

.swatch {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 3px solid transparent;
  border-radius: 50%;
}

.swatch.selected {
  border-color: var(--blue);
}

.try-panel {
  width: 100%;
  margin-top: 40px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--muted);
}

.try-panel h2 {
  margin: 18px 0 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.try-panel > p:not(.eyebrow) {
  margin: 16px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.7;
}

.studio-intro {
  padding: 64px 48px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.studio {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  border: 1px solid var(--line);
}

.studio-controls,
.studio-result {
  padding: 34px;
}

.studio-result {
  border-left: 1px solid var(--line);
  background: var(--muted);
}

.try-on-page-shell {
  padding: 0;
}

.try-on-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.try-on-selectors label,
.try-on-selectors strong {
  display: block;
  font-size: 13px;
}

.try-on-selectors select {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 1px solid #aeb3be;
  border-radius: 0;
  padding: 0 14px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.try-on-selectors select:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.upload-zone {
  display: flex;
  min-height: 350px;
  align-items: center;
  margin-top: 24px;
  border: 1px dashed #aeb3be;
  background: var(--muted);
  cursor: pointer;
  overflow: hidden;
}

.upload-zone[data-drag-active="true"] {
  border-color: var(--blue);
  background: #eaf0ff;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.upload-zone > img {
  width: 100%;
  height: 350px;
  object-fit: contain;
}

#upload-prompt {
  display: flex;
  flex-direction: column;
  padding: 36px;
}

#upload-prompt strong {
  font-size: 20px;
}

#upload-prompt small {
  margin-top: 12px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.6;
}

#drop-replace-prompt {
  margin: 18px;
  padding: 10px 14px;
  background: var(--blue);
  color: white;
  font-size: 13px;
  font-weight: 700;
}

#photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.top-gap {
  margin-top: 40px;
}

.selected-hat {
  display: grid;
  grid-template-columns: 96px 1fr;
  margin-top: 18px;
  border: 1px solid var(--line);
}

.selected-hat img {
  width: 96px;
  height: 96px;
  object-fit: cover;
}

.selected-hat > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
  border-left: 1px solid var(--line);
  font-size: 14px;
}

.selected-hat span {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 12px;
}

#generate-button {
  margin-top: 26px;
}

.try-on-error {
  margin-top: 16px;
  border: 1px solid var(--blue);
  padding: 12px;
  color: var(--blue);
  font-size: 13px;
  line-height: 1.5;
}

.privacy {
  display: block;
  margin-top: 12px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.6;
}

.result-placeholder {
  display: flex;
  min-height: 520px;
  flex-direction: column;
  justify-content: center;
  margin-top: 24px;
  border: 1px solid var(--line);
  padding: 48px;
  background: white;
}

.result-placeholder strong {
  margin-top: 24px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.result-placeholder p {
  max-width: 420px;
  margin: 14px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.65;
}

.result-placeholder .button {
  align-self: flex-start;
  margin-top: 24px;
}

.try-on-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.try-on-result-head > span {
  border: 1px solid var(--line);
  padding: 6px 10px;
  background: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.try-on-result-ready {
  align-items: stretch;
  justify-content: flex-start;
}

.mock-result-frame {
  position: relative;
  display: flex;
  min-height: 390px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--muted);
}

.final-result-frame > #final-result-image {
  display: block;
  width: 100%;
  max-height: 470px;
  object-fit: contain;
}

.identity-lock-controls {
  margin-top: 14px;
  border: 1px solid var(--line);
  padding: 14px;
  background: white;
}

.identity-lock-controls > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 13px;
}

.identity-lock-controls output {
  color: var(--blue);
  font-weight: 700;
}

.identity-lock-controls input {
  width: 100%;
  margin-top: 14px;
  accent-color: var(--blue);
}

.identity-lock-controls p {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
}

.mock-hat-reference {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 118px;
  border: 1px solid var(--line);
  padding: 8px;
  background: white;
  box-shadow: 6px 6px 0 var(--blue);
}

.mock-hat-reference img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.mock-hat-reference strong {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0;
}

.try-on-result-ready .button-row {
  margin-top: 22px;
}

.try-on-result-ready .button {
  margin-top: 0;
}

.portrait-placeholder {
  width: 96px;
  height: 128px;
  border: 1px solid #aeb3be;
  background: var(--muted);
}

.result-page {
  display: grid;
  min-height: 680px;
  grid-template-columns: 0.78fr 1.22fr;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.result-copy-panel,
.result-visual {
  padding: 48px;
}

.result-copy-panel {
  display: flex;
  flex-direction: column;
}

.result-copy-panel dl {
  margin: auto 0 0;
  border-top: 1px solid var(--line);
}

.result-copy-panel dl > div {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.result-copy-panel dt {
  color: var(--ink-muted);
}

.result-copy-panel dd {
  margin: 0;
  font-weight: 700;
}

.result-visual {
  border-left: 1px solid var(--line);
  background: var(--muted);
}

.result-canvas {
  position: relative;
  display: flex;
  min-height: 510px;
  align-items: center;
  padding: 28px;
  background: white;
  overflow: hidden;
}

.result-canvas > #saved-photo {
  width: 100%;
  height: 500px;
  object-fit: contain;
}

.portrait-placeholder.large {
  width: 180px;
  height: 240px;
}

.hat-chip {
  position: absolute;
  top: 28px;
  right: 28px;
  display: grid;
  width: 250px;
  grid-template-columns: 84px 1fr;
  border: 1px solid var(--line);
  background: white;
}

.hat-chip img {
  width: 84px;
  height: 84px;
  object-fit: cover;
}

.hat-chip > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
}

.hat-chip strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hat-chip small {
  margin-top: 5px;
  color: var(--ink-muted);
}

.result-canvas > b {
  position: absolute;
  right: 28px;
  bottom: 28px;
  left: 28px;
  padding: 18px;
  background: var(--blue);
  color: white;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-align: left;
}

.result-visual > .button-row {
  margin-top: 18px;
}

.not-found {
  min-height: 68vh;
  padding-top: 96px;
  padding-bottom: 96px;
}

.not-found h1 {
  max-width: 840px;
  margin-bottom: 36px;
}

#site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  background: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  padding-top: 48px;
  padding-bottom: 48px;
  gap: 48px;
}

.footer-grid > div > strong {
  font-size: 26px;
  letter-spacing: -0.04em;
}

.footer-grid p {
  max-width: 500px;
  margin: 14px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.footer-grid nav {
  justify-content: flex-end;
  gap: 28px;
  font-size: 13px;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

@media (max-width: 920px) {
  .hero-grid,
  .detail-hero,
  .product-hero,
  .structure-section,
  .knowledge-hero,
  .studio,
  .result-page {
    grid-template-columns: 1fr;
  }

  .hero-image,
  .detail-image,
  .product-hero > .detail-image:first-child,
  .studio-result,
  .result-visual {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .hero-image {
    min-height: 520px;
  }

  .structure-image {
    min-height: 430px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

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

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

  .knowledge-stats {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .knowledge-stats > div {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .knowledge-stats strong {
    font-size: 50px;
  }

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

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

  .knowledge.wide,
  .knowledge.full {
    grid-column: 1 / -1;
  }

  .result-copy-panel {
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(calc(100% - 24px), 1280px);
  }

  .brand span {
    display: none;
  }

  .nav nav a {
    padding: 22px 10px;
    font-size: 12px;
  }

  .page-intro {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 44px 24px;
  }

  .giant-index {
    font-size: 68px;
  }

  .page-intro h1,
  .detail-copy h1,
  .studio-intro h1,
  .result-copy-panel h1,
  .not-found h1 {
    font-size: 52px;
  }

  .lede {
    font-size: 16px;
  }

  .hero-copy,
  .detail-copy,
  .studio-intro,
  .studio-controls,
  .studio-result,
  .result-copy-panel,
  .result-visual {
    padding: 28px 22px;
  }

  .hero h1 {
    font-size: 66px;
  }

  .hero-folio {
    gap: 18px;
  }

  .hero-copy > div:nth-child(2) > p {
    font-size: 16px;
  }

  .hero-image,
  .detail-image {
    min-height: 430px;
  }

  .stats {
    margin-top: 36px;
  }

  .stats dt {
    font-size: 10px;
  }

  .section {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .knowledge-hero > div:first-child,
  .portal-section,
  .data-section,
  .directory-note {
    padding: 48px 22px;
  }

  .knowledge-hero h1 {
    font-size: 54px;
  }

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

  .knowledge-stats > div {
    padding: 28px 22px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .knowledge-stats > div:last-child {
    border-bottom: 0;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .section-head h2,
  .section-head.simple h2 {
    font-size: 42px;
  }

  .cards.two,
  .cards.three,
  .knowledge-grid,
  .ability-grid,
  .encyclopedia-grid,
  .spec-grid {
    grid-template-columns: 1fr;
  }

  .encyclopedia-grid article:nth-child(3) {
    background: white;
  }

  .encyclopedia-grid article:nth-child(even) {
    background: var(--muted);
  }

  .legacy-plate {
    grid-template-columns: 1fr;
  }

  .legacy-plate img {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .knowledge.wide,
  .knowledge.full {
    grid-column: auto;
  }

  .detail-copy .giant-index {
    margin-top: 42px;
  }

  .record-count {
    margin-top: 52px;
  }

  .listing-meta {
    align-items: start;
    flex-direction: column;
    line-height: 1.5;
  }

  .directory-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .variant-buttons {
    grid-template-columns: 1fr;
  }

  .upload-zone {
    min-height: 300px;
  }

  .try-on-selectors {
    grid-template-columns: 1fr;
  }

  .result-placeholder {
    min-height: 430px;
    padding: 30px;
  }

  .hat-chip {
    width: 220px;
  }

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

  .footer-grid nav {
    justify-content: flex-start;
  }
}
