/* ==========================================================================
   OpenBAS storefront — implementation of design/Storefront.dc.html
   Tokens are lifted verbatim from the design's inline styles.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg:            #08090B;
  --bg-alt:        #0A0C0E;
  --surface:       #0F1215;
  --surface-2:     #141A1E;
  --surface-3:     #171C21;
  --surface-4:     #12181C;

  /* Lines */
  --line:          #1E242A;
  --line-strong:   #2A333A;
  --line-soft:     #242C32;
  --line-mid:      #3A444B;
  --grid-hero:     #0E1216;
  --grid-card:     #131A1F;

  /* Text */
  --text:          #F2F4F5;
  --text-bright:   #E6E9EB;
  --text-dim:      #C6CDD3;
  --text-muted:    #9AA3AA;
  --text-faint:    #8A9298;
  --text-off:      #4A5259;

  /* Accent — signal cyan */
  --accent:        #22D3EE;
  --accent-light:  #5EE7F5;
  --accent-ink:    #06232A;
  --accent-tint:   #0B2027;
  --accent-tint-2: #0E2A31;
  --accent-tint-3: #17262B;
  --accent-tint-4: #0E1A1E;
  --accent-edge:   #17414A;

  /* Accent — heating amber */
  --amber:         #F5B32C;
  --amber-tint:    #2A2011;
  --amber-ink:     #241900;

  /* Alarm — extends the design palette; amber is reserved for heating coils */
  --alarm:         #F2564A;
  --alarm-tint:    #2A1310;

  /* Type */
  --font-sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --page:      1440px;
  --gutter:    48px;
  --radius:    8px;
  --radius-sm: 5px;
}

/* --------------------------------------------------------------- reset -- */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, figure { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
img { max-width: 100%; }

/* `svg { display: block }` above is an author rule, so it outranks the UA's
   `[hidden] { display: none }` and leaves hidden SVGs on screen. Restore the
   attribute's meaning for every element. */
[hidden] { display: none !important; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--text); }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: top .15s ease;
}
.skip-link:focus { top: 16px; color: var(--accent-ink); }

/* -------------------------------------------------------- shared atoms -- */

.shell {
  max-width: var(--page);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section { border-bottom: 1px solid var(--line); }
.section--alt { background: var(--bg-alt); }
.section__inner { padding-top: 76px; padding-bottom: 76px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--accent-light);
}
.eyebrow--amber { color: var(--amber); }

.section-title {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.12;
  text-wrap: balance;
}

.section-lede {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 640px;
  text-wrap: pretty;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 32px;
}
.section-head__text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: .06em;
}

/* Grid-paper backdrop used behind every drawing surface */
.blueprint {
  background-image:
    linear-gradient(var(--grid-card) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-card) 1px, transparent 1px);
  background-size: 22px 22px;
}
.blueprint--lg { background-size: 44px 44px; }
.blueprint--md { background-size: 20px 20px; }
.blueprint--sm { background-size: 16px 16px; }
.blueprint--page {
  background-image:
    linear-gradient(var(--grid-hero) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-hero) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  padding: 15px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  text-align: center;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-light); color: var(--accent-ink); }

.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--text-muted); color: var(--text); background: var(--surface); }

.btn--amber { background: var(--amber); color: var(--amber-ink); }
.btn--amber:hover { background: #ffc954; color: var(--amber-ink); }

.btn--sm { font-size: 15px; padding: 13px 20px; }
.btn--xs { font-size: 13px; padding: 10px 16px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--text-dim);
  padding: 4px 8px;
  background: var(--surface-3);
  border-radius: 3px;
  white-space: nowrap;
}

/* --------------------------------------------------------- signal state --
   The hero drawing recolours through these classes so the state tabs do
   what the product promises: off / running / alarm on one artwork.        */

.sig-stroke { stroke: var(--accent); transition: stroke .18s ease; }
.sig-fill   { fill:   var(--accent); transition: fill .18s ease; }
.sig-ink    { fill:   var(--accent-ink); transition: fill .18s ease; }
.sig-panel  { fill: var(--surface-2); stroke: var(--line-strong); transition: stroke .18s ease, fill .18s ease; }

[data-state="off"] .sig-stroke { stroke: var(--text-off); }
[data-state="off"] .sig-fill   { fill:   var(--text-off); }
[data-state="off"] .sig-ink    { fill:   var(--bg); }

[data-state="alarm"] .sig-stroke { stroke: var(--alarm); }
[data-state="alarm"] .sig-fill   { fill:   var(--alarm); }
[data-state="alarm"] .sig-ink    { fill:   #2A0D0A; }
[data-state="alarm"] .sig-panel  { fill: var(--alarm-tint); stroke: var(--alarm); }

/* ================================================================== nav == */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  flex: none;
}
.brand:hover { color: var(--text); }

/* The mark is an open frame — the "Open" — with a damper blade across it, the
   most recognisable symbol in a BAS drawing. The frame takes currentColor so it
   reads on any surface; the blade stays the signal accent. */
.brand__mark {
  width: 24px;
  height: 24px;
  flex: none;
  overflow: visible;
}
.brand__name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.brand--sm .brand__mark { width: 22px; height: 22px; }
.brand--sm .brand__name { font-size: 18px; }

.nav-left { display: flex; align-items: center; gap: 40px; min-width: 0; }

.nav-links {
  display: flex;
  gap: 26px;
  font-size: 15px;
}
.nav-links a { color: var(--text-muted); }
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: none;
}
.nav-actions__signin { font-size: 15px; color: var(--text-muted); }
.nav-actions__signin:hover { color: var(--text); }
.nav-actions .btn { font-size: 15px; padding: 11px 20px; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  flex: none;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  content: "";
}
.nav-toggle span { position: relative; }
.nav-toggle span::before { position: absolute; top: -5px; }
.nav-toggle span::after  { position: absolute; top: 5px; }

/* ================================================================= hero == */

.hero { border-bottom: 1px solid var(--line); }
.hero__inner { padding-top: 78px; padding-bottom: 66px; }

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero__copy { display: flex; flex-direction: column; gap: 24px; }

.hero__badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  padding: 7px 13px;
  border: 1px solid var(--accent-edge);
  background: var(--accent-tint);
  border-radius: 100px;
  color: var(--accent-light);
}
.hero__badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.hero__title {
  font-size: 64px;
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.hero__lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 540px;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  gap: 13px;
  align-items: center;
  padding-top: 4px;
  flex-wrap: wrap;
}

.hero__specs {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: .06em;
  padding-top: 6px;
}
.hero__specs li { display: flex; align-items: center; gap: 22px; }
.hero__specs li + li::before { content: "|"; color: var(--line-strong); }

/* Preview card */

.preview__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.state-tabs { display: flex; gap: 4px; }
.state-tabs button {
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: background-color .15s ease, color .15s ease;
}
.state-tabs button:hover { color: var(--text-dim); }
.state-tabs button[aria-selected="true"] {
  background: var(--accent-tint-3);
  color: var(--accent-light);
}
.state-tabs button[aria-selected="true"][data-state-value="alarm"] {
  background: var(--alarm-tint);
  color: #FF8D82;
}

.preview__stage { padding: 30px 26px; }
.preview__stage svg { width: 100%; height: auto; }

.preview__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: .06em;
}
.preview__foot a { color: var(--accent-light); }

/* =========================================================== libraries == */

.lib-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.lib-grid + .lib-grid { margin-top: 18px; }

.lib-card { display: flex; flex-direction: column; }
.lib-card__art {
  /* Even top and bottom: the design's 26/20 split was fine behind a drawn SVG
     that filled the box, but a centred render sits visibly off-axis in it. */
  padding: 23px 24px;
  border-bottom: 1px solid var(--line);
}
.lib-card__art svg { width: 100%; height: auto; }

.lib-card__body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.lib-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.lib-card__name { font-size: 19px; font-weight: 600; }
.lib-card__ver { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.lib-card__desc { font-size: 14px; line-height: 1.6; color: var(--text-muted); }
.lib-card__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 8px;
}

.lib-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  color: var(--text);
  transition: border-color .15s ease, background-color .15s ease;
}
.lib-row:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.lib-row__name { font-size: 16px; font-weight: 600; }
.lib-row__meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.lib-row__arrow { font-size: 22px; color: var(--accent-light); flex: none; }

.link-all { font-size: 15px; font-weight: 500; color: var(--accent-light); flex: none; }

/* ========================================================== components == */

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar button {
  font-size: 13px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--text-muted);
  transition: border-color .15s ease, color .15s ease;
}
.filter-bar button:hover { color: var(--text-dim); border-color: var(--line-strong); }
.filter-bar button[aria-pressed="true"] {
  border-color: var(--line-strong);
  color: var(--text);
}

.comp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.comp-card {
  border-radius: 7px;
  transition: border-color .15s ease;
}
.comp-card:hover { border-color: var(--line-strong); }
.comp-card[hidden] { display: none; }

.comp-card__art {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.comp-card__art svg { width: 100%; height: auto; }

.comp-card__body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comp-card__name { font-size: 15px; font-weight: 500; }
.comp-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.comp-card__id { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }

.comp-card--ask {
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  min-height: 200px;
}
.comp-card--ask p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.comp-empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--line);
  border-radius: 7px;
}

/* ================================================================= how == */

.how__head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 34px;
  max-width: 720px;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.how-step {
  background: var(--surface);
  padding: 30px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.how-step__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-light);
  letter-spacing: .06em;
}
.how-step__title { font-size: 20px; font-weight: 600; }
.how-step__desc { font-size: 14px; line-height: 1.65; color: var(--text-muted); }

/* ============================================================== custom == */

.custom__inner {
  padding-top: 70px;
  padding-bottom: 70px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 56px;
  align-items: center;
}
.custom__copy { display: flex; flex-direction: column; gap: 16px; }
.custom__title {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -.03em;
  max-width: 640px;
  text-wrap: balance;
}
.custom__desc {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 560px;
  text-wrap: pretty;
}
.custom__actions { display: flex; gap: 12px; padding-top: 6px; flex-wrap: wrap; }
.custom__actions .btn { font-size: 15px; padding: 14px 22px; }

.spec-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.spec-card__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--text-muted);
}
.spec-card dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: 14px;
}
.spec-card__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.spec-card__row:last-child { padding-bottom: 0; border-bottom: 0; }
.spec-card dt { color: var(--text-muted); }
.spec-card dd { margin: 0; text-align: right; }
.spec-card__row--accent dd { color: var(--accent-light); }

/* ============================================================= pricing == */

.pricing-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  flex: none;
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
}
.toggle-group button {
  padding: 9px 15px;
  border-radius: 100px;
  border: 1px solid transparent;
  color: var(--text-muted);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.toggle-group button:not([aria-pressed="true"]) { border-color: var(--line-strong); }
.toggle-group button:hover { color: var(--text-dim); }
.toggle-group button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}
.toggle-group--currency button { padding: 9px 12px; }

/* Sized to the number of plans actually published — two, since Firm came out.
   auto-fit means adding one back needs no change here; the max-width keeps a
   pair from stretching into two very wide slabs across the shell. */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  max-width: 760px;
  margin-inline: auto;
}

.plan {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  /* The featured card's flag is drawn straddling the top border, which .card's
     overflow: hidden cropped in half. Plans carry no artwork to clip. */
  overflow: visible;
}
.plan--featured {
  background: var(--accent-tint-4);
  border-color: var(--accent);
}
.plan__flag {
  position: absolute;
  top: -11px;
  left: 30px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  padding: 5px 10px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 3px;
}
.plan__head { display: flex; flex-direction: column; gap: 6px; }
.plan__name { font-size: 19px; font-weight: 600; }
.plan__for { font-size: 14px; color: var(--text-muted); }
.plan__price { display: flex; align-items: baseline; gap: 6px; }
.plan__amount {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.plan__per { font-size: 15px; color: var(--text-muted); }
.plan__features {
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: 15px;
  color: var(--text-dim);
}
.plan--featured .plan__features { color: var(--text-bright); }
.plan .btn { margin-top: auto; padding: 13px; width: 100%; font-size: 15px; }

/* ============================================================== footer == */

.site-footer__inner {
  padding-top: 56px;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand { display: flex; flex-direction: column; gap: 14px; }
.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 300px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: 14px;
}
.footer-col h2 {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .12em;
  color: var(--text-dim);
}
.footer-col a { color: var(--text-muted); }
.footer-col a:hover { color: var(--text); }

.footer-base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.footer-base ul { display: flex; gap: 22px; }
.footer-base a { color: var(--text-muted); }
.footer-base a:hover { color: var(--text); }

/* ========================================================= breakpoints == */

@media (max-width: 1200px) {
  .hero__title { font-size: 54px; }
  .comp-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1080px) {
  :root { --gutter: 32px; }

  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }

  .site-header__inner[data-open="true"] { flex-wrap: wrap; }
  .site-header__inner[data-open="true"] .nav-links {
    display: flex;
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0 4px;
    border-top: 1px solid var(--line);
    margin-top: 14px;
  }
  .site-header__inner[data-open="true"] .nav-links a { padding: 10px 0; font-size: 16px; }

  .hero__grid { grid-template-columns: 1fr; gap: 44px; }
  .hero__lede, .hero__title { max-width: none; }
  .hero__inner { padding-top: 56px; padding-bottom: 52px; }

  .lib-grid { grid-template-columns: repeat(2, 1fr); }
  .how-grid { grid-template-columns: 1fr; }
  .custom__inner { grid-template-columns: 1fr; gap: 36px; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan--featured { order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  :root { --gutter: 20px; }

  .section__inner { padding-top: 52px; padding-bottom: 52px; }
  .hero__title { font-size: 40px; }
  .hero__lede { font-size: 17px; }
  .section-title { font-size: 30px; }
  .custom__title { font-size: 28px; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 20px; }
  .comp-grid { grid-template-columns: repeat(2, 1fr); }
  .lib-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }

  .nav-actions__signin { display: none; }
  .hero__actions .btn { flex: 1 1 auto; }
  .pricing-controls { width: 100%; }
}

@media (max-width: 520px) {
  .comp-grid { grid-template-columns: 1fr; }
  .hero__title { font-size: 34px; }
  .plan__amount { font-size: 38px; }
  .preview__stage { padding: 20px 16px; }
  #preview-stage.preview__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-base { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* Hold the artwork back until the live components have replaced the drawn
   placeholders — see the inline script in index.html. Visibility rather than
   display so the grid never reflows when the images arrive. */
.art-pending #preview-stage,
.art-pending .comp-card__art,
.art-pending .lib-card__art { visibility: hidden; }

html:not(.art-pending) #preview-stage,
html:not(.art-pending) .comp-card__art,
html:not(.art-pending) .lib-card__art {
  animation: art-in .18s ease-out both;
}
@keyframes art-in { from { opacity: 0 } to { opacity: 1 } }

/* --------------------------------------------------------- artwork fit --
   Generated components have wildly different aspect ratios: a tall inline
   pump next to a wide rooftop unit. Sizing them by width alone makes the
   wide one fill the card and the tall one shrink to a stamp. Give the art
   area a fixed height instead and let each render scale to fit inside it,
   centred both ways — then every card reads at the same optical weight. */

.comp-card__art,
.lib-card__art,
#preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Four components across, each in its own cell so a tall unit and a flat one
   still read as a set. Wraps to two rows before it squeezes anything. */
/* One row, always. A flex wrap put the fourth component on its own line,
   which reads as an afterthought rather than a set — so the columns share the
   width evenly and the artwork scales down instead of dropping. */
#preview-stage.preview__row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  /* The height used to come from an inline style on the stage. It belongs
     here: without it the hero card collapses to the height of four small
     drawings and stops holding its side of the fold. */
  min-height: 190px;
}
.preview__cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.preview__cell img {
  max-width: 100%;
  max-height: 170px;
  width: auto;
  height: auto;
}
.preview__cell-tag {
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--text-dim);
}

.comp-card__art { height: 150px; }
.lib-card__art  { height: 196px; }

/* :not(.preview__cell) — this rule sizes a single centred drawing. Applied to
   a grid cell it fights the track width and squeezes every component. */
.comp-card__art > *,
.lib-card__art > *,
#preview-stage > *:not(.preview__cell) {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

/* The drawn SVG placeholders are authored to fill their width; inside the
   centred box they should behave like the renders do. */
.comp-card__art > svg,
.lib-card__art > svg { width: 100%; height: auto; }

.art-img { object-fit: contain; display: block; }
