/* =====================================================================
   PRESSURE — coffee equipment storefront
   Design tokens derived from ui-design-rules.md
   Brand hue ~186 (petrol / patinated-brass), black + white + 5 HSB steps.
   ===================================================================== */

:root {
  /* ---- Brand hue 186, five HSB-derived steps ---- */
  --brand:        #0E5E63;  /* 186,85,39  interactive / strong  */
  --brand-strong: #0A464A;  /* 186,89,29  hover / pressed        */
  --brand-ink:    #123033;  /* 186,64,20  brand-tinted heading   */
  --brand-tint:   #D4E4E4;  /* 186,9,89   soft fill / active bg  */
  --brand-wash:   #EAF1F0;  /* 186,4,94   faint wash             */

  /* ---- Neutrals ---- */
  --bg:            #E9EBEA;
  --surface:       #FFFFFF;
  --surface-2:     #F5F6F5;
  --text-strong:   #15201F;
  --text-secondary:#4A5755;
  --stroke-weak:   #D2D8D6;
  --stroke-strong: #79857F;
  --white:         #FFFFFF;

  /* ---- System status (reserved) ---- */
  --error: #B0271F;

  /* ---- Spacing scale (4 / 8 based) ---- */
  --s-4: 4px;  --s-8: 8px;  --s-12: 12px; --s-16: 16px;
  --s-24: 24px; --s-32: 32px; --s-40: 40px; --s-48: 48px; --s-64: 64px;

  /* ---- Type scale, base 16, ratio 1.25 ---- */
  --t-tiny: 14px; --t-body: 16px; --t-h4: 20px; --t-h3: 25px;
  --t-h2: 31px;   --t-h1: 39px;   --t-display: 49px;

  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;

  --rail-w: 248px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--text-strong);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; }

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

/* =====================================================================
   LAYOUT — fixed left rail + offset main
   ===================================================================== */
.shell { min-height: 100vh; }

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-w);
  background: var(--surface);
  border-right: 1px solid var(--stroke-weak);
  padding: var(--s-32) var(--s-24);
  display: flex;
  flex-direction: column;
  gap: var(--s-32);
  z-index: 40;
}
.rail__brand {
  display: flex; align-items: center; gap: var(--s-12);
  font-family: var(--font-display);
  font-size: var(--t-h4);
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
.rail__mark { width: 28px; height: 28px; flex: 0 0 auto; }
.rail__tag {
  font-size: var(--t-tiny);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: calc(var(--s-8) * -1) 0 0;
}

.rail__nav { display: flex; flex-direction: column; gap: var(--s-4); }
.rail__link {
  display: flex; align-items: center;
  min-height: 48px;
  padding: 0 var(--s-12);
  color: var(--text-strong);
  font-weight: 700;
  font-size: var(--t-body);
  border-radius: 6px;
}
.rail__link:hover { background: var(--brand-wash); }
.rail__link[aria-current="page"] {
  background: var(--brand-tint);
  color: var(--brand-ink);
}

.rail__spacer { flex: 1 1 auto; }

.rail__label {
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin: 0 0 var(--s-8);
}

/* segmented currency control */
.seg {
  display: inline-flex;
  border: 1px solid var(--stroke-strong);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}
.seg__btn {
  flex: 1 1 50%;
  min-height: 48px;
  border: 0;
  background: var(--surface);
  color: var(--text-strong);
  font-family: var(--font-body);
  font-size: var(--t-body);
  font-weight: 700;
  cursor: pointer;
}
.seg__btn + .seg__btn { border-left: 1px solid var(--stroke-strong); }
.seg__btn:hover { background: var(--brand-wash); }
.seg__btn.is-active { background: var(--brand); color: var(--white); }

.rail__contact { font-size: var(--t-tiny); line-height: 1.5; color: var(--text-secondary); }
.rail__contact a { color: var(--brand); word-break: break-word; }
.rail__contact div + div { margin-top: var(--s-4); }

/* mobile top bar (hidden on desktop) */
.topbar { display: none; }

/* main column */
.main {
  margin-left: var(--rail-w);
  padding: var(--s-48) var(--s-48) var(--s-64);
  max-width: 1120px;
}

/* =====================================================================
   MASTHEAD (thesis, not a stock hero)
   ===================================================================== */
.masthead {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: var(--s-48);
  align-items: center;
  padding: var(--s-24) 0 var(--s-48);
  border-bottom: 1px solid var(--stroke-weak);
}
.masthead__eyebrow {
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  font-weight: 700;
  margin: 0 0 var(--s-16);
}
.masthead__title {
  font-size: var(--t-display);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin: 0 0 var(--s-16);
  max-width: 15ch;
}
.masthead__lead {
  font-size: var(--t-h4);
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 var(--s-32);
  max-width: 56ch;
}
.masthead__cta { display: flex; gap: var(--s-16); flex-wrap: wrap; }

/* pressure-gauge signature */
.gauge { justify-self: center; width: 100%; max-width: 300px; }

/* =====================================================================
   BUTTONS — 3 weights, one primary per view
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; min-width: 48px;
  padding: 0 var(--s-24);
  font-family: var(--font-body);
  font-size: var(--t-body); font-weight: 700;
  border-radius: 8px; cursor: pointer;
  border: 1px solid transparent;
  line-height: 1.2;
}
.btn--primary { background: var(--brand); color: var(--white); }
.btn--primary:hover { background: var(--brand-strong); }
.btn--secondary { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn--secondary:hover { background: var(--brand-wash); }

.link {
  font-weight: 700; color: var(--brand);
  display: inline-flex; align-items: center;
  min-height: 48px;
}
.link:hover { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; }

/* =====================================================================
   CATALOGUE
   ===================================================================== */
.catgroup { padding: var(--s-48) 0 var(--s-16); }
.catgroup + .catgroup { border-top: 1px solid var(--stroke-weak); }
.catgroup__head { margin-bottom: var(--s-32); }
.eyebrow {
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 700;
  display: block;
  margin-bottom: var(--s-8);
}
.catgroup__title {
  font-size: var(--t-h2);
  letter-spacing: -0.01em;
  color: var(--text-strong);
  margin-bottom: var(--s-8);
}
.catgroup__note { font-size: var(--t-body); color: var(--text-secondary); margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-40) var(--s-32);
}

.card { display: flex; flex-direction: column; }
.card__frame {
  background: var(--surface-2);
  border: 1px solid var(--stroke-weak);
  border-radius: 10px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: var(--s-16);
}
.card__img { width: 100%; height: 100%; object-fit: cover; }
.card__spec {
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 700;
  margin: 0 0 var(--s-4);
}
.card__name {
  font-size: var(--t-h4);
  color: var(--text-strong);
  margin: 0 0 var(--s-8);
}
.card__desc {
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 var(--s-16);
  flex: 1 1 auto;
}
.card__foot {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--stroke-weak);
  padding-top: var(--s-12);
  gap: var(--s-16);
}
.card__price { font-size: var(--t-h4); font-weight: 700; color: var(--text-strong); font-family: var(--font-display); }

/* quiet reassurance strip between/after sections */
.assure {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-32);
  padding: var(--s-40) 0;
  border-top: 1px solid var(--stroke-weak);
}
.assure__item h3 { font-size: var(--t-h4); color: var(--text-strong); margin-bottom: var(--s-8); }
.assure__item p { font-size: var(--t-body); line-height: 1.5; color: var(--text-secondary); margin: 0; }

/* =====================================================================
   POLICY PAGES
   ===================================================================== */
.doc { max-width: 72ch; }
.doc__kicker {
  font-size: var(--t-tiny); text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--brand); font-weight: 700; margin: 0 0 var(--s-12);
}
.doc h1 {
  font-size: var(--t-h1); letter-spacing: -0.01em; color: var(--text-strong);
  margin-bottom: var(--s-8);
}
.doc__meta { font-size: var(--t-tiny); color: var(--text-secondary); margin: 0 0 var(--s-40); }
.doc h2 {
  font-size: var(--t-h3); color: var(--text-strong);
  margin: var(--s-40) 0 var(--s-12);
}
.doc h3 { font-size: var(--t-h4); color: var(--text-strong); margin: var(--s-24) 0 var(--s-8); }
.doc p, .doc li { font-size: var(--t-body); line-height: 1.6; color: var(--text-secondary); }
.doc p { margin: 0 0 var(--s-16); }
.doc ul { margin: 0 0 var(--s-16); padding-left: var(--s-24); }
.doc li { margin-bottom: var(--s-8); }
.doc strong { color: var(--text-strong); }
.doc a { color: var(--brand); }

.callout {
  background: var(--brand-wash);
  border: 1px solid var(--brand-tint);
  border-radius: 10px;
  padding: var(--s-24);
  margin: 0 0 var(--s-32);
}
.callout p { margin: 0; color: var(--brand-ink); }

.doc table {
  width: 100%; border-collapse: collapse; margin: 0 0 var(--s-24);
  font-size: var(--t-body);
}
.doc th, .doc td {
  text-align: left; padding: var(--s-12);
  border: 1px solid var(--stroke-weak); vertical-align: top;
  color: var(--text-secondary);
}
.doc th { background: var(--surface-2); color: var(--text-strong); font-weight: 700; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.foot {
  margin-top: var(--s-64);
  border-top: 1px solid var(--stroke-weak);
  padding-top: var(--s-32);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--s-32);
}
.foot h4 { font-size: var(--t-body); color: var(--text-strong); margin-bottom: var(--s-12); font-family: var(--font-display); }
.foot p, .foot li { font-size: var(--t-tiny); line-height: 1.6; color: var(--text-secondary); margin: 0; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: var(--s-8); }
.foot a { color: var(--brand); }
.foot__legal {
  grid-column: 1 / -1;
  border-top: 1px solid var(--stroke-weak);
  padding-top: var(--s-16); margin-top: var(--s-16);
  font-size: var(--t-tiny); color: var(--text-secondary);
}

.skip-link {
  position: absolute; left: -9999px; top: var(--s-8);
  background: var(--brand); color: var(--white);
  padding: var(--s-8) var(--s-16); border-radius: 6px; z-index: 100;
}
.skip-link:focus { left: var(--s-8); }

/* =====================================================================
   RESPONSIVE — collapse rail into a top bar + drawer
   ===================================================================== */
@media (max-width: 900px) {
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--stroke-weak);
    padding: var(--s-12) var(--s-16);
  }
  .topbar__brand { display: flex; align-items: center; gap: var(--s-8);
    font-family: var(--font-display); font-size: var(--t-h4); color: var(--text-strong); }
  .topbar__right { display: flex; align-items: center; gap: var(--s-8); }
  .topbar .seg { width: auto; }
  .topbar .seg__btn { padding: 0 var(--s-16); min-width: 56px; }
  .nav-toggle {
    min-height: 48px; min-width: 48px;
    border: 1px solid var(--stroke-strong); border-radius: 8px;
    background: var(--surface); color: var(--text-strong);
    font-size: var(--t-h4); cursor: pointer;
  }

  .rail {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: min(320px, 86vw);
    box-shadow: 0 0 0 100vmax rgba(21,32,31,0);
  }
  .rail.is-open { transform: translateX(0); box-shadow: 0 0 0 100vmax rgba(21,32,31,0.4); }
  .rail__brand, .rail .rail__currency-desktop { display: none; }

  .main { margin-left: 0; padding: var(--s-24) var(--s-16) var(--s-48); }
  .masthead { grid-template-columns: 1fr; gap: var(--s-32); }
  .masthead__title { font-size: var(--t-h1); }
  .gauge { max-width: 220px; grid-row: 1; }
  .assure, .foot { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
