:root {
  --bg: #f8f5ef;
  --surface: #fff;
  --sunken: #f1ece3;
  --ink: #1f1828;
  --muted: #5d546a;
  --line: #e6dfd4;
  --line-strong: #d2c8b9;
  --plum: #4a2b6a;
  --plum-deep: #2c1a40;
  --lavender: #ece3f4;
  --peach: #f4dcc0;
  --lime: #d9eb9a;
  --shadow: 0 1px 2px rgb(31 24 40 / 5%), 0 10px 28px rgb(31 24 40 / 6%);
  --shadow-lift: 0 2px 6px rgb(31 24 40 / 8%), 0 22px 44px rgb(31 24 40 / 13%);
  color-scheme: light;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--plum); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.2vw, 4.5rem); font-weight: 800; letter-spacing: -.045em; }
button { cursor: pointer; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 16px; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; }
#main:focus { outline: none; }
.shell { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
main.shell { flex: 1; }
.muted { color: var(--muted); }
.icon { flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: absolute; left: 16px; top: -80px; z-index: 50; padding: 10px 18px; border-radius: 999px; background: var(--plum); color: #fff; font-weight: 650; text-decoration: none; }
.skip-link:focus { top: 12px; }
.site-header { position: sticky; top: 0; z-index: 20; background: rgb(248 245 239 / 90%); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.45rem; font-weight: 800; letter-spacing: -.05em; text-decoration: none; white-space: nowrap; }
.brand-mark { flex: none; fill: var(--plum); }
.dot { color: #7d4fa3; }
.site-nav { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-links { display: flex; gap: 4px; margin-left: 20px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; color: var(--ink); font-weight: 560; text-decoration: none; white-space: nowrap; }
.nav-links a:hover { background: var(--sunken); }
.nav-tools { display: flex; align-items: center; gap: 10px; }
.bag-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 8px 6px 14px; border-radius: 999px; background: var(--plum); color: #fff; font-weight: 620; text-decoration: none; white-space: nowrap; }
.bag-link:hover { background: var(--plum-deep); }
#cart-count { min-width: 26px; padding: 0 7px; border-radius: 999px; background: #fff; color: var(--plum); font-size: .8rem; font-weight: 750; line-height: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.markets { position: relative; font-size: .92rem; }
.markets summary { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); cursor: pointer; list-style: none; white-space: nowrap; }
.markets summary::-webkit-details-marker { display: none; }
.markets summary::after { content: ""; width: 6px; height: 6px; margin: 0 2px 3px 2px; border-right: 1.6px solid; border-bottom: 1.6px solid; transform: rotate(45deg); }
.markets[open] summary::after { margin-bottom: -3px; transform: rotate(-135deg); }
.markets summary:hover { border-color: var(--plum); }
.markets ul { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; min-width: 220px; max-width: 86vw; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lift); }
.markets li a { display: block; padding: 10px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.markets li a:hover { background: var(--sunken); }
.markets [aria-current] { background: var(--lavender); font-weight: 650; }

.action, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border-radius: 999px; font-weight: 650; text-decoration: none; transition: background-color .2s, border-color .2s, transform .2s, box-shadow .2s; }
.action { border: 0; background: var(--plum); color: #fff; box-shadow: 0 8px 20px rgb(74 43 106 / 24%); }
.action:hover { background: var(--plum-deep); transform: translateY(-1px); }
.secondary { border: 1px solid var(--line-strong); background: rgb(255 255 255 / 70%); color: var(--ink); }
.secondary:hover { border-color: var(--plum); background: var(--surface); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); min-height: 460px; margin-top: 28px; overflow: hidden; border-radius: 32px; background: var(--lavender); box-shadow: var(--shadow); }
.intro { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(28px, 4.5vw, 60px); background: linear-gradient(100deg, var(--lavender) 58%, rgb(236 227 244 / 0)), radial-gradient(circle, rgb(74 43 106 / 7%) 4px, transparent 4.5px) 0 0 / 26px 26px; }
.intro p { max-width: 34ch; margin: 22px 0 32px; color: var(--muted); font-size: 1.15rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }

.collection { padding: 80px 0 16px; scroll-margin-top: 80px; }
.section-head { display: grid; gap: 10px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
.section-head p { max-width: 46ch; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button { min-height: 42px; padding: 8px 18px; font-weight: 560; transition: background-color .2s, border-color .2s; }
.filters button:hover { border-color: var(--plum); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.card { display: flex; flex-direction: column; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease, border-color .25s; }
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.card-body { display: grid; gap: 6px; padding: 16px 12px 10px; }
.card h3 { font-size: 1.4rem; }
.card-link { margin-top: 6px; color: var(--plum); font-size: .95rem; font-weight: 620; }
.card-link span, .card-arrow { display: inline-block; transition: transform .2s; }
.card:hover .card-link span, .card:hover .card-arrow { transform: translateX(4px); }
.kicker { color: var(--muted); font-size: .75rem; font-weight: 680; letter-spacing: .09em; text-transform: uppercase; }
.art { aspect-ratio: 4/5; overflow: hidden; border-radius: 18px; background: var(--peach) url('/collection.webp') 0 center / 300% auto no-repeat; }
.art.trai-than-hong { background-position: 50% center; }
.art.long-an { background-position: 100% center; }
.photo { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 18px; background: #fff; }
.specs { color: var(--muted); font-size: .9rem; }
.card-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-top: 6px; }
.card-foot .card-link { margin-top: 0; }
.price { color: var(--ink); font-size: 1.1rem; font-weight: 720; }
.price.pending { color: var(--muted); font-size: .9rem; font-weight: 600; }

.market-grid { gap: 20px; }
.card.market-card { display: grid; grid-template: "code name arrow" auto "code currency arrow" auto / auto 1fr auto; align-items: center; column-gap: 18px; padding: 22px 24px; }
.market-code { grid-area: code; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--lavender); color: var(--plum); font-size: 1.05rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.market-card h2 { grid-area: name; align-self: end; font-size: 1.3rem; }
.market-currency { grid-area: currency; align-self: start; color: var(--muted); font-size: .92rem; }
.card-arrow { grid-area: arrow; color: var(--plum); font-size: 1.3rem; }

.detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: center; padding: 40px 0 24px; }
.detail > .art, .detail > .photo { border-radius: 32px; box-shadow: var(--shadow); }
.detail-price { margin: 4px 0 0; }
.detail-price .price { font-size: 1.7rem; }
.detail-info { max-width: 32rem; }
.back-link { display: inline-flex; margin-bottom: 28px; color: var(--muted); font-size: .95rem; font-weight: 560; text-decoration: none; }
.back-link:hover { color: var(--plum); text-decoration: underline; }
.detail .kicker { display: block; width: fit-content; margin: 0 0 16px; padding: 5px 12px; border-radius: 999px; background: var(--lavender); color: var(--plum); }
.detail h1 { font-size: clamp(2.5rem, 4.6vw, 4rem); }
.lede { margin: 20px 0; font-size: 1.2rem; }
.note { display: flex; gap: 12px; margin: 0; padding: 14px 18px; border-radius: 16px; background: var(--sunken); color: var(--muted); font-size: .95rem; }
.note::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: .55em; border-radius: 50%; background: var(--plum); }
.detail .note { width: fit-content; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
#bag-feedback { min-height: 1.6em; margin: 14px 0 0; color: var(--plum); font-weight: 620; }

.basket { width: min(100%, 720px); padding: 40px 0 24px; }
.basket h1 { margin: 0 0 28px; font-size: clamp(2.3rem, 4.6vw, 3.4rem); }
#bag-empty { margin: 0 0 16px; padding: 36px 24px; border: 1px dashed var(--line-strong); border-radius: 22px; background: rgb(255 255 255 / 55%); color: var(--muted); text-align: center; }
.bag-list { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 18px; padding: 10px 14px 10px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.row > a { flex: 1; min-width: 0; color: var(--ink); font-size: 1.12rem; font-weight: 650; text-decoration: none; }
.row > a:hover { color: var(--plum); text-decoration: underline; }
.art.thumb, .photo.thumb { flex: none; width: 64px; border-radius: 14px; }
.quantity { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; }
.quantity button { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; font-size: 1.2rem; line-height: 1; }
.quantity button:hover:not(:disabled) { background: var(--sunken); }
[data-count] { min-width: 2ch; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.basket > .note { margin-top: 24px; }

.not-found { display: grid; justify-items: center; gap: 22px; padding: 96px 0 72px; text-align: center; }
.not-found h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.lost-brick { fill: var(--lavender); stroke: var(--plum); stroke-width: 1.6; transform: rotate(-9deg); }

.info-page { width: min(100%, 780px); margin: 48px auto 16px; padding: clamp(24px, 5vw, 60px); background: var(--surface); border: 1px solid var(--line); border-radius: 30px; box-shadow: var(--shadow); }
.info-page h1 { margin: 24px 0 20px; font-size: clamp(2.1rem, 4vw, 3.1rem); }
.info-page p:not(.draft-note) { max-width: 64ch; font-size: 1.06rem; line-height: 1.75; }
.draft-note { display: flex; gap: 10px; width: fit-content; margin: 0; padding: 8px 14px; border: 1px dashed var(--line-strong); border-radius: 12px; background: #fbf7ec; color: var(--muted); font-size: .9rem; }

.site-footer { margin-top: 96px; padding: 64px 0 36px; background: var(--plum-deep); color: #d8cfe3; }
.site-footer a { color: #f3eef8; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--lime); }
.footer-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-columns h2 { margin: 0 0 16px; color: #c8bcd8; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.footer-columns ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin: 56px 0 0; padding-top: 28px; border-top: 1px solid rgb(255 255 255 / 12%); color: #fff; font-size: 1.15rem; font-weight: 800; letter-spacing: -.03em; }
.footer-brand::before { content: ""; flex: none; width: 24px; height: 22px; background: linear-gradient(var(--lime) 0 0) 4px 0 / 6px 7px no-repeat, linear-gradient(var(--lime) 0 0) 14px 0 / 6px 7px no-repeat, linear-gradient(var(--lime) 0 0) 0 5px / 24px 17px no-repeat; }

@media (max-width: 1000px) {
  .market-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .intro { background: var(--lavender); }
  .hero-art { height: auto; aspect-ratio: 3/2; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 28px); }
  .site-header { position: relative; }
  .top { position: relative; flex-wrap: wrap; gap: 0; min-height: 0; padding-top: 10px; }
  .top > .brand { min-height: 44px; font-size: 1.3rem; }
  .site-nav { flex-basis: 100%; }
  .nav-links { margin: 0 0 6px -14px; }
  .nav-tools { position: absolute; top: 10px; right: 0; height: 44px; gap: 8px; }
  .bag-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .markets summary { padding-inline: 12px 10px; }
  .bag-link { padding-left: 12px; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .hero { margin-top: 16px; border-radius: 24px; }
  .collection { padding-top: 56px; }
  .grid { gap: 14px; }
  .market-grid { grid-template-columns: minmax(0, 1fr); }
  .card { border-radius: 20px; padding: 8px; }
  .card .art, .card .photo { border-radius: 14px; }
  .card-body { padding: 12px 6px 6px; }
  .card h3 { font-size: 1.15rem; }
  .detail { padding-top: 20px; }
  .detail > .art, .detail > .photo { border-radius: 24px; }
  .back-link { margin-bottom: 18px; }
  .row { gap: 12px; }
  .art.thumb { width: 52px; }
  .row > a { font-size: 1rem; }
  .info-page { margin-top: 20px; border-radius: 22px; }
  .site-footer { margin-top: 64px; padding-top: 44px; }
  .footer-columns { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 28px 20px; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  .card:hover, .action:hover, .card:hover .card-link span, .card:hover .card-arrow { transform: none; }
}
