/* Burner Mason — warm minimal. Quiet, handmade, unlabeled. */

:root {
  color-scheme: light dark; /* let native controls (selects, scrollbars) follow the OS */
  --cream: #faf7f1;       /* page background */
  --cream-2: #f3ede2;     /* secondary panels */
  --ink: #2b2825;         /* primary text */
  --ink-soft: #6b6258;    /* muted text */
  --clay: #b08968;        /* accent */
  --clay-deep: #8c6a4f;   /* accent (stronger) */
  --line: #e4dccd;        /* borders */
  --ok: #5a7d5a;          /* success */
  --surface: #fff;        /* raised surfaces: inputs, hovered cards, rate chips */
  --header-bg: rgba(250, 247, 241, 0.9);
  --err-bg: #f7e9e4;
  --err-text: #8a3b22;
  --err-line: #e7c6b8;
  --max: 1080px;
  --radius: 4px;
}

/* Dark palette. Applied in two cases:
   1. System preference is dark AND the patron hasn't chosen a theme
      (`:root:not([data-theme])`), and
   2. The patron explicitly chose dark (`:root[data-theme="dark"]`).
   The two blocks below MUST stay in sync. A manual choice (data-theme) always
   wins over the system media query because it has higher specificity. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --cream: #1c1a17;
    --cream-2: #24211d;
    --ink: #ece6db;
    --ink-soft: #a89e90;
    --clay: #c69c77;
    --clay-deep: #d8b58e;
    --line: #38332c;
    --ok: #8fb38f;
    --surface: #2b2722;
    --header-bg: rgba(28, 26, 23, 0.9);
    --err-bg: #3a2620;
    --err-text: #f0b9a3;
    --err-line: #5c392e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --cream: #1c1a17;
  --cream-2: #24211d;
  --ink: #ece6db;
  --ink-soft: #a89e90;
  --clay: #c69c77;
  --clay-deep: #d8b58e;
  --line: #38332c;
  --ok: #8fb38f;
  --surface: #2b2722;
  --header-bg: rgba(28, 26, 23, 0.9);
  --err-bg: #3a2620;
  --err-text: #f0b9a3;
  --err-line: #5c392e;
}
/* Explicit light choice overrides a dark system preference. The light tokens
   already live in :root; we only need to pin the native color-scheme. */
:root[data-theme="light"] {
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--clay-deep); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-bg);
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 22px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { font-size: 14px; letter-spacing: 0.06em; color: var(--ink-soft); }
.nav a:hover { color: var(--ink); }
.cart-btn {
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 14px; letter-spacing: 0.06em; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px;
}
.cart-btn:hover { color: var(--ink); }
.cart-count {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--clay); color: #fff;
  border-radius: 999px; font-size: 12px; letter-spacing: 0;
}
.theme-toggle {
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--ink-soft);
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover { color: var(--ink); background: var(--cream-2); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }

/* ---- Hero ---- */
.hero {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.hero h1 { font-size: clamp(40px, 7vw, 72px); margin: 0 0 16px; }
.hero p {
  max-width: 560px; margin: 0 auto;
  color: var(--ink-soft); font-size: 19px;
}
.hero .eyebrow {
  text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 12px; color: var(--clay-deep); margin-bottom: 20px;
}

/* ---- Sections ---- */
.section { padding: 72px 0; }
.section-head { margin-bottom: 36px; }
.section-head h2 { font-size: 32px; margin: 0 0 6px; }
.section-head p { margin: 0; color: var(--ink-soft); }

/* ---- Product grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  min-height: 230px;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.card:hover { background: var(--surface); border-color: var(--clay); }
.card .mark {
  width: 44px; height: 44px; margin-bottom: 20px;
  border: 1px solid var(--clay); border-radius: 999px;
  display: grid; place-items: center;
  font-family: "EB Garamond", Georgia, serif;
  color: var(--clay-deep); font-size: 18px;
}
.card h3 { font-size: 21px; margin: 0 0 6px; }
.card .blurb { color: var(--ink-soft); font-size: 15px; margin: 0 0 18px; flex: 1; }
.card-link { display: flex; flex-direction: column; flex: 1; color: inherit; }
.card-link:hover h3 { color: var(--clay-deep); }
.card .row { display: flex; align-items: center; justify-content: space-between; }
.card .price { font-family: "EB Garamond", Georgia, serif; font-size: 20px; }

/* ---- Product detail page ---- */
.product { padding: 40px 0 72px; }
.back { display: inline-block; margin-bottom: 28px; font-size: 14px; color: var(--ink-soft); letter-spacing: 0.04em; }
.back:hover { color: var(--ink); }
.product-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
.product-visual {
  aspect-ratio: 1 / 1; display: grid; place-items: center;
  background: var(--cream-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.mark.big {
  width: 120px; height: 120px; border: 1px solid var(--clay); border-radius: 999px;
  display: grid; place-items: center;
  font-family: "EB Garamond", Georgia, serif; color: var(--clay-deep); font-size: 52px;
}
.product-info .eyebrow { text-transform: uppercase; letter-spacing: 0.22em; font-size: 12px; color: var(--clay-deep); margin-bottom: 12px; }
.product-info h1 { font-size: clamp(34px, 5vw, 48px); margin: 0 0 10px; }
.product-info .price { font-family: "EB Garamond", Georgia, serif; font-size: 26px; margin: 0 0 24px; }
.product-info .lead { font-size: 19px; margin: 0 0 16px; }
.product-info .detail { color: var(--ink-soft); margin: 0 0 28px; }
.buy { max-width: 320px; margin-bottom: 28px; display: flex; flex-direction: column; gap: 10px; }
.product-meta { list-style: none; padding: 0; margin: 0 0 24px; border-top: 1px solid var(--line); }
.product-meta li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; display: flex; gap: 10px; align-items: baseline; }
.product-meta li::before { content: "—"; color: var(--clay); }
.patron-note { font-style: italic; color: var(--ink-soft); font-size: 15px; }
.notfound { text-align: center; padding: 80px 0; }

@media (max-width: 760px) {
  .product-grid { grid-template-columns: 1fr; gap: 28px; }
}

.btn {
  appearance: none; cursor: pointer;
  font: inherit; font-size: 14px; letter-spacing: 0.04em;
  border: 1px solid var(--ink); background: var(--ink); color: var(--cream);
  padding: 9px 16px; border-radius: var(--radius);
  min-height: 44px; /* comfortable touch target on mobile */
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 0.2s ease, transform 0.05s ease;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: none; color: var(--ink); }
.btn.ghost:hover { background: var(--cream-2); }
.btn.block { width: 100%; padding: 14px; font-size: 15px; }

/* ---- Notice strip ---- */
.strip {
  text-align: center; padding: 14px 24px;
  background: var(--cream-2); border-bottom: 1px solid var(--line);
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft);
}

/* ---- Values ---- */
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.value h3 { font-size: 20px; margin: 0 0 8px; }
.value p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---- Cart drawer ---- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(43, 40, 37, 0.35);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 40;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 92vw);
  background: var(--cream); z-index: 50;
  transform: translateX(100%); transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; box-shadow: -8px 0 40px rgba(0,0,0,0.08);
}
.drawer.open { transform: translateX(0); }
.drawer header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-bottom: 1px solid var(--line);
}
.drawer header h2 { margin: 0; font-size: 22px; }
.drawer .items { flex: 1; overflow-y: auto; padding: 8px 24px; }
.drawer footer { padding: 20px 24px; border-top: 1px solid var(--line); }
.x { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--ink-soft); line-height: 1; }
.x:hover { color: var(--ink); }

.line {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.line .name { font-family: "EB Garamond", Georgia, serif; font-size: 18px; }
.line .lt { font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.qty button { width: 30px; height: 30px; border: none; background: none; cursor: pointer; font-size: 16px; color: var(--ink-soft); }
.qty button:hover { color: var(--ink); background: var(--cream-2); }
.qty span { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; font-size: 14px; }
.line .rm { background: none; border: none; color: var(--ink-soft); cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0; justify-self: start; }
.line .rm:hover { color: var(--clay-deep); }

.subtotal { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.subtotal .amt { font-family: "EB Garamond", Georgia, serif; font-size: 24px; font-variant-numeric: tabular-nums; }
.ship-hint { font-size: 13px; color: var(--ink-soft); margin: 0 0 16px; }
.ship-hint.met { color: var(--ok); }
.empty { color: var(--ink-soft); text-align: center; padding: 48px 0; }

/* ---- Checkout page ---- */
.checkout { padding: 56px 0; }
.checkout-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 56px; align-items: start; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; letter-spacing: 0.04em; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; font: inherit; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--clay); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.summary { background: var(--cream-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: sticky; top: 88px; }
.summary h2 { margin: 0 0 16px; font-size: 24px; }
.summary .line { padding: 12px 0; }

.rate { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; cursor: pointer; background: var(--surface); }
.rate:hover { border-color: var(--clay); }
.rate.sel { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.rate input { margin: 0; }
.rate .meta { flex: 1; }
.rate .meta .svc { font-size: 15px; }
.rate .meta .eta { font-size: 13px; color: var(--ink-soft); }
.rate .amt { font-variant-numeric: tabular-nums; }

.totals { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.totals .row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--ink-soft); font-size: 15px; }
.totals .row.grand { color: var(--ink); font-family: "EB Garamond", Georgia, serif; font-size: 22px; padding-top: 10px; }

.note { font-size: 13px; color: var(--ink-soft); }
.ece-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-soft); font-size: 13px; letter-spacing: 0.04em; }
.ece-divider::before, .ece-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin: 12px 0; }
.msg.err { background: var(--err-bg); color: var(--err-text); border: 1px solid var(--err-line); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Prose (About) ---- */
.prose { max-width: 660px; }
.prose .lead { font-size: 21px; line-height: 1.55; margin: 0 0 36px; }
.prose h2 { font-size: 28px; margin: 44px 0 12px; }
.prose p { margin: 0 0 18px; }
.prose .signoff { margin-top: 40px; font-style: italic; color: var(--ink-soft); }

/* ---- Result pages ---- */
.result { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.result .inner { max-width: 480px; }
.result h1 { font-size: 48px; margin: 0 0 12px; }
.result p { color: var(--ink-soft); }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 40px; color: var(--ink-soft); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 760px) {
  .checkout-grid { grid-template-columns: 1fr; gap: 32px; }
  .summary { position: static; }
  .nav { gap: 18px; }
  .hero { padding: 64px 0 48px; }
  .section { padding: 48px 0; }
}

/* Phone refinements — keep the header from crowding and cards compact. */
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .site-header .wrap { height: 58px; }
  .brand { font-size: 18px; letter-spacing: 0.1em; }
  .nav { gap: 14px; }
  .nav a { font-size: 13px; }
  .theme-toggle { width: 40px; height: 40px; } /* bigger touch target */
  .card { min-height: auto; }                  /* no empty space in single column */
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .field-row { grid-template-columns: 1fr; gap: 0; } /* stack name/email, city/state, etc. */
}
