/* Colours from brand/theme.toml. Turquoise is only 2.7:1 on white, so on white it is used for
   rules and numbers, never for small text. On deep blue it is 4.8:1 and fine for text. */
:root {
  --deep: #0a3443;
  --accent: #00abbf;
  --text: #262626;
  --muted: #595959;
  --line: #dfe5e8;
  --on-deep: #ffffff;
  --on-deep-muted: #b7c7cd;
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
}

@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/SourceSans3-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/SourceSans3-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/SourceSans3-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

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

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

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

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

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

/* Small uppercase section label with a short turquoise rule before it. */
.label {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--deep);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.label::before {
  content: "";
  width: 32px;
  height: 2px;
  background: var(--accent);
}
.label-on-dark { color: var(--accent); }

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

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: min(100svh, 860px);
  background-color: var(--deep);
  color: var(--on-deep);
}

/* The fine-line sunburst, centred on the lower-right corner so only its upper-left rays show,
   as on the "field" document cover. */
.hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: clamp(520px, 64vw, 940px);
  aspect-ratio: 1;
  transform: translate(50%, 50%);
  background: url("assets/sunburst-thin-turquoise.svg") center / contain no-repeat;
  opacity: 0.85;
  pointer-events: none;
}

/* On narrow screens the rays reach behind the text, so they are fainter there. */
@media (max-width: 759px) {
  .hero::after { opacity: 0.35; }
}

.hero-bar {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: clamp(24px, 4vw, 40px);
}

.logo img { width: clamp(120px, 14vw, 160px); }

.bar-link {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--on-deep);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.bar-link:hover { border-color: var(--accent); }

.hero-body {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: auto;
  padding-top: clamp(96px, 16vh, 180px);
  padding-bottom: clamp(64px, 12vh, 128px);
}

.kicker {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  max-width: 15em;
  font-size: clamp(2.5rem, 6vw, 4rem);
  text-wrap: balance;  /* even lines, no single word left on the last one */
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.015em;
}

/* The smallest phones need a smaller headline to avoid one-word lines. */
@media (max-width: 359px) {
  .hero h1 { font-size: 1.875rem; }
}

.lede {
  max-width: 38em;
  margin-top: 28px;
  color: var(--on-deep-muted);
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  font-weight: 300;
}

.button {
  display: inline-block;
  margin-top: 40px;
  padding: 14px 28px;
  border: 1.5px solid var(--accent);
  color: var(--on-deep);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.button:hover { background: var(--accent); color: var(--deep); }

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

.section { padding: clamp(80px, 12vw, 144px) 0; }
/* Two white sections in a row share one gap rather than doubling it. */
.section + .section { padding-top: 0; }

.section h2:not(.label),
.contact h2 {
  max-width: 18em;
  margin-top: 20px;
  font-size: clamp(2rem, 4vw, 2.875rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.section h2 { color: var(--deep); }

/* Services: 1, 2 or 3 columns. */
.cards {
  list-style: none;
  margin: clamp(32px, 4vw, 48px) 0 0;
  padding: 0;
  display: grid;
  gap: 48px clamp(32px, 4vw, 56px);
}
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, 1fr); } }
/* Exactly four services read better as two rows of two than as three and one. */
@media (min-width: 1000px) {
  .cards:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(2, 1fr); }
}

.cards li {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.group {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cards h3 {
  color: var(--deep);
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.3;
}

.cards h3 + p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1.0625rem;
}

/* About: label on the left, text on the right. */
.about { display: grid; gap: 20px; align-items: start; }
@media (min-width: 760px) {
  .about { grid-template-columns: 1fr 3fr; gap: 48px; }
  .about .label { margin-top: 0.7em; }
}

.headshot {
  width: 100%;
  max-width: 160px;
  margin-top: 24px;
  border-radius: 4px;
}
@media (min-width: 760px) { .headshot { max-width: 220px; } }

.about-lead {
  max-width: 30em;
  color: var(--deep);
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  font-weight: 300;
  line-height: 1.45;
}
/* Credentials: one per paragraph, close together, so a wrapped one still reads as one. */
.credential + .credential { margin-top: 6px; }

.about-body {
  max-width: 36em;
  margin-top: 24px;
  color: var(--muted);
}

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

.contact {
  background: var(--deep);
  color: var(--on-deep);
  padding-top: clamp(80px, 11vw, 128px);
}

.contact-grid {
  display: grid;
  gap: 40px;
}

@media (min-width: 760px) {
  .contact-grid {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }
}

.contact h2 { max-width: 13em; }

address {
  font-style: normal;
  font-size: 1.0625rem;
  line-height: 1.8;
}
address .name { font-weight: 600; font-size: 1.1875rem; margin-bottom: 12px; }
address .post-nominals {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--on-deep-muted);
}

.contact-intro {
  margin-top: 16px;
  color: var(--on-deep-muted);
  font-size: 1.1875rem;
}
address a {
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 171, 191, 0.6);
  transition: border-color 0.2s, color 0.2s;
}
address a:hover { color: var(--accent); border-color: var(--accent); }

.legal {
  position: relative;
  margin-top: clamp(64px, 9vw, 112px);
  padding-top: 24px;
  padding-bottom: 32px;
  color: var(--on-deep-muted);
  font-size: 0.875rem;
}
/* A border on .legal would span the gutters too, so the rule is drawn inside them instead. */
.legal::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

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