@font-face { font-family: "Cinzel"; src: url("/fonts/Cinzel-Bold.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }

:root {
  color-scheme: light;
  --curtain: #6b1a24;
  --curtain-dark: #3f0d14;
  --gold: #b88a3e;
  --gold-soft: #e9d5a9;
  --paper: #f8f3ea;
  --card: #fffdf9;
  --ink: #2a1d16;
  --muted: #76675c;
  --line: #e4d8c6;
  --wood: #d4a167;
  --ok: #2f6b3a;
  --warn: #8a4b0c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(60, 30, 10, .06), 0 6px 20px rgba(60, 30, 10, .07);
  --display: "Cinzel", Georgia, "Times New Roman", serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--body); }
a { color: var(--curtain); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; letter-spacing: .01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: .2em 0 .4em; }
h2 { font-size: 1.5rem; margin: 1.6em 0 .5em; }
h3 { font-size: 1.05rem; margin: .4em 0 .3em; }
img, svg { max-width: 100%; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.site-header { position: relative; background: var(--curtain-dark); color: #fff; overflow: hidden; }
.curtain { position: absolute; inset: 0; opacity: .9;
  background: repeating-linear-gradient(90deg, #5a1520 0 18px, #7a2230 18px 30px, #5a1520 30px 44px); }
.curtain::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.45)); }
.nav { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand strong { display: block; font-family: var(--display); font-size: 1.05rem; letter-spacing: .04em; }
.brand small { display: block; color: var(--gold-soft); font-size: .78rem; }
.brand-mark { width: 38px; height: 14px; border-radius: 2px; background: linear-gradient(180deg, #e2b77f, #c38e55); box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.nav-links { display: flex; gap: 18px; align-items: center; }
.nav-links a { color: #fff; text-decoration: none; font-weight: 500; white-space: nowrap; }
.nav-links a:hover { color: var(--gold-soft); }
.cart-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: #1d120a; font-size: .8rem; text-align: center; font-weight: 700; }
.cart-count[hidden] { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px;
  padding: .6em 1.2em; font: 600 1rem var(--body); cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--curtain); color: #fff; }
.btn-primary:hover { background: #82202d; }
.btn-primary:disabled { background: #b9a9a0; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--card); }
.btn-lg { padding: .8em 1.6em; font-size: 1.05rem; }
.btn-sm { padding: .35em .9em; font-size: .9rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--curtain); font: inherit; cursor: pointer; text-decoration: underline; }
.icon-btn { width: 36px; height: 40px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; font-size: 1.2rem; cursor: pointer; color: var(--muted); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* notices */
.notice { margin: 16px 0; padding: 12px 16px; border-radius: var(--radius); background: #fff6df; border: 1px solid #efd9a2; }
.notice p { margin: 0 0 8px; }
.notice-ok { background: #eaf5ec; border-color: #bcdcc2; }
.notice-warn { background: #fdf0e3; border-color: #f0cfa9; }
.form-error { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #fbe9e9; color: #8b1c1c; border: 1px solid #efc4c4; }
.form-error[hidden] { display: none; }

/* home */
.hero { background: linear-gradient(180deg, #efe4d2, var(--paper)); padding: 40px 0 24px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--gold); font-weight: 700; margin: 0; }
.lead { font-size: 1.15rem; color: #4d3d33; max-width: 36em; }
.hero-board { margin: 0; }
.hero-board svg { width: 100%; height: auto; display: block; }
.hero-board figcaption { color: var(--muted); font-size: .85rem; text-align: center; margin-top: 6px; }
.story p { max-width: 46em; font-size: 1.05rem; }
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.size-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.size-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.size-card.is-out { opacity: .55; pointer-events: none; }
.size-bar { display: block; height: 14px; width: calc(var(--w) * 100%); min-width: 14px; border-radius: 2px; background: linear-gradient(180deg, #e2b77f, #c38e55); margin-bottom: 8px; }
.size-name { font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.size-price { font-weight: 700; }
.size-stock { font-size: .85rem; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 48px auto; }
.step-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--curtain); color: #fff; font: 700 .9rem var(--body); }

/* designer */
.designer { padding-top: 16px; padding-bottom: 48px; }
.designer-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 28px; align-items: start; }
.preview-pane { position: sticky; top: 16px; }
.preview-stage { background: radial-gradient(ellipse at 50% 30%, #fff 0%, #efe6d8 70%); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 20px; min-height: 260px; display: grid; place-items: center; }
.preview-board { width: 100%; }
.preview-board svg { display: block; width: 100%; height: auto; max-height: 420px; margin: 0 auto; }
.preview-loading { color: var(--muted); text-align: center; }
.preview-caption { color: var(--muted); font-size: .85rem; margin: 8px 2px; }
.warnings { list-style: none; padding: 0; margin: 8px 0; }
.warnings li { padding: 8px 12px; margin-bottom: 6px; border-radius: 8px; background: #fdf0e3; color: var(--warn); border: 1px solid #f0cfa9; font-size: .92rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 16px; box-shadow: var(--shadow); min-width: 0; }
fieldset.panel legend { font-family: var(--display); font-weight: 600; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.field { margin: 12px 0; border: 0; padding: 0; min-width: 0; }
.field > label, .label, .field > legend { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 9px 11px; border: 1px solid #d8c9b3; border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
input[type=range] { padding: 0; accent-color: var(--curtain); }
input[type=radio] { width: auto; accent-color: var(--curtain); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1 1 auto; min-height: 40px; padding: 6px 10px; border: 1px solid #d8c9b3; border-radius: 8px; background: #fff; font: 500 .92rem var(--body); cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--curtain); border-color: var(--curtain); color: #fff; }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.seg button small { font-size: .75rem; opacity: .8; }
.seg-sizes button { display: flex; flex-direction: column; align-items: center; min-width: 64px; line-height: 1.2; padding: 8px 6px; }
.seg-sizes .sz { font-weight: 700; font-size: 1rem; }
.seg-sizes .pr { font-size: .8rem; opacity: .85; }
.seg-sizes .so { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.line-row { display: grid; grid-template-columns: 1fr 100px 36px; gap: 6px; margin-bottom: 8px; }
.side-label { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--curtain); margin: 4px 0 6px; }
#right-group { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.font-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.font-list button { text-align: left; padding: 8px 10px; border: 1px solid #d8c9b3; border-radius: 8px; background: #fff; cursor: pointer; color: var(--ink); }
.font-list button.on { border-color: var(--curtain); box-shadow: inset 0 0 0 1px var(--curtain); background: #fbf2f1; }
.font-sample { display: block; font-size: 1.25rem; line-height: 1.3; }
.font-desc { display: block; font-size: .75rem; color: var(--muted); }
.panel-cta { position: sticky; bottom: 12px; }
.cta-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 1.1rem; }
.cta-row strong { font-size: 1.4rem; }

/* cart + order */
.cart { padding-bottom: 48px; }
.cart-grid, .order-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 28px; align-items: start; }
.cart-items { list-style: none; margin: 0 0 16px; padding: 0; }
.cart-item { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px; margin-bottom: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.cart-thumb svg, .cart-thumb img { display: block; width: 100%; height: auto; max-height: 150px; object-fit: contain; }
.cart-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.cart-meta span { color: var(--muted); font-size: .92rem; }
.cart-actions { display: flex; gap: 14px; margin-top: 6px; font-size: .9rem; }
.cart-price { font-weight: 700; }
.checkout h2 { margin-top: 0; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.choice:has(input:checked) { border-color: var(--curtain); background: #fbf2f1; }
.choice input { margin-top: 5px; }
.choice small { display: block; color: var(--muted); font-size: .85rem; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .04em; }
.code-msg { margin: 6px 0 0; font-size: .9rem; }
.code-msg.ok { color: var(--ok); }
.code-msg.bad { color: #8b1c1c; }
.comp-line dd { color: var(--ok); font-weight: 600; }
.link-btn.small { font-size: .85rem; margin-left: 8px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.totals { margin: 16px 0; }
.totals > div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals dt, .totals dd { margin: 0; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 1.15rem; }
.empty { text-align: center; padding: 48px 0; }
.progress { display: flex; list-style: none; padding: 0; margin: 12px 0 24px; counter-reset: s; }
.progress li { flex: 1; text-align: center; position: relative; padding-top: 34px; color: var(--muted); font-size: .9rem; }
.progress li::before { counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%;
  background: #e8ddcc; color: var(--muted); display: grid; place-items: center; font-weight: 700; z-index: 1; }
.progress li::after { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 3px; background: #e8ddcc; }
.progress li:first-child::after { display: none; }
.progress li.done { color: var(--ink); }
.progress li.done::before, .progress li.done::after { background: var(--curtain); color: #fff; }
.progress li.current { font-weight: 700; }

.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .9rem; margin-top: 32px; }

@media (max-width: 860px) {
  .hero-grid, .designer-grid, .cart-grid, .order-grid { grid-template-columns: 1fr; }
  .preview-pane { position: sticky; top: 0; z-index: 5; background: var(--paper); padding-top: 8px; }
  .preview-stage { padding: 16px 10px; min-height: 0; }
  .preview-board svg { max-height: 200px; }
  .steps { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 1fr auto; }
  .cart-thumb { grid-column: 1 / -1; }
  .panel-cta { position: static; }
}
@media (max-width: 480px) {
  .brand small { display: none; }
  .brand strong { font-size: .88rem; letter-spacing: .02em; }
  .brand-mark { display: none; }
  .nav-links { gap: 12px; font-size: .92rem; }
  .line-row { grid-template-columns: 1fr 98px 36px; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 .field:first-child { grid-column: 1 / -1; }
}
