/* ===========================================================================
   S&S Portable Kitchen Trailer — design tokens, reset and shared primitives.
   Palette is sampled straight from the logo (#B60505 red, #14100F black) and
   from the trailer photography (butcher-block #8B745C, slate ceiling #46565E).
   =========================================================================== */

:root {
  /* Brand */
  --brand:        #B60505;
  --brand-dark:   #8C0404;
  --brand-bright: #D91414;
  --brand-tint:   #FDF0EF;

  /* Neutrals */
  --ink:      #14100F;
  --ink-soft: #3A3330;
  --ink-mute: #6B615C;
  --paper:    #FFFFFF;
  --paper-2:  #FAF7F4;
  --paper-3:  #F1EBE4;
  --line:     #E4DBD2;
  --line-2:   #D2C7BB;

  /* Accents drawn from the build */
  --wood:  #8B745C;
  --slate: #46565E;

  /* Status */
  --ok:      #17703F;
  --ok-bg:   #E6F4EC;
  --warn:    #9A6100;
  --warn-bg: #FDF3E0;
  --stop:    #A81C1C;
  --stop-bg: #FBEBEB;
  --info:    #1F5B8F;
  --info-bg: #E9F2F9;

  /* Type */
  --font-display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing scale */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  /* Radii + shadow */
  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(20,16,15,.06), 0 2px 6px rgba(20,16,15,.05);
  --shadow-2: 0 2px 6px rgba(20,16,15,.07), 0 10px 26px rgba(20,16,15,.09);
  --shadow-3: 0 12px 32px rgba(20,16,15,.13), 0 32px 68px rgba(20,16,15,.13);

  --container: 1180px;
  --header-h: 68px;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Any class that sets `display` outranks the user-agent's `[hidden]` rule, so
   an element with the hidden attribute would still be painted. Enforce it once
   here rather than remembering to guard every component. */
[hidden] { display: none !important; }

img, picture, video, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 7.2vw, 4.6rem); font-weight: 800; text-transform: uppercase; }
h2 { font-size: clamp(2rem, 4.6vw, 3.1rem); text-transform: uppercase; }
h3 { font-size: clamp(1.3rem, 2.3vw, 1.6rem); }
p  { text-wrap: pretty; }

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

/* ── Layout helpers ──────────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s5); }
@media (max-width: 560px) { .container { padding-inline: var(--s4); } }
.section { padding-block: clamp(56px, 9vw, 112px); }
.section--tight { padding-block: clamp(40px, 6vw, 72px); }
.section--paper { background: var(--paper-2); }
.section--ink { background: var(--ink); color: #CFC7C2; }
.section--ink h2, .section--ink h3 { color: #fff; }

.stack > * + * { margin-top: var(--s4); }
.center { text-align: center; }
.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;
}

/* ── Section headings ────────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-body);
  font-size: .78rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--brand);
  display: flex; align-items: center; gap: var(--s3);
}
.eyebrow::before {
  content: ''; width: 28px; height: 3px; background: var(--brand); border-radius: 2px;
  flex: none;
}
.center .eyebrow { justify-content: center; }
.section-head { max-width: 62ch; margin-bottom: var(--s7); }
.section-head.center { margin-inline: auto; }
.section-head h2 { margin-top: var(--s3); }
.section-head p { margin-top: var(--s4); font-size: 1.075rem; color: var(--ink-mute); }
.section--ink .section-head p { color: #A9A09B; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 14px 26px; min-height: 50px;
  font-family: var(--font-body); font-size: .95rem; font-weight: 650;
  letter-spacing: .01em; border-radius: var(--r-pill);
  border: 2px solid transparent; text-decoration: none; cursor: pointer;
  transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease, color .16s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .5; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-1); }
.btn--primary:hover { background: var(--brand-dark); box-shadow: var(--shadow-2); }

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

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ink); background: var(--paper-2); }

.btn--on-dark { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.35); backdrop-filter: blur(6px); }
.btn--on-dark:hover { background: rgba(255,255,255,.2); border-color: #fff; }

.btn--sm { padding: 9px 18px; min-height: 40px; font-size: .875rem; }
.btn--lg { padding: 17px 34px; min-height: 58px; font-size: 1.03rem; }
.btn--block { display: flex; width: 100%; }

/* ── Cards, pills, misc ──────────────────────────────────────────────────── */
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s5);
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: .76rem; font-weight: 650; letter-spacing: .03em; text-transform: uppercase;
  background: var(--paper-3); color: var(--ink-soft); white-space: nowrap;
}
.pill--ok   { background: var(--ok-bg);   color: var(--ok); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--stop { background: var(--stop-bg); color: var(--stop); }
.pill--info { background: var(--info-bg); color: var(--info); }
.pill--brand{ background: var(--brand); color: #fff; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.field { display: block; }
.field + .field { margin-top: var(--s4); }
.field > label, .label {
  display: block; margin-bottom: 6px;
  font-size: .82rem; font-weight: 650; color: var(--ink);
  letter-spacing: .02em;
}
.req { color: var(--brand); }
.input, .select, .textarea {
  width: 100%; padding: 13px 15px; min-height: 50px;
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--line-2); border-radius: var(--r);
  font-size: 16px; /* 16px stops iOS Safari zooming on focus */
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(182,5,5,.13);
}
.input::placeholder, .textarea::placeholder { color: #A79C95; }
.textarea { min-height: 116px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none;
  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 1l5 5 5-5' stroke='%236B615C' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
  padding-right: 40px;
}
.hint { margin-top: 6px; font-size: .8rem; color: var(--ink-mute); }
.error-text { margin-top: 6px; font-size: .82rem; font-weight: 600; color: var(--stop); }
.input[aria-invalid='true'], .textarea[aria-invalid='true'], .select[aria-invalid='true'] {
  border-color: var(--stop); background: var(--stop-bg);
}
.field-row { display: grid; gap: var(--s4); }
@media (min-width: 620px) { .field-row--2 { grid-template-columns: 1fr 1fr; } }

/* `.field + .field` spaces fields stacked in a column — but side-by-side grid
   columns are adjacent siblings too, so without this the second column sits
   16px lower than the first. The grid's own gap handles that spacing. */
.field-row > .field + .field,
.subgrid > .field + .field { margin-top: 0; }

/* Honeypot — bots fill it, humans never see it. */
.hp { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; width: 0; }

/* ── Notices ─────────────────────────────────────────────────────────────── */
.notice {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s4); border-radius: var(--r); font-size: .92rem;
  border: 1px solid; line-height: 1.5;
}
.notice--ok   { background: var(--ok-bg);   border-color: #B6DEC6; color: #10502D; }
.notice--warn { background: var(--warn-bg); border-color: #F0D9A8; color: #7A4D00; }
.notice--stop { background: var(--stop-bg); border-color: #EFC0C0; color: #8A1616; }
.notice--info { background: var(--info-bg); border-color: #BBD6EA; color: #164A75; }
.notice strong { display: block; margin-bottom: 2px; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2.5px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--paper-3) 25%, #E8E0D8 37%, var(--paper-3) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-sm); color: transparent !important;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
