/*
 * Webash styles
 * -------------
 * Follows the AppTrack style guide: mobile-first, base rules for phones, media
 * queries add layout for tablets (48em) and desktops (64em). All values come
 * from tokens.css. The shared components (skip link, header, buttons, cards,
 * panels, tags, summary list, footer) use the same class names and rules as
 * AppTrack's app.css; the marketing-only parts (sections, hero, steps,
 * feature, call to action) are grouped at the end.
 */

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--space-4);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  margin: 0 0 var(--space-4);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
  text-wrap: balance;
}
h1 { font-size: var(--font-size-xxl); }
h2 { font-size: var(--font-size-xl); margin-top: var(--space-6); }
h3 { font-size: var(--font-size-lg); margin-top: var(--space-5); }
h4 { font-size: var(--font-size-md); }

p, ul, ol, dl { margin: 0 0 var(--space-4); }
em { font-style: var(--font-style-emphasis); }
code { font-family: var(--font-family-mono); font-size: 0.95em; }

a { color: var(--color-link); text-underline-offset: 0.15em; }
a:visited { color: var(--color-link-visited); }
a:hover { text-decoration-thickness: 2px; }

/* One clear focus style everywhere: yellow ring plus a dark outline. */
:focus-visible {
  outline: var(--focus-width) solid var(--color-focus-text);
  outline-offset: var(--focus-offset);
  box-shadow: 0 0 0 calc(var(--focus-width) + var(--focus-offset) + 2px) var(--color-focus);
}
a:focus-visible { background: var(--color-focus); color: var(--color-focus-text); text-decoration: none; }

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -10rem;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-focus);
  color: var(--color-focus-text) !important;
  font-weight: var(--font-weight-bold);
}
.skip-link:focus { top: var(--space-2); }

/* ---------- Header and navigation ---------- */

.site-header {
  background: var(--color-header-bg);
  color: var(--color-header-text);
}
.site-header__inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: var(--space-2) var(--page-gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
}
.site-header a, .site-header a:visited { color: var(--color-header-text); }
.site-header a:focus-visible { color: var(--color-focus-text); }
.site-header__brand {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: var(--space-2) 0;
  margin-right: auto;
}
/* The "SH" in WeBASH: the bit we don't spell out. */
.site-header__brand span { color: var(--color-accent); }
.site-header__brand:focus-visible span { color: inherit; }
.site-header__menu-button {
  display: none;            /* shown by JavaScript on small screens */
  min-height: var(--target-min);
  padding: 0 var(--space-4);
  border: var(--border-width-strong) solid var(--color-header-text);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-header-text);
  font: inherit;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
}
.site-nav { width: 100%; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.site-nav a {
  display: flex;
  align-items: center;
  min-height: var(--target-min);
  padding: 0 var(--space-2);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
}
.site-nav a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
.site-nav [aria-current="page"], .site-nav .is-current {
  box-shadow: inset 4px 0 0 var(--color-header-link-active);
}

/* With JavaScript the menu collapses behind a button on small screens. */
.js .site-header__menu-button { display: inline-flex; align-items: center; }
.js .site-nav[data-collapsed="true"] { display: none; }

@media (min-width: 64em) {
  /* Sticky only where the header is a single short row. */
  html { scroll-padding-top: calc(var(--header-height) + var(--space-4)); }
  .site-header { position: sticky; top: 0; z-index: 50; }
  .js .site-header__menu-button { display: none; }
  .js .site-nav[data-collapsed="true"], .site-nav { display: block; width: auto; }
  .site-nav ul { flex-direction: row; flex-wrap: wrap; gap: 0 var(--space-2); }
  .site-nav [aria-current="page"], .site-nav .is-current {
    box-shadow: inset 0 -4px 0 var(--color-header-link-active);
  }
}

/* ---------- Page layout ---------- */

main { flex: 1; width: 100%; }
main:focus { outline: none; }

/* Ordinary (non-modular) pages sit in a centred column. */
.page {
  width: 100%;
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: var(--space-6) var(--page-gutter) var(--space-7);
}
.page--narrow { max-width: calc(var(--measure) + 2 * var(--page-gutter)); }

.lead { font-size: var(--font-size-md); color: var(--color-text-muted); max-width: var(--measure); }
.muted { color: var(--color-text-muted); }
.prose { max-width: var(--measure); }
.prose img { border-radius: var(--radius-md); }

/* ---------- Breadcrumbs ---------- */

.breadcrumbs { margin-bottom: var(--space-4); font-size: var(--font-size-sm); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) 0; }
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs li + li::before {
  content: "";
  display: inline-block;
  width: 0.45em; height: 0.45em;
  margin: 0 var(--space-2);
  border-top: 2px solid var(--color-text-muted);
  border-right: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: var(--border-width) solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}
.site-footer__inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: var(--space-5) var(--page-gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
}
.site-footer p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--color-text-muted); }

/* ---------- Panels and cards ---------- */

.panel {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.panel > :last-child { margin-bottom: 0; }
.panel h2:first-child, .panel h3:first-child { margin-top: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-5);
  list-style: none;
  padding: 0;
  margin: 0;
}
.card {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.card h2, .card h3 { margin: 0; font-size: var(--font-size-lg); }
.card p { margin: 0; }
.card .tag-list { margin-top: auto; padding-top: var(--space-2); }

/* ---------- Summary list (label / value pairs) ---------- */

.summary-list { margin: 0; }
.summary-list > div {
  padding: var(--space-3) 0;
  border-bottom: var(--border-width) solid var(--color-border);
}
.summary-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.summary-list dt { font-weight: var(--font-weight-bold); }
.summary-list dd { margin: 0; }
@media (min-width: 48em) {
  .summary-list > div { display: grid; grid-template-columns: minmax(8rem, 35%) 1fr; gap: var(--space-4); }
}

/* ---------- Tags (always text, never colour alone) ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-2);
  border: var(--border-width) solid currentColor;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  line-height: 1.6;
  white-space: nowrap;
  background: var(--color-surface-muted);
  color: var(--color-text);
}
.tag--success { background: var(--color-success-bg); color: var(--color-success); }
.tag--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.tag--error { background: var(--color-error-bg); color: var(--color-error); }
.tag--info { background: var(--color-info-bg); color: var(--color-info); }
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: 0; }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--target-min);
  padding: var(--space-2) var(--space-5);
  border: var(--border-width-strong) solid transparent;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-primary-text);
  font: inherit;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.button:visited { color: var(--color-primary-text); }
.button:hover { background: var(--color-primary-hover); }
.button--secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.button--secondary:visited { color: var(--color-primary); }
.button--secondary:hover { background: var(--color-info-bg); }
.button--small { min-height: 2.25rem; padding: var(--space-1) var(--space-3); font-size: var(--font-size-sm); }

/* For dark bands: the header's yellow as a solid button, and a white outline. */
.button--accent, .button--accent:visited { background: var(--color-accent); color: var(--color-accent-text); }
.button--accent:hover { background: var(--color-accent-hover); }
.button--on-dark, .button--on-dark:visited {
  background: transparent;
  color: var(--color-header-text);
  border-color: var(--color-header-text);
}
.button--on-dark:hover { background: var(--color-header-text); color: var(--color-header-bg); }
.button:focus-visible { background: var(--color-focus); color: var(--color-focus-text); }

.button-group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin-top: var(--space-5); }

/* ---------- Notices ---------- */

.notice {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-left: 6px solid var(--color-info);
  border-radius: var(--radius-sm);
  background: var(--color-info-bg);
  max-width: 60rem;
}
.notice p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Marketing-only components (not in AppTrack)
   ========================================================================== */

/* ---------- Sections: full-width bands, one per modular block ---------- */

.section { padding: var(--section-space) 0; }
.section__inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}
.section__inner > :last-child { margin-bottom: 0; }
.section h2 { margin-top: 0; }
.section .lead { margin-bottom: var(--space-6); }

.section--surface {
  background: var(--color-surface);
  border-top: var(--border-width) solid var(--color-border);
  border-bottom: var(--border-width) solid var(--color-border);
}
/* Cards sit on the page colour when the band itself is the surface colour. */
.section--surface .card, .section--surface .step { background: var(--color-bg); box-shadow: none; }

.section--dark {
  background: var(--color-header-bg);
  color: var(--color-header-text);
}
.section--dark .lead { color: var(--color-header-text-muted); }

.eyebrow {
  margin-bottom: var(--space-2);
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section--dark .eyebrow { color: var(--color-accent); }

/* ---------- Hero ---------- */

.hero { padding-top: clamp(2.5rem, 1.5rem + 5vw, 5rem); }
.hero__grid { display: grid; gap: var(--space-7); align-items: center; }
.hero__title {
  margin-bottom: var(--space-5);
  font-size: var(--font-size-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.hero__title span { display: block; color: var(--color-accent); }
.hero .lead { margin-bottom: 0; font-size: var(--font-size-lg); }
.hero__wink {
  margin: var(--space-5) 0 0;
  color: var(--color-header-text-muted);
  font-size: var(--font-size-sm);
}

/* The "job sheet": an AppTrack-style panel, tilted a touch because we can. */
.hero__sheet {
  margin: 0;
  color: var(--color-text);
  box-shadow: var(--shadow-md);
  border-top: 6px solid var(--color-accent);
}
.hero__sheet-title {
  margin: 0 0 var(--space-2);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-muted);
}

@media (min-width: 64em) {
  .hero__grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .hero__sheet { transform: rotate(1.5deg); }
}

/* ---------- Service cards ---------- */

.card--service { border-top: 4px solid var(--color-primary); }
/* Four cards: one, two or four across, never three and a stray. */
.card-grid--services { grid-template-columns: 1fr; }
@media (min-width: 48em) { .card-grid--services { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 80em) { .card-grid--services { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Steps (numbered process) ---------- */

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
@media (min-width: 48em) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64em) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  counter-increment: step;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.step::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--target-min);
  height: var(--target-min);
  margin-bottom: var(--space-2);
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-accent-text);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
}
.step h3 { margin: 0; font-size: var(--font-size-lg); }
.step p { margin: 0; color: var(--color-text-muted); }

/* ---------- Feature (text beside a list of points) ---------- */

.feature { display: grid; gap: var(--space-6); align-items: start; }
.feature__intro > :last-child { margin-bottom: 0; }
.feature__intro .lead { margin-bottom: var(--space-4); }
.feature__places { margin-top: var(--space-5); }
.feature__places-label { margin-bottom: var(--space-2); font-size: var(--font-size-sm); font-weight: var(--font-weight-bold); }
.feature .panel { margin: 0; }
@media (min-width: 64em) {
  .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-8); }
  .feature--flip .feature__intro { order: 2; }
}

/* ---------- Call to action ---------- */

.cta { text-align: center; }
.cta h2 { font-size: var(--font-size-xxl); }
.cta .lead { margin-left: auto; margin-right: auto; margin-bottom: 0; }
.cta .button-group { justify-content: center; }
.cta__note { margin-top: var(--space-4); color: var(--color-header-text-muted); font-size: var(--font-size-sm); }
