:root {
  --bg: #f7f5f2; --surface: #ffffff; --soft: #efebe6; --fg: #1a1714; --muted: #6f6861; --line: #e4dfd8;
  --accent: #c2410c; --accent-hover: #9a3412; --accent-fg: #ffffff; --sale: #dc2626; --ok: #15803d; --warn: #b45309;
  --star: #f59e0b; --radius: 18px; --shadow: 0 1px 2px rgba(26,23,20,.04), 0 8px 24px rgba(26,23,20,.06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12100e; --surface: #1b1916; --soft: #24211d; --fg: #f4f1ec; --muted: #a39b92; --line: #302c27;
    --accent: #fb923c; --accent-hover: #fdba74; --accent-fg: #1a1714; --sale: #f87171; --ok: #4ade80; --warn: #fbbf24;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Inter", "Pretendard", system-ui, -apple-system, "Segoe UI", "Noto Sans KR", "Noto Sans JP", sans-serif;
  background: var(--bg); color: var(--fg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
body.lock { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.section { padding: 48px 20px 8px; }
.section h2 { font-size: 24px; letter-spacing: -0.02em; margin: 0 0 20px; }

/* promo + header */
.promo { background: var(--fg); color: var(--bg); font-size: 13px; font-weight: 500; text-align: center; padding: 9px 16px; min-height: 38px; letter-spacing: .01em; }
header.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { font-weight: 800; font-size: 22px; letter-spacing: -0.04em; }
.logo span { color: var(--accent); }
nav.cats { display: flex; gap: 22px; font-size: 14px; font-weight: 500; color: var(--muted); flex: 1; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
nav.cats a { padding: 6px 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
nav.cats a:hover { color: var(--fg); border-color: var(--fg); }
.langs { display: flex; gap: 4px; font-size: 12px; font-weight: 600; background: var(--soft); padding: 3px; border-radius: 999px; }
.langs a { padding: 4px 10px; border-radius: 999px; color: var(--muted); }
.langs a.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.cart-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: transform .15s; }
.cart-btn:hover { transform: translateY(-1px); }
.cart-btn .count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.cart-btn .count[data-zero] { display: none; }
.cart-btn.bump { animation: bump .4s ease; }
@keyframes bump { 30% { transform: scale(1.18); } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font-weight: 600; font-size: 15px;
  padding: 14px 26px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); transition: background .15s, transform .15s; }
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.wide { flex: 1; }
.btn[disabled] { opacity: .5; cursor: default; }

/* hero */
.hero { background: radial-gradient(120% 120% at 100% 0%, #fde3d3 0%, transparent 55%), linear-gradient(180deg, var(--surface), var(--bg)); border-bottom: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .hero { background: radial-gradient(120% 120% at 100% 0%, #3b2214 0%, transparent 55%), linear-gradient(180deg, var(--surface), var(--bg)); } }
.hero-in { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
.kicker { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 6px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.05; letter-spacing: -0.045em; margin: 18px 0 16px; font-weight: 800; }
.hero p { color: var(--muted); font-size: 17px; max-width: 460px; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art img { width: 100%; max-width: 520px; margin-left: auto; border-radius: 32px; box-shadow: 0 30px 60px -20px rgba(26,23,20,.25); transform: rotate(2deg); transition: transform .3s; }
.hero-art:hover img { transform: rotate(0) scale(1.01); }

/* trust bar */
.trust { border-bottom: 1px solid var(--line); background: var(--surface); }
.trust .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.trust div { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.trust svg { color: var(--accent); flex: none; }

/* category tiles */
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.tile { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile img { width: 100%; aspect-ratio: 1; }
.tile span { position: absolute; left: 12px; bottom: 12px; background: var(--surface); padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; padding-bottom: 40px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card .thumb { display: block; position: relative; overflow: hidden; }
.card .thumb img { width: 100%; aspect-ratio: 1; transition: transform .4s; }
.card:hover .thumb img { transform: scale(1.04); }
.badge { position: absolute; top: 12px; left: 12px; z-index: 1; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 5px 9px; border-radius: 6px; color: #fff; }
.badge.sale { background: var(--sale); } .badge.new { background: #1a1714; } .badge.best { background: #7c3aed; }
.media { position: relative; }
.quick { position: absolute; right: 12px; bottom: 12px; z-index: 2; border: 0; cursor: pointer; padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s, background .15s; }
.card:hover .quick, .quick:focus-visible { opacity: 1; transform: none; }
.quick:hover { background: var(--fg); color: var(--bg); }
.card .body { display: block; padding: 14px 16px 18px; }
.cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.card .name { font-weight: 600; font-size: 16px; margin: 2px 0 4px; }
.rating { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stars { color: var(--star); letter-spacing: 1px; } .stars i { color: var(--line); font-style: normal; }
.price { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; font-size: 16px; }
.price b.sale { color: var(--sale); }
.price s { color: var(--muted); font-size: 14px; }
.price em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--sale); background: color-mix(in srgb, var(--sale) 12%, transparent); padding: 2px 6px; border-radius: 4px; }
.price.big { font-size: 28px; font-weight: 700; margin: 14px 0 6px; }
.price.big s { font-size: 18px; }
@media (hover: none) { .quick { opacity: 1; transform: none; } }

/* PDP */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.crumbs a:hover { color: var(--fg); }
.page-title { font-size: 36px; letter-spacing: -0.03em; margin: 0 0 24px; }
.page-title small { font-size: 16px; color: var(--muted); font-weight: 500; }
.pdp { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; padding-bottom: 24px; }
.gallery { position: relative; }
.gallery img { width: 100%; height: auto; border-radius: 24px; border: 1px solid var(--line); }
.gallery .badge { top: 18px; left: 18px; font-size: 13px; }
.info h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; margin: 6px 0 10px; line-height: 1.15; }
.stock { font-size: 14px; font-weight: 600; min-height: 22px; display: flex; align-items: center; gap: 8px; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock:empty::before, .stock.pending::before { display: none; }
.stock.in { color: var(--ok); } .stock.low { color: var(--warn); } .stock.out { color: var(--sale); }
.desc { color: var(--muted); font-size: 16px; margin: 18px 0 24px; }
.buy { display: flex; gap: 12px; align-items: stretch; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); overflow: hidden; }
.stepper button { width: 42px; height: 100%; min-height: 44px; border: 0; background: none; cursor: pointer; font-size: 18px; }
.stepper button:hover { background: var(--soft); }
.stepper input { width: 36px; border: 0; background: none; text-align: center; font: inherit; font-weight: 600; color: var(--fg); -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper.sm button { width: 32px; min-height: 32px; font-size: 15px; }
.stepper.sm span { min-width: 22px; text-align: center; font-weight: 600; font-size: 14px; }
.perks { list-style: none; padding: 20px 0 0; margin: 24px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 14px; }
.perks li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: 10px; }
.empty-page { text-align: center; padding: 96px 20px; }
.empty-page h1 { font-size: 72px; margin: 0; letter-spacing: -0.05em; }

/* footer */
.foot { margin-top: 56px; background: var(--surface); border-top: 1px solid var(--line); font-size: 14px; }
.foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1.6fr; gap: 32px; padding: 48px 0 32px; }
.foot h4 { margin: 0 0 12px; font-size: 14px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--muted); }
.foot ul a:hover { color: var(--fg); }
.foot form { display: flex; gap: 8px; margin-top: 12px; }
.foot input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 999px; padding: 10px 14px; font: inherit; }
.foot form button { border: 0; border-radius: 999px; padding: 10px 16px; background: var(--fg); color: var(--bg); font-weight: 600; cursor: pointer; }
.legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 18px 0 96px; color: var(--muted); font-size: 12px; }

/* cart drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(15,12,10,.45); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); z-index: 41; display: flex; flex-direction: column;
  transform: translateX(100%); visibility: hidden; transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s .3s; }
body.cart-open .drawer { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: -20px 0 50px rgba(0,0,0,.15); }
body.cart-open .drawer-bg { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 18px; }
.drawer-head h3 span { color: var(--muted); font-weight: 500; }
.x { border: 0; background: var(--soft); width: 36px; height: 36px; border-radius: 999px; cursor: pointer; }
.ship { padding: 14px 22px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ship .bar { height: 6px; border-radius: 999px; background: var(--soft); margin-top: 8px; overflow: hidden; }
.ship .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .4s; }
.ship.done .bar i { background: var(--ok); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 22px; }
.line { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line img { width: 72px; height: 72px; border-radius: 12px; border: 1px solid var(--line); }
.line .nm { font-weight: 600; font-size: 14px; line-height: 1.3; }
.line .unit { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.line .right { text-align: right; display: grid; gap: 6px; justify-items: end; }
.line .rm { border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0; }
.drawer-empty { text-align: center; padding: 64px 0; color: var(--muted); }
.drawer-empty svg { margin: 0 auto 12px; opacity: .4; }
.drawer-foot { padding: 18px 22px 22px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.drawer-foot .sum { display: flex; justify-content: space-between; font-size: 17px; font-weight: 700; }
.drawer-foot .note { font-size: 12px; color: var(--muted); text-align: center; }
.ordered { text-align: center; padding: 56px 8px; }
.ordered .check { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); display: grid; place-items: center; font-size: 30px; }
.ordered h4 { margin: 0 0 6px; font-size: 20px; }
.ordered code { background: var(--soft); padding: 3px 8px; border-radius: 6px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; }

/* lookbook (heavy photos) + CDN speed test */
.lookbook .lb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.lookbook .lb-head h2 { margin: 0; }
.lb-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lb-strip figure { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--soft); aspect-ratio: 12 / 5; }
.lb-strip figure:first-child { grid-column: 1 / -1; }
.lb-strip img { width: 100%; height: 100%; object-fit: cover; }
.lb-strip figcaption, .heavy-stat { position: absolute; left: 12px; bottom: 12px; background: rgba(20,16,12,.72); color: #fff; font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 7px 10px; border-radius: 999px; backdrop-filter: blur(6px); white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.lb-strip figcaption b, .heavy-stat b { color: #fde68a; }
.gallery img[data-heavy] { background: center / cover no-repeat; }
.gallery .heavy-stat { left: 18px; bottom: 18px; }
.speed { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.speed-head { display: flex; gap: 20px; align-items: center; justify-content: space-between; }
.speed-head h3 { margin: 0 0 6px; font-size: 18px; }
.speed-head p { margin: 0; color: var(--muted); font-size: 14px; max-width: 720px; }
.speed-head .btn { flex: none; }
.speed-out:not(:empty) { margin-top: 16px; overflow-x: auto; }
.speed table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.speed th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.speed td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.speed tfoot td { border-bottom: 0; font-weight: 700; }
.speed tr.pending td { color: var(--muted); }
.speed .bar-col { width: 32%; min-width: 120px; }
.speed .bar { display: block; height: 10px; border-radius: 99px; background: var(--muted); transition: width .3s; }
.speed .bar.hit { background: #16a34a; } .speed .bar.miss { background: #f59e0b; }
.speed .tag { padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.speed small { color: var(--muted); }
.speed-note { margin-top: 10px; color: var(--muted); font-size: 12px; }
.speed-note:empty { display: none; }
@media (max-width: 720px) {
  .lb-strip { grid-template-columns: 1fr; }
  .speed { padding: 18px 16px; }
  .speed-head { flex-direction: column; align-items: stretch; }
}

/* CDN test page */
.cdn-test .lb-head { margin-top: 28px; }
.ct-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ct-photos figure { margin: 0; position: relative; border-radius: 14px; overflow: hidden; background: var(--soft); aspect-ratio: 4 / 3; }
.ct-photos img { width: 100%; height: 100%; object-fit: cover; }
.ct-photos figcaption { position: absolute; left: 10px; bottom: 10px; background: rgba(20,16,12,.72); color: #fff; font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 7px 10px; border-radius: 999px; white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }
.ct-photos figcaption b { color: #fde68a; }
.speed td.cc { white-space: normal; color: var(--muted); font-size: 12px; min-width: 220px; }
.speed h3 { margin: 0 0 6px; font-size: 18px; }
.ct-notes { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.served a { color: inherit; text-decoration: underline; }
@media (max-width: 720px) { .ct-photos { grid-template-columns: 1fr 1fr; } }

/* responsive */
@media (max-width: 960px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .foot .cols { grid-template-columns: 1fr 1fr 1fr; }
  .foot .cols > div:first-child, .foot .news { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  header.top .wrap { flex-wrap: wrap; height: auto; padding-top: 12px; gap: 12px; }
  .logo { flex: 1; }
  nav.cats { order: 3; flex-basis: 100%; padding-bottom: 8px; gap: 18px; }
  .hero-in { grid-template-columns: 1fr; padding-top: 32px; padding-bottom: 32px; gap: 24px; }
  .hero-art img { max-width: 100%; transform: none; }
  .trust .wrap { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card .body { padding: 10px 12px 14px; }
  .card .name { font-size: 14px; }
  .price { flex-wrap: wrap; gap: 4px 6px; font-size: 15px; }
  .quick { right: 8px; bottom: 8px; padding: 7px 11px; font-size: 12px; }
  .pdp { grid-template-columns: 1fr; gap: 24px; }
  .section { padding-top: 32px; }
}

/* CDN debug panel */
#cdn-debug { position: fixed; right: 16px; bottom: 16px; z-index: 30; display: flex; flex-direction: column-reverse; align-items: flex-end; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
#cdn-debug > button { border: 1px solid var(--line); background: var(--surface); color: var(--fg); padding: 7px 12px; border-radius: 999px; cursor: pointer; box-shadow: var(--shadow); font-weight: 700; }
#cdn-debug .panel { display: none; margin-bottom: 8px; width: min(440px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
#cdn-debug.open .panel { display: block; }
#cdn-debug table { width: 100%; border-collapse: collapse; }
#cdn-debug td { padding: 4px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-all; }
#cdn-debug .tag { white-space: nowrap; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.tag.hit { background: #dcfce7; color: #166534; } .tag.miss { background: #fee2e2; color: #991b1b; } .tag.na { background: var(--soft); color: var(--muted); }
