:root {
  --forge: #e8662a;
  --forge-ink: #b8461a;
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f2ede5;
  --ink: #1f2026;
  --muted: #6a6b73;
  --line: #e4ddd1;
  --ok: #2f7d4f;
  --err: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(31 32 38 / 0.06);
  --font: "Inter", system-ui, sans-serif;
  --display: "Space Grotesk", var(--font);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15161a;
    --surface: #1e2026;
    --surface-2: #262830;
    --ink: #f1ede6;
    --muted: #a4a5ad;
    --line: #33353d;
    --forge-ink: #f38a55;
    --ok: #5cc28a;
    --err: #f2867d;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.05rem; }
a { color: var(--forge-ink); }
img, svg { max-width: 100%; display: block; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.section { padding-block: 48px; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.center .btn { margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.lede { font-size: 1.125rem; color: var(--muted); max-width: 60ch; }
.center .lede { margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header / footer */
header.site { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.logo-mark { width: 30px; height: 30px; }
nav { display: flex; gap: 4px; align-items: center; }
nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: 0.95rem; }
nav a:hover { background: var(--surface-2); }
nav a[aria-current="page"] { background: var(--surface-2); color: var(--forge-ink); }
.cart-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--forge); color: #fff; font-size: 0.75rem; font-weight: 600; margin-left: 2px; }
.cart-count[hidden] { display: none; }
footer.site { border-top: 1px solid var(--line); background: var(--surface); margin-top: 48px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr; gap: 16px 32px; padding-block: 32px; }
.footer-inner > p { grid-column: 1 / -1; margin: 0; }
.footer-links { display: flex; flex-direction: column; gap: 4px; }
.footer-links a { color: var(--ink); text-decoration: none; }

/* Buttons and controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font: 600 0.95rem var(--font); text-decoration: none; cursor: pointer; transition: transform 0.1s, background 0.15s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn.primary { background: var(--forge); border-color: var(--forge); color: #fff; }
.btn.primary:hover { background: #d4561d; }
.btn.block { width: 100%; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.85rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--forge); outline-offset: 1px; border-color: transparent; }
:focus-visible { outline: 2px solid var(--forge); outline-offset: 2px; }

/* Hero */
.hero { background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; padding-block: 72px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 600; color: var(--forge-ink); margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.accent { color: var(--forge); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-stack { display: flex; flex-direction: column-reverse; align-items: center; gap: 6px; }
.hero-stack span { height: 26px; border-radius: 8px; background: var(--forge); animation: layer 0.5s ease-out backwards; }
.hero-stack span:nth-child(1) { width: 92%; opacity: 1; animation-delay: 0s; }
.hero-stack span:nth-child(2) { width: 82%; opacity: 0.9; animation-delay: 0.12s; }
.hero-stack span:nth-child(3) { width: 72%; opacity: 0.8; animation-delay: 0.24s; }
.hero-stack span:nth-child(4) { width: 62%; opacity: 0.7; animation-delay: 0.36s; }
.hero-stack span:nth-child(5) { width: 50%; opacity: 0.6; animation-delay: 0.48s; }
.hero-stack span:nth-child(6) { width: 36%; opacity: 0.45; animation-delay: 0.6s; }
.hero-stack span:nth-child(7) { width: 20%; opacity: 0.3; animation-delay: 0.72s; }
@keyframes layer { from { transform: translateY(-24px) scaleX(0.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-stack span { animation: none; } .btn { transition: none; } }

/* Catalog */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform 0.15s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); }
.card-art { background: var(--surface-2); aspect-ratio: 8 / 7; display: grid; place-items: center; padding: 16px; color: var(--ink); }
.card-art svg, .card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 18px; }
.card-body h3 { margin: 6px 0 2px; }
.tag { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.price { font-weight: 600; margin: 0; color: var(--forge-ink); }
.price.big { font-size: 1.5rem; font-family: var(--display); }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-right input { width: 200px; }
.toolbar-right select { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); padding: 7px 14px; border-radius: 999px; cursor: pointer; font: 500 0.9rem var(--font); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.empty { padding: 32px; text-align: center; color: var(--muted); grid-column: 1 / -1; }
.empty .btn { margin-top: 8px; }

/* Product */
.crumbs { font-size: 0.9rem; margin-bottom: 16px; color: var(--muted); }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.product-art { background: var(--surface-2); border-radius: var(--radius); padding: 32px; aspect-ratio: 1; display: grid; place-items: center; position: sticky; top: 88px; color: var(--ink); }
.product-art svg { width: 100%; }
fieldset { border: 0; padding: 0; margin: 20px 0; }
legend { font-weight: 500; margin-bottom: 8px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span:not(.sr-only) { display: block; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); box-shadow: inset 0 0 0 2px var(--surface); }
.swatch input:checked + span { border-color: var(--forge); border-width: 3px; }
.swatch input:focus-visible + span { outline: 2px solid var(--forge); outline-offset: 2px; }
.materials { display: grid; gap: 8px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); }
.option input { width: auto; margin-top: 5px; accent-color: var(--forge); }
.option:has(input:checked) { border-color: var(--forge); }
.field { display: grid; gap: 6px; font-weight: 500; margin-bottom: 16px; }
.buy-row { display: flex; gap: 12px; align-items: end; margin-top: 8px; }
.buy-row .btn { flex: 1; }
.qty { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 500; }
.qty input { width: 80px; }

/* Cart */
.cart { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.cart-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cart-line { display: grid; grid-template-columns: 88px 1fr auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.cart-line h3, .cart-line p { margin: 0; }
.thumb { background: var(--surface-2); border-radius: 10px; padding: 6px; aspect-ratio: 1; display: grid; place-items: center; color: var(--ink); }
.line-end { display: grid; justify-items: end; gap: 6px; }
.line-end input { width: 70px; padding: 6px 8px; }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); position: sticky; top: 88px; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 0; margin: 0 0 16px; }
.summary dd { margin: 0; text-align: right; }
.summary .total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: 10px; }

/* Forms and notices */
.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-top: 24px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.notice { border-radius: 10px; margin: 16px 0; }
.notice:not(:empty) { padding: 14px 16px; background: var(--surface-2); }
.notice.success { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.notice.error { background: color-mix(in srgb, var(--err) 14%, var(--surface)); color: var(--err); }
.steps { list-style: none; counter-reset: step; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 24px 0; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 4px; }
.steps li::before { content: counter(step); font: 700 1.4rem var(--display); color: var(--forge); }
.steps span { color: var(--muted); font-size: 0.95rem; }
.success-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 2rem; margin: 0 auto 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow); transition: transform 0.25s; z-index: 20; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 800px) {
  .hero-inner, .product, .cart { grid-template-columns: 1fr; }
  .hero-inner { padding-block: 48px; }
  .hero-stack { max-width: 260px; margin-inline: auto; width: 100%; }
  .product-art, .summary { position: static; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .brand span { display: none; }
  nav a { padding: 8px 10px; }
  .row { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 64px 1fr; }
  .line-end { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; align-items: center; justify-items: start; }
  .line-end strong { justify-self: end; }
  .toolbar-right, .toolbar-right input { width: 100%; }
  .toolbar-right select { flex: 1; }
}
