/* ─────────────────────────────────────────────────────────────────────
   American Acrylic Works — design system

   Palette:   paper #F4ECDB · navy #1E2A3D · brass #B8862B · ink #0F1620
   Display:   Georgia italic
   Body:      system sans
   Labels:    JetBrains Mono (with system mono fallback)
   ───────────────────────────────────────────────────────────────────── */

:root {
  --paper:        #f4ecdb;
  --paper-warm:   #ebe1c8;
  --paper-deep:   #e8dcc1;
  --navy:         #1e2a3d;
  --brass:        #b8862b;
  --brass-deep:   #8e6818;
  --ink:          #0f1620;
  --ink-soft:     #2a2522;
  --rule:         #c9bfae;

  --serif:        Georgia, "Times New Roman", serif;
  --sans:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                  "Helvetica Neue", Arial, sans-serif;
  --mono:         "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --max:          1240px;
  --gutter:       clamp(1.25rem, 3vw, 2.5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--brass); color: var(--paper); }

/* ─── HEADER ─────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 0.5px solid var(--navy);
}
.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand .dot { color: var(--brass); }

/* Header wordmark stacks over a QC-stamp descriptor. Scoped to .brand--header
   so the footer wordmark (same .brand class) is untouched. */
.brand--header {
  display: inline-flex;
  flex-direction: column;
  gap: 0.18rem;
  line-height: 1.1;
}
.brand__mark { display: block; }
.brand__descriptor {
  /* Subordinate to the wordmark: mono, small, letter-spaced, muted — reads as
     a mill stamp, not a slogan. Never wraps to two lines. */
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.6;
  white-space: nowrap;
}
/* Tight horizontal space → drop to the short form "CAST ACRYLIC". */
@media (max-width: 860px) {
  .brand__descriptor-tail { display: none; }
}

/* ─── USA STAMP ROUNDEL ───────────────────────────────────────────── */
/* A mark, not a callout: subordinate everywhere it appears. Monochrome —
   the ring/text follow currentColor so it works on paper and on navy. */
.usa-stamp {
  width: 48px;
  height: 48px;
  flex: none;
  display: block;
  overflow: visible;
}
.usa-stamp__ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.usa-stamp__ring--inner { stroke-width: 0.8; }
.usa-stamp__text {
  /* Sized to the widest the 32→47 ring band allows. At 34–44px display the ring
     legend still reads more as texture than as words — that is acceptable for a
     QC mark, but it is why the band is as wide as it is. */
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  fill: currentColor;
}
.usa-stamp__star { fill: var(--brass); }
.nav {
  display: flex;
  gap: 1.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
  align-items: center;
}
.nav a { transition: color 0.15s; }
.nav a:hover { color: var(--brass); }
.nav .cart-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav .cart-link.has-items { color: var(--brass); }

.nav-toggle {
  display: none;
  background: none;
  border: 0.5px solid var(--navy);
  padding: 0.45rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
@media (max-width: 760px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--paper); border-bottom: 0.5px solid var(--navy); padding: 1rem var(--gutter); gap: 0.9rem; }
  .nav.is-open { display: flex; }
  .nav-toggle { display: inline-block; }
}

/* ─── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 0.5px solid var(--navy);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.18s;
  background: transparent;
  color: var(--navy);
}
.btn--primary {
  background: var(--navy);
  color: var(--paper);
}
.btn--primary:hover {
  background: var(--brass);
  border-color: var(--brass);
}
.btn--ghost:hover {
  background: var(--navy);
  color: var(--paper);
}
.btn__arrow {
  display: inline-block;
  transition: transform 0.18s;
}
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ─── EYEBROW LABELS ─────────────────────────────────────────────── */
.label,
.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
}
.label--rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.label--rule::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--brass);
}
.section-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-label::before {
  content: "§";
  opacity: 0.55;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────────────────── */
.h-display {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.02;
  color: var(--ink);
  margin: 0;
}
.h-display--xl { font-size: clamp(2.4rem, 6vw, 4.2rem); }
.h-display--lg { font-size: clamp(2rem, 4.5vw, 3rem); }
.h-display--md { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.h-display--sm { font-size: clamp(1.2rem, 2vw, 1.5rem); }

/* ─── LAYOUT ─────────────────────────────────────────────────────── */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding-top: clamp(3rem, 6vw, 5.5rem);
  padding-bottom: clamp(3rem, 6vw, 5.5rem);
}
.section--warm   { background: var(--paper-warm); }
.section--deep   { background: var(--paper-deep); }
.section--navy   { background: var(--navy); color: var(--paper); }
.section--navy .label,
.section--navy .section-label { color: var(--brass); }

/* Rule divider, optionally with a brass dot */
.rule {
  border: 0;
  border-top: 0.5px solid var(--navy);
  margin: 0;
}

/* ─── FOOTER ─────────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: var(--paper);
  padding: 3rem var(--gutter) 1.5rem;
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  /* brand · Shop · Learn · Policies · Account · Reach */
  grid-template-columns: 2fr repeat(5, 1fr);
  gap: 2.5rem;
}
@media (max-width: 1080px) {
  .site-footer__inner { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
@media (max-width: 760px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
.site-footer h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 0 0 0.85rem;
  font-weight: 500;
}
.site-footer__brand .brand { color: var(--paper); font-size: 1.55rem; }
.site-footer__brand p {
  font-size: 0.85rem;
  opacity: 0.7;
  max-width: 34ch;
  margin: 0.75rem 0 0;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer a { opacity: 0.75; transition: opacity 0.15s; }
.site-footer a:hover { opacity: 1; color: var(--brass); }
.site-footer__bottom {
  max-width: var(--max);
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 0.5px solid rgba(244, 236, 219, 0.1);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  opacity: 0.5;
  text-transform: uppercase;
}
/* Stamp sits with the certification line, sized down so it never competes. */
.site-footer__cert {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.site-footer__cert .usa-stamp { width: 34px; height: 34px; }

/* ─── PAGE HEAD (interior pages) ─────────────────────────────────── */
.page-head {
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter) 1.5rem;
}
.page-head__inner {
  max-width: var(--max);
  margin: 0 auto;
  border-bottom: 0.5px solid var(--rule);
  padding-bottom: 1.5rem;
}
.page-head__crumb {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.65;
  margin-bottom: 0.6rem;
}
.page-head__title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.page-head__lede {
  font-size: 1.02rem;
  max-width: 60ch;
  color: var(--ink-soft);
  margin: 1rem 0 0;
}

/* ─── PRODUCT CARD (shared component) ────────────────────────────── */
.product-card {
  background: var(--paper);
  border: 0.5px solid var(--navy);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 42, 61, 0.08);
}
.product-card__thumb {
  height: 110px;
  background: var(--paper-deep);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.product-card__type {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}
.product-card__name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.2;
  margin: 0;
}
.product-card__view {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.7;
  margin-top: auto;
}

/* ─── AVAILABILITY BADGES (PDP + cart, live Sage inventory) ──────── */
.avail-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}
/* Status dot */
.avail-pill::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.avail-pill--in-stock {
  color: #065f46;
  border-color: #047857;
  background: #ecfdf5;
}
.avail-pill--in-stock::before { background: #10b981; }
.avail-pill--mto-finishing,
.avail-pill--mto-cast {
  color: #92400e;
  border-color: #b45309;
  background: #fffbeb;
}
.avail-pill--mto-finishing::before { background: #f59e0b; }
/* Fresh-cast dot runs slightly deeper than finishing to differentiate */
.avail-pill--mto-cast::before { background: #d97706; }
.avail-pill--unavailable {
  color: #374151;
  border-color: #6b7280;
  background: #f9fafb;
  text-decoration: none;
}
.avail-pill--unavailable::before { background: #9ca3af; }
a.avail-pill--unavailable:hover {
  border-color: #374151;
  color: #111827;
}

/* ─── FLASH MESSAGES ─────────────────────────────────────────── */
.flash-stack {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.flash {
  background: var(--paper);
  border: 0.5px solid var(--navy);
  padding: 0.7rem 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  max-width: 32ch;
  pointer-events: auto;
  animation: flash-in 0.25s ease;
}
.flash--success { border-left: 3px solid var(--brass); }
.flash--info { border-left: 3px solid var(--navy); }
.flash--error { border-left: 3px solid #993c1d; }
@keyframes flash-in {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }

/* ─── FORM FIELDS ────────────────────────────────────────────────── */
/* Generic form primitives. Originally lived in checkout.css; promoted here
   once the account pages needed the same look. Used by checkout/*.html and
   accounts/*.html. */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.field__label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
}
.field__input,
.field__select {
  padding: 0.7rem 0.85rem;
  background: var(--paper);
  border: 0.5px solid var(--navy);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  width: 100%;
}
.field__select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%),
                    linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}
.field__input:focus,
.field__select:focus {
  outline: none;
  border-color: var(--brass);
  background: #fff;
}
.field__help {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-style: italic;
}
.field__error {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #993c1d;
}
.field--has-error .field__input,
.field--has-error .field__select { border-color: #993c1d; }

/* A submit button that has to sit inside body text or a footer list and
   read as a link (sign-out, which must be a POST). */
.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.linkish:hover { color: var(--brass); }

/* ─── ACCESSIBILITY ──────────────────────────────────────────────── */
.sr-only {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── HERO ASIDE ───────────────────────────────────────────────────
   The understated educational hook under a hero's CTAs ("Why cast, not
   extruded? →"). Lives in main.css rather than pages.css because the
   homepage (home.css) and the landing pages (pages.css) both use it.
   Deliberately quieter than a .btn — it's a third option, not a third CTA. */
.hero-aside {
  margin: 1rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
}
.hero-aside a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 0.5px solid var(--rule);
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
.hero-aside a:hover {
  color: var(--brass-deep);
  border-bottom-color: var(--brass);
}
.hero-aside .btn__arrow { font-style: normal; }
