:root {
  --bg: #f6f5f1;
  --ink: #16191d;
  --muted: #565c63;
  --rule: #d9d5ca;
  --accent: #1c5866;
  --accent-ink: #ffffff;
  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111416;
    --ink: #e8e6e0;
    --muted: #9ba2a8;
    --rule: #2a3035;
    --accent: #86c5d2;
    --accent-ink: #0d1214;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
}

p { margin: 0; text-wrap: pretty; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

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

.skip { position: absolute; left: -999px; }
.skip:focus {
  left: var(--gutter);
  top: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--bg);
}

/* Header */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1.5rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.9rem + 1vw, 1.25rem);
  color: var(--ink);
  text-decoration: none;
}
.wordmark span { color: var(--muted); }

.header-link { color: var(--ink); font-size: 0.9375rem; }

/* Hero */

/* Same two columns as the sections below: the logo sits in the label column, facing the text */
.hero {
  display: grid;
  gap: 1.5rem 3rem;
  align-items: center;
  padding-block: clamp(2rem, 8vw, 6rem) clamp(3rem, 8vw, 5.5rem);
}

.hero-logo {
  display: block;
  width: 8.5rem;
}
.hero-logo img {
  display: block;
  width: 100%;
  height: auto;
}

/* Logo motion: surfaces on load with two water ripples, hops on hover.
   The entrance runs on the img and the hover on the picture, so leaving
   the hover never restarts the entrance. */

.hero-logo {
  position: relative;
  transform-origin: 40% 90%;
  transition: transform 450ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 300ms ease;
  /* Sit slightly back: on light, the white body takes the page colour and the ink softens */
  opacity: 0.85;
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .hero-logo { opacity: 0.8; mix-blend-mode: normal; }
}

.hero-logo img {
  animation: surface 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transform-origin: 40% 90%;
}

.hero-logo::before,
.hero-logo::after {
  content: "";
  position: absolute;
  left: 48%;
  bottom: -2%;
  width: 90%;
  aspect-ratio: 5 / 1;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: ripple 1400ms ease-out 450ms;
}
.hero-logo::after { animation-delay: 700ms; }

@keyframes surface {
  from { opacity: 0; transform: translateY(1.25rem) rotate(-6deg) scale(0.96); }
  60%  { opacity: 1; transform: translateY(-0.25rem) rotate(1.5deg); }
  to   { opacity: 1; transform: none; }
}

@keyframes ripple {
  from { opacity: 0.55; transform: translateX(-50%) scale(0.25); }
  to   { opacity: 0;    transform: translateX(-50%) scale(1.25); }
}

@media (hover: hover) {
  .hero-logo:hover { transform: translateY(-0.4rem) rotate(-5deg) scale(1.03); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo,
  .hero-logo img,
  .hero-logo::before,
  .hero-logo::after { animation: none; transition: none; }
  .hero-logo:hover { transform: none; }
}

@media (min-width: 52rem) {
  .hero { grid-template-columns: 11rem 1fr; }
  .hero-logo { width: 100%; }
}

.eyebrow,
.label {
  font: 600 0.8125rem/1.4 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow { margin-bottom: 1.25rem; }

h1 {
  max-width: 21ch;
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 1.4rem + 4vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.lede {
  max-width: 36rem;
  margin-top: 1.75rem;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  color: var(--muted);
}

.button {
  display: inline-block;
  margin-top: 2.25rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}
.button:hover { filter: brightness(1.12); }

/* Sections: label on the left, content on the right when there is room */

.section {
  display: grid;
  gap: 1.25rem 3rem;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--rule);
}

@media (min-width: 52rem) {
  .section { grid-template-columns: 11rem 1fr; }
  .label { padding-top: 0.45rem; }
}

.label { margin: 0; }

h3 {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.25;
}

.items article + article { margin-top: 2rem; }
.items p { max-width: 38rem; }

.principles {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: principle;
}
.principles li {
  position: relative;
  max-width: 38rem;
  padding-left: 2.5rem;
  counter-increment: principle;
}
.principles li + li { margin-top: 1.25rem; }
.principles li::before {
  content: counter(principle, decimal-leading-zero);
  position: absolute;
  left: 0;
  font: 600 0.8125rem/1.7rem var(--sans);
  letter-spacing: 0.05em;
  color: var(--accent);
}

.contact-lede {
  max-width: 30ch;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  line-height: 1.25;
}

.email {
  margin-top: 1.5rem;
  font-size: clamp(1.0625rem, 0.95rem + 0.6vw, 1.25rem);
  overflow-wrap: anywhere;
}

.note { margin-top: 0.5rem; color: var(--muted); }

/* Footer: the rule sits on an inner box so it lines up with the section rules */

.site-footer span { white-space: nowrap; }

.site-footer {
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--muted);
}
