/* O3 Diversified - site styles.
   All colours are tokens on :root. Light is the default; dark comes from prefers-color-scheme.
   Palette: Ink Navy #14213D, Ozone #4FC3F7, Deep Ozone #0F6F96, Mist #F4F6FA, Slate #4A5571, Night #0B1120. */

:root {
  color-scheme: light dark;

  /* named palette */
  --ink: #14213D;
  --ozone: #4FC3F7;
  --ozone-deep: #0F6F96;
  --mist: #F4F6FA;
  --slate: #4A5571;
  --night: #0B1120;

  /* light theme roles */
  --bg: var(--mist);
  --surface: #FFFFFF;
  --text: var(--ink);
  --text-soft: var(--slate);
  --rule: #D8DEE8;
  --rule-strong: #7D8AA3;
  --accent-text: var(--ozone-deep);
  --link: var(--ozone-deep);
  --focus: var(--ozone-deep);
  --btn-bg: var(--ink);
  --btn-text: #FFFFFF;
  --glyph-bg: var(--ink);
  --glyph-fg: var(--ozone);
  --glyph-ring: transparent;
  --shadow: 0 1px 2px rgba(20, 33, 61, 0.06), 0 10px 28px -16px rgba(20, 33, 61, 0.28);

  /* the navy band (structure card + contact) - same in both themes */
  --band-bg: var(--ink);
  --band-text: #E8EEF7;
  --band-soft: #A9B6CC;
  --band-line: #3A4B70;
  --band-edge: transparent;

  --font-display: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 72rem;
  --gutter: 16px;
  --radius: 14px;
  --tap: 44px;              /* minimum touch-target size */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--night);
    --surface: #111A2E;
    --text: #E6ECF5;
    --text-soft: #A3B0C6;
    --rule: #24304A;
    --rule-strong: #55678A;
    --accent-text: var(--ozone);
    --link: var(--ozone);
    --focus: var(--ozone);
    --btn-bg: var(--ozone);
    --btn-text: var(--night);
    --glyph-bg: rgba(79, 195, 247, 0.12);
    --glyph-fg: var(--ozone);
    --glyph-ring: rgba(79, 195, 247, 0.28);
    --shadow: none;
    --band-edge: #24304A;
  }
}

@media (min-width: 48em) {
  :root { --gutter: 32px; }
}

/* ---------- base ---------- */

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* flex column so the footer sits at the bottom of short pages (404) instead of leaving a blank strip */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;   /* only breaks a word that would otherwise overflow (e.g. fonts.googleapis.com at 200% text) */
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

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

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;   /* long addresses wrap instead of pushing the page sideways at large text sizes */
}
a:hover { text-decoration-thickness: 2px; }

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

::selection { background: var(--ozone); color: var(--ink); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}

.nb { white-space: nowrap; }   /* keeps "small-batch", "made-to-order" from splitting at the hyphen */

/* An address inside a sentence. As an inline-block it moves to the next line whole when it does not fit,
   and breaks at its <wbr> hints (before the "@" or a dot) only when it is wider than the whole line - large
   text on phones. Trailing punctuation sits inside, so it never starts a line on its own. */
.addr { display: inline-block; max-width: 100%; }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -120px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-family: var(--font-display);
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* ---------- header ---------- */

.site-header { border-bottom: 1px solid var(--rule); }

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 28px;
  padding-block: 13px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  border-radius: 6px;
}
.site-logo img { width: 222px; height: auto; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  min-width: var(--tap);
  padding: 10px 0;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent-text); text-decoration: underline; }

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

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn--solid { background: var(--btn-bg); color: var(--btn-text); }
.btn--solid:hover { text-decoration: underline; }
.btn--ghost { border-color: var(--rule-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--text); }
.btn--band { background: var(--ozone); color: var(--night); }   /* on the navy band, both themes */
.btn--band:hover { text-decoration: underline; }

/* ---------- hero ---------- */

.hero { padding-block: 44px 56px; }

/* minmax(0, 1fr): single-column grids may shrink below their content's min width (no sideways scroll at large text) */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }

/* The h1 is one sentence: the main clause large, the "spanning ..." clause as a smaller second line
   of the same heading, so the sentence stays intact for screen readers and search. */
.hero h1 {
  max-width: 18ch;
  font-size: clamp(2.05rem, 1.35rem + 3vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.hero__more {
  display: block;
  max-width: 30rem;
  margin-top: 0.6em;
  font-size: clamp(1.1875rem, 1rem + 0.8vw, 1.5rem);
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--accent-text);
}

.lede {
  max-width: 36rem;
  margin: 24px 0 0;
  font-size: 1.125rem;
  color: var(--text-soft);
  text-wrap: pretty;
}

/* focus-areas chart: a right-hand illustration beside the hero text. Below 60em the hero is one column
   and the chart would only repeat the What we do cards that follow, so it is not shown there. */
.structure {
  max-width: 32rem;
  margin: 0;
  padding: 26px 24px 18px;
  border: 1px solid var(--band-edge);
  border-radius: var(--radius);
  background: var(--band-bg);
  color: var(--band-text);
}

.structure__cap {
  margin-bottom: 20px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--band-soft);
}

/* at very large text the mark wraps above the name, and the name breaks only between its words */
.structure__root {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.0625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.structure__root svg { width: 50px; height: 40px; flex: none; }
.structure__root span { min-width: 0; overflow-wrap: break-word; }

.structure__list {
  margin: 0;
  padding: 0 0 0 19px;
  list-style: none;
}

/* Branch + atom line up with the first line of each area name (it may wrap at large text sizes):
   item top padding 11px + half of the name's 1.3 line-height (0.65em). */
.structure__list li {
  --name-mid: calc(11px + 0.65em);
  position: relative;
  padding: 11px 0 11px 32px;
}

.structure__list li::before {          /* trunk */
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-left: 2px solid var(--band-line);
}
.structure__list li:last-child::before { bottom: auto; height: var(--name-mid); }

.structure__list li::after {           /* branch */
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--name-mid) - 1px);
  width: 20px;
  border-top: 2px solid var(--band-line);
}

.structure__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.3;
}
.structure__name::before {             /* the atom at the end of each branch (positioned on the li) */
  content: "";
  position: absolute;
  left: 17px;
  top: var(--name-mid);
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--ozone);
}

@media (max-width: 59.99em) {
  .structure { display: none; }
}

@media (min-width: 60em) {
  .hero { padding-block: 88px 100px; }
  .hero .wrap {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: center;
    gap: 64px;
  }
  .structure { justify-self: end; width: 100%; }
}

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

.section { padding-block: 64px; }
.section--rule { border-top: 1px solid var(--rule); }

.section-head { max-width: 44rem; margin-bottom: 36px; }

.section h2,
.band h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.section-intro { margin: 14px 0 0; color: var(--text-soft); text-wrap: pretty; }

@media (min-width: 60em) {
  .section { padding-block: 96px; }
}

/* ---------- what we do: three area cards ---------- */

.area-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 24px 28px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.area__glyph {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--glyph-bg);
  box-shadow: inset 0 0 0 1px var(--glyph-ring);
  color: var(--glyph-fg);
}
.area__glyph svg { width: 28px; height: 28px; }

/* "pretty", not the headings' "balance": balance narrows the line box, and the body's break-word then
   split "Specialty" mid-word at 200% text */
.area__name { margin-top: 6px; font-size: 1.375rem; line-height: 1.2; text-wrap: pretty; }

.area__text { margin: 0; color: var(--text-soft); text-wrap: pretty; }

/* tablet: one card per row, icon beside the text (a single sentence across 700px looks lost) */
@media (min-width: 40em) and (max-width: 55.99em) {
  .area {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 22px;
    row-gap: 6px;
    align-items: start;
  }
  .area__glyph { grid-row: 1 / span 2; }
  .area__name { margin-top: 2px; }
}

@media (min-width: 56em) {
  .area-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}

/* ---------- about ---------- */

.about { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }

.about__body { max-width: 38rem; }

.about__text {
  margin: 12px 0 0;
  font-size: 1.1875rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.about__owner {
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--text-soft);
  text-wrap: pretty;
}

@media (min-width: 60em) {
  .about {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 64px;
    align-items: start;
  }
  /* line the paragraph up with the heading, not the eyebrow above it */
  .about__body { margin-top: calc(0.8125rem * 1.4 + 14px); }
  .about__text { margin-top: 0; }
}

/* ---------- contact band ---------- */

.band {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--band-edge);
  background: var(--band-bg);
  color: var(--band-text);
}

.band .eyebrow { color: var(--ozone); }
.band :focus-visible { outline-color: var(--ozone); }

.contact .wrap { padding-block: 64px 72px; }

.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 44px; }

/* :not(.eyebrow) - the eyebrow keeps its own spacing (0 above, 14px below), like the other sections */
.contact p:not(.eyebrow) { max-width: 36rem; margin: 14px 0 0; color: var(--band-soft); text-wrap: pretty; }

.contact__email {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  margin-top: 22px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 1rem + 3.2vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ozone);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact__email:hover { text-decoration: underline; }

.contact__actions { margin-top: 24px; }

.contact__topics { max-width: 34rem; }

.contact__topics h3 {
  font-size: 0.78rem;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--band-soft);
}

.contact__topics ul { margin: 8px 0 0; padding: 0; list-style: none; }

.contact__topics li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--band-line);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.45;
  color: var(--band-text);
}
.contact__topics li:last-child { border-bottom: 0; padding-bottom: 0; }
.contact__topics li::before {          /* ozone atom, centred on the first line */
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: calc(0.725em - 4px);
  border-radius: 50%;
  background: var(--ozone);
}
.contact__topics li > span { min-width: 0; }

@media (min-width: 60em) {
  .contact .wrap { padding-block: 88px 96px; }
  .contact__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 64px;
    align-items: center;
  }
}

/* ---------- prose pages (privacy, 404) ---------- */

.page-head { padding-block: 48px 8px; }
.page-head h1 {
  font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.page-meta { margin: 12px 0 0; color: var(--text-soft); font-size: 0.9375rem; }

.legal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 24px 72px; }

.glance {
  align-self: start;
  padding: 20px 22px 22px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.glance h2 {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.glance ul { margin: 10px 0 0; padding: 0; list-style: none; }
.glance li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  line-height: 1.45;
}
.glance li:last-child { border-bottom: 0; padding-bottom: 0; }
.glance li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 0.5em;
  border-radius: 50%;
  background: var(--ozone);
}

.prose { max-width: 42rem; min-width: 0; }
.prose h2 { margin: 40px 0 0; font-size: 1.375rem; line-height: 1.25; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 12px 0 0; text-wrap: pretty; }
.prose ul { margin: 12px 0 0; padding-left: 1.25em; }
.prose li { margin: 6px 0; }

@media (min-width: 60em) {
  .page-head { padding-block: 72px 8px; }
  .legal {
    grid-template-columns: minmax(0, 1fr) 18rem;
    gap: 64px;
    padding-block: 32px 112px;
  }
  .glance { order: 2; position: sticky; top: 24px; }
}

/* 404: the page is short, so centre it in the space between header and footer */
main:has(> .notfound) { display: flex; flex-direction: column; justify-content: center; }
.notfound {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  padding-block: 56px 88px;
  align-items: center;
}
.notfound h1 {
  max-width: 14ch;
  font-size: clamp(2.15rem, 1.4rem + 3.6vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.notfound .lede { margin-top: 20px; }
.notfound__mark { width: 132px; color: var(--rule-strong); }

@media (min-width: 60em) {
  .notfound { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); padding-block: 112px 140px; }
  .notfound__mark { justify-self: end; width: 300px; }
}

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

.site-footer {
  padding-block: 44px 52px;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--text-soft);
}

.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }

.footer-logo { width: 176px; height: auto; margin-bottom: 18px; }

.site-footer p { margin: 8px 0 0; }

.footer-h {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}

/* every footer link is a 44px-tall row */
.site-footer ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.site-footer li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.35em;
  min-height: var(--tap);
}
.site-footer li a,
.site-footer p a {
  display: inline-flex;
  align-items: center;
  min-width: var(--tap);
  min-height: var(--tap);
}
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--accent-text); }

/* two columns: company block + Company links. From 60em the links column starts on the same line as the
   hero's structure chart and the contact band's topics (same 7fr / 5fr split and 64px gap). */
@media (min-width: 48em) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; }
}
@media (min-width: 60em) {
  .footer-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 64px; }
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
