:root {
  --bg: #f3efe6;
  --surface: #fbf9f4;
  --ink: #1f2a23;
  --muted: #5e665f;
  --moss: #2f4a3a;
  --moss-2: #3d5d49;
  --ember: #c46f4e;
  --line: #ddd6c6;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--moss); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 2px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; letter-spacing: .01em; }
nav { display: flex; gap: 20px; margin-left: auto; }
nav a { text-decoration: none; color: var(--muted); font-size: .95rem; }
nav a:hover { color: var(--ink); }
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer;
}
.cart-btn:hover { border-color: var(--moss); }
.cart-count { background: var(--moss); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: .8rem; padding: 0 6px; }

/* Hero */
.hero { border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 32px; padding: 72px 0 64px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--ember); margin: 0 0 14px; font-weight: 600; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 14ch; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 46ch; margin: 18px 0 28px; }
.hero-mark { justify-self: end; opacity: .12; width: min(100%, 300px); height: auto; transform: rotate(-8deg); }

/* Buttons */
.btn {
  display: inline-flex; justify-content: center; align-items: center;
  border: 0; border-radius: 999px; padding: 12px 22px;
  font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.btn-primary { background: var(--moss); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--moss-2); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { background: #b9bdb6; color: #f4f4f2; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Shop */
.shop { padding: 56px 0 24px; }
.shop-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.shop-head h2 { font-size: 2rem; }
.shop-note { color: var(--muted); font-size: .9rem; margin: 8px 0 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: .9rem; cursor: pointer;
}
.chip:hover { border-color: var(--moss); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-img img { width: 100%; height: auto; aspect-ratio: 400 / 460; object-fit: cover; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-cat { margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.card-title { font-size: 1.2rem; }
.card-meta { margin: 0; display: flex; justify-content: space-between; color: var(--muted); }
.card-meta strong { color: var(--ink); }

.sizes { border: 0; padding: 0; margin: 4px 0 auto; display: flex; gap: 6px; }
.size { flex: 1; position: relative; }
.size input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.size label {
  display: grid; place-items: center; height: 36px;
  border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.size input:hover + label { border-color: var(--moss); }
.size input:checked + label { background: var(--moss); border-color: var(--moss); color: #fff; }
.size input:focus-visible + label { outline: 3px solid var(--ember); outline-offset: 2px; }

/* About / help */
.about { background: var(--moss); color: #eef0ea; margin-top: 48px; }
.about-inner { padding: 64px 0; max-width: 720px; }
.about h2 { font-size: 2rem; margin-bottom: 14px; }
.about p { margin: 0; font-size: 1.1rem; color: #d5dccf; }
.help { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 56px 0; }
.help h3 { font-size: 1.2rem; margin-bottom: 8px; }
.help p { margin: 0; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; padding: 24px 0; color: var(--muted); font-size: .9rem; }

/* Bag dialog */
.cart {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(420px, 100%);
  border: 0; padding: 0; background: var(--surface); color: var(--ink);
  display: none; flex-direction: column;
}
.cart[open] { display: flex; }
.cart::backdrop { background: rgb(20 26 22 / .45); }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.cart-head h2 { font-size: 1.4rem; }
.icon-btn { border: 0; background: transparent; font-size: 1.1rem; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; color: var(--ink); }
.icon-btn:hover { background: var(--bg); }
.cart-items { list-style: none; margin: 0; padding: 8px 20px; overflow-y: auto; flex: 1; }
.cart-empty { padding: 0 20px; color: var(--muted); flex: 1; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line img { border-radius: 8px; }
.line-info { display: flex; flex-direction: column; gap: 2px; font-size: .92rem; }
.line-info span { color: var(--muted); }
.line-price { font-size: .92rem; white-space: nowrap; }
.qty { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; }
.qty span { color: var(--ink); min-width: 1ch; text-align: center; }
.qty-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: 1rem; line-height: 1; color: var(--ink); }
.qty-btn:disabled { opacity: .4; cursor: not-allowed; }
.cart-foot { padding: 18px 20px 22px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.05rem; }
.cart-fine { margin: 0; font-size: .8rem; color: var(--muted); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  nav { display: none; }
  .cart-btn { margin-left: auto; }
  .hero-inner { grid-template-columns: 1fr; padding: 48px 0 40px; }
  .hero-mark { display: none; }
  .help { grid-template-columns: 1fr; gap: 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .card-body { padding: 12px; }
  .size label { height: 32px; font-size: .78rem; }
  .sizes { gap: 4px; }
}

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