/* Drayage Cloud marketing site. Every colour, radius, shadow, duration and type size comes from the Cosmosoto
   tokens in cosmosoto/tokens. The only site-level additions are the two marketing sizes below, which the
   toolkit has no use for: a display size for the home hero and the section rhythm. Flat surfaces, one accent,
   no gradients, no imagery — the design system's rules. */
:root {
  --text-display: 44px;
  --section-space: 88px;
  --header-height: 64px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + var(--space-xxl)); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { line-height: var(--leading-normal); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--text-page-h1); font-weight: var(--weight-bold); line-height: var(--leading-tight); letter-spacing: -0.01em; }
h2 { font-size: var(--text-title); font-weight: var(--weight-semibold); line-height: var(--leading-tight); }
h3 { font-size: var(--text-body-large); font-weight: var(--weight-semibold); line-height: var(--leading-tight); }
.display { font-size: var(--text-display); letter-spacing: -0.02em; }
.lead { font-size: var(--text-body-large); color: var(--text-muted); line-height: var(--leading-loose); max-width: 640px; }
.muted { color: var(--text-muted); }
.accent { color: var(--accent-text); }
.mono { font-family: var(--font-mono); font-size: var(--text-code); }
.center { text-align: center; }
.cs-icon { vertical-align: middle; }

/* The long-form section label: 12px, letter-spacing 2, uppercase (readme §3). */
.section-label {
  font-size: var(--text-caption); font-weight: var(--weight-semibold); letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: var(--space-l);
}

.container { width: 100%; max-width: var(--page-max-width); margin: 0 auto; padding: 0 var(--space-xxl); }
.reading { max-width: var(--reading-column-wide); }
.stack-xl > * + * { margin-top: var(--space-xxl); }

.skip-link { position: absolute; left: -9999px; top: var(--space-m); }
.skip-link:focus { left: var(--space-m); z-index: 100; background: var(--surface); padding: var(--space-m) var(--space-l); border-radius: var(--radius-medium); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--app-background); border-bottom: var(--border-width) solid var(--border);
}
.header-row { display: flex; align-items: center; gap: var(--space-xxl); height: var(--header-height); }
.brand { display: flex; align-items: center; }
.brand:hover { text-decoration: none; }
.site-nav { display: flex; gap: var(--space-s); flex: 1; }
.nav-link {
  color: var(--text-muted); font-size: var(--text-control); font-weight: var(--weight-semibold);
  padding: var(--space-m) var(--space-l); border-radius: var(--radius-medium); transition: var(--state-fade);
}
.nav-link:hover { color: var(--text); background: var(--surface-hover); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--surface); }
.header-actions { display: flex; align-items: center; gap: var(--space-m); margin-left: auto; }
.btn.show-narrow { display: none; }

/* Logo: show the treatment that matches the theme. */
.logo { display: inline-flex; }
.logo img { height: auto; }
.logo-light { display: none; }
[data-theme="light"] .logo-light { display: block; }
[data-theme="light"] .logo-dark { display: none; }

/* Buttons — Fluent model: discrete hover/pressed colours, 6px corners, 13px semibold labels. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-m);
  height: 32px; padding: 0 var(--control-pad-x-chip); border-radius: var(--radius-button);
  font: var(--weight-semibold) var(--text-control) / 1 var(--font-ui); white-space: nowrap;
  border: var(--border-width) solid transparent; cursor: pointer; transition: var(--state-fade);
}
.btn:hover { text-decoration: none; }
.btn-large { height: 40px; padding: 0 var(--space-xl); font-size: var(--text-body); }
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--text-on-accent); }
.btn-primary:active { background: var(--accent-pressed); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-hover); color: var(--text); }
.btn-secondary:active { background: var(--surface-pressed); }
.btn-icon { width: 32px; padding: 0; background: transparent; color: var(--text-muted); }
.btn-icon:hover { background: var(--surface-hover); color: var(--text); }

/* Cards carry both a border and a shadow: the surfaces sit too close together for either alone. */
.card {
  background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-rest); padding: var(--space-xxl);
}

.chip {
  display: inline-flex; align-items: center; gap: var(--space-s); height: 22px; padding: 0 var(--space-m);
  border-radius: var(--radius-pill); border: var(--border-width) solid var(--border); background: var(--app-background);
  color: var(--text-muted); font-size: var(--text-badge); font-weight: var(--weight-semibold);
}
.chip-link { height: 30px; padding: 0 var(--control-pad-x-chip); font-size: var(--text-control); color: var(--text); background: var(--surface); }
.chip-link:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-m); margin-top: var(--space-xl); }
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 var(--space-m); border-radius: var(--radius-small);
  background: var(--selection); color: var(--text); font-size: var(--text-badge); font-weight: var(--weight-semibold);
}

/* Status is a recoloured dot, never a second shape. */
.status { display: inline-flex; align-items: center; gap: var(--space-m); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-disabled); }
.dot.pass { background: var(--status-pass-text); }
.dot.new { background: var(--status-new); }
.dot.fail { background: var(--status-fail); }

/* Sections */
.section { padding: var(--section-space) 0; }
.section-alt { background: var(--surface); border-top: var(--border-width) solid var(--border); border-bottom: var(--border-width) solid var(--border); }
.section-alt .card { background: var(--app-background); }
.section-header { margin-bottom: 40px; max-width: 720px; }
.section-header h2 { font-size: var(--text-title-large); }
.section-header .lead { margin-top: var(--space-l); }
.section-header.centered { margin-left: auto; margin-right: auto; text-align: center; }
.page-hero { padding: 72px 0 var(--space-xxl); }
.page-hero .lead { margin-top: var(--space-xl); }
.page-hero .btn { margin-top: var(--space-xxl); }

.grid { display: grid; gap: var(--space-xl); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Hero */
.hero { padding: 80px 0 var(--section-space); border-bottom: var(--border-width) solid var(--border); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero-copy .lead { margin-top: var(--space-xxl); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-l); margin-top: 32px; }
.hero-points { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: var(--space-m); color: var(--text-muted); font-size: var(--text-body); }
.hero-points li { display: flex; align-items: center; gap: var(--space-m); }

/* The product preview: a Bookings main view drawn with the system's own surfaces. */
.preview { padding: 0; margin: 0; overflow: hidden; box-shadow: var(--shadow-dialog); }
.preview-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-l);
  padding: var(--space-l) var(--space-xl); border-bottom: var(--border-width) solid var(--border);
}
.preview-title { display: inline-flex; align-items: center; gap: var(--space-m); font-size: var(--text-control); font-weight: var(--weight-semibold); }
.preview-search {
  display: inline-flex; align-items: center; gap: var(--space-s); height: var(--control-height); padding: 0 var(--control-pad-x);
  border: var(--border-width) solid var(--border); border-radius: var(--radius-medium); background: var(--app-background);
  color: var(--text-disabled); font-size: var(--text-caption); min-width: 160px;
}
.preview-table { width: 100%; border-collapse: collapse; font-size: var(--text-control); }
.preview-table th {
  text-align: left; white-space: nowrap; font-size: var(--text-section-label); font-weight: var(--weight-semibold); letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-muted); padding: var(--space-m) var(--space-l); background: var(--app-background);
}
.preview-table td { height: var(--control-height-grid); padding: var(--space-m) var(--space-l); border-top: var(--border-width) solid var(--border); white-space: nowrap; }
.preview-table tbody tr:first-child td { background: var(--selection); }
.preview-table .chip { margin-left: var(--space-s); height: 18px; }
.preview-foot { padding: var(--space-m) var(--space-xl); font-size: var(--text-status); color: var(--text-disabled); border-top: var(--border-width) solid var(--border); }

/* Feature cards */
.feature h3 { margin-top: var(--space-xl); }
.feature p { margin-top: var(--space-m); font-size: var(--text-body); }
.feature-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: var(--radius-large); background: var(--selection); color: var(--accent-text);
}
[data-theme="light"] .feature-icon { color: var(--accent); }

/* The chain on the home page */
.chain { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-l); counter-reset: none; }
.chain-step {
  position: relative; display: flex; flex-direction: column; gap: var(--space-m); padding: var(--space-xl);
  background: var(--app-background); border: var(--border-width) solid var(--border); border-radius: var(--radius-card);
}
.chain-step h3 { font-size: var(--text-body); }
.chain-index { font-family: var(--font-mono); font-size: var(--text-caption); color: var(--text-muted); }
.link-arrow { display: inline-flex; align-items: center; gap: var(--space-s); font-weight: var(--weight-semibold); }

/* App cards */
.app-card h3 { display: flex; align-items: center; gap: var(--space-m); font-size: var(--text-subtitle); }
.app-card > p { margin-top: var(--space-m); }
.module-list { list-style: none; padding: 0; margin: var(--space-xl) 0 0; display: grid; gap: var(--space-xs); }
.module-list a {
  display: flex; align-items: center; gap: var(--space-l); padding: var(--space-m) var(--space-l); border-radius: var(--radius-medium);
  color: var(--text); font-size: var(--text-body); transition: var(--state-fade);
}
.module-list a:hover { background: var(--surface-hover); text-decoration: none; }
.module-list .cs-icon { color: var(--text-muted); }

/* Product page modules */
.module-head { display: flex; align-items: flex-start; gap: var(--space-xl); margin-bottom: var(--space-xl); }
.module-head > div { flex: 1; }
.module-tagline { color: var(--text-muted); margin-top: var(--space-s); }
.check-list { list-style: none; padding: 0; margin: var(--space-xl) 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-m) var(--space-xxl); }
.check-list li { display: flex; align-items: flex-start; gap: var(--space-m); font-size: var(--text-body); }
.check-list .cs-icon { margin-top: 2px; }
.contact-aside .check-list { grid-template-columns: 1fr; }

/* How it works timeline */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-xxl); position: relative; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 20px; bottom: 20px; width: var(--border-width); background: var(--border); }
.timeline-step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-xl); align-items: start; position: relative; }
.timeline-marker {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--text-on-accent);
  display: inline-flex; align-items: center; justify-content: center; margin-top: var(--space-xxl);
}
.timeline-body h2 { font-size: var(--text-subtitle); margin-top: var(--space-s); }
.timeline-body p.muted { margin-top: var(--space-m); }
.step-number { font-size: var(--text-caption); color: var(--text-muted); font-weight: var(--weight-semibold); }

/* FAQ */
.faq-list { display: grid; gap: var(--space-l); margin-bottom: 32px; }
.faq { padding: 0; }
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--space-xl);
  padding: var(--space-xl) var(--space-xxl); font-weight: var(--weight-semibold); font-size: var(--text-body-large);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--surface-hover); border-radius: var(--radius-card); }
.faq p { padding: 0 var(--space-xxl) var(--space-xxl); }
.faq-chevron { color: var(--text-muted); transition: transform var(--duration-normal) var(--ease-standard); }
.faq[open] .faq-chevron { transform: rotate(180deg); }

/* CTA */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 40px; }
.cta p { margin-top: var(--space-m); max-width: 560px; }
.cta-actions { display: flex; gap: var(--space-l); flex-wrap: wrap; }

/* Contact form */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.contact-aside h2 { font-size: var(--text-subtitle); }
.form { display: grid; gap: var(--space-xl); }
.field { display: grid; gap: var(--space-s); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xl); }
.field label { font-size: var(--text-control); font-weight: var(--weight-semibold); }
.input {
  width: 100%; height: 36px; padding: 0 var(--control-pad-x); font: var(--weight-regular) var(--text-body) var(--font-ui);
  color: var(--text); background: var(--app-background); border: var(--border-width) solid var(--border);
  border-radius: var(--radius-medium); transition: var(--state-fade);
}
.input::placeholder { color: var(--text-disabled); }
.input:hover { border-color: var(--text-disabled); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.textarea { height: auto; padding: var(--space-m) var(--control-pad-x); resize: vertical; line-height: var(--leading-normal); }
select.input { appearance: auto; }
.input.invalid { border-color: var(--status-fail); }
.field-error, .validation-message { color: var(--status-fail); font-size: var(--text-caption); }
.form .btn { justify-self: start; }

.infobar {
  display: flex; gap: var(--space-l); align-items: flex-start; padding: var(--space-l) var(--control-pad-x-bar);
  border-radius: var(--radius-medium); border: var(--border-width) solid var(--border); background: var(--app-background);
}
.infobar ul { margin: 0; padding-left: var(--space-xl); }
.infobar p { margin-top: var(--space-xs); color: var(--text-muted); }
.infobar-success { border-left: var(--indicator-width) solid var(--status-pass); }
.infobar-success > .cs-icon { color: var(--status-pass-text); }
.infobar-error { border-left: var(--indicator-width) solid var(--status-fail); }
.infobar-error > .cs-icon { color: var(--status-fail); }

/* Footer */
.site-footer { border-top: var(--border-width) solid var(--border); background: var(--surface); padding: 48px 0 var(--space-xxl); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-brand p { margin-top: var(--space-l); max-width: 320px; font-size: var(--text-control); }
.footer-grid nav { display: grid; gap: var(--space-m); align-content: start; font-size: var(--text-control); }
.footer-grid nav a { color: var(--text-muted); }
.footer-grid nav a:hover { color: var(--text); }
.footer-heading { font-size: var(--text-section-label); font-weight: var(--weight-semibold); letter-spacing: 1.2px; text-transform: uppercase; color: var(--text); margin-bottom: var(--space-s); }
.footer-foot { display: flex; justify-content: space-between; margin-top: 40px; padding-top: var(--space-xxl); border-top: var(--border-width) solid var(--border); font-size: var(--text-caption); }

#blazor-error-ui {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: var(--space-l) var(--space-xxl);
  background: var(--surface); border-top: var(--border-width) solid var(--status-fail); box-shadow: var(--shadow-flyout);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: var(--space-xl); top: var(--space-l); }

/* Collapse ramp */
@media (max-width: 1240px) {
  .preview-table th:nth-child(3), .preview-table td:nth-child(3) { display: none; }
}
@media (max-width: 1076px) {
  .chain { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --text-display: 36px; --section-space: 64px; }
  .hero-grid, .contact-grid { grid-template-columns: 1fr; }
  .cta { flex-direction: column; align-items: flex-start; }
  .btn.show-narrow { display: inline-flex; }
  .btn.hide-narrow { display: none; }
  .site-nav {
    display: none; position: absolute; top: var(--header-height); left: 0; right: 0; flex-direction: column;
    padding: var(--space-m) var(--space-xxl) var(--space-xl); background: var(--app-background);
    border-bottom: var(--border-width) solid var(--border); box-shadow: var(--shadow-flyout);
  }
  .site-nav.open { display: flex; }
}
@media (max-width: 720px) {
  .container { padding: 0 var(--space-xl); }
  .grid-2, .grid-3, .check-list, .field-row { grid-template-columns: 1fr; }
  .chain { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .module-head { flex-wrap: wrap; }
  .preview-table th:nth-child(3), .preview-table td:nth-child(3) { display: none; }
  .preview-search, .preview-table .chip { display: none; }
  .card { padding: var(--space-xl); }
  .cta { padding: var(--space-xxl); }
  h1 { font-size: var(--text-title); }
  .display { font-size: 32px; }
}
