/*
 * site.css - the public website and the sign-in pages (#1030, #1034).
 * One stylesheet for every edition. The edition only changes the --color-brand-*
 * variables, which website_theme_style_tag writes in the page head.
 * Plain CSS: no Sass, no Bootstrap, no jQuery, no web fonts. Token names follow the
 * Tailwind v4 @theme namespaces (--color-*, --radius-*, --shadow-*, --font-*, ...)
 * so a later Tailwind theme can take them over as they are.
 */

:root {
  /* Fallbacks; the theme style tag overrides these. */
  --color-brand-accent: #f59e0b;
  --color-brand-on-accent: #000;
  --color-brand-dark: #13233a;
  --color-brand-on-dark: #fff;
  --color-brand-accent-ink: #13233a;

  --color-ink: #1d2430;
  --color-ink-soft: #4b5563;
  --color-muted: #6b7280;
  --color-line: #e4e7ec;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f6f8;
  --color-danger: #b42318;
  --color-danger-bg: #fef3f2;
  --color-danger-line: #fecdca;
  --color-success: #067647;
  --color-success-bg: #ecfdf3;
  --color-success-line: #abefc6;
  --color-surface: #fff;
  --color-on-image: #fff; /* text on the hero photo, always under a dark overlay */
  --color-line-strong: #cfd4dc;
  --color-input-border: #c9ced6;
  --color-bg-auth: #eef0f3;
  --color-danger-surface: #fffbfa;
  --color-hover: #eaecf0;

  --radius-md: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .06);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .10);
  --container-site: 1120px;
  --spacing-gutter: 24px;
  --shadow-focus: 0 0 0 3px #fff, 0 0 0 5px var(--color-brand-accent-ink);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}
/* Smooth only once the page has loaded (site.js): smooth from the start made
   Chrome often skip the jump to a #section on load (/home/contact landed on top). */
html.smooth-scroll { scroll-behavior: smooth; }

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

body.site,
body.auth {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-brand-accent-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--color-ink); }

.wrap {
  width: 100%;
  max-width: var(--container-site);
  margin: 0 auto;
  padding: 0 var(--spacing-gutter);
}

.skip-link {
  position: absolute;
  left: 8px;
  top: 8px;
  transform: translateY(-200%);
  z-index: 100;
  padding: 10px 14px;
  background: var(--color-surface);
  color: var(--color-ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.skip-link:focus { transform: none; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s ease, background-color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--color-brand-accent);
  color: var(--color-brand-on-accent);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
}
.btn-primary:hover { filter: brightness(.94); }

.btn-outline {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-line-strong);
}
.btn-outline:hover { background: var(--color-bg-alt); }

.btn-ghost-light {
  background: rgba(255, 255, 255, .08);
  color: var(--color-on-image);
  border-color: rgba(255, 255, 255, .55);
}
.btn-ghost-light:hover { background: rgba(255, 255, 255, .18); }

.btn-block { display: flex; width: 100%; }

/* ---------- Logo tile ----------
 * Logos are opaque JPEGs (white, grey or navy backgrounds), so they always sit
 * in a white rounded tile, never straight on a coloured background. */

.logo-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  line-height: 0;
  text-decoration: none;
}
.logo-tile img {
  display: block;
  width: auto;
  height: 52px;
  max-width: 200px;
  object-fit: contain;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--color-line);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
}

.site-header__logo { flex: 0 0 auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--color-ink-soft);
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--color-ink); background: var(--color-bg-alt); }

.site-header__cta { flex: 0 0 auto; }

/* Phone menu: a <details> element, no JavaScript. */
.site-menu { display: none; margin-left: auto; position: relative; }

.site-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.site-menu > summary::-webkit-details-marker { display: none; }

.site-menu__icon,
.site-menu__icon::before,
.site-menu__icon::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
}
.site-menu__icon::before,
.site-menu__icon::after { content: ""; position: absolute; left: 0; }
.site-menu__icon::before { top: -6px; }
.site-menu__icon::after { top: 6px; }
.site-menu[open] .site-menu__icon { background: transparent; }
.site-menu[open] .site-menu__icon::before { top: 0; transform: rotate(45deg); }
.site-menu[open] .site-menu__icon::after { top: 0; transform: rotate(-45deg); }

.site-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(280px, calc(100vw - 32px));
  padding: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.site-menu__panel a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  font-weight: 500;
  text-decoration: none;
}
.site-menu__panel a:not(.btn):hover { background: var(--color-bg-alt); }
.site-menu__panel .btn { margin-top: 8px; }

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

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 60vh;
  padding: 72px 0;
  background: var(--color-brand-dark);
  color: var(--color-brand-on-dark);
  overflow: hidden;
  isolation: isolate;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  z-index: -2;
}

/* The dark overlay keeps white text readable on any photo. */
.hero--image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-brand-dark);
  opacity: .72;
}
.hero--image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, 0) 70%);
}

.hero--plain {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(255, 255, 255, .10), transparent 60%),
    var(--color-brand-dark);
}

.hero__content { max-width: 720px; }

.hero__eyebrow {
  display: inline-block;
  width: 48px;
  height: 4px;
  margin-bottom: 20px;
  border-radius: 2px;
  background: var(--color-brand-accent);
}

.hero h1 {
  margin: 0 0 16px;
  color: var(--color-on-image);
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.hero__lead {
  margin: 0 0 28px;
  color: rgba(255, 255, 255, .92);
  font-size: clamp(1.0625rem, 1rem + .4vw, 1.3rem);
  line-height: 1.5;
}
.hero__lead > :last-child { margin-bottom: 0; }
.hero__lead p, .hero__lead div { margin: 0 0 .5em; }
.hero__lead a { color: var(--color-on-image); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Sections ---------- */

.band { padding: 72px 0; background: var(--color-bg); }
main > section.band:nth-of-type(odd) { background: var(--color-bg-alt); }

.band__head { max-width: 720px; margin-bottom: 28px; }

.band__kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--color-brand-accent-ink);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.band h2 {
  margin: 0;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  font-weight: 750;
  letter-spacing: -.01em;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 700;
}
.card__title::before {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--color-brand-accent);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px;
  align-items: start;
}
.contact-grid__side { display: grid; gap: 24px; }
.contact-grid__full { grid-column: 1 / -1; max-width: 760px; }
.card__intro { margin: -4px 0 20px; color: var(--color-muted); }

/* ---------- Text written in the editor (or old Textile) ---------- */

.prose { color: var(--color-ink-soft); overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p,
.prose div,
.prose blockquote,
.prose pre,
.prose ul,
.prose ol { margin: 0 0 1em; }
.prose div:has(> div) { margin: 0; }
.prose strong, .prose b { color: var(--color-ink); font-weight: 650; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.25em 0 .5em; color: var(--color-ink); font-size: 1.125rem; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin: .25em 0; }
.prose li::marker { color: var(--color-brand-accent-ink); }
.prose blockquote {
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--color-brand-accent);
  color: var(--color-ink);
}
.prose pre {
  padding: 12px 14px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  font: inherit;
  white-space: pre-wrap;
}
.prose a { font-weight: 500; }
.prose--lead { font-size: 1.0625rem; max-width: 70ch; }
.card .prose p,
.card .prose div { margin-bottom: .6em; }

/* Services: a list reads as a tidy two-column checklist on wide screens. */
.prose--list ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.prose--list ul li { position: relative; margin: 0; padding-left: 28px; }
.prose--list ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .3em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-brand-accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.2L4.6 10l1.4-1.4 2.8 2.8 5.2-5.2 1.4 1.4-6.6 6.6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.2L4.6 10l1.4-1.4 2.8 2.8 5.2-5.2 1.4 1.4-6.6 6.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.tracking-card { display: flex; gap: 28px; align-items: center; justify-content: space-between; }
.tracking-card .prose { flex: 1 1 auto; max-width: 70ch; }
.tracking-card__action { flex: 0 0 auto; }

/* ---------- Forms (contact form and sign-in pages) ---------- */

.form-summary {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--color-danger-line);
  border-radius: var(--radius-sm);
  background: var(--color-danger-bg);
  color: var(--color-danger);
  font-weight: 600;
}
.form-summary ul { margin: 6px 0 0; padding-left: 1.25em; font-weight: 400; }

.notice-box {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--color-success-line);
  border-radius: var(--radius-sm);
  background: var(--color-success-bg);
  color: var(--color-success);
  font-weight: 600;
}
.notice-box--after { margin: 16px 0 0; }

.field { margin: 0 0 18px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }

.field label,
.field .label {
  display: block;
  margin: 0 0 6px;
  color: var(--color-ink);
  font-size: .9375rem;
  font-weight: 600;
}
.field .optional { color: var(--color-muted); font-weight: 400; }

.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.field-head a { display: inline-flex; align-items: center; min-height: 44px; font-size: .9375rem; }
.field-head label { margin-bottom: 0; }

.input,
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"],
.field textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming on focus */
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 140px; resize: vertical; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-brand-accent-ink);
  box-shadow: 0 0 0 3px rgba(19, 35, 58, .15); /* older browsers */
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand-accent-ink) 25%, transparent);
}

.field.field--error input,
.field.field--error textarea { border-color: var(--color-danger); background: var(--color-danger-surface); }
.field.field--error label { color: var(--color-danger); }

.field-error {
  display: block;
  margin-top: 6px;
  color: var(--color-danger);
  font-size: .9375rem;
  font-weight: 500;
}

.field-hint { display: block; margin-top: 6px; color: var(--color-muted); font-size: .875rem; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0 0 12px;
  font-weight: 500;
  cursor: pointer;
}
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--color-brand-dark); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 84px; }
.pw-toggle {
  position: absolute;
  right: 2px;
  top: 2px;
  bottom: 2px; /* 44px tall inside the 48px field */
  min-width: 64px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  color: var(--color-ink);
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
}
.pw-toggle:hover { background: var(--color-hover); }

/* Read by screen readers, not shown ("Show" + " password"). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Off-screen trap field for bots; people never see it. */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.form-foot { color: var(--color-muted); font-size: .875rem; margin: 12px 0 0; }

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

.site-footer {
  padding: 32px 0;
  background: var(--color-brand-dark);
  color: var(--color-brand-on-dark);
  font-size: .9375rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
}
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; }
.site-footer__powered { opacity: .8; }

/* ---------- Flash bar (e.g. "Signed out") ---------- */

.flash-bar { padding: 12px 0; background: var(--color-success-bg); color: var(--color-success); border-bottom: 1px solid var(--color-success-line); font-weight: 600; }
.flash-bar--alert { background: var(--color-danger-bg); color: var(--color-danger); border-color: var(--color-danger-line); }

/* ---------- Sign-in pages ---------- */

body.auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-auth);
}

.auth-main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

.auth-wrap { width: 100%; max-width: 440px; }

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 36px 36px 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  background: var(--color-brand-accent);
}

.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; text-align: center; }
.auth-brand .logo-tile img { height: 56px; max-width: 220px; }

.auth-title { margin: 0 0 6px; font-size: 1.5rem; font-weight: 750; text-align: center; letter-spacing: -.01em; }
.auth-intro { margin: 0 0 24px; color: var(--color-ink-soft); text-align: center; }
.auth-card form { margin-top: 20px; }

.auth-alt {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--color-line);
  color: var(--color-ink-soft);
  text-align: center;
  font-size: .9375rem;
}
.auth-alt__title { margin: 0 0 10px; color: var(--color-ink); font-weight: 600; }

.auth-links { margin: 16px 0 0; text-align: center; }
.auth-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

.auth-footer {
  flex: 0 0 auto;
  padding: 0 16px 28px;
  color: var(--color-ink-soft); /* --color-muted is 4.2:1 on the grey auth background, under AA */
  font-size: .875rem;
  text-align: center;
}
.auth-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-ink-soft); }
.auth-footer__back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

.dev-login-panel { max-width: 440px; margin: 24px auto 0; }

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  .site-nav,
  .site-header__cta { display: none; }
  .site-menu { display: block; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .tracking-card { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  :root { --spacing-gutter: 16px; }
  html { scroll-padding-top: 76px; }
  .site-header__inner { min-height: 64px; gap: 12px; }
  .logo-tile img { height: 38px; max-width: 150px; }
  .hero { min-height: 0; padding: 56px 0 60px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .band { padding: 48px 0; }
  .card { padding: 20px; }
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .prose--list ul { grid-template-columns: minmax(0, 1fr); }
  .tracking-card__action,
  .tracking-card__action .btn { width: 100%; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; }

  .auth-main { padding: 16px; align-items: flex-start; }
  .auth-card { padding: 28px 20px 24px; }
}
