/* Mended Matter store - shared styles. Brand: kintsugi ink + gold, IBM Plex. */
:root {
  --ink: #16181D;
  --ink-2: #1e2128;
  --ink-3: #2a2e37;
  --gold: #C8A24B;
  --gold-hi: #E7CB7E;
  --gold-lo: #9C7726;
  --paper: #F7F3EC;
  --paper-dim: #d9d4c8;
  --ok: #5fae7a;
  --warn: #d9894b;
  --err: #d05b5b;
  --line: rgba(200,162,75,0.22);
  --radius: 12px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(22,24,29,0.9);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold), var(--gold-lo));
  display: grid; place-items: center; color: var(--ink); font-family: var(--mono); font-weight: 700;
}
.brand .name { font-family: var(--mono); font-weight: 600; letter-spacing: 0.02em; }
.brand .name small { display: block; font-size: 11px; color: var(--paper-dim); font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; }
.nav { display: flex; gap: 22px; font-family: var(--mono); font-size: 14px; }
.nav a { color: var(--paper); }
.nav a:hover { color: var(--gold-hi); text-decoration: none; }

/* Hero */
.hero { padding: 64px 0 40px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px; opacity: 0.15; pointer-events: none;
}
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.05; margin: 0 0 14px; letter-spacing: -0.01em; }
.hero h1 .grad { background: linear-gradient(120deg, var(--gold-hi), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lede { font-size: 19px; color: var(--paper-dim); max-width: 640px; margin: 0 0 26px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  padding: 12px 22px; border-radius: 10px; border: 1px solid transparent; transition: 0.15s;
}
.btn-primary { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); color: var(--ink); }
.btn-primary:hover { filter: brightness(1.06); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--paper); }
.btn-ghost:hover { border-color: var(--gold); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Sections */
section.block { padding: 48px 0; border-bottom: 1px solid var(--line); }
h2.section-title { font-size: 26px; margin: 0 0 8px; }
.muted { color: var(--paper-dim); }

/* Cards / grid */
.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.card h3 { margin: 0 0 6px; font-size: 18px; }

/* Product card */
.product .thumb { aspect-ratio: 4/3; border-radius: 8px; background: var(--ink-3); display: grid; place-items: center; color: var(--paper-dim); font-family: var(--mono); margin-bottom: 12px; }
.product .price { font-family: var(--mono); color: var(--gold-hi); font-size: 18px; }

/* Quote tool layout */
.quote-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: start; }
.viewer { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); height: 460px; position: relative; overflow: hidden; }
.viewer canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.dropzone {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  border: 2px dashed var(--line); border-radius: var(--radius); transition: 0.15s;
}
.dropzone.drag { border-color: var(--gold); background: rgba(200,162,75,0.06); }
.dropzone .big { font-family: var(--mono); font-size: 15px; }
.controls .field { margin-bottom: 16px; }
.controls label { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper-dim); margin-bottom: 6px; }
.controls select, .controls input[type=number] {
  width: 100%; background: var(--ink); color: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 15px;
}
.toggle-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 13px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.chip.active { border-color: var(--gold); background: rgba(200,162,75,0.1); color: var(--gold-hi); }

/* Segmented Easy/Advanced toggle */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 18px; background: var(--ink); }
.seg-btn { font-family: var(--mono); font-size: 13px; padding: 7px 16px; border: 0; background: transparent; color: var(--paper-dim); border-radius: 7px; cursor: pointer; }
.seg-btn.active { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); color: var(--ink); font-weight: 600; }

/* Link row */
.linkrow { display: flex; gap: 8px; margin-top: 10px; }
.linkrow input { flex: 1; background: var(--ink); color: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 14px; }
.linkrow .btn { padding: 10px 16px; }

/* Text inputs */
.text-in { width: 100%; background: var(--ink); color: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 15px; }

/* Colour swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line) inset; transition: 0.12s; }
.swatch:hover { transform: translateY(-1px); }
.swatch.active { border-color: var(--gold-hi); box-shadow: 0 0 0 2px var(--gold) ; }
.swatch.special::after { content: "+"; position: absolute; top: -5px; right: -5px; width: 15px; height: 15px; border-radius: 50%; background: var(--warn); color: var(--ink); font-family: var(--mono); font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* Easy mode hides advanced-only elements */
body.mode-easy .adv-only { display: none !important; }

/* Result panel */
.result { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-top: 20px; }
.result .price-big { font-family: var(--mono); font-size: 40px; font-weight: 700; color: var(--gold-hi); line-height: 1; }
.result .price-band { font-family: var(--mono); color: var(--paper-dim); font-size: 14px; margin-top: 4px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 18px 28px; margin: 16px 0; font-family: var(--mono); font-size: 14px; }
.stat-row .stat b { color: var(--gold-hi); font-weight: 600; }
.notice { font-size: 13px; border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.notice.warn { background: rgba(217,137,75,0.12); border: 1px solid rgba(217,137,75,0.4); color: #f0c199; }
.notice.err { background: rgba(208,91,91,0.12); border: 1px solid rgba(208,91,91,0.4); color: #f0a3a3; }
.notice.info { background: rgba(200,162,75,0.08); border: 1px solid var(--line); color: var(--paper-dim); }

/* Footer */
.site-footer { padding: 32px 0; color: var(--paper-dim); font-family: var(--mono); font-size: 13px; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Responsive */
@media (max-width: 820px) {
  .quote-layout { grid-template-columns: 1fr; }
  .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .nav { gap: 14px; }
}
