/* ============================================================
   Sierra.ev Tools: shared design system
   One source for tokens, base styles, focus states, and the
   site shell (top bar + footer). Page CSS loads after this.
   ============================================================ */

:root {
  /* Ground */
  --ground:        #ede7db;
  --ground-deep:   #e4ddd0;
  --ground-raised: #f2ede5;
  --ground-mid:    #e8e2d6;
  --ground-high:   #dad4c8;
  /* Ink and text (all text tokens pass WCAG AA 4.5:1 on ground) */
  --ink:           #1a1612;
  --text:          #2c2520;
  --text-muted:    #6b5e52;
  --text-faint:    #6e6155;
  /* Lines */
  --rule:          rgba(26,22,18,0.10);
  --rule-rr:       rgba(61,140,138,0.30);
  /* Teal accent. Use --rr for lines and fills, --rr-text for text on light,
     --rr-pale for text on dark, --rr-deep behind white text. */
  --rr:            #3d8c8a;
  --rr-deep:       #2d6e6c;
  --rr-deeper:     #245856;
  --rr-pale:       #5aa8a6;
  --rr-glow:       rgba(61,140,138,0.14);
  --rr-text:       #1e5c5a;
  /* Status */
  --crimson:       #9e2d1e;
  --success:       #2e7a5a;
  --amber:         #8a5210;
  /* Third-party brand colours (used only on their own buttons) */
  --wa:            #25D366;
  --reddit:        #FF4500;
  --amz:           #FF9900;
  --amz-bg:        rgba(255,153,0,0.08);
  /* Legacy aliases kept so older page CSS keeps working */
  --teal:          var(--rr-deep);
  --teal-dk:       var(--rr-deeper);
  --teal-bg:       rgba(61,140,138,0.09);
  --teal-rule:     var(--rule-rr);
  /* Motion */
  --ease-out:      cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer:   cubic-bezier(0.32, 0.72, 0, 1);
  /* Layout */
  --wrap:          1240px;
  --gutter:        24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--ground);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-tap-highlight-color: rgba(61,140,138,0.15);
}
button, a, input, select { touch-action: manipulation; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Focus: visible for keyboard, hidden for mouse clicks */
:focus-visible {
  outline: 2px solid var(--rr);
  outline-offset: 2px;
  border-radius: 1px;
}
.site-top :focus-visible, .site-foot :focus-visible { outline-color: var(--rr-pale); }

/* Skip link */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 1000;
  background: var(--ink); color: #fff; padding: 10px 14px;
  font-size: 13px; font-weight: 600; text-decoration: none; border-radius: 1px;
  transition: top 150ms var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* Screen-reader only */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Site top bar ───────────────────────────────────────────── */
.site-top {
  background: var(--ink);
  border-bottom: 2px solid var(--rr);
  padding: 0 var(--gutter);
  position: sticky; top: 0; z-index: 200;
}
.site-top-inner {
  max-width: var(--wrap); margin: 0 auto;
  min-height: 52px;
  display: flex; align-items: center; gap: 14px;
}
.st-back {
  white-space: nowrap; flex-shrink: 0;
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: 0.03em;
  color: rgba(255,255,255,0.75); text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px 6px 0;
  border-right: 1px solid rgba(255,255,255,0.12);
  transition: color 150ms ease;
}
.st-back:hover { color: #fff; }
.st-brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.st-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--rr); border: 2px solid var(--rr-deep);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px;
}
.st-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 21px; font-weight: 700; letter-spacing: 0.02em; color: #fff;
}
.st-name span { color: var(--rr-pale); }
.st-name small { font-weight: 400; color: rgba(255,255,255,0.6); margin-left: 4px; font-size: 18px; }
.st-spacer { flex: 1; }
.st-link {
  font-family: 'Space Mono', monospace; font-size: 11px;
  color: rgba(255,255,255,0.7); text-decoration: none;
  transition: color 150ms ease;
}
.st-link:hover { color: #fff; }
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .st-name small { display: none; }
  .st-hide-sm { display: none; }
}

/* ── Site footer ────────────────────────────────────────────── */
.site-foot {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 0 var(--gutter);
  margin-top: 48px;
}
.site-foot-inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: 28px 0 32px;
  display: grid; gap: 18px;
}
.sf-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sf-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.sf-nav a {
  font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: 0.03em;
  color: rgba(255,255,255,0.75); text-decoration: none;
  transition: color 150ms ease;
}
.sf-nav a:hover { color: #fff; }
.sf-legal {
  font-size: 12px; line-height: 1.6; color: rgba(255,255,255,0.6);
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 16px;
  max-width: 900px;
}
.sf-legal a { color: rgba(255,255,255,0.8); }
.btn-bmc {
  display: inline-flex; align-items: center; gap: 6px;
  background: #FFDD00; color: #000;
  font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 700;
  padding: 8px 18px; border-radius: 8px; text-decoration: none;
  transition: transform 120ms ease;
}
.btn-bmc:active { transform: scale(0.97); }

/* ── Shared buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 1px;
  font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 120ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--rr-deep); color: #fff; }
.btn-primary:hover { background: var(--rr-deeper); }
.btn-ghost { background: transparent; color: var(--rr-text); border-color: var(--rule-rr); }
.btn-ghost:hover { background: var(--rr-glow); }
.btn-amz { background: var(--amz); color: #000; }
.btn-amz:hover { background: #e68a00; }
.btn-wa { background: var(--wa); color: #0b3d20; }

/* Numbers line up in price columns */
.num, .prod-price, .drawer-item-price, .drawer-total-amount, .prod-modal-price { font-variant-numeric: tabular-nums; }

/* Subtle paper grain on the ground */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  opacity: 0.035; z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
