/* Matt's 3D Print Shop: shared styles
   Tokens, base, layout, buttons, forms, announcement bar, header, footer. */

:root {
  --ink: #0F0F10;
  --bg: #FFFFFF;
  --panel: #F1F0EE;
  --panel-soft: #FAFAF9;
  --border: #ECEAE7;
  --border-strong: #D6D3D1;
  --muted: #57534E;
  --muted-strong: #44403C;
  --accent: #9A5420;
  --accent-tint: #F5EDE6;

  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-card: 24px;
  --radius-card-lg: 28px;
  --radius-card-sm: 20px;
  --radius-input: 12px;
  --radius-pill: 999px;

  --tap: 44px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);

  --shadow-soft: 0 1px 2px rgba(15, 15, 16, .04), 0 8px 24px rgba(15, 15, 16, .06);
  --shadow-pop: 0 12px 40px rgba(15, 15, 16, .18);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.25rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }

p { margin: 0 0 1em; }

a { color: inherit; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-pill);
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(56px, 8vw, 104px); }
.section--panel { background: var(--panel-soft); }
.section--dark { background: var(--ink); color: #fff; }

.eyebrow {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .75rem;
}
.section--dark .eyebrow { color: #E0A877; }

.muted { color: var(--muted); }

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.panel {
  background: var(--panel);
  border-radius: var(--radius-card);
}

/* ---------- Pills, notes ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  color: var(--accent);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.2;
}

.note {
  background: var(--accent-tint);
  color: var(--muted-strong);
  border-radius: var(--radius-input);
  padding: 10px 14px;
  font-size: .875rem;
  line-height: 1.45;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #2A2A2C; color: #fff; }

.btn--secondary { background: var(--bg); color: var(--ink); border-color: var(--border-strong); }
.btn--secondary:hover { border-color: var(--ink); color: var(--ink); }

.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: var(--panel); color: var(--ink); }

.btn--block { width: 100%; }
.btn--lg { min-height: 52px; padding-inline: 28px; font-size: 1.0625rem; }

.link-btn {
  background: none; border: 0; padding: 0;
  min-height: var(--tap);
  font: 600 .875rem/1.2 var(--font-body);
  color: var(--muted-strong);
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--accent); }

/* ---------- Forms ---------- */

.field { display: grid; gap: 6px; }
.label { font-weight: 600; font-size: .9375rem; }
.hint { font-size: .8125rem; color: var(--muted); }

.input, .select, .textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-input);
  background: #fff;
  color: var(--ink);
  font: 400 1rem/1.4 var(--font-body);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 112px; resize: vertical; }
.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230F0F10' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(154, 84, 32, .18);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: #B42318; }

/* Quantity stepper (used in configurator, cart drawer, checkout) */
.stepper {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: #fff;
}
.stepper button {
  width: var(--tap); height: var(--tap);
  border: 0; background: none; cursor: pointer;
  font-size: 1.25rem; line-height: 1; color: var(--ink);
  border-radius: var(--radius-pill);
}
.stepper button:hover:not([disabled]) { background: var(--panel); }
.stepper button[disabled] { color: var(--border-strong); cursor: not-allowed; }
.stepper output {
  min-width: 2ch; text-align: center;
  font-weight: 600; font-variant-numeric: tabular-nums;
}

/* ---------- Announcement bar ---------- */

.announce {
  background: var(--ink);
  color: #fff;
  font-size: .875rem;
  font-weight: 500;
  text-align: center;
  padding: 10px var(--gutter);
  line-height: 1.4;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; gap: 16px;
  min-height: 72px;
}

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-head); font-weight: 700;
  font-size: 1.125rem; letter-spacing: -0.01em;
  margin-right: auto;
  min-height: var(--tap);
}
.logo:hover { color: var(--ink); }
.logo__mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
}
.logo__mark svg { width: 22px; height: 22px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center;
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 500; font-size: .9375rem;
  color: var(--muted-strong);
}
.nav a:hover { color: var(--ink); background: var(--panel-soft); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.cart-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap);
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: #fff; color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.cart-btn:hover { border-color: var(--ink); color: var(--ink); }
.cart-btn svg { width: 20px; height: 20px; }
.cart-btn__badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--accent); color: #fff;
  font-size: .75rem; font-weight: 700; line-height: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
  border: 2px solid #fff;
  box-sizing: content-box;
}
.cart-btn__badge[hidden] { display: none; }

.menu-btn {
  display: none;
  width: var(--tap); height: var(--tap);
  align-items: center; justify-content: center;
  border: 0; background: none; cursor: pointer; color: var(--ink);
  border-radius: var(--radius-pill);
}
.menu-btn svg { width: 22px; height: 22px; }

@media (max-width: 720px) {
  .site-header__inner { gap: 6px; min-height: 64px; }
  .logo { font-size: 1rem; }
  .logo__mark { width: 32px; height: 32px; }
  .menu-btn { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 8px var(--gutter) 16px;
    box-shadow: 0 12px 24px rgba(15, 15, 16, .06);
  }
  .nav:not(.is-open) { display: none; }
  .nav a { padding: 0 8px; font-size: 1rem; border-radius: var(--radius-input); }
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--panel-soft);
  border-top: 1px solid var(--border);
  padding-block: 56px 32px;
  font-size: .9375rem;
  color: var(--muted-strong);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 32px;
}
.site-footer h2 {
  font-family: var(--font-body);
  font-size: .8125rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink);
  margin-bottom: 12px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a {
  display: inline-flex; align-items: center;
  min-height: 36px;
  text-decoration: none; color: var(--muted-strong);
}
.site-footer li a:hover { color: var(--accent); }
.site-footer .logo { margin-bottom: 12px; }
.site-footer__blurb { max-width: 34ch; color: var(--muted); }
.site-footer__bottom {
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  font-size: .8125rem; color: var(--muted);
}

@media (max-width: 720px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}

/* ---------- Page placeholder (removed as pages are built) ---------- */

.placeholder {
  padding-block: 96px;
  text-align: center;
}
.placeholder p { color: var(--muted); max-width: 48ch; margin-inline: auto; }

/* Make the hidden attribute win over component display rules. */
[hidden] { display: none !important; }
