/* ============================================================
   S&M Vending Dallas — styles.css
   Direction: "route manifest" — industrial/utility, paper + ink,
   one deep-teal accent. Archivo display / IBM Plex Sans body /
   IBM Plex Mono labels.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* color */
  --paper: #f2f0ea;        /* warm paper background */
  --paper-tint: #e9e6dd;   /* slightly deeper paper for tinted sections */
  --ink: #16181d;          /* near-black ink */
  --ink-2: #1e2127;        /* raised surfaces on ink */
  --ink-text: #23262c;     /* body text on paper */
  --muted: #5b5e66;        /* secondary text on paper */
  --muted-ink: #a3a7b0;    /* secondary text on ink */
  --line: #d4d0c4;         /* hairlines on paper */
  --line-ink: #32363e;     /* hairlines on ink */
  --teal: #0E6E63;         /* primary accent — fills, rules, text on light */
  --teal-bright: #37a99b;  /* accent for TEXT on dark surfaces (AA) */
  --teal-deep: #0b544c;    /* accent for small text on paper (AA) */
  --error: #b3261e;

  /* type */
  --display: "Archivo", sans-serif;
  --body: "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", monospace;

  /* fluid type scale */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.5vw, 4.6rem);

  /* space */
  --space-section: clamp(4rem, 3rem + 6vw, 8rem);
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --container: 72rem;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ul, ol, dl, dd, fieldset, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
input, button, select, textarea { font: inherit; color: inherit; }
fieldset { border: 0; padding: 0; }

html {
  scroll-padding-top: 4.5rem; /* sticky header offset */
  background: var(--paper);
}

/* fixed, faded break-room backdrop the page scrolls over */
.site-bg { position: fixed; inset: 0; z-index: -1; background: url("images/breakroom-office.jpg") center 18% / cover no-repeat; }
.site-bg::after { content: ""; position: absolute; inset: 0; background: rgba(242, 240, 234, 0.93); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink-text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: inherit;
}
h1 { font-size: var(--step-4); font-weight: 900; }
h2 { font-size: var(--step-3); font-weight: 800; max-width: 22ch; }
h3 { font-size: var(--step-1); font-weight: 800; line-height: 1.2; }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--teal-deep);
  margin-bottom: 1rem;
}

.mono-label {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.section-lead {
  color: var(--muted);
  max-width: 50ch;
  margin-top: 1rem;
}

a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.site-footer a { color: var(--teal-bright); }

:focus-visible {
  outline: 2px solid var(--teal-deep);
  outline-offset: 3px;
  border-radius: 2px;
}
.site-header :focus-visible {
  outline-color: var(--teal-bright);
}

::selection { background: var(--teal); color: #fff; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow { max-width: 52rem; margin-inline: 0; }
@media (min-width: 72rem) {
  .container-narrow { margin-inline: auto; max-width: var(--container); }
  .container-narrow > * { max-width: 52rem; }
}

.section { padding-block: var(--space-section); }
.section-ink { background: transparent; color: var(--ink-text); }
.section-tint { background: transparent; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  border-bottom: 1px solid var(--line-ink);
}
.header-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 0.65rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
}
.wordmark span { color: var(--teal-bright); }
.wordmark { white-space: nowrap; }
@media (max-width: 30rem) {
  .header-inner { gap: 0.75rem; }
  .wordmark { font-size: 0.85rem; }
  .site-header .btn-header { font-size: 0.68rem; padding: 0.45rem 0.6rem; white-space: nowrap; letter-spacing: 0.02em; }
}

/* ---------- Hamburger nav ---------- */
.header-actions { display: flex; align-items: center; gap: 0.6rem; }
.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 38px; padding: 0 9px;
  background: transparent; border: 1px solid var(--line-ink); border-radius: 2px;
  cursor: pointer; flex: none;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle:hover { border-color: var(--teal-bright); }
.nav-toggle:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 2px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu {
  position: absolute; top: 100%; right: var(--gutter); margin-top: 0.45rem;
  min-width: 230px;
  background: var(--ink-2); border: 1px solid var(--line-ink);
  box-shadow: 0 20px 44px -20px rgba(0, 0, 0, 0.75);
  display: flex; flex-direction: column; padding: 0.4rem; z-index: 60;
}
.nav-menu[hidden] { display: none; }
.nav-menu a {
  font-family: var(--mono); font-size: var(--step--1);
  text-transform: uppercase; letter-spacing: 0.08em;
  color: #edeef0; text-decoration: none;
  padding: 0.65rem 0.8rem; border-radius: 2px;
}
.nav-menu a:hover, .nav-menu a:focus-visible {
  background: rgba(255, 255, 255, 0.06); color: var(--teal-bright); outline: none;
}
.nav-menu a:last-child {
  color: var(--teal-bright); border-top: 1px solid var(--line-ink);
  margin-top: 0.2rem; padding-top: 0.75rem;
}
@media (prefers-reduced-motion: reduce) { .nav-toggle span { transition: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}
.btn-header {
  background: var(--teal);
  color: #fff;
  font-size: 0.8rem;
  padding: 0.5rem 0.9rem;
}
.btn-primary {
  background: var(--teal);
  color: #fff;
  font-size: var(--step-0);
  padding: 0.9rem 1.6rem;
}
.btn:hover { background: #12867a; }
.btn:active { transform: translateY(1px); }
/* Buttons: white text on the teal fill */
.hero .btn, .section-ink .btn, .site-header .btn { color: #fff; }
.btn-ghost {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  align-self: center;
}

/* "Download catalog" row under the machine formats */
.machines-cta {
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}
.machines-cta .btn-ghost {
  border: 1px solid var(--teal);
  padding: 0.7rem 1.1rem;
}
/* beat the white-on-ink button rule — this section reads on paper */
.section-ink .machines-cta .btn-ghost { color: var(--teal-deep); }
.machines-cta .btn-ghost:hover { background: var(--teal); }
.section-ink .machines-cta .btn-ghost:hover { color: #fff; }
.machines-cta-note {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
}

/* ---------- Hero ---------- */
.hero {
  background: transparent;
  color: var(--ink-text);
  padding-block: clamp(4rem, 3rem + 6vw, 7.5rem);
  border-bottom: 4px solid var(--teal);
}
.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: start;
}
@media (min-width: 56rem) {
  .hero-grid { grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); gap: 4rem; }
}
.hero h1 {
  color: var(--ink);
  max-width: 14ch;
  text-wrap: balance;
}
.hero-sub {
  margin-top: 1.5rem;
  max-width: 46ch;
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--muted);
}
.hero-actions {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* the "placement manifest" spec card */
.manifest {
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 1.5rem;
  font-family: var(--mono);
  font-size: var(--step--1);
}
.manifest-title {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
  color: var(--teal-deep);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}
.manifest dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.4rem;
}
.manifest dt { color: var(--muted); }
.manifest dd { color: var(--ink-text); text-align: right; }
.manifest div:last-child dd { color: var(--teal-deep); font-weight: 500; }

/* ---------- Steps ---------- */
.steps {
  margin-top: 3rem;
  display: grid;
  gap: 2.5rem;
  counter-reset: step;
}
@media (min-width: 56rem) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}
.step {
  border-top: 3px solid var(--ink);
  padding-top: 1.25rem;
}
.step-num {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  color: var(--teal-deep);
}
.step h3 { margin-top: 0.5rem; }
.step p { margin-top: 0.75rem; color: var(--muted); }

/* ---------- Formats (what we place) ---------- */
.formats {
  margin-top: 3rem;
  display: grid;
  gap: 1px;                 /* hairline grid via background */
  background: var(--line);
  border: 1px solid var(--line);
}
@media (min-width: 56rem) {
  .formats { grid-template-columns: repeat(6, 1fr); }
  .format { grid-column: span 2; }
  .format-feature { grid-column: span 3; }
}
.format {
  background: #ffffff;
  padding: 1.75rem;
}
.format-feature {
  background: #ffffff;
  border-top: 3px solid var(--teal);
}
.slot {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.15rem 0.5rem;
}
.slot-accent { color: #fff; background: var(--teal); border-color: var(--teal); font-weight: 500; }
.format h3 { margin-top: 1rem; color: var(--ink); }
.format p { margin-top: 0.75rem; color: var(--muted); font-size: var(--step-0); }
.format-note {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--teal-deep) !important;
  margin-top: 1rem !important;
}

/* ---------- Segments ---------- */
.segments {
  margin-top: 2.5rem;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 40rem) { .segments { grid-template-columns: 1fr 1fr; column-gap: 3rem; } }
.segments li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.segments li::before {
  content: "→";
  font-family: var(--mono);
  color: var(--teal-deep);
  flex: none;
}
.service-area {
  margin-top: 2rem;
  max-width: 60ch;
  color: var(--muted);
}
.service-area .mono-label { color: var(--teal-deep); }

/* ---------- Why ---------- */
.why-grid {
  margin-top: 3rem;
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 56rem) { .why-grid { grid-template-columns: 1fr 1fr; gap: 3rem 4rem; } }
.why { border-left: 3px solid var(--teal); padding-left: 1.25rem; }
.why p { margin-top: 0.6rem; color: var(--muted); }

/* ---------- Break-room feature ---------- */
.feat-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 56rem) { .feat-grid { grid-template-columns: 0.9fr 1.1fr; gap: 3.5rem; } }
.feat-photo {
  margin: 0; overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 22px 48px -30px rgba(0, 0, 0, 0.5);
}
.feat-photo img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 3 / 4; }
.feat-copy h2 { max-width: 18ch; }
.feat-copy .section-lead { max-width: 46ch; }
.feat-copy .btn-primary { margin-top: 1.75rem; }

/* ---------- FAQ ---------- */
.faq-list { margin-top: 2.5rem; border-top: 1px solid var(--line); }
.faq { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 2.5rem 1.1rem 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--step-1);
  line-height: 1.25;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--mono);
  font-weight: 400;
  position: absolute;
  right: 0.25rem;
  top: 50%;
  translate: 0 -50%;
  color: var(--teal-deep);
  font-size: 1.4rem;
}
.faq[open] summary::after { content: "–"; }
.faq p { padding: 0 0 1.4rem; max-width: 60ch; color: var(--muted); }

/* ---------- Form ---------- */
#lead-form { margin-top: 2.5rem; }
.form-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 40rem) { .form-grid { grid-template-columns: 1fr 1fr; gap: 1.25rem 1.5rem; } }

.field { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0; }
.field + .field, fieldset.field, .field:has(textarea) { margin-top: 1.25rem; }
.form-grid .field { margin-top: 0; }

.field label, .field legend {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.optional { text-transform: none; letter-spacing: 0; color: var(--muted); opacity: 0.7; }

.field input, .field select, .field textarea {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink-text);
  padding: 0.7rem 0.85rem;
  border-radius: 0;
  width: 100%;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 1.15rem) 50%, calc(100% - 0.8rem) 50%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--teal-bright);
  outline-offset: 0;
  border-color: var(--teal-bright);
}
.field input.invalid, .field select.invalid {
  border-color: #ff6f61;
}

.field-radios legend { margin-bottom: 0.5rem; }
.radio-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }
.radio-pill { position: relative; }
.radio-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.radio-pill span {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--step--1);
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.radio-pill input:checked + span {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  font-weight: 500;
}
.radio-pill input:focus-visible + span { outline: 2px solid var(--teal-bright); outline-offset: 2px; }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.btn-submit { margin-top: 2rem; }
.btn-submit[disabled] { opacity: 0.6; cursor: wait; }
.form-fine {
  margin-top: 1rem;
  font-size: var(--step--1);
  color: var(--muted);
}
.form-error {
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e0857c;
  color: #b3261e;
  font-size: var(--step--1);
}
.form-success {
  margin-top: 2.5rem;
  border: 1px solid var(--teal);
  background: var(--paper-tint);
  padding: 1.75rem;
}
.form-success p + p { margin-top: 0.75rem; }
.form-success p { color: var(--muted); }
.form-success .manifest-title { border-color: var(--line); color: var(--teal-deep); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--muted-ink);
  border-top: 1px solid var(--line-ink);
  padding-block: 3rem 2rem;
  font-size: var(--step--1);
}
.footer-grid {
  display: grid;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line-ink);
}
@media (min-width: 56rem) { .footer-grid { grid-template-columns: 2fr 1fr; } }
.wordmark-footer { display: inline-block; margin-bottom: 0.75rem; }
.footer-area { max-width: 44ch; }
.footer-meaning { margin-top: 0.75rem; font-family: var(--mono); }
.footer-contact p { display: flex; gap: 0.75rem; align-items: baseline; padding-block: 0.25rem; }
.footer-contact .mono-label { color: var(--muted-ink); min-width: 3.5rem; }
.footer-nudge { display: block; margin-top: 0.6rem; max-width: 32ch; opacity: 0.75; }
.footer-legal { padding-top: 1.5rem; }

/* ---------- SVG machine illustrations ---------- */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* hero — AI cooler sits above the manifest card */
.hero-visual { display: flex; flex-direction: column; gap: 1.75rem; }
.hero-machine {
  width: 100%;
  max-width: 220px;
  height: auto;
  align-self: center;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

/* format cards — small illustration at the top */
.format-media {
  margin-bottom: 1.25rem;
  height: 108px;
  display: flex;
  align-items: flex-end;
}
.format-svg { width: auto; height: 100%; display: block; }
.format-media-feature { height: 132px; }
.format-svg-market { height: 92%; } /* wider viewBox — trim height so it reads at the same scale */

/* ---------- Real-placement photo gallery ---------- */
.placements-grid {
  margin-top: 3rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 46rem) {
  .placements-grid { grid-template-columns: repeat(2, 1fr); }
  /* the two-door cooler leads, spanning both columns as a feature */
  .placement-wide { grid-column: 1 / -1; }
}
@media (min-width: 64rem) {
  .placements-grid { grid-template-columns: repeat(3, 1fr); }
  .placement-wide { grid-column: span 1; }
}
.placement { margin: 0; }
.placement-img {
  border: 1px solid var(--line);
  background: var(--ink);
  overflow: hidden;
  aspect-ratio: 4 / 5;
}
.placement img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 500ms ease;
}
@media (prefers-reduced-motion: no-preference) {
  .placement:hover img { transform: scale(1.03); }
}
.placement figcaption {
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1.4;
  color: var(--muted);
  padding-left: 0.9rem;
  border-left: 2px solid var(--teal);
}
/* On the widest layout the lead photo gets a taller, more cinematic frame */
@media (min-width: 64rem) {
  .placement-wide .placement-img { aspect-ratio: 4 / 5; }
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    translate: 0 14px;
    transition: opacity 500ms ease, translate 500ms ease;
    transition-delay: var(--reveal-delay, 0ms);
  }
  .js .reveal.in {
    opacity: 1;
    translate: 0 0;
  }
}
