@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/pjs-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/pjs-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f6f3ef;
  --paper: #fffcf9;
  --ink: #1a1714;
  --muted: #514c47;
  --line: #e6e0d8;
  --accent: #9a2e24;
  --ok: #1f6b45;
  --header-h: 62px;
  --bar-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.011em;
}
::selection { background: #e8d9cf; color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }

.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;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 0 8px;
  background: color-mix(in srgb, var(--bg) 92%, white);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.header-side {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  border-radius: 999px;
}
.header-side svg { display: block; }
.header-side[hidden], .header-side.is-hidden { visibility: hidden; pointer-events: none; }
.brand {
  text-align: center;
  text-decoration: none;
  min-width: 0;
}
.brand-name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.15;
}
.brand-sub {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Home */
#view-home { padding-bottom: 32px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.search svg { flex: 0 0 auto; }
.search input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
  caret-color: var(--ink);
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:focus { outline: none; }
.search:focus-within { border-bottom-color: var(--ink); color: var(--ink); }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 8px;
  padding: 16px 12px 8px;
}
.tile { text-decoration: none; color: inherit; min-width: 0; }
.tile-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #ece7e1;
  overflow: hidden;
}
.tile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--paper);
  padding: 3px 6px 2px;
  line-height: 1.2;
}
.tile-meta { padding: 10px 2px 0; }
.tile-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.tile-code {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tile-name {
  margin: 3px 0 6px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-price {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.tile-price span { font-weight: 500; color: var(--muted); font-size: 11px; letter-spacing: 0; }
.tile-seri {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.empty-msg {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
  font-size: 14px;
}
.hidden { display: none !important; }

.home-foot {
  text-align: center;
  padding: 28px 16px 12px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.home-foot a { text-decoration: none; border-bottom: 1px solid var(--line); }

/* Detail */
#view-detail { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px)); }
#view-detail.is-off { display: none; }
#view-home.is-off { display: none; }

.gallery {
  position: relative;
  background: #ece7e1;
}
.slides {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.slides::-webkit-scrollbar { display: none; }
.slides img {
  flex: 0 0 100%;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 18%;
  background: #ece7e1;
  scroll-snap-align: start;
  cursor: zoom-in;
}
.dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px 0 0;
}
.dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c9c2b9;
  cursor: pointer;
}
.dots button[aria-current="true"] {
  background: var(--ink);
  width: 16px;
}

.detail-body { padding: 14px 20px 20px; }
.detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.detail-code {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.badge-inline {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.detail-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.price-block { margin: 0 0 8px; }
.price-main {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.price-main em {
  font-style: normal;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--muted);
}
.price-seri {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.caption-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 16px 0;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.caption-toggle svg {
  flex: 0 0 auto;
  transition: transform 240ms var(--ease);
}
.caption-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.caption {
  margin: 0;
  padding: 0 0 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
  color: var(--ink);
}
.caption-hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
}

/* Sticky action bar */
.action-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 88%, white);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.action-bar[hidden] { display: none !important; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
}
.btn svg { display: block; }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.is-done { background: var(--ok); border-color: var(--ok); color: #fff; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: #11100e;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 8px 24px;
}
.lightbox[hidden] { display: none !important; }
.lightbox img {
  max-width: 100%;
  max-height: calc(100dvh - 88px);
  object-fit: contain;
}
.lb-bar {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; justify-content: space-between; align-items: center;
  color: #f6f3ef;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.lightbox button {
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  border: 0;
  border-radius: 999px;
  width: 40px; height: 40px;
  cursor: pointer;
  display: grid; place-items: center;
}
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 6px; }
.lb-next { right: 6px; }

/* Gate */
.gate {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  display: grid; place-items: center;
  padding: 24px;
}
.gate[hidden] { display: none !important; }
.gate-box { width: min(340px, 100%); text-align: center; }
.gate-box .brand-name { font-size: 14px; margin-bottom: 16px; }
.gate-box p { color: var(--muted); font-size: 14px; }
.gate-box input {
  width: 100%;
  margin: 16px 0 12px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: center;
}
.gate-box input:focus { outline: none; border-bottom-color: var(--ink); }
.gate-error { color: var(--accent); font-size: 13px; min-height: 1.2em; }
.gate-box .btn { width: 100%; }

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 28px 12px; padding: 24px 24px; max-width: 1200px; margin: 0 auto; }
  .search { margin: 16px auto 0; max-width: 1200px; }
  .home-foot { max-width: 1200px; margin-left: auto; margin-right: auto; }
  #view-detail:not(.is-off) {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    grid-template-rows: auto auto;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
    column-gap: 8px;
    padding: 0 24px 56px;
  }
  #view-detail .article-detail:not([hidden]) { display: contents; }
  #view-detail .detail-shell { display: contents; }
  #view-detail .gallery { grid-column: 1; grid-row: 1 / span 2; }
  #view-detail .detail-body { grid-column: 2; grid-row: 1; padding: 28px 8px 12px 16px; }
  .slides img { height: min(80vh, 760px); }
  .action-bar {
    grid-column: 2;
    grid-row: 2;
    position: static;
    padding: 8px 8px 0 16px;
    background: none;
    border: 0;
    backdrop-filter: none;
    align-self: start;
  }
}

@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
