
:root {
  --page: #f7f5f1;
  --page-top: #fbfaf8;
  --ink: #1f2730;
  --muted: #68727d;
  --line: rgba(31,39,48,.12);
  --surface: #ffffff;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--page-top) 0%, var(--page) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }

.site-header {
  text-align: center;
  padding: 42px 22px 20px;
}
.eyebrow {
  color: #6d7782;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  margin-bottom: 8px;
}
h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 7vw, 74px);
  font-weight: 600;
  letter-spacing: .06em;
  line-height: .95;
  color: #1c2430;
}
.header-link { text-decoration: none; }
.section-title {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #374250;
  font-size: 14px;
  letter-spacing: .04em;
}
.dot { color: #8692a0; }

/* shared color marks */
.mana-orb, .color-mark {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  border: 1px solid rgba(26,34,42,.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.34);
}
.mana-orb { width: 25px; height: 25px; font-size: 13px; }
.color-mark { width: 62px; height: 62px; font-size: 25px; }
.w { background: #f3ead1; color: #403a2b; }
.u { background: #93cceb; color: #102c3d; }
.b { background: #36343a; color: #f3f0f4; }
.r { background: #dc7868; color: #421c17; }
.g { background: #78a982; color: #17331e; }
.m { background: #d1b86f; color: #3a2e12; }
.c { background: #c6c9cb; color: #30363a; }
.l { background: #b9a27d; color: #342a1e; }

/* top color navigation */
.color-nav {
  width: min(880px, calc(100% - 34px));
  margin: 4px auto 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.nav-home, .nav-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px solid rgba(31,39,48,.12);
  background: rgba(255,255,255,.74);
  text-decoration: none;
  color: #394553;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .03em;
}
.nav-home { padding: 0 13px; }
.nav-chip { min-width: 34px; padding: 0 10px; }
.nav-chip.available:hover, .nav-home:hover { background: #fff; border-color: rgba(31,39,48,.22); }
.nav-chip.active { background: #273340; color: #fff; border-color: #273340; }
.nav-chip.disabled { color: #9ba2a9; background: rgba(255,255,255,.42); cursor: default; }

/* landing page */
.home-main {
  width: min(960px, calc(100% - 42px));
  margin: 0 auto;
  padding: 18px 0 64px;
}
.home-intro {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 auto 30px;
  max-width: 580px;
}
.color-index {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.color-tile {
  min-height: 180px;
  border-radius: 16px;
  border: 1px solid rgba(31,39,48,.11);
  background: rgba(255,255,255,.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(19,28,36,.045);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.color-tile.available:hover {
  transform: translateY(-3px);
  border-color: rgba(31,39,48,.20);
  box-shadow: 0 9px 20px rgba(19,28,36,.09);
}
.color-tile.disabled { opacity: .48; cursor: default; }
.color-name { font-family: Georgia, "Times New Roman", serif; font-size: 20px; }
.color-count { color: #6c7680; font-size: 12px; }
.color-status { color: #92999f; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }

/* card gallery: v8 density */
.gallery-main {
  width: min(1020px, calc(100% - 140px));
  margin: 0 auto;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  padding: 12px 0 44px;
}
.card-button {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: #fff;
  border-radius: 4.75% / 3.4%;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(16,24,32,.08), 0 0 0 1px rgba(33,42,51,.10);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.card-button:hover {
  transform: translateY(-4px) scale(1.008);
  box-shadow: 0 8px 18px rgba(16,24,32,.14), 0 0 0 1px rgba(33,42,51,.14);
}
.card-button:focus-visible { outline: 2px solid #5f99c6; outline-offset: 5px; }
.card-button img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 7;
  object-fit: contain;
}
footer {
  text-align: center;
  color: #6b7580;
  font-size: 12px;
  padding: 0 20px 34px;
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(245,242,237,.985);
  color: #1f2730;
  overflow: hidden;
}
.lightbox::backdrop { background: #f5f2ed; }
.lightbox[open] {
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  grid-template-rows: 1fr;
}
.stage {
  grid-column: 2;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 68px 20px 100px;
  touch-action: none;
  cursor: default;
}
.stage.zoomed { cursor: grab; }
.stage.dragging { cursor: grabbing; }
.full-image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 220px);
  max-height: calc(100dvh - 190px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
  filter: drop-shadow(0 16px 28px rgba(0,0,0,.20));
}
.lightbox-chrome {
  position: fixed;
  left: 0; right: 0; top: 0;
  z-index: 4;
  height: 62px;
  pointer-events: none;
}
.counter {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #495463;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.icon-btn, .nav-btn, .tool-btn, .fit-btn, .zoom-readout {
  border: 1px solid rgba(27,35,44,.12);
  background: rgba(255,255,255,.92);
  color: #1f2730;
  backdrop-filter: blur(10px);
}
.close-btn {
  pointer-events: auto;
  position: absolute;
  top: 14px;
  right: 17px;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 31px;
  cursor: pointer;
}
.nav-btn {
  align-self: center;
  z-index: 3;
  width: 48px;
  height: 68px;
  border-radius: 12px;
  font-size: 48px;
  line-height: 52px;
  cursor: pointer;
  opacity: .78;
}
.prev-btn { grid-column: 1; justify-self: center; }
.next-btn { grid-column: 3; justify-self: center; }
.nav-btn:hover, .icon-btn:hover, .tool-btn:hover, .fit-btn:hover, .zoom-readout:hover { background: #fff; opacity: 1; }
.toolbar {
  position: fixed;
  z-index: 5;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(244,240,234,.9);
  border: 1px solid rgba(27,35,44,.08);
  backdrop-filter: blur(12px);
}
.tool-btn, .zoom-readout, .fit-btn { height: 36px; border-radius: 9px; cursor: pointer; font: inherit; }
.tool-btn { width: 38px; font-size: 21px; }
.zoom-readout { min-width: 66px; padding: 0 10px; font-size: 12px; color: #43505d; }
.fit-btn { padding: 0 13px; font-size: 12px; }
.toolbar-divider { width: 1px; height: 20px; background: rgba(27,35,44,.10); margin: 0 2px; }
.hint {
  position: fixed;
  z-index: 4;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(65,76,89,.60);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 1280px) {
  .gallery-main { width: min(980px, calc(100% - 72px)); }
  .gallery { gap: 16px; }
}
@media (max-width: 1020px) {
  .color-index { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .gallery-main { width: min(900px, calc(100% - 40px)); }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 760px) {
  .site-header { padding-top: 34px; }
  .home-main { width: min(100% - 22px, 960px); }
  .color-index { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
  .color-tile { min-height: 145px; }
  .color-mark { width: 52px; height: 52px; font-size: 21px; }
  .gallery-main { width: min(100% - 18px, 1480px); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .lightbox[open] { grid-template-columns: 44px 1fr 44px; }
  .stage { padding: 60px 4px 92px; }
  .full-image { max-width: calc(100vw - 100px); max-height: calc(100dvh - 165px); }
  .nav-btn { width: 38px; height: 58px; border-radius: 10px; font-size: 42px; }
  .hint { display: none; }
}


/* ---- overlay lightbox refinement ---- */
body.viewer-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(24, 31, 40, .30);
  color: #1f2730;
  overflow: hidden;
}
.lightbox::backdrop {
  background: rgba(24, 31, 40, .22);
  backdrop-filter: blur(1px);
}
.lightbox[open] {
  display: block;
}
.stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 84px 86px;
  touch-action: none;
  cursor: default;
}
.stage.zoomed { cursor: grab; }
.stage.dragging { cursor: grabbing; }
.full-image {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
  filter: drop-shadow(0 22px 38px rgba(0,0,0,.28));
  border-radius: 14px;
  animation: gf-pop .16s ease-out;
}
@keyframes gf-pop {
  from { transform: scale(.96); opacity: .6; }
  to { transform: scale(1); opacity: 1; }
}
.lightbox-chrome {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 4;
  height: 62px;
  pointer-events: none;
}
.counter {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #f7fafc;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: rgba(32,40,50,.42);
  padding: 6px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.icon-btn, .nav-btn, .tool-btn, .fit-btn, .zoom-readout {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.92);
  color: #1f2730;
  backdrop-filter: blur(10px);
}
.close-btn {
  pointer-events: auto;
  position: absolute;
  top: 14px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 31px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.14);
}
.nav-btn {
  position: absolute;
  z-index: 4;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 64px;
  border-radius: 12px;
  font-size: 46px;
  line-height: 50px;
  cursor: pointer;
  opacity: .94;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}
.prev-btn { left: 22px; }
.next-btn { right: 22px; }
.nav-btn:hover, .icon-btn:hover, .tool-btn:hover, .fit-btn:hover, .zoom-readout:hover { background: #fff; opacity: 1; }
.toolbar {
  position: absolute;
  z-index: 5;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(250,250,250,.88);
  border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
.tool-btn, .zoom-readout, .fit-btn { height: 36px; border-radius: 9px; cursor: pointer; font: inherit; }
.tool-btn { width: 38px; font-size: 21px; }
.zoom-readout { min-width: 66px; padding: 0 10px; font-size: 12px; color: #43505d; }
.fit-btn { padding: 0 13px; font-size: 12px; }
.toolbar-divider { width: 1px; height: 20px; background: rgba(27,35,44,.10); margin: 0 2px; }
.hint {
  position: absolute;
  z-index: 4;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.92);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,.18);
}

@media (max-width: 760px) {
  .lightbox::backdrop { background: rgba(24, 31, 40, .26); }
  .stage {
    padding: 58px 18px 92px;
  }
  .nav-btn {
    width: 38px;
    height: 54px;
    border-radius: 10px;
    font-size: 40px;
  }
  .prev-btn { left: 8px; }
  .next-btn { right: 8px; }
  .hint { display: none; }
}


/* ---- overlay v2 stronger background dimming ---- */
.lightbox {
  background: rgba(18, 24, 32, .52);
}

.lightbox::backdrop {
  background: rgba(18, 24, 32, .42);
  backdrop-filter: blur(2px);
}

.counter {
  background: rgba(20, 27, 35, .56);
}

@media (max-width: 760px) {
  .lightbox::backdrop {
    background: rgba(18, 24, 32, .48);
  }
}


/* ---- overlay v3 maximum-dim experiment ---- */
.lightbox {
  background: rgba(14, 19, 26, .68);
}

.lightbox::backdrop {
  background: rgba(14, 19, 26, .58);
  backdrop-filter: blur(3px);
}

.counter {
  background: rgba(16, 22, 29, .68);
}

.toolbar {
  background: rgba(248,248,248,.94);
}

@media (max-width: 760px) {
  .lightbox::backdrop {
    background: rgba(14, 19, 26, .62);
  }
}


/* ---- overlay v4 decluttered viewer ---- */
.toolbar,
.hint {
  display: none !important;
}

.stage {
  padding: 52px 84px 42px;
}

@media (max-width: 760px) {
  .stage {
    padding: 58px 18px 28px;
  }
}


/* ---- overlay v5 larger default inspection size ---- */
.stage {
  padding: 42px 76px 28px;
}

@media (max-width: 760px) {
  .stage {
    padding: 52px 14px 22px;
  }
}
