/* Known Distance: one stylesheet, no framework. Light by default, dark by
   system preference or by the toggle (html[data-theme]). */

@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/space-grotesk.woff2?v=22f9fe0df477") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f3f9;
  --surface: #ffffff;
  --ink: #16121f;
  --muted: #575166;
  --line: #d8d3e6;
  --rule: #16121f;
  --accent: #7e16ff;
  --link: #6a0fe0;
  --azure: #006c96;
  --gold: #85650a;
  --down: #b3261e;
  --on-accent: #ffffff;
  --focus: #7e16ff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --surface: #141219;
    --ink: #eeeaf7;
    --muted: #a59eb6;
    --line: #2b2735;
    --rule: #eeeaf7;
    --accent: #9b55ff;
    --link: #bb8cff;
    --azure: #00beff;
    --gold: #d4af37;
    --down: #ff8a80;
    --on-accent: #ffffff;
    --focus: #bb8cff;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #141219;
  --ink: #eeeaf7;
  --muted: #a59eb6;
  --line: #2b2735;
  --rule: #eeeaf7;
  --accent: #9b55ff;
  --link: #bb8cff;
  --azure: #00beff;
  --gold: #d4af37;
  --down: #ff8a80;
  --on-accent: #ffffff;
  --focus: #bb8cff;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "ss01" 0;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

main:focus {
  outline: none;
}

h1,
h2,
h3 {
  line-height: 1.15;
  font-weight: 600;
  margin: 0;
}

h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--focus);
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

/* Frame */

.site-header,
main,
.site-footer {
  width: min(100% - 2.5rem, 72rem);
  margin-inline: auto;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
  padding-block: 1.25rem;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.mark {
  width: 2.25rem;
  height: auto;
  flex: none;
}

.mark-dim,
.mark-line {
  stroke: currentColor;
}

.mark-point {
  fill: var(--accent);
}

.site-header nav {
  margin-left: auto;
}

.site-header nav ul,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header nav a {
  color: var(--ink);
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  border-color: var(--ink);
}

.theme-icon {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

main {
  padding-bottom: 4rem;
}

/* Hero: the name, and the Group drawn as a measured line beneath it */

.hero {
  padding-block: clamp(3rem, 9vw, 7rem) clamp(3rem, 6vw, 5rem);
}

.hero h1 {
  font-size: clamp(3.25rem, 11vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-weight: 600;
  max-width: 9ch;
}

.lede {
  margin-top: 1.75rem;
  max-width: 34rem;
  font-size: clamp(1.125rem, 1.8vw, 1.3125rem);
  line-height: 1.55;
  color: var(--muted);
}

.survey {
  margin: clamp(3rem, 6vw, 4.5rem) 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 clamp(2rem, 6vw, 5rem);
}

.baseline,
.apart,
.branch {
  list-style: none;
  margin: 0;
  padding: 0;
}

.baseline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  padding-top: 2.25rem;
}

/* the measured line itself */
.baseline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0.55rem;
  height: 2px;
  background: var(--rule);
  transform-origin: left center;
  animation: draw 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* an arrowhead closing the line */
.baseline::after {
  content: "";
  position: absolute;
  right: -1px;
  top: calc(0.55rem - 5px);
  border-left: 9px solid var(--rule);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  animation: appear 300ms 800ms both;
}

.stop {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

/* a tick where each company sits on the line */
.stop::before {
  content: "";
  position: absolute;
  left: 0;
  top: -2.25rem;
  width: 2px;
  height: 1.25rem;
  background: var(--rule);
  animation: appear 300ms both;
}

.baseline > .stop:nth-child(2)::before { animation-delay: 350ms; }
.baseline > .stop:nth-child(3)::before { animation-delay: 500ms; }
.baseline > .stop:nth-child(4)::before { animation-delay: 650ms; }

.stop.origin::before {
  top: -2.75rem;
  left: -0.45rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--accent);
  animation: none;
}

.stop-name {
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.stop-name:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.stop-focus {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.4;
}

/* a company under another hangs from it */
.branch {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 2px dashed var(--line);
}

.branch li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.branch .stop-name {
  font-size: 1.0625rem;
}

/* Wymond: off the line, its own marker */
.apart {
  position: relative;
  padding-top: 2.25rem;
  min-width: 10rem;
}

.stop.alone::before {
  top: -2.75rem;
  left: 0;
  width: 1.1rem;
  height: 1.1rem;
  background: transparent;
  border: 2px solid var(--gold);
  transform: rotate(45deg);
  animation-delay: 900ms;
}

.stop.alone .stop-name {
  color: var(--ink);
}

@keyframes draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sections */

.group,
.previews {
  padding-top: clamp(3rem, 6vw, 4.5rem);
  scroll-margin-top: 1rem;
}

.section-intro {
  margin-top: 0.75rem;
  max-width: 40rem;
  color: var(--muted);
}

.company {
  display: grid;
  grid-template-columns: minmax(12rem, 18rem) minmax(0, 40rem);
  gap: 0.5rem 3rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1rem;
}

.group .section-intro {
  margin-bottom: 2rem;
}

.company:target {
  border-top-color: var(--accent);
  box-shadow: inset 0 2px 0 var(--accent);
}

.relation {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.company-body {
  display: grid;
  gap: 0.6rem;
}

.areas {
  color: var(--muted);
  font-size: 0.9375rem;
}

.preview-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 0;
  border-top: 2px solid var(--rule);
}

.preview {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 0.2rem;
  padding: 1.25rem 1.5rem 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.preview-name {
  font-size: 1.1875rem;
}

.preview-name a {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

.preview-host {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.preview-company {
  font-size: 0.875rem;
  color: var(--azure);
  font-weight: 500;
}

.preview-summary {
  margin-top: 0.4rem;
  max-width: 34rem;
}

/* Inner pages */

.page {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
}

.page h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: -0.03em;
}

.page > p + p {
  margin-top: 1rem;
}

.narrow {
  max-width: 40rem;
}

.status-summary {
  margin: 2rem 0 1.5rem;
  max-width: 44rem;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.status-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 30rem;
}

.status-table th,
.status-table td {
  text-align: left;
  padding: 0.85rem 1rem 0.85rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.status-table thead th {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid var(--rule);
}

.status-table tbody th {
  font-weight: 600;
}

.status-table tbody th a {
  color: var(--ink);
}

.num {
  font-variant-numeric: tabular-nums;
}

.health {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.health-dot {
  width: 0.7rem;
  height: 0.7rem;
  flex: none;
}

.health-up {
  color: var(--azure);
}

.health-up .health-dot {
  border-radius: 50%;
  background: var(--azure);
}

.health-down {
  color: var(--down);
}

/* a square marker for down, so the state never rests on colour alone */
.health-down .health-dot {
  background: var(--down);
}

.health-reason {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Contact form */

.contact-form {
  margin-top: 2rem;
  display: grid;
  gap: 1.4rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 600;
}

.field-hint {
  font-size: 0.9375rem;
  color: var(--muted);
}

.field-error {
  font-weight: 600;
  color: var(--down);
}

input,
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--muted);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  width: 100%;
}

textarea {
  resize: vertical;
  min-height: 9rem;
}

[aria-invalid="true"] {
  border-color: var(--down);
  border-width: 2px;
}

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

.privacy {
  font-size: 0.9375rem;
  color: var(--muted);
}

.button {
  justify-self: start;
  font: inherit;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  padding: 0.75rem 1.4rem;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.08);
}

.error-summary {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--down);
  border-radius: 6px;
  background: var(--surface);
}

.error-summary h2 {
  font-size: 1.125rem;
}

.error-summary ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.error-summary a {
  color: var(--down);
  font-weight: 600;
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  padding-block: 2rem 2.5rem;
  border-top: 2px solid var(--rule);
}

.footer-links {
  margin-left: auto;
}

.footer-note {
  width: 100%;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Narrow screens: the measured line runs down the page */

@media (max-width: 760px) {
  .survey {
    grid-template-columns: 1fr;
  }

  .baseline {
    grid-template-columns: 1fr;
    gap: 1.6rem;
    padding: 0 0 0 2rem;
  }

  .baseline::before {
    left: 0.45rem;
    right: auto;
    top: 0;
    bottom: 0;
    width: 2px;
    height: auto;
    transform-origin: center top;
    animation-name: draw-down;
  }

  .baseline::after {
    right: auto;
    left: calc(0.45rem - 5px);
    top: auto;
    bottom: -8px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 9px solid var(--rule);
    border-bottom: 0;
  }

  .stop::before {
    left: -2rem;
    top: 0.75rem;
    width: 1.1rem;
    height: 2px;
  }

  .stop.origin::before {
    left: -2rem;
    top: 0.35rem;
  }

  .apart {
    margin-top: 2.5rem;
    padding: 0 0 0 2rem;
  }

  .stop.alone::before {
    left: -1.95rem;
    top: 0.3rem;
  }

  .company {
    grid-template-columns: 1fr;
  }

  .site-header nav {
    margin-left: 0;
    order: 3;
    width: 100%;
  }

  .theme-toggle {
    margin-left: auto;
  }

  .footer-links {
    margin-left: 0;
  }
}

@keyframes draw-down {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

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

@media print {
  .site-header nav,
  .theme-toggle,
  .skip {
    display: none;
  }
}
