:root {
  --ink: #14120c;
  --ink-2: #1b1810;
  --ink-3: #231f15;
  --plate: #ffffff;
  --paper: #f5f1e6;
  --paper-dim: #d8d1bf;
  --muted: #9a9075;
  --line: rgba(214, 196, 140, .16);
  --line-strong: rgba(214, 196, 140, .30);
  --yellow: #f4dd00;
  --purple-lite: #b164e0;
  --gold: #c99a2e;
  --gold-lite: #e6bd5b;
  --topbar-h: 50px;
  --sidebar-w: 250px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  --ui-gap: clamp(.6rem, 1.5vw, .9rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ff-display: "Anton", "Arial Narrow", "Helvetica Neue", sans-serif;
  --ff-body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-jp: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(80% 70% at 90% -10%, rgba(177, 100, 224, .12), transparent 48%),
    radial-gradient(70% 60% at 8% 0%, rgba(244, 221, 0, .09), transparent 46%),
    var(--ink);
  color: var(--paper-dim);
  font-family: var(--ff-body);
  font-size: clamp(15px, 1vw + 12px, 17px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.lb-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

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

::selection {
  background: var(--yellow);
  color: var(--ink);
}

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 3vw, 2.1rem);
}

.eyebrow {
  margin: 0;
  color: var(--gold-lite);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .75rem;
  margin: var(--ui-gap) var(--ui-gap) 0;
  padding-inline: clamp(1.1rem, 3vw, 2.1rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(20, 18, 12, .88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .15);
  font-family: var(--ff-jp);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.brand__txt {
  display: none;
  color: var(--paper);
  font-family: var(--ff-display);
  font-size: 1.02rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.topnav {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-width: 0;
  margin-left: auto;
  padding: .2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(27, 24, 16, .72);
}

.tab-button {
  flex: 1;
  min-width: 0;
  padding: .4rem .55rem;
  border-radius: 999px;
  color: var(--paper-dim);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
  transition: background .18s, color .18s, transform .12s;
}

.tab-button:hover {
  background: rgba(245, 241, 230, .07);
  color: var(--paper);
}

.tab-button.is-active {
  background: var(--yellow);
  color: var(--ink);
}

.tab-button:active {
  transform: scale(.97);
}

.tab-button:focus-visible,
.card:focus-visible,
.lb__btn:focus-visible,
.lb__close:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.sidebar-toggle {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  transition: background .15s, border-color .15s;
}

.sidebar-toggle:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .06);
}

.sidebar-toggle span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--paper-dim);
  transition: background .15s;
}

.sidebar-toggle:hover span {
  background: var(--paper);
}

.sidebar-toggle.is-res-hidden {
  visibility: hidden;
  pointer-events: none;
}

.site-dl {
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 1rem;
  transition: background .15s, border-color .15s, opacity .15s;
}

.site-dl:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .06);
}

.site-dl[disabled] {
  opacity: .35;
  pointer-events: none;
}

.topbar-end {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.gh-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  transition: background .15s, border-color .15s, color .15s;
}

.gh-link:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .06);
  color: var(--paper);
}

.page,
.page__content,
.scroll-area {
  min-width: 0;
}

.page__content {
  display: block;
}

.scroll-area {
  overflow: visible;
  height: auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  scrollbar-gutter: auto;
}

.is-hidden-tab {
  display: none !important;
}

.controls {
  position: relative;
  z-index: 55;
  max-height: 38vh;
  margin: var(--ui-gap);
  overflow: auto;
  overscroll-behavior: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(20, 18, 12, .96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.controls__inner {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: .8rem clamp(1.1rem, 3vw, 2.1rem);
}

.controls__title {
  display: none;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}

.controls__title strong {
  display: block;
  color: var(--paper);
  font-family: var(--ff-display);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.controls__heading-label {
  display: block;
  margin-bottom: .35rem;
  color: var(--gold-lite);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.fgroup {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
  min-width: 0;
}

.fgroup__label {
  flex: none;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-direction: row;
  gap: .42rem;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .45rem;
  width: auto;
  padding: .42rem .78rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-3);
  color: var(--paper-dim);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: left;
  white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s, transform .12s;
}

.chip .jp {
  min-width: 1.2em;
  font-family: var(--ff-jp);
  font-size: .92rem;
  font-weight: 700;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--paper);
}

.chip[aria-pressed="true"] {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
}

.chip[aria-pressed="true"] .jp {
  color: var(--ink);
}

.chip[style*="--livery-chip-color"][aria-pressed="true"] {
  border-color: var(--livery-chip-color);
  background: var(--livery-chip-color);
  color: var(--livery-chip-text, #fff);
}

.chip[style*="--livery-chip-color"][aria-pressed="true"] .jp {
  color: var(--livery-chip-text, #fff);
}

.chip:active {
  transform: scale(.98);
}

.result {
  margin-top: 0;
  padding-top: .65rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.result b {
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}

#count-label {
  display: inline;
}

.page.sidebar-collapsed .controls {
  display: none;
}

.page.is-resources {
  grid-template-columns: minmax(0, 1fr);
}

.page.is-resources .controls {
  display: none;
}

.gallery-intro {
  padding-block: clamp(1.1rem, 3vw, 2.2rem) 0;
}

.gallery {
  padding-block: clamp(1rem, 2.5vw, 1.8rem) clamp(3rem, 6vw, 5rem);
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .75rem;
}

.hero__eyebrow span {
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--gold);
}

.resource-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.2rem, 3vw, 2.1rem);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(35, 31, 21, .96), rgba(20, 18, 12, .92));
  box-shadow: var(--shadow);
}

.resource-hero::after {
  content: "三月";
  position: absolute;
  top: 50%;
  right: clamp(1rem, 4vw, 2.4rem);
  transform: translateY(-50%);
  color: rgba(244, 221, 0, .045);
  font-family: var(--ff-jp);
  font-size: clamp(8rem, 26vw, 20rem);
  font-weight: 900;
  line-height: .8;
  pointer-events: none;
}

.resource-hero h1 {
  position: relative;
  z-index: 1;
  margin: .5rem 0 .6rem;
  color: var(--paper);
  font-family: var(--ff-display);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.20;
  text-transform: uppercase;
}

.resource-hero h1 .y {
  color: var(--yellow);
}

.resource-hero p:not(.eyebrow) {
  position: relative;
  z-index: 1;
  max-width: 72ch;
  margin: 0;
  color: var(--paper-dim);
}

.vsec {
  padding-block: clamp(1.45rem, 3vw, 2.35rem);
  scroll-margin-top: 14px;
}

.vsec:first-child {
  padding-top: .4rem;
}

.vsec.is-hidden,
.card.is-hidden,
.card-wrap:has(> .card.is-hidden) {
  display: none;
}

.dhead {
  display: flex;
  align-items: center;
  gap: clamp(.85rem, 2vw, 1.4rem);
  margin-bottom: 1.05rem;
}

.dhead__glyph {
  flex: none;
  color: var(--yellow);
  font-family: var(--ff-jp);
  font-size: clamp(2.55rem, 6vw, 5.2rem);
  font-weight: 900;
  line-height: .78;
}

.dhead__body {
  min-width: 0;
  padding-bottom: .2rem;
}

.dhead__eyebrow {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .35rem;
  color: var(--gold-lite);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.dhead__eyebrow .num {
  color: var(--purple-lite);
}

.dhead h2 {
  margin: 0;
  color: var(--paper);
  font-family: var(--ff-display);
  font-size: clamp(1.55rem, 3.8vw, 2.55rem);
  font-weight: 400;
  line-height: 1.20;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.dhead__meta {
  margin-top: .35rem;
  color: var(--muted);
  font-size: .84rem;
}

.dhead__meta b {
  color: var(--paper-dim);
  font-weight: 600;
}

.pinstripe {
  position: relative;
  height: 0;
  margin-bottom: 1.2rem;
  border-top: 2px solid var(--gold);
  opacity: .55;
}

.pinstripe::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 60px;
  border-top: 2px solid var(--purple-lite);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(.85rem, 1.8vw, 1.25rem);
}

.card-wrap {
  position: relative;
}

.card-download {
  position: absolute;
  top: .5rem;
  right: .5rem;
  z-index: 1;
  opacity: 0;
  transition: opacity .18s;
}

.card-wrap:hover .card-download {
  opacity: 1;
}

.card {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--ink-2);
  text-align: left;
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s, opacity .4s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.card__img {
  position: relative;
  background: var(--plate);
}

.card__img img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.card__cap {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  padding: .75rem .8rem;
  background: var(--ink-2);
}

.card__cap::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .26s var(--ease);
}

.card:hover .card__cap::before,
.card:focus-visible .card__cap::before {
  transform: scaleX(1);
}

.tag {
  flex: none;
  padding: .25rem .46rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--paper-dim);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tag--view {
  border-color: rgba(216, 209, 191, .26);
  color: var(--paper-dim);
}

.tag--livery {
  border-color: color-mix(in srgb, var(--livery-tag-color, #888) 40%, transparent);
  color: var(--livery-tag-color, #888);
}

.empty {
  display: none;
  margin-bottom: 3rem;
  padding: 3rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.empty.is-on {
  display: block;
}

.empty b {
  color: var(--paper);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
}

.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}

.resources {
  padding-block: clamp(1.1rem, 3vw, 2.2rem) clamp(2.8rem, 6vw, 4.8rem);
}

.resources.wrap,
.gallery-intro.wrap {
  max-width: 1600px;
}

.resource-section {
  padding-top: clamp(2rem, 4vw, 3rem);
}

.resource-head {
  margin-bottom: 1.05rem;
}

.resource-head .eyebrow {
  margin-bottom: .35rem;
  color: var(--gold-lite);
}

.resource-head h2 {
  margin: 0;
  color: var(--paper);
  font-family: var(--ff-display);
  font-size: clamp(1.65rem, 3.6vw, 2.7rem);
  font-weight: 400;
  line-height: 1.20;
  text-transform: uppercase;
}

.resource-head p:not(.eyebrow) {
  margin: .4rem 0 0;
  color: var(--muted);
  font-size: .95rem;
}

.resource-grid {
  display: grid;
  gap: clamp(.9rem, 2vw, 1.35rem);
}

.resource-grid--colors {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.resource-grid--kamon,
.resource-grid--kanji,
.resource-grid--font,
.resource-grid--3d {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
}

.resource-card--ghost {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 560px) {
  .resource-card--ghost {
    display: none;
  }
}

.resource-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(35, 31, 21, .95), rgba(27, 24, 16, .98));
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .75);
}

.resource-card:hover {
  border-color: var(--line-strong);
}

.color-card {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100%;
}

.color-card__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 18, 12, .55);
}

.color-wheel {
  position: relative;
  width: 124px;
  height: 124px;
  border-radius: 12px;
  background:
    linear-gradient(to bottom, transparent, #000),
    linear-gradient(to right, #fff, hsl(var(--wheel-hue), 100%, 50%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 14px 30px -20px #000;
}

.color-wheel::after {
  content: "";
  position: absolute;
  left: calc(var(--wheel-sat, 100) * 1%);
  top: calc((100 - var(--wheel-val, 100)) * 1%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  background: var(--swatch);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .5);
  transform: translate(-50%, -50%);
}

.hue-strip {
  position: relative;
  width: 124px;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(
    to right,
    #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 4px 10px -4px rgba(0, 0, 0, .5);
}

.hue-strip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--wheel-hue-pct, 0) * 1%);
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  background: hsl(var(--wheel-hue), 100%, 50%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .45);
}

.swatch {
  width: 92px;
  height: 38px;
  border: 1px solid rgba(245, 241, 230, .26);
  border-radius: 10px;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45);
}

.resource-card__body {
  min-width: 0;
  padding: 1.05rem;
}

.resource-card__role {
  margin: 0 0 .35rem;
  color: var(--gold-lite);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.resource-card__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin: 0 0 .9rem;
}

.resource-card h3 {
  margin: 0;
  color: var(--paper);
  font-family: var(--ff-display);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.color-card h3 {
  margin-bottom: .9rem;
}

.spec-grid {
  display: grid;
  gap: .45rem;
  margin: 0;
}

.spec-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  padding: .44rem .52rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(20, 18, 12, .38);
}

.spec-row__label {
  color: var(--muted);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.spec-row__value {
  margin: 0;
  color: var(--paper-dim);
  font-size: .88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.spec-row--hex .spec-row__value {
  color: var(--paper);
}

.finish-list {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .9rem;
}

.finish-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .36rem .55rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(20, 18, 12, .55);
  color: var(--paper-dim);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
}

.finish-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.finish-badge--medium::before {
  background: var(--gold-lite);
}

.finish-badge--strong::before {
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(244, 221, 0, .12);
}

.kamon-card,
.kanji-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.kamon-card__frame,
.kanji-card__frame {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 1.2rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.font-card__frame {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 1.2rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.kamon-card__frame img,
.kanji-card__frame img {
  width: min(100%, 250px);
  max-height: 250px;
  object-fit: contain;
}

.kanji-card__frame img {
  width: min(100%, 230px);
  max-height: 230px;
}

.font-card__preview {
  font-family: 'Yuji Syuku', serif;
  font-size: clamp(5rem, 14vw, 9rem);
  font-weight: 400;
  color: #101820;
  line-height: 1;
  user-select: none;
}

.model-3d-card__frame {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 1.2rem;
  border-bottom: 1px solid var(--line);
  background: #3f3f3f;
}

.model-3d-card__frame img {
  width: min(100%, 250px);
  max-height: 250px;
  object-fit: contain;
}

.model-3d-card__placeholder {
  font-family: var(--ff-display);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 400;
  color: rgba(245, 241, 230, .12);
  letter-spacing: .1em;
  text-transform: uppercase;
  user-select: none;
}

.file-path {
  margin: .25rem 0 .8rem;
  padding: .5rem .6rem;
  overflow-wrap: anywhere;
  border-radius: 9px;
  background: rgba(20, 18, 12, .55);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .72rem;
}

.resource-link {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--paper);
  font-size: 1rem;
  text-decoration: none;
  transition: background .18s, color .18s, border-color .18s;
}

.resource-link:hover {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--ink);
}

.dl-mobile-hint {
  display: none;
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
}

@media (hover: none) and (pointer: coarse) {
  .resource-link,
  .gh-link {
    display: none;
  }
  .dl-mobile-hint { display: block; }
  .lb__cap .dl-mobile-hint { flex-basis: 100%; }
  .site-dl { display: flex; }
  .site-dl[hidden] { display: none; }
}

@media (hover: hover) and (pointer: fine) {
  .site-dl {
    display: flex;
  }
  .site-dl[hidden] {
    display: none;
  }
}

body:not(.is-local) .section-subtitle,
body:not(.is-local) .file-path {
  display: none;
}

.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(8, 7, 4, .94);
  backdrop-filter: blur(6px);
}

.lb.is-open {
  display: flex;
}

.lb__fig {
  position: relative;
  width: 100%;
  max-width: min(94vw, 1200px);
}

.lb__plate {
  overflow: hidden;
  border-top: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
  border-radius: 12px;
  background: var(--plate);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
}

.lb__plate img {
  width: 100%;
  height: auto;
  max-height: 74vh;
  object-fit: contain;
}

.lb__cap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem;
  margin-top: 1rem;
  color: var(--paper);
}

.lb__glyph {
  color: var(--yellow);
  font-family: var(--ff-jp);
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
}

.lb__name {
  font-family: var(--ff-display);
  font-size: 1.3rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.lb__sub {
  color: var(--muted);
  font-size: .85rem;
}

.lb__idx {
  margin-left: auto;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .14em;
}

.lb__idx b {
  color: var(--yellow);
}

.lb__btn,
.lb__close {
  position: fixed;
  z-index: 102;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(20, 18, 12, .75);
  color: var(--paper);
  transition: background .18s, transform .12s;
}

.lb__btn {
  top: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.4rem;
  transform: translateY(-50%);
}

.lb__close {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
}

.lb__btn:hover,
.lb__close:hover {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--ink);
}

.lb__btn:active {
  transform: translateY(-50%) scale(.94);
}

.lb__prev {
  left: .55rem;
}

.lb__next {
  right: .55rem;
}

@media (min-width: 561px) {
  .lb__prev {
    left: clamp(.75rem, 2vw, 1.35rem);
  }

  .lb__next {
    right: clamp(.75rem, 2vw, 1.35rem);
  }

  .lb__btn {
    width: 48px;
    height: 48px;
  }

  .resource-grid--kanji,
  .resource-grid--font {
    grid-template-rows: auto;
    grid-auto-rows: 0;
    overflow: hidden;
  }
}

/* ── Download confirmation dialog ─────────────────────────────────────────── */

.dl-dialog {
  padding: 0;
  width: min(90vw, 420px);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--ink-2);
  color: var(--paper);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
}

.dl-dialog::backdrop {
  background: rgba(8, 7, 4, .85);
  backdrop-filter: blur(6px);
}

.dl-dialog__form {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: 1.6rem 1.8rem;
}

.dl-dialog__title {
  margin: 0;
  color: var(--paper);
  font-family: var(--ff-display);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.dl-dialog__body {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}

.dl-dialog__check-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--ink-3);
  font-size: .88rem;
  cursor: pointer;
}

.dl-dialog__check-label:hover {
  border-color: var(--line-strong);
}

.dl-dialog__size {
  color: var(--muted);
  font-size: .78rem;
}

.dl-dialog__warn {
  margin: 0;
  color: var(--gold-lite);
  font-size: .8rem;
}

.dl-dialog__warn[hidden] {
  display: none;
}

.dl-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  margin-top: .4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.dl-dialog__btn {
  padding: .45rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.dl-dialog__btn--cancel {
  background: transparent;
  color: var(--muted);
}

.dl-dialog__btn--cancel:hover {
  background: rgba(245, 241, 230, .07);
  color: var(--paper);
}

.dl-dialog__btn--confirm {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
}

.dl-dialog__btn--confirm:hover {
  background: var(--gold-lite);
  border-color: var(--gold-lite);
}

.dl-dialog__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--ink-3);
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding-block: .45rem;
    gap: .5rem;
  }

  .brand {
    flex: 1;
  }

  .brand__txt {
    display: inline;
  }

  .topnav {
    order: 3;
    flex: 0 0 100%;
    margin-left: 0;
    border-radius: 10px;
  }
}

@media (min-width: 721px) {
  .brand__txt {
    display: inline;
  }

  .topnav {
    flex: 0 1 auto;
    margin-inline: 1rem;
  }

  .tab-button {
    flex: 0 0 auto;
    min-width: 92px;
    padding: .43rem .85rem;
    font-size: .68rem;
    letter-spacing: .16em;
  }

  .color-card {
    grid-template-columns: 150px minmax(0, 1fr);
  }

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

  .spec-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

@media (min-width: 981px) {
  :root {
    --topbar-h: 54px;
  }

  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .topbar {
    gap: 1.25rem;
  }

  .sidebar-toggle {
    display: none;
  }

  .page {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    align-items: stretch;
    min-height: 0;
    height: calc(100vh - var(--topbar-h) - var(--ui-gap));
    height: calc(100dvh - var(--topbar-h) - var(--ui-gap));
    height: calc(var(--app-vh, 100dvh) - var(--topbar-h) - var(--ui-gap));
    overflow: hidden;
  }

  .page__content {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .scroll-area {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .controls {
    min-height: 0;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .controls__inner {
    gap: 1.15rem;
    padding: 1.05rem 1rem 1.25rem;
  }

  .controls__title {
    display: block;
  }

  .fgroup {
    gap: .48rem;
  }

  .chips {
    flex-direction: column;
    overflow: visible;
    padding-bottom: 0;
    scrollbar-width: auto;
  }

  .chip {
    width: 100%;
    flex: initial;
    border-radius: 9px;
    padding: .48rem .7rem;
    white-space: normal;
  }

  .result {
    margin-top: auto;
    padding-top: .9rem;
  }

  .resources-area {
    grid-row: 1 / -1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .dhead {
    align-items: flex-end;
  }
}

.scroll-top {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1.1rem);
  right: 1.1rem;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(20, 18, 12, .92);
  color: var(--paper);
  font-size: 1.1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(.5rem);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}

.scroll-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@media (min-width: 981px) {
  .scroll-top {
    display: none;
  }
}

/* ── About panel ────────────────────────────────────────────────────────────── */
.about-section {
  margin-top: 2.5rem;
  max-width: 680px;
}
.about-section__title {
  font-family: var(--ff-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line-strong);
}
.about-accent {
  color: var(--yellow);
}

.about-section__body {
  line-height: 1.7;
  margin: 0;
}
.about-section__body p          { margin: 0 0 .7rem; line-height: 1.7; }
.about-section__body p:last-child { margin-bottom: 0; }
.about-section__body h2,
.about-section__body h3         { font-size: .88rem; font-weight: 700;
                                   letter-spacing: .09em; text-transform: uppercase;
                                   color: var(--paper); margin: 1.1rem 0 .4rem; }
.about-section__body h2:first-child,
.about-section__body h3:first-child { margin-top: 0; }
.about-section__body ul         { margin: 0 0 .7rem; padding-left: 1.3rem; }
.about-section__body li         { margin: .2rem 0; line-height: 1.6; }
.about-section__body a          { color: var(--yellow); }
.about-section__body a:hover    { text-decoration: underline; }
.about-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: auto;
  justify-content: start;
  gap: .4rem 5rem;
}
.about-links__link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--yellow);
  text-decoration: none;
  font-weight: 500;
}
.about-links__link:hover { text-decoration: underline; }

@media (orientation: landscape) and (max-width: 980px) {
  .about-links {
    grid-template-columns: repeat(3, auto);
  }

  .result b {
    font-weight: 600;
  }
}

@media (min-width: 981px) {
  .about-links {
    grid-template-columns: repeat(3, auto);
  }
}

/* ── Download overlay ──────────────────────────────────────────────────────── */
.dl-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(20, 18, 12, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dl-overlay[hidden] { display: none; }
.dl-overlay__box {
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  padding: 2rem 2.5rem;
  width: min(360px, 90vw);
}
.dl-overlay__title {
  margin: 0 0 1.25rem;
  font-weight: 600;
  font-size: 1rem;
}
.dl-overlay__track {
  height: 6px;
  background: rgba(245, 241, 230, 0.15);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.dl-overlay__fill {
  height: 100%;
  width: 0%;
  background: var(--yellow);
  border-radius: 3px;
  transition: width 0.15s ease;
}
.dl-overlay__label {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.6;
}

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

  * {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
