/* railbed.io's one header and one footer, shared by every generated page (about, contact, security, the legal pages,
   the 404, the industries overview and each industry page). The markup is scripts/sitegen.py's nav_html and
   footer_html; scripts/sitegen.py copies this file and frame.js to site/public and versions them (frame_assets).
   Colours, type and sizes are the design tokens (docs-tokens.css, linked first): DESIGN.md §4, §8 "Buttons" and §9
   "Marketing site". Both sit on the marketing grid's 1200px content box with a 20px gutter (16px on the narrowest
   phones). Light only, like every railbed.io page outside the docs; the tokens carry the docs' dark theme. */
:root { --site-gut: 20px; }

/* ---------- Header: wordmark, the four primary links, Log in + Get started ---------- */
.sitenav { position: relative; z-index: 30; font-family: var(--font-sans); }
.sitenav__bar {
  box-sizing: border-box; width: min(100% - 2 * var(--site-gut), var(--container)); height: var(--nav-height);
  margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  column-gap: 24px;
}
.sitenav__brand { justify-self: start; font: 400 32px/36px var(--font-serif); letter-spacing: -0.02em; color: var(--text-strong); text-decoration: none; }
.sitenav__links { display: flex; align-items: center; gap: 32px; }
.sitenav__links a {
  position: relative; display: inline-flex; align-items: center; min-height: 40px; font-size: 15px; line-height: 1;
  color: var(--text-body); text-decoration: none; transition: color var(--dur-fast);
}
.sitenav__links a:hover, .sitenav__links a[aria-current] { color: var(--text-strong); }
/* The current section: ink, with a hairline under it, so the mark never rests on colour alone. */
.sitenav__links a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 1px; background: currentColor; }
.sitenav__actions { justify-self: end; display: flex; align-items: center; gap: 12px; }
.sitenav__btn {
  position: relative; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  height: var(--button-height-md); margin: 0; padding: 0 var(--button-pad-md); border: 1px solid transparent;
  border-radius: var(--radius-xs); font: var(--button-weight) var(--button-font-md)/1 var(--font-sans);
  text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color var(--dur-base);
}
.sitenav__btn--quiet { background: var(--btn-quiet-bg); color: var(--text-strong); }
.sitenav__btn--quiet:hover { background: var(--btn-quiet-hover); }
.sitenav__btn--primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.sitenav__btn--primary:hover { background: var(--btn-primary-hover); }
.sitenav__menu { display: none; }
.sitenav a:focus-visible, .sitenav button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-xs); }

/* ---------- Phone menu: a full-width panel under the header (frame.js opens it; it never covers the whole screen) ---- */
.sitenav__panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg-page); border-bottom: 1px solid var(--border); }
.sitenav__panel[hidden] { display: none; }
.sitenav__sheet { box-sizing: border-box; width: min(100% - 2 * var(--site-gut), var(--container)); margin-inline: auto; padding: 4px 0 28px; }
.sitenav__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--text-strong); }
.sitenav__list a {
  display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--border); font-size: 17px; line-height: 1.3;
  color: var(--text-strong); text-decoration: none;
}
.sitenav__list a[aria-current] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.sitenav__list a:focus-visible { outline-offset: -2px; }
.sitenav__wide { display: flex; width: 100%; height: var(--button-height-marketing); margin-top: 20px; font-size: var(--button-font-marketing); }

@media (min-width: 900px) {
  .sitenav__panel { display: none; }
}
@media (max-width: 1023px) {
  .sitenav__links { gap: 24px; }
}
@media (max-width: 899px) {
  .sitenav__bar { height: 64px; display: flex; justify-content: space-between; gap: 12px; }
  .sitenav__brand { font-size: 28px; line-height: 32px; }
  .sitenav__links { display: none; }
  .sitenav__actions { gap: 8px; }
  /* With frame.js the menu holds Log in; without it the bar keeps Log in and the footer links every page. */
  .sitenav--ready .sitenav__login { display: none; }
  .sitenav--ready .sitenav__menu { display: inline-flex; }
  /* Labelled buttons keep their compact height with an invisible 44px tap area (DESIGN.md §8 "Touch use"). */
  .sitenav__bar .sitenav__btn::before { content: ""; position: absolute; inset: -5px 0; }   /* measured from inside the 1px border */
}
@media (any-pointer: coarse) {
  .sitenav__bar .sitenav__btn::before { content: ""; position: absolute; inset: calc((var(--button-height-md) - var(--touch-target)) / 2 - 1px) 0; }
  .sitenav__wide { min-height: var(--touch-target); }
}
@media (prefers-reduced-motion: no-preference) {
  .sitenav__panel:not([hidden]) { animation: sitenav-open .32s cubic-bezier(.16, 1, .3, 1); }
}
@keyframes sitenav-open { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }

/* ---------- Footer: wordmark and line, then Product, Industries, Developers, Company and Legal ---------- */
.foot {
  box-sizing: border-box; width: min(100% - 2 * var(--site-gut), var(--container)); margin: 0 auto; padding: 72px 0 40px;
  border-top: 1px solid var(--border); font: 400 15px/1.45 var(--font-sans); color: var(--text-strong);
}
.foot a { color: var(--text-strong); text-decoration: none; transition: opacity var(--dur-fast); }
.foot a:hover { opacity: .6; }
.foot a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-xs); }
/* The wordmark takes the grid's first three columns (the label rail); the five columns share the other nine. */
.foot__top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); column-gap: 24px; }
.foot .brand { font: 400 32px/36px var(--font-serif); letter-spacing: -0.02em; }
.foot__brand p { margin: 12px 0 0; max-width: 260px; font-size: 15px; line-height: 1.5; color: var(--text-muted); text-wrap: pretty; }
.foot__cols { display: flex; justify-content: space-between; gap: 24px; }
.foot__cols > div { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.foot__label { margin: 0 0 4px; color: var(--text-muted); }
.foot__legal { margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--border); font-size: var(--font-size-label); line-height: 1.5; color: var(--text-muted); }

@media (max-width: 1099px) {
  .foot__top { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
}
@media (max-width: 899px) {
  .foot { padding-top: 56px; }
  .foot .brand { font-size: 28px; line-height: 32px; }
  .foot__top { row-gap: 40px; }
  .foot__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; }
  .foot__cols > div { gap: 0; }
  /* 44px rows; a name that wraps (two lines of an industry) keeps space from its neighbours. */
  .foot__cols a { box-sizing: border-box; display: flex; align-items: center; min-height: 44px; padding-block: 8px; }
  .foot__label { margin-bottom: 4px; }
  .foot__legal { margin-top: 56px; }
}
@media (max-width: 599px) {
  .foot__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 400px) {
  :root { --site-gut: 16px; }
}
@media (any-pointer: coarse) {
  .foot__cols > div { gap: 0; }
  .foot__cols a { display: flex; align-items: center; min-height: var(--touch-target); }
}
