/* ------------------------------------------------------------------
   Design tokens
   Colour pairs below are chosen for a contrast ratio of 7:1+
   (WCAG 2.2 SC 1.4.6, level AAA) against their intended background.
   ------------------------------------------------------------------ */
:root {
  color-scheme: dark;
  --color-bg: #0f1117;
  --color-bg-alt: #171a21;
  --color-text: #f5e7a3;       /* pale yellow, ~15:1 on --color-bg */
  --color-text-soft: #d7dbe2;  /* ~14:1 on --color-bg */
  --color-accent: #7eb6ff;     /* ~9:1 on --color-bg */
  --color-border: #3a3f4a;
  --max-text-width: 65ch;
  --focus-color: var(--color-accent);

  /* Solid-button fill: yellow background with site-background-colour
     text. #0f1117 on #f5e7a3 is ~15.1:1, well above AAA's 7:1. */
  --color-button-bg: var(--color-text);
  --color-button-text: var(--color-bg);

  /* Border & text for transparent (outline) buttons. #181772 (the old
     light-theme value) is only ~1.3:1 against this dark background, so
     this uses the lighter accent colour instead. */
  --color-button-secondary: var(--color-accent);
}

/* ------------------------------------------------------------------
   Reset & base
   ------------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Inclusive Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

h1, h2, h3 {
  line-height: 1.25;
  color: var(--color-text);
}

h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); margin-top: 0; }
h3 { font-size: 1.15rem; }

p {
  max-width: var(--max-text-width);
  margin: 0 0 1.5em;
}

.section-lede {
  font-size: 1.1rem;
}

.container {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

section {
  padding-block: clamp(2.5rem, 2rem + 2vw, 4.5rem);
  border-bottom: 1px solid var(--color-border);
}

section:nth-of-type(even) {
  background: var(--color-bg-alt);
}

/* ------------------------------------------------------------------
   Links & focus
   ------------------------------------------------------------------ */
a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

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

a:focus,
button:focus,
input:focus,
[tabindex]:focus {
  outline: 3px solid var(--focus-color);
  outline-offset: 3px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus-color);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -8rem;
  transform: translateX(-50%);
  background: var(--color-button-bg);
  color: var(--color-button-text);
  padding: 0.75rem 1.25rem;
  border-radius: 0.25rem;
  text-decoration: none;
  transition: top 0.15s ease;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

/* ------------------------------------------------------------------
   Header & nav
   ------------------------------------------------------------------ */
header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.75rem;
}

.logo {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
}

.logo a {
  color: var(--color-text);
  text-decoration: none;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.75rem;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 0.25rem;
}

nav a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.4rem;
  border-radius: 0.35rem;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid transparent;
}

.button-primary {
  background: var(--color-button-bg);
  color: var(--color-button-text);
}

.button-primary:hover {
  text-decoration: underline;
}

.button-secondary {
  background: transparent;
  color: var(--color-button-secondary);
  border-color: var(--color-button-secondary);
}

.button-secondary:hover {
  text-decoration: underline;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

/* ------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------ */
.hero-lede {
  /* Avoids single-word orphan lines; unsupported browsers just wrap normally. */
  text-wrap: pretty;
}

.hero-inner {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero-figure {
  margin: 0;
  justify-self: start;
  width: 100%;
  max-width: 320px;
}

.hero-figure img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  clip-path: url(#tilted-oval);
}

@media (min-width: 56rem) {
  .hero-inner {
    grid-template-columns: 3fr 2fr;
  }

  .hero-figure {
    justify-self: end;
    max-width: 420px;
  }
}

/* ------------------------------------------------------------------
   Prose & lists
   ------------------------------------------------------------------ */
.prose {
  max-width: var(--max-text-width);
}

.plain-list {
  padding-left: 1.25rem;
}

.plain-list li {
  margin-bottom: 0.5rem;
}

/* ------------------------------------------------------------------
   Selected work
   ------------------------------------------------------------------ */
.work-item {
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.work-item:first-of-type {
  padding-top: 0;
  margin-top: 1.5rem;
  border-top: none;
}

.work-item h3 {
  margin-top: 0;
}

.work-figure {
  margin: 1.5rem 0 0;
  max-width: 100%;
}

.work-figure img {
  border: 1px solid var(--color-border);
  border-radius: 0.35rem;
}

.work-figure figcaption {
  margin-top: 0.6rem;
  color: var(--color-text-soft);
  font-size: 0.9rem;
  max-width: var(--max-text-width);
}

/* ------------------------------------------------------------------
   Case study pages (work/*.html)
   ------------------------------------------------------------------ */
.case-study-eyebrow {
  margin-bottom: 1.5rem;
}

.case-study-eyebrow a {
  font-size: 0.95rem;
}

.case-study-kicker {
  margin: 0 0 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  color: var(--color-text-soft);
}

/* ------------------------------------------------------------------
   Services cards
   ------------------------------------------------------------------ */
.card-grid {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

@media (min-width: 56rem) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.card h3 {
  margin-top: 0;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.card p {
  margin-bottom: 0;
  max-width: none;
}

/* ------------------------------------------------------------------
   Approach steps
   ------------------------------------------------------------------ */
.steps {
  margin: 2rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 1.5rem;
}

.steps > li {
  padding-left: 0.5rem;
}

.steps h3 {
  margin: 0 0 0.35rem;
}

.steps p {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
footer {
  padding-block: 2rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  color: var(--color-text-soft);
}

.footer-inner p {
  margin: 0;
  max-width: none;
}

/* ------------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
