/*
 * The public websites. One stylesheet for every business; each business's
 * colour comes from /brand.css as --brand (and --on-brand for text on it).
 */

:root {
  --brand: #1f4e5f;
  --on-brand: #ffffff;
  --ink: #15191d;
  --ink-soft: #4a525a;
  --paper: #ffffff;
  --tint: #f4f2ee;
  --line: #e2ded6;
  --radius: 14px;
  --wrap: 72rem;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.6rem, 1.35rem + 1.1vw, 2.2rem);
  --step-3: clamp(2.2rem, 1.6rem + 2.8vw, 3.9rem);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}

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

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

:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.6em; }
h1 { font-size: var(--step-3); font-weight: 750; }
h2 { font-size: var(--step-2); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 650; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.muted { color: var(--ink-soft); }

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 10;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

/* -- buttons ----------------------------------------------------------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 2.9rem; padding: 0.7rem 1.35rem;
  font: inherit; font-weight: 650; line-height: 1.2; text-decoration: none;
  color: var(--on-brand); background: var(--brand);
  border: 2px solid var(--brand); border-radius: 999px; cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.button:hover { filter: brightness(1.08); text-decoration: none; }
.button:active { transform: translateY(1px); }
.button-quiet { color: var(--brand); background: transparent; }
.button-quiet:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); filter: none; }
.button-small { min-height: 2.4rem; padding: 0.45rem 1rem; font-size: 0.95rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.text-link { font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* -- masthead ------------------------------------------------------------ */

.masthead {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.wordmark {
  font-weight: 750; font-size: 1.15rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none;
  overflow-wrap: anywhere;
}
.nav { display: flex; align-items: center; gap: clamp(0.6rem, 2.5vw, 1.6rem); }
.nav a:not(.button) { color: var(--ink); text-decoration: none; font-weight: 550; }
.nav a:not(.button):hover, .nav a:not(.button)[aria-current="page"] { color: var(--brand); text-decoration: underline; }

@media (max-width: 30rem) {
  .masthead-inner { flex-wrap: wrap; padding-block: 0.6rem; }
  .nav { width: 100%; justify-content: space-between; }
}

/* -- hero and page heads --------------------------------------------------- */

.hero {
  background:
    radial-gradient(60rem 30rem at 85% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    var(--tint);
  border-bottom: 1px solid var(--line);
}
.hero-inner { padding-block: clamp(3.5rem, 10vw, 7.5rem); }
.hero-title { max-width: 18ch; }
.eyebrow {
  display: inline-block; margin-bottom: 1.1rem; padding: 0.3rem 0.8rem;
  font-size: 0.85rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--paper)); border-radius: 999px;
}
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); max-width: 40ch; margin: 0; }
.lede-small { font-size: 1.15rem; margin: 0; }

.page-head { padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem); }
.page-head h1 { margin-bottom: 0.35em; }
.page-head-message { min-height: 50vh; }
.breadcrumb { margin-bottom: 0.75rem; font-weight: 600; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a::before { content: "\2190\00a0"; }

/* -- sections ---------------------------------------------------------------- */

.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section-flush { padding-top: 0; }
.section-tint { background: var(--tint); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head h2 { margin: 0; }

.split { display: grid; gap: clamp(2rem, 6vw, 5rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.prose { max-width: 62ch; }
.prose p:last-child { margin-bottom: 0; }

.service-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.service-list li {
  padding: 0.85rem 1rem 0.85rem 2.6rem; position: relative;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; font-weight: 550;
}
.service-list li::before {
  content: ""; position: absolute; left: 1rem; top: 50%; width: 0.7rem; height: 0.7rem; margin-top: -0.35rem;
  border-radius: 3px; background: var(--brand);
}

.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: clamp(1.75rem, 5vw, 3rem); border-radius: calc(var(--radius) * 1.5);
  color: var(--on-brand); background: var(--brand);
}
.cta h2 { margin: 0; }
.cta .button { color: var(--brand); background: var(--on-brand); border-color: var(--on-brand); }

.empty { padding: 3rem 0; color: var(--ink-soft); font-size: 1.1rem; }

/* -- project cards --------------------------------------------------------------- */

.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(1rem, 2.5vw, 1.75rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}
.card-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.card-media {
  aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 22%, var(--tint)), var(--tint));
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card-link:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 0.9rem 0.15rem 0; }
.card-title { font-size: 1.15rem; margin: 0 0 0.2rem; }
.card-link:hover .card-title { color: var(--brand); }
.card-body p { margin: 0; font-size: 0.95rem; }

/* -- a project's page ------------------------------------------------------------------ */

.project { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
.gallery { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.gallery-item { display: block; overflow: hidden; border-radius: 10px; background: var(--tint); }
.gallery-item img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-lead { grid-column: 1 / -1; border-radius: var(--radius); }
.gallery-lead img { aspect-ratio: auto; max-height: 78vh; object-fit: contain; background: var(--tint); }
.project-text { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); align-items: start; }

.aside-card { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint); }
.aside-card h2 { font-size: var(--step-1); margin-bottom: 0.4rem; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }

/* -- contact form ------------------------------------------------------------------------ */

.contact { display: grid; gap: clamp(2rem, 5vw, 3.5rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
.form { display: grid; gap: 1.15rem; max-width: 40rem; }
.field { display: grid; gap: 0.35rem; }
.field-row { display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
label { font-weight: 600; }
.optional { font-weight: 400; color: var(--ink-soft); }

input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 0.75rem 0.9rem; background: var(--paper);
  border: 1.5px solid #cfc9bf; border-radius: 10px;
}
textarea { resize: vertical; min-height: 9rem; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
[aria-invalid="true"] { border-color: #b3261e; }

.choice { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.choice legend { font-weight: 600; margin-bottom: 0.5rem; padding: 0; }
.choice-option { font-weight: 500; }
.choice-option input { position: absolute; opacity: 0; }
.choice-option span {
  display: inline-block; padding: 0.55rem 1rem; border: 1.5px solid #cfc9bf; border-radius: 999px; cursor: pointer;
}
.choice-option input:checked + span { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
.choice-option input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

.check { display: flex; gap: 0.7rem; align-items: flex-start; font-weight: 400; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: 0.2rem; accent-color: var(--brand); flex: none; }

.field-error { margin: 0; color: #b3261e; font-size: 0.95rem; font-weight: 550; }
.form-error { margin: 0; padding: 0.8rem 1rem; color: #7a1c16; background: #fbe9e7; border-radius: 10px; font-weight: 550; }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* -- footer ------------------------------------------------------------------------------- */

.footer { margin-top: clamp(2rem, 6vw, 4rem); padding-block: 2.5rem 1.5rem; background: var(--ink); color: #e9ecef; }
.footer a { color: #fff; }
.footer .muted { color: #aab2ba; }
.footer-inner { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.footer-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.25rem; }
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.footer-base { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }
.footer-legal { display: flex; gap: 1.25rem; }
.prose-page { max-width: 46rem; }
.prose-page h2 { margin: 2rem 0 0.5rem; font-size: 1.15rem; }
.prose-page ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.prose-page li { margin-bottom: 0.6rem; }

/* -- no site at this address --------------------------------------------------------------- */

.no-site main { min-height: 100vh; display: grid; place-content: center; text-align: center; }
.no-site h1 { font-size: var(--step-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* -- the customer portal --------------------------------------------------------------------- */

.portal-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
  padding: 0.75rem 1rem; margin-bottom: 2rem;
  background: var(--tint); border: 1px solid var(--line); border-radius: 10px;
}
.portal-who { font-weight: 600; }
.portal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.portal-links a { color: var(--ink); text-decoration: none; font-weight: 550; }
.portal-links a:hover, .portal-links a[aria-current="page"] { color: var(--brand); text-decoration: underline; }
.portal-signout { margin: 0; }
.text-button {
  font: inherit; font-weight: 550; color: var(--ink-soft); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline;
}
.text-button:hover { color: var(--brand); }

.messages-wrap { display: grid; gap: 2rem; max-width: 46rem; }
.messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.message { padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--tint); border: 1px solid var(--line); }
.message-customer { background: color-mix(in srgb, var(--brand) 10%, var(--paper)); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); margin-left: 2rem; }
.message-business { margin-right: 2rem; }
.message-who { margin: 0 0 0.35rem; font-size: 0.85rem; font-weight: 650; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-soft); }
.message-body p:last-child { margin-bottom: 0; }

.field-note { margin: 0.4rem 0 0; font-size: 0.85rem; }

/* -- a logo in the header, in any style ------------------------------------------------------ */

.wordmark-logo { display: block; line-height: 0; }
.wordmark-logo img { height: 3.1rem; width: auto; max-width: min(15rem, 46vw); object-fit: contain; }
@media (max-width: 30rem) { .wordmark-logo img { height: 2.6rem; } }

/* -- the Space style ------------------------------------------------------------------------------
 * Made for the Mercatus logo: chrome letters filled with deep space, electric-blue glows and an
 * orbit, drawn on white. So the page stays light where the logo sits (the logo is blended into it,
 * never boxed), the bands around it are deep space with stars, headings are wide capitals, and
 * thin glowing lines echo the ones under each word of the logo. --brand should be the blue.
 */

.style-space {
  --space: #040914;
  --space-2: #0a1733;
  --chrome: #c5ccd7;
  --chrome-soft: #f0f3f8;
  --ink: #0a0f1a;
  --ink-soft: #4a5467;
  --tint: #f3f5f9;
  --line: #dce1e9;
  --display: "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
  --glow: color-mix(in srgb, var(--brand) 55%, transparent);
  --glow-line: linear-gradient(90deg, transparent, var(--brand) 22%, #d8ecff 50%, var(--brand) 78%, transparent);
  --metal: linear-gradient(180deg, #ffffff 0%, #dde2ea 46%, #f5f7fa 54%, #c4cbd6 100%);
}

/* the logo leads from the header, a size bigger than in Classic */
.style-space .masthead-inner { min-height: 5rem; }
.style-space .wordmark-logo img { height: 4rem; max-width: min(17rem, 52vw); }
@media (max-width: 30rem) { .style-space .wordmark-logo img { height: 3.25rem; } }

.style-space h1, .style-space h2 {
  font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.style-space h3 { font-family: var(--display); letter-spacing: 0.02em; }

/* the header: glass over white, a glowing line beneath */
.style-space .masthead { border-bottom: 0; }
.style-space .masthead::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--glow-line); box-shadow: 0 0 10px var(--glow);
}
.style-space .nav a:not(.button) {
  font-family: var(--display); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
}

/* buttons: electric blue that glows, or brushed chrome */
.style-space .button {
  border-radius: 10px; font-family: var(--display); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em;
  transition: box-shadow 0.2s ease, filter 0.15s ease, transform 0.15s ease;
}
.style-space .button:hover {
  filter: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent), 0 10px 28px -8px var(--glow);
}
.style-space .button-small { font-size: 0.78rem; }
.style-space .button-quiet { color: var(--space-2); background: var(--metal); border-color: var(--chrome); }
.style-space .button-quiet:hover { background: var(--metal); }

/* the opening: short, centred, a glowing line under the headline, so the work shows without scrolling */
.style-space .hero {
  text-align: center; border-bottom: 0;
  background:
    radial-gradient(40rem 14rem at 50% 30%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 70%),
    linear-gradient(180deg, #ffffff 40%, var(--chrome-soft));
}
.style-space .hero-inner { display: flex; flex-direction: column; align-items: center; padding-block: clamp(1.75rem, 5vw, 3.25rem); }
.style-space .hero-title { max-width: 26ch; margin-inline: auto; font-size: clamp(1.6rem, 1.15rem + 2.1vw, 2.7rem); overflow-wrap: anywhere; }
.style-space .hero .lede { margin-inline: auto; }
.style-space .hero .actions { justify-content: center; margin-top: 1.25rem; }
.style-space .hero-title::after,
.style-space .page-head h1::after {
  content: ""; display: block; height: 2px; width: min(24rem, 70%); margin: 1rem auto 0;
  border-radius: 2px; background: var(--glow-line); box-shadow: 0 0 14px 1px var(--glow);
}
.style-space .page-head h1::after { margin-left: 0; width: min(14rem, 60%); }
.style-space .eyebrow {
  font-family: var(--display); letter-spacing: 0.12em; color: var(--space-2);
  background: var(--metal); border: 1px solid var(--chrome);
}

/* project cards: a chrome edge that lights up blue */
.style-space .card-media { border: 1px solid var(--line); transition: box-shadow 0.25s ease, border-color 0.25s ease; }
.style-space .card-link:hover .card-media {
  border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), 0 14px 34px -12px var(--glow);
}

/* deep-space bands: about and services, the call to action, the footer */
.style-space .section-tint,
.style-space .cta,
.style-space .footer {
  position: relative; isolation: isolate; overflow: hidden; color: #dfe7f5; border: 0;
  background:
    radial-gradient(60rem 26rem at 12% 0%, color-mix(in srgb, var(--brand) 30%, transparent), transparent 70%),
    radial-gradient(42rem 24rem at 92% 100%, color-mix(in srgb, #3a2fc4 22%, transparent), transparent 70%),
    linear-gradient(180deg, var(--space-2), var(--space));
}
.style-space .section-tint::before,
.style-space .cta::before,
.style-space .footer::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12px 18px, #ffffff 60%, transparent 61%),
    radial-gradient(1px 1px at 64px 112px, #cfe3ff 60%, transparent 61%),
    radial-gradient(1.4px 1.4px at 131px 47px, #ffffff 60%, transparent 61%),
    radial-gradient(1px 1px at 188px 160px, #9ec5ff 60%, transparent 61%),
    radial-gradient(1.6px 1.6px at 240px 88px, #ffffff 60%, transparent 61%),
    radial-gradient(1px 1px at 33px 214px, #d8e6ff 60%, transparent 61%),
    radial-gradient(1.2px 1.2px at 97px 262px, #ffffff 60%, transparent 61%),
    radial-gradient(1px 1px at 158px 236px, #bcd6ff 60%, transparent 61%),
    radial-gradient(1.3px 1.3px at 276px 205px, #ffffff 60%, transparent 61%),
    radial-gradient(1px 1px at 214px 11px, #e3edff 60%, transparent 61%);
  background-size: 300px 300px;
  opacity: 0.9;
}
.style-space .section-tint::after,
.style-space .cta::after,
.style-space .footer::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(2.6px 2.6px at 80px 60px, #ffffff 30%, #7fb4ff66 60%, transparent 100%),
    radial-gradient(2px 2px at 330px 190px, #ffffff 30%, #7fb4ff55 60%, transparent 100%),
    radial-gradient(3px 3px at 210px 400px, #ffffff 25%, #5b9dff55 60%, transparent 100%),
    radial-gradient(1.6px 1.6px at 420px 300px, #ffffff 40%, transparent 100%);
  background-size: 470px 470px;
  opacity: 0.85;
}
.style-space .section-tint h2,
.style-space .cta h2 { color: #ffffff; }
.style-space .section-tint .prose { color: #c9d6ee; }
.style-space .section-tint .service-list li {
  color: #eef3ff; background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.13);
}
.style-space .service-list li::before {
  width: 0.5rem; height: 0.5rem; margin-top: -0.25rem; border-radius: 50%;
  background: #d8ecff; box-shadow: 0 0 6px 2px var(--brand);
}
.style-space .cta { border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.1); }
.style-space .cta .button { color: var(--space); background: var(--metal); border-color: transparent; }
.style-space .footer { box-shadow: 0 -1px 0 color-mix(in srgb, var(--brand) 60%, transparent), 0 -10px 28px -14px var(--glow); }
.style-space .footer a { color: #cfe2ff; }
.style-space .footer .muted { color: #9fb0cc; }
.style-space .footer-base { border-top-color: rgba(255, 255, 255, 0.1); }
