:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #272522;
  --text-sub: #6d6761;
  --border: #e7e2dd;
  --border-strong: #d8d1cb;
  --accent: #a95449;
  --accent-hover: #8f433a;
  --accent-soft: #f4e8e5;
  --neutral-soft: #f2efeb;
  --focus: #365f73;
  --danger: #8a352c;
  --shadow-card: 0 8px 24px rgba(54, 47, 41, 0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --content: 1320px;
  color-scheme: light;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-synthesis: none;
  font-weight: 400;
  line-height: 1.65;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; overflow-x: clip; background: var(--bg); }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: white;
}
.skip-link:focus { transform: translateY(0); }
.container { width: min(calc(100% - 40px), var(--content)); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(231, 226, 221, 0.9);
  background: rgba(250, 249, 247, 0.95);
  backdrop-filter: blur(12px);
}
.header-inner { display: flex; min-height: 60px; align-items: center; justify-content: space-between; gap: 20px; }
.brand { text-decoration: none; }
.brand-text { font-size: 17px; font-weight: 700; letter-spacing: .12em; }
.menu-toggle {
  display: none;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.site-nav { display: flex; align-items: center; gap: 3px; }
.site-nav a { min-height: 42px; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; font-size: 14px; font-weight: 600; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--neutral-soft); }

/* First view and search */
.hero { padding: clamp(44px, 6vw, 72px) 0 34px; }
.hero__inner { max-width: 920px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(31px, 5vw, 48px); font-weight: 700; line-height: 1.2; letter-spacing: -.035em; }
.hero__lead { margin: 12px 0 24px; color: var(--text-sub); font-size: clamp(15px, 2vw, 17px); }
.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  max-width: 800px;
  min-height: 64px;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 6px;
  background: var(--surface);
  box-shadow: 0 6px 22px rgba(54, 47, 41, .07);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 6px 22px rgba(54,47,41,.06); }
.search-icon { display: grid; width: 44px; place-items: center; color: var(--text-sub); }
.search-icon svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.search-box input { min-width: 0; min-height: 50px; border: 0; padding: 0 8px; background: transparent; color: var(--text); font-size: 16px; outline: 0; }
.search-box input::placeholder { color: #8a847e; }
.search-box button { min-width: 82px; min-height: 50px; border: 0; border-radius: var(--radius-sm); padding: 0 18px; background: var(--text); color: white; font-weight: 700; }
.search-box button:hover { background: #3b3834; }
.quick-types { display: inline-flex; gap: 4px; margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 4px; background: var(--surface); }
.quick-types a { display: inline-flex; min-height: 38px; align-items: center; border-radius: 7px; padding: 7px 16px; color: var(--text-sub); font-size: 13px; font-weight: 600; text-decoration: none; }
.quick-types a:hover { background: var(--neutral-soft); color: var(--text); }
.quick-types a[aria-current="page"] { background: var(--accent); color: white; }

/* Sections */
.section { padding: 42px 0; }
.section--tinted { border-block: 1px solid var(--border); background: #f5f2ef; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(23px, 3vw, 31px); font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
.section-heading p { margin: 4px 0 0; color: var(--text-sub); }
.text-link { flex: none; color: var(--accent-hover); font-size: 13px; font-weight: 600; text-underline-offset: 4px; }

/* Product cards */
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.product-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-card); }
.product-card__image { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-bottom: 1px solid var(--border); background: #f2f0ed; }
.product-card__image--emoji { display: grid; place-items: center; background: #f0f3f1; }
.product-card__image--sticker,
.product-card__image--big { display: grid; place-items: center; }
.product-card__image--big { background: #f4f0ea; }
.product-card__image img { width: 100%; height: 100%; padding: 10px; image-rendering: auto; object-fit: contain; transition: opacity 180ms ease; }
.product-card__image--sticker img,
.product-card__image--big img {
  width: min(78%, 216px);
  height: auto;
  max-height: 78%;
  padding: 0;
  object-position: center;
}
.product-card__image--emoji img {
  width: clamp(112px, 66%, 168px);
  height: auto;
  max-height: 66%;
  padding: 0;
}
.product-card:hover .product-card__image img { opacity: .96; }
.product-card__image.is-sample::after { position: absolute; right: 9px; bottom: 9px; border-radius: 5px; padding: 4px 7px; background: rgba(39,37,34,.78); color: white; content: "SAMPLE"; font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.product-card__body { display: flex; flex: 1; flex-direction: column; padding: 14px; }
.product-card__meta { min-height: 24px; }
.type-badge { display: inline-flex; width: fit-content; align-items: center; border-radius: 5px; padding: 4px 7px; background: var(--neutral-soft); color: #625c56; font-size: 11px; font-weight: 600; line-height: 1.2; }
.type-badge--emoji { background: #ebf0ed; color: #4e685d; }
.type-badge--big { background: #f3ece2; color: #705d45; }
.product-card__title { min-height: 2.8em; margin: 8px 0 11px; font-size: 16px; font-weight: 650; line-height: 1.42; }
.product-card__title a { display: -webkit-box; overflow: hidden; color: var(--text); text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-card__title a:hover { color: var(--accent-hover); }
.tag-list { display: flex; min-height: 27px; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.tag-list a { display: inline-flex; padding: 4px 7px; border-radius: 5px; background: var(--neutral-soft); color: var(--text-sub); font-size: 11px; font-weight: 500; line-height: 1.3; text-decoration: none; }
.tag-list a:hover { background: var(--accent-soft); color: var(--accent-hover); }
.tag-list--large { gap: 7px; }
.tag-list--large a { padding: 7px 10px; font-size: 12px; }
.product-card__footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: auto; padding-top: 14px; }
.product-card__footer--no-date { grid-template-columns: 1fr; }
.product-card__footer--no-date .button { width: 100%; }
.product-card__date { color: var(--text-sub); font-size: 11px; white-space: nowrap; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 10px 16px; text-align: center; text-decoration: none; font-weight: 650; line-height: 1.25; transition: background-color 170ms ease, border-color 170ms ease, transform 170ms ease; }
.button:active { transform: translateY(1px); }
.button--small { min-height: 40px; padding: 8px 11px; font-size: 11px; }
.button--primary { background: var(--accent); color: white; }
.button--primary:hover { background: var(--accent-hover); }
.button--quiet { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.button--quiet:hover { border-color: #c3bbb4; background: var(--neutral-soft); }
.button--large { width: 100%; min-height: 52px; margin-top: 26px; font-size: 15px; }
.button.is-disabled { background: #e8e4e0; color: #706a65; cursor: not-allowed; }

/* Categories and live results */
.category-list { display: flex; flex-wrap: wrap; gap: 8px; }
.category-pill { display: inline-flex; min-height: 40px; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 99px; padding: 7px 12px; background: var(--surface); font-size: 13px; font-weight: 600; text-decoration: none; }
.category-pill:hover { border-color: #c9aaa4; color: var(--accent-hover); }
.category-pill__count { display: grid; min-width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--neutral-soft); color: var(--text-sub); font-size: 10px; }
.live-results { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--border); }
.live-results__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.live-results__head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.live-results__head p { margin: 0; color: var(--text-sub); font-size: 13px; font-weight: 600; }

/* Search results */
.page-hero { padding: 38px 0 14px; }
.page-hero h1 { max-width: 840px; margin: 0; font-size: clamp(29px, 4.5vw, 43px); font-weight: 700; line-height: 1.25; letter-spacing: -.03em; overflow-wrap: anywhere; }
.page-hero p { max-width: 680px; margin: 8px 0 0; color: var(--text-sub); font-size: 15px; }
.page-hero__count { font-weight: 600; }
.filter-panel { display: grid; grid-template-columns: 2fr repeat(3, minmax(130px, 1fr)); gap: 10px; margin: 6px 0 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.field { min-width: 0; }
.field label { display: block; margin: 0 0 4px; color: var(--text-sub); font-size: 11px; font-weight: 600; }
.field input, .field select { width: 100%; min-height: 44px; border: 1px solid var(--border-strong); border-radius: 7px; padding: 0 11px; background: var(--surface); color: var(--text); outline: 0; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.results-toolbar { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--text-sub); font-size: 12px; font-weight: 600; }
.text-button { min-height: 40px; border: 0; padding: 8px; background: transparent; color: var(--accent-hover); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.load-more-wrap { display: grid; place-items: center; padding-top: 30px; }
.load-more-wrap .button { min-width: 210px; }
.status-message { grid-column: 1 / -1; margin: 12px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; background: var(--neutral-soft); color: var(--text-sub); text-align: center; }
.status-message--error { border-color: #d8aaa4; background: #f9ebe8; color: var(--danger); }
.empty-state { grid-column: 1 / -1; padding: clamp(36px, 8vw, 72px) 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); text-align: center; }
.empty-state h2 { margin: 0; font-size: clamp(20px, 4vw, 27px); }
.empty-state p { margin: 8px 0 20px; color: var(--text-sub); }
.empty-state__categories { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }

/* Product detail */
.product-page { padding: 30px 0 56px; }
.breadcrumb { margin-bottom: 18px; color: var(--text-sub); font-size: 12px; }
.breadcrumb a { text-underline-offset: 3px; }
.product-detail { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(30px, 6vw, 72px); align-items: start; }
.product-detail__media { display: grid; overflow: hidden; aspect-ratio: 1; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #f2f0ed; }
.product-detail__media img { width: 100%; aspect-ratio: 1; padding: 18px; object-fit: contain; }
.product-detail__media.product-card__image--sticker img,
.product-detail__media.product-card__image--big img {
  width: min(62%, 240px);
  height: auto;
  max-height: 62%;
  aspect-ratio: auto;
  padding: 0;
  object-position: center;
}
.product-detail__media.product-card__image--emoji img {
  width: min(52%, 200px);
  height: auto;
  max-height: 52%;
  aspect-ratio: auto;
  padding: 0;
}
.product-detail__content { padding-top: 4px; }
.product-detail__content h1 { margin: 12px 0 0; font-size: clamp(30px, 4.5vw, 48px); font-weight: 700; line-height: 1.25; letter-spacing: -.03em; }
.product-detail__english { margin: 8px 0 0; color: var(--text-sub); font-size: 13px; }
.product-detail__description { margin: 24px 0; font-size: 16px; }
.product-facts { display: grid; grid-template-columns: 76px 1fr; gap: 7px 12px; margin: 0; padding: 14px 0; border-block: 1px solid var(--border); }
.product-facts dt { color: var(--text-sub); font-size: 12px; font-weight: 600; }
.product-facts dd { margin: 0; font-size: 13px; }
.detail-label { margin: 20px 0 7px; font-size: 12px; font-weight: 700; }
.external-note { margin: 9px 0 0; color: var(--text-sub); font-size: 11px; text-align: center; }
.related-section { margin-top: 64px; padding-top: 36px; border-top: 1px solid var(--border); }

/* About, browse CTA and footer */
.about-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, .65fr); gap: 54px; padding-bottom: 64px; }
.prose { font-size: 16px; }
.prose h2 { margin: 36px 0 8px; font-size: 24px; font-weight: 700; letter-spacing: -.015em; }
.prose p { color: #514c47; }
.prose a { color: var(--accent-hover); text-underline-offset: 4px; }
.side-note { height: fit-content; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 21px; background: var(--surface); }
.side-note h2 { margin: 0 0 7px; font-size: 18px; }
.side-note p { margin: 0; color: var(--text-sub); font-size: 14px; }
.browse-cta { padding: 34px 0 58px; }
.browse-cta__inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(24px, 5vw, 44px); background: var(--surface); }
.browse-cta h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); }
.browse-cta p:not(.eyebrow) { margin: 6px 0 0; color: var(--text-sub); }
.browse-cta .button { flex: none; }
.site-footer { margin-top: 30px; border-top: 1px solid var(--border); background: #f4f1ee; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; padding-block: 30px; }
.footer-brand { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .1em; }
.footer-copy { margin: 4px 0 0; color: var(--text-sub); font-size: 11px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-nav a { min-height: 40px; padding-block: 8px; color: var(--text-sub); font-size: 12px; }
.footer-nav a:hover { color: var(--text); }

@media (min-width: 1280px) {
  body[data-page="products"] .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1040px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-panel { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 28px), var(--content)); }
  .menu-toggle { display: inline-flex; }
  .site-nav { position: absolute; top: calc(100% + 1px); right: 14px; left: 14px; display: none; padding: 8px; border: 1px solid var(--border); border-radius: 0 0 var(--radius-md) var(--radius-md); background: var(--bg); box-shadow: var(--shadow-card); }
  .site-nav.is-open { display: grid; }
  .site-nav a { display: flex; min-height: 44px; align-items: center; }
  .hero { padding: 38px 0 28px; }
  .search-box { min-height: 60px; }
  .search-box button { min-width: 64px; padding-inline: 12px; }
  .quick-types { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .quick-types a { justify-content: center; padding-inline: 8px; }
  .section { padding: 34px 0; }
  .section-heading { align-items: start; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product-card__body { padding: 11px; }
  .product-card__title { min-height: 2.9em; margin-block: 7px 10px; font-size: 14px; }
  .product-card__footer { grid-template-columns: 1fr; align-items: stretch; padding-top: 11px; }
  .product-card__date { order: 1; }
  .button--small { width: 100%; min-height: 44px; font-size: 12px; }
  .category-list { width: calc(100% + 14px); flex-wrap: nowrap; overflow-x: auto; padding: 2px 14px 8px 0; scrollbar-width: thin; scroll-snap-type: x proximity; }
  .category-pill { flex: none; scroll-snap-align: start; }
  .filter-panel { grid-template-columns: 1fr; padding: 11px; }
  .field input, .field select { min-height: 46px; }
  .product-detail { grid-template-columns: 1fr; }
  .product-detail__media { width: min(100%, 520px); margin-inline: auto; }
  .about-layout { grid-template-columns: 1fr; gap: 22px; }
  .browse-cta__inner { align-items: stretch; flex-direction: column; }
  .browse-cta .button { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .container { width: min(calc(100% - 24px), var(--content)); }
  .search-icon { width: 34px; }
  .search-box { padding: 5px; }
  .search-box input { padding-inline: 4px; font-size: 15px; }
  .quick-types a { font-size: 12px; }
  .product-grid { gap: 10px; }
  .product-card__body { padding: 10px; }
  .product-card__image img { padding: 7px; }
  .product-card__image--sticker img,
  .product-card__image--big img { width: min(82%, 184px); max-height: 82%; padding: 0; }
  .product-card__image--emoji img { width: clamp(104px, 70%, 128px); max-height: 70%; padding: 0; }
}

@media (max-width: 340px) {
  .product-grid { grid-template-columns: 1fr; }
  .product-card__body { padding: 13px; }
}

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