/*
 * site.css — layout and components for the Agile Gauge marketing site.
 * Direction 3 (Tabler + Fluent 2): white/cool-gray grounds, cards with soft
 * shadows and 12px radii, an indigo identity accent, tone-coloured status,
 * small inline icons — replacing Measured Paper's paper tones, hairline-only
 * ruled regions and serif display type. See css/tokens.css for the token
 * values (copied verbatim from the product's src/hub/tokens.css) and the
 * product repo's docs/decisions/2026-09-21-design-system-direction-3.md for
 * the decision this implements.
 */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv05', 'cv11';
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
}

a:not(.brand):not(.button) {
  text-underline-offset: 0.15em;
}

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

.wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 100;
  background: var(--surface);
  color: var(--ink);
  padding: var(--space-2) var(--space-4);
  border: var(--hairline) solid var(--rule-strong);
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  top: var(--space-2);
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: var(--hairline) solid var(--rule);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding-block: var(--space-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.brand__mark {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--accent-fill);
  color: var(--accent-on);
}

.brand__mark svg {
  width: 18px;
  height: 18px;
}

.brand__name {
  font-family: var(--font-sans);
  font-weight: var(--weight-bold);
  font-size: var(--text-card-title);
  letter-spacing: -0.01em;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  transition:
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface-sunken);
}

.site-nav a[aria-current='page'] {
  color: var(--accent);
  background: var(--accent-tint);
  font-weight: var(--weight-semibold);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--surface);
  border: var(--hairline) solid var(--rule-strong);
  border-radius: var(--radius-pill);
  color: var(--ink-secondary);
  cursor: pointer;
  transition:
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.theme-toggle:hover {
  background: var(--surface-sunken);
  color: var(--ink);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme='light'])) .theme-toggle .icon-sun {
    display: none;
  }

  :root:where(:not([data-theme='light'])) .theme-toggle .icon-moon {
    display: block;
  }
}

/* ---- Main / sections ---- */
main {
  padding-block: 0 var(--space-8);
}

.hero {
  padding-block: var(--space-8);
  border-bottom: var(--hairline) solid var(--rule);
  background: var(--surface);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: var(--space-7);
  align-items: center;
}

.hero__art-frame {
  background: var(--page);
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__art {
  color: var(--accent-fill);
  width: 100%;
  max-width: 220px;
}

h1 {
  font-family: var(--font-sans);
  font-weight: var(--weight-bold);
  font-size: var(--text-hero);
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-4);
}

h2 {
  font-family: var(--font-sans);
  font-weight: var(--weight-bold);
  font-size: var(--text-title);
  letter-spacing: -0.015em;
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-3);
}

h3 {
  font-family: var(--font-sans);
  font-weight: var(--weight-bold);
  font-size: var(--text-card-title);
  margin: 0 0 var(--space-2);
}

.lede {
  font-size: var(--text-body-lg);
  color: var(--ink-secondary);
  max-width: 52ch;
}

.section {
  padding-block: var(--space-7);
}

.section__label {
  font-size: var(--text-overline);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-overline);
  color: var(--accent);
  margin: 0 0 var(--space-2);
}

/* ---- Feature groups: cards with a small inline icon each ---- */
.view-group {
  margin-block-end: var(--space-7);
}

.view-group:last-child {
  margin-block-end: 0;
}

.view-group > h3 {
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: var(--tracking-overline);
  color: var(--ink-muted);
  margin-block-end: var(--space-4);
}

.view-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

/* A group with a single view (Portfolio, Configuration) should not stretch
   its one card across the whole row. */
.view-grid:has(> :only-child) {
  grid-template-columns: minmax(240px, 420px);
}

.view-card {
  background: var(--surface);
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.view-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.view-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-tint);
  color: var(--accent);
  margin-block-end: var(--space-3);
}

.view-card__icon svg {
  width: 20px;
  height: 20px;
}

.view-card__name {
  display: block;
  font-weight: var(--weight-semibold);
  color: var(--ink);
  margin-block-end: var(--space-1);
}

.view-card__desc {
  color: var(--ink-secondary);
  margin: 0;
  font-size: var(--text-body);
}

/* ---- Buttons ---- */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  border: var(--hairline) solid var(--rule-strong);
  text-decoration: none;
  font-weight: var(--weight-semibold);
  font-size: var(--text-body);
  color: var(--ink);
  background: var(--surface);
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    background-color var(--duration) var(--ease);
}

.button:hover {
  background: var(--surface-sunken);
}

.button--primary {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--accent-on);
  box-shadow: var(--shadow-sm);
}

.button--primary:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.button-row {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-block-start: var(--space-5);
}

/* ---- Pricing ---- */
.price-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
  margin-block: var(--space-5);
}

.price-tile {
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  background: var(--surface);
}

.price-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-tint);
  color: var(--accent);
  margin-block-end: var(--space-3);
}

.price-tile__icon svg {
  width: 20px;
  height: 20px;
}

.price-tile__figure {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: 32px;
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  margin: var(--space-2) 0;
}

.price-tile__figure small {
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  color: var(--ink-muted);
}

ol.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: var(--content-width-prose);
}

ol.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin-block-end: 0;
}

ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1em;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: var(--weight-bold);
  font-size: var(--text-caption);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Legal / draft ---- */
.legal-body {
  max-width: var(--content-width-prose);
}

.draft-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: var(--warning-tint);
  border: var(--hairline) solid var(--warning-mark);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-block-end: var(--space-6);
}

.draft-banner__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--warning-mark);
  color: var(--warning-tint);
}

.draft-banner__icon svg {
  width: 16px;
  height: 16px;
}

.draft-banner__label {
  display: block;
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: var(--tracking-overline);
  color: var(--warning-text);
  font-weight: var(--weight-bold);
  margin-block-end: var(--space-1);
}

.draft-banner p {
  margin: 0;
  color: var(--ink);
}

.legal-body h2 {
  margin-block-start: var(--space-7);
}

.legal-body pre {
  white-space: pre-wrap;
  background: var(--surface-sunken);
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-caption);
  color: var(--ink-secondary);
}

.legal-body table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--space-4);
  font-size: var(--text-caption);
  background: var(--surface);
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.legal-body th,
.legal-body td {
  text-align: left;
  padding: var(--space-3);
  border-bottom: var(--hairline) solid var(--rule);
  vertical-align: top;
}

.legal-body tr:last-child td {
  border-bottom: none;
}

.legal-body th {
  background: var(--surface-sunken);
  border-bottom: var(--hairline) solid var(--rule-strong);
  text-transform: uppercase;
  letter-spacing: var(--tracking-overline);
  font-size: 11px;
  font-weight: var(--weight-bold);
  color: var(--ink-secondary);
}

.legal-body tbody tr:hover {
  background: var(--surface-sunken);
}

.placeholder {
  color: var(--ink-muted);
  font-style: italic;
}

.contact-fields {
  background: var(--surface);
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 0 var(--space-5);
  margin: 0;
  max-width: var(--content-width-prose);
}

.contact-fields dt {
  font-weight: var(--weight-semibold);
  padding-block-start: var(--space-4);
  border-top: var(--hairline) solid var(--rule);
}

.contact-fields dt:first-child {
  border-top: none;
}

.contact-fields dd {
  margin: 0;
  padding-block-end: var(--space-4);
  color: var(--ink-muted);
  font-style: italic;
}

/* ---- Footer ---- */
.site-footer {
  border-top: var(--hairline) solid var(--rule);
  background: var(--surface);
  padding-block: var(--space-6);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  justify-content: space-between;
  align-items: flex-start;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: var(--text-caption);
}

.footer-nav a:hover {
  color: var(--ink);
}

.footer-copy {
  color: var(--ink-muted);
  font-size: var(--text-caption);
  margin: 0;
}

/* ---- 404 ---- */
.not-found {
  padding-block: var(--space-8);
  text-align: center;
}

.not-found__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--accent-tint);
  color: var(--accent);
  margin: 0 auto var(--space-5);
}

.not-found__mark svg {
  width: 40px;
  height: 40px;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
  }

  .hero__art-frame {
    order: -1;
    max-width: 280px;
    margin-inline: auto;
    padding: var(--space-5);
  }
}

@media (max-width: 640px) {
  :root {
    --text-hero: 34px;
    --text-title: 22px;
  }

  .site-header__inner {
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
  }

  .brand {
    margin-right: 0;
    flex-basis: 100%;
  }

  .site-nav {
    gap: var(--space-1);
    row-gap: var(--space-1);
  }

  .site-nav a {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-caption);
  }

  .site-footer__inner {
    flex-direction: column;
  }

  .price-tiles {
    grid-template-columns: 1fr;
  }
}
