/* Rachel Earley — rachelearley.com
   Simple, black and white, Helvetica Neue. Light and dark themes via tokens. */

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #6b6b6b;
  --rule: #e4e4e4;
  --accent: #e0472b;   /* the one accent colour: change it here */
  --surface: #f4f1ec;  /* tinted band behind header, intro and footer */
  color-scheme: light;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Space Mono", "Courier New", monospace;  /* headline font: change it here */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0f;
    --text: #f0f0f0;
    --muted: #9a9a9a;
    --rule: #2a2a2a;
    --accent: hsl(323.06, 100%, 50%);
    --surface: #1b1a19;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f0f0f;
  --text: #f0f0f0;
  --muted: #9a9a9a;
  --rule: #2a2a2a;
  --accent: hsl(323.06, 100%, 50%);
  --surface: #1b1a19;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; text-decoration-color: var(--accent); }

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--text); color: var(--bg); padding: 8px 12px;
}
.skip-link:focus { left: 16px; top: 16px; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Full-width tinted band from inside the centred column */
.band {
  background: var(--surface);
  box-shadow: 0 0 0 100vmax var(--surface);
  clip-path: inset(0 -100vmax);
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 32px;
  padding-bottom: 32px;
}
.site-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 16px;
}
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--rule); border-radius: 50%;
  background: transparent; color: var(--text); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Type */
main { padding-bottom: 64px; }

.intro {
  padding: 56px 0 48px;
}
.intro h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.6vw, 42px);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.03em;
  margin: 0 0 28px;
}
.intro p { margin: 0 0 16px; max-width: 640px; }
.lede { font-size: 20px; }

.facts {
  list-style: none;
  margin: 0;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px 24px;
  font-size: 15px;
  color: var(--muted);
}
.facts.band { border-bottom: 0; padding-bottom: 48px; margin-bottom: 24px; }
.intro.band + .facts.band { margin-top: 0; }
.intro.band:not(:has(+ .facts)) { margin-bottom: 24px; }
.facts strong {
  display: block;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

section { padding: 40px 0 8px; }

.label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}
.label::before { content: "/// "; color: var(--accent); font-weight: 700; letter-spacing: 0; }

section p { margin: 0 0 16px; }

h2 { font-family: var(--font-display); font-size: 23px; font-weight: 700; line-height: 1.3; letter-spacing: -0.03em; margin: 0 0 8px; }

.muted { color: var(--muted); }

/* Photo */
figure { margin: 40px 0 0; }
figure img, .photo-placeholder {
  display: block;
  width: 100%;
  border-radius: 4px;
}
.photo-placeholder {
  aspect-ratio: 3 / 2;
  background: var(--surface);
  border: 1px dashed var(--rule);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 15px; text-align: center; padding: 16px;
}
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* Personal: small round photo beside the text */
.personal {
  display: flex;
  align-items: center;
  gap: 24px;
}
.personal p { margin: 0; }
.avatar {
  flex: none;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 55% 40%;
}
@media (max-width: 560px) {
  .personal { flex-direction: column; align-items: flex-start; gap: 16px; }
  .avatar { width: 112px; height: 112px; }
}

/* Lists (focus areas) */
.focus {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 24px;
}
.focus li { padding: 10px 0; border-bottom: 1px solid var(--rule); }

/* Projects */
.project {
  padding: 40px 0;
  border-top: 1px solid var(--rule);
}
.project:first-of-type { border-top: 0; }
.project .kicker { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.project h2 { margin-bottom: 4px; }
.project .sub { color: var(--muted); margin: 0 0 16px; }
.project .results {
  list-style: none; margin: 16px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.project .results li {
  font-size: 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 4px 12px;
}
.project figure { margin-top: 24px; }
.project figure img,
.project figure video { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 4px; }

/* Timeline lists (writing/speaking/awards) */
.entries { list-style: none; margin: 0; padding: 0; }
.entries li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.entries li:first-child { border-top: 1px solid var(--rule); }
.entries .year { color: var(--muted); font-variant-numeric: tabular-nums; }
.entries .meta { display: block; color: var(--muted); font-size: 16px; }

/* Footer */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  padding-top: 32px; padding-bottom: 48px;
  font-size: 15px; color: var(--muted);
}
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

@media (max-width: 560px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .site-header { padding-top: 20px; padding-bottom: 12px; }
  .site-nav { gap: 16px; width: 100%; justify-content: space-between; }
  .intro { padding: 32px 0 36px; }
  .entries li { grid-template-columns: 52px 1fr; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}

h1, h2 { text-wrap: balance; }

/* Motion (all switched off for prefers-reduced-motion; see motion.js) */
.intro h1 .untyped { visibility: hidden; }
.intro h1 .cursor {
  display: inline-block;
  width: 0.55em;
  height: 0.9em;
  margin: 0 0.04em -0.08em;
  background: var(--accent);
  animation: blink 1s step-end infinite;
}
.intro h1 .cursor.done { animation: blink 1s step-end 3, fade-out .6s ease 3s forwards; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.will-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
}
.will-reveal.is-visible { opacity: 1; transform: none; }

.project figure { overflow: hidden; border-radius: 4px; }
.project figure img,
.project figure video { transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.project:hover figure img,
.project:hover figure video { transform: scale(1.015); }

@media (prefers-reduced-motion: reduce) {
  .will-reveal { opacity: 1; transform: none; transition: none; }
  .project figure img, .project figure video { transition: none; }
  .project:hover figure img, .project:hover figure video { transform: none; }
}

.accent { color: var(--accent); }

/* Case study pages */
.case-intro .kicker { font-size: 14px; color: var(--muted); margin: 0 0 20px; }
.case-intro .kicker a { color: var(--muted); }
.snapshot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px 24px;
  margin: 32px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.snapshot dt {
  font-family: var(--font-display);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--muted); margin-bottom: 4px;
}
.snapshot dd { margin: 0; font-size: 16px; line-height: 1.45; }

.compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin: 28px 0;
}
.compare > div { background: var(--surface); border-radius: 6px; padding: 20px 22px; }
.compare > div:last-child { box-shadow: inset 3px 0 0 var(--accent); }
.compare-head { font-family: var(--font-display); font-weight: 700; margin: 0 0 10px; }
.compare ul { margin: 0; padding-left: 18px; font-size: 16px; }
.compare li { margin-bottom: 8px; }

.stakeholders li strong { display: block; font-weight: 500; }
.stakeholders li { font-size: 16px; color: var(--muted); }
.stakeholders li strong { color: var(--text); font-size: 18px; margin-bottom: 2px; }

.decision { padding: 28px 0; border-top: 1px solid var(--rule); }
.decision:first-of-type { border-top: 0; padding-top: 4px; }
.decision-num { font-family: var(--font-display); font-size: 13px; color: var(--accent); margin: 0 0 6px; }
.tradeoff {
  display: inline-block; margin-top: 4px;
  font-size: 16px; padding: 10px 14px; border-radius: 6px; background: var(--surface);
}
.tradeoff span {
  font-family: var(--font-display); font-size: 12px; text-transform: uppercase;
  color: var(--accent); margin-right: 8px;
}

.pipeline {
  list-style: none; margin: 24px 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  counter-reset: step;
}
.pipeline li {
  font-family: var(--font-display); font-size: 14px;
  border: 1px solid var(--text); border-radius: 4px; padding: 8px 12px;
  position: relative;
}
.pipeline li:not(:last-child)::after {
  content: "\2192"; position: absolute; right: -14px; top: 50%;
  transform: translate(50%, -50%); color: var(--accent);
}
.pipeline li:not(:last-child) { margin-right: 18px; }

.nda-note {
  margin: 40px 0 0; padding: 20px 22px; border-radius: 6px;
  border: 1px dashed var(--rule); color: var(--muted); font-size: 16px;
}
.nda-note p { margin: 0; }
.back-link { margin: 32px 0 0; font-family: var(--font-display); font-size: 15px; }

.case-link { margin: 16px 0 0; font-family: var(--font-display); font-size: 15px; }
.case-link a { text-decoration-color: var(--accent); }

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

/* Case study v2: short lines + diagrams */
.case-meta { font-family: var(--font-display); font-size: 13px; color: var(--muted); margin-top: 20px; }
.big-line {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 26px); line-height: 1.35; letter-spacing: -0.02em;
  margin: 0 0 20px; text-wrap: balance;
}

.diagram { margin: 24px 0 0; background: var(--surface); border-radius: 8px; padding: 18px 18px 12px; position: relative; }
.diagram svg { display: block; width: 100%; height: auto; overflow: visible; }
.diagram-tag {
  font-family: var(--font-display); font-size: 12px; text-transform: uppercase;
  margin: 0 0 10px; color: var(--muted);
}
.diagram-after .diagram-tag { color: var(--accent); }
.diagram-after { box-shadow: inset 0 0 0 1.5px var(--accent); }
.diagram-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.diagram-pair .diagram { margin-top: 8px; }
.diagram-map { max-width: 620px; margin-left: auto; margin-right: auto; }

.dg-frame { fill: var(--bg); stroke: var(--text); stroke-width: 1.3; }
.dg-block { fill: var(--muted); opacity: .35; }
.dg-block2 { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 3 2; }
.dg-accent { fill: var(--accent); }
.dg-link { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 3 3; }
.dg-layer { fill: var(--bg); stroke: var(--text); stroke-width: 1.3; }
.dg-layer-accent { fill: var(--accent); stroke: var(--accent); }
.dg-layer-t { font-family: var(--font-display); font-size: 11px; letter-spacing: .06em; fill: var(--text); }
.dg-layer-t-accent { fill: var(--bg); font-weight: 700; }
.dg-label { font-family: var(--font-display); font-size: 10.5px; letter-spacing: .04em; fill: var(--muted); }
.dg-hub { fill: var(--accent); }
.dg-hub-t { font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .04em; fill: var(--bg); }
.dg-node { fill: var(--bg); stroke: var(--text); stroke-width: 1.2; }
.dg-node-t { font-family: var(--font-display); font-size: 12px; fill: var(--text); }

.decisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.decision-card {
  border: 1px solid var(--rule); border-radius: 8px; padding: 20px;
  display: flex; flex-direction: column;
}
.decision-card:first-child { border-color: var(--accent); }
.decision-card h2 { font-size: 19px; margin-bottom: 10px; }
.decision-card p { font-size: 16px; margin: 0 0 14px; }
.decision-card .tradeoff { margin-top: auto; margin-bottom: 0; font-size: 14px; padding: 8px 10px; }
.decision-card .tradeoff span { display: block; margin-bottom: 2px; }

@media (max-width: 640px) {
  .diagram-pair { grid-template-columns: 1fr; }
}

.case-hero { margin: 0 0 28px; }
.case-hero img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 8px; }

/* ===== Platform-style diagrams (case study): echoes the AI platform's own design ===== */
.ds {
  --ds-bg: #fbfaf7;
  --ds-grid: rgba(30, 40, 50, .045);
  --ds-card: #ffffff;
  --ds-border: #ebe9e4;
  --ds-ink: #1d2433;
  --ds-sub: #5f6878;
  --ds-teal: #4f9d96;
  --ds-teal-soft: #e6f2f0;
  --ds-gold: #b59c55;
  --ds-chip: #f1f0ec;
  --ds-bar: #e4e2dc;
  --ds-gate: #1d2433;
  --ds-shadow: rgba(25, 35, 50, .10);
  font-family: "Inter", var(--font-body);
  color: var(--ds-ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ds {
    --ds-bg: #131616; --ds-grid: rgba(255,255,255,.045); --ds-card: #1c2121; --ds-border: #2b3232;
    --ds-ink: #eef1f1; --ds-sub: #9ba6a6; --ds-teal: #6cc0b7; --ds-teal-soft: rgba(108,192,183,.15);
    --ds-gold: #d4b86c; --ds-chip: #262c2c; --ds-bar: #2f3636; --ds-gate: #0b0d0d; --ds-shadow: rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] .ds {
  --ds-bg: #131616; --ds-grid: rgba(255,255,255,.045); --ds-card: #1c2121; --ds-border: #2b3232;
  --ds-ink: #eef1f1; --ds-sub: #9ba6a6; --ds-teal: #6cc0b7; --ds-teal-soft: rgba(108,192,183,.15);
  --ds-gold: #d4b86c; --ds-chip: #262c2c; --ds-bar: #2f3636; --ds-gate: #0b0d0d; --ds-shadow: rgba(0,0,0,.5);
}

.ds-panel {
  margin: 24px 0 0; padding: 28px; border-radius: 16px;
  border: 1px solid var(--ds-border);
  background-color: var(--ds-bg);
  background-image:
    linear-gradient(var(--ds-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--ds-grid) 1px, transparent 1px);
  background-size: 36px 36px;
}
.ds-eyebrow {
  margin: 0 0 14px; font-size: 12px; font-weight: 500;
  letter-spacing: .3em; text-transform: uppercase; color: var(--ds-teal);
}
.ds-eyebrow-muted { color: var(--ds-sub); }
.ds figcaption { font-size: 13px; color: var(--ds-sub); margin-top: 10px; }

/* Before / after */
.ds-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.ds-pair figure { margin: 0; }
.ds-pair svg { display: block; width: 100%; height: auto; overflow: visible; }
.ds-card-r { fill: var(--ds-card); stroke: var(--ds-border); stroke-width: 1; }
.ds-shadow { flood-color: var(--ds-shadow); flood-opacity: 1; }
.ds-bar { fill: var(--ds-bar); }
.ds-bar-teal { fill: var(--ds-teal); }
.ds-bar-gold { fill: var(--ds-gold); }
.ds-bar-outline { fill: none; stroke: var(--ds-sub); stroke-width: 1; stroke-dasharray: 3 2; opacity: .6; }
.ds-dot { fill: var(--ds-teal-soft); stroke: var(--ds-teal); stroke-width: 1; }
.ds-link { stroke: var(--ds-teal); stroke-width: 1.1; stroke-dasharray: 3 3; }
.ds-layer-t { font-family: "Inter", var(--font-body); font-size: 10.5px; font-weight: 500; fill: var(--ds-ink); }
.ds-layer-t-inv { fill: #fff; }
.ds-stop-teal { stop-color: var(--ds-teal); }
.ds-stop-gold { stop-color: var(--ds-gold); }

/* Ring layouts: stakeholder map and "one library" cycle */
.ds-ring {
  position: relative; display: grid; gap: 22px 14px; align-items: center;
  grid-template-columns: 1fr minmax(120px, .8fr) 1fr;
  padding: 8px 0;
}
.ds-ring-5 { grid-template-areas: ". a ." "e hub b" "d . c"; }
.ds-ring-4 { grid-template-areas: ". a ." "e hub b" ". c ."; }
.ds-ring ul { display: contents; list-style: none; }
.ds-ring-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ds-ring-line ellipse { fill: none; stroke: var(--ds-teal); stroke-width: 1.2; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; opacity: .7; }
.ds-hub {
  position: relative; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--ds-border); background: var(--ds-bg);
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.ds-grad {
  font-size: clamp(22px, 3.4vw, 32px); font-weight: 300; line-height: 1.05;
  background: linear-gradient(100deg, var(--ds-teal), var(--ds-gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ds-node {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  background: var(--ds-card); border: 1px solid var(--ds-border); border-radius: 14px;
  padding: 14px 16px; box-shadow: 0 10px 28px -12px var(--ds-shadow);
}
.ds-node strong { display: block; font-weight: 500; font-size: 15px; line-height: 1.3; }
.ds-node span span { display: block; font-size: 13px; line-height: 1.4; color: var(--ds-sub); margin-top: 3px; }
.ds-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ds-teal-soft); color: var(--ds-teal);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.ds-icon {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  background: var(--ds-teal-soft); color: var(--ds-teal);
  display: inline-flex; align-items: center; justify-content: center;
}
.ds-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Decision steps */
.ds-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.ds-step {
  position: relative; display: flex; flex-direction: column;
  background: var(--ds-card); border: 1px solid var(--ds-border); border-radius: 16px;
  padding: 20px; box-shadow: 0 12px 30px -14px var(--ds-shadow);
}
.ds-step:not(:last-child)::after {
  content: "\2192"; position: absolute; top: 26px; right: -22px;
  color: var(--ds-teal); font-size: 16px;
}
.ds-step-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.ds-step-num { color: var(--ds-teal); font-size: 14px; letter-spacing: .08em; }
.ds-step h2 {
  font-family: "Inter", var(--font-body); font-weight: 400; font-size: 20px;
  letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 10px;
}
.ds-step p { font-size: 15px; line-height: 1.5; color: var(--ds-sub); margin: 0 0 16px; }
.ds-chips { margin-top: auto !important; margin-bottom: 0 !important; display: flex; flex-wrap: wrap; gap: 6px; }
.ds-chip { font-size: 12px; color: var(--ds-sub); background: var(--ds-chip); border-radius: 7px; padding: 4px 9px; }
.ds-gate { font-size: 12px; color: #fff; background: var(--ds-gate); border-radius: 7px; padding: 4px 9px; }
.ds-gate b { color: #e3c06a; font-weight: 500; margin-right: 4px; }

@media (max-width: 680px) {
  .ds-panel { padding: 20px 16px; }
  .ds-pair { grid-template-columns: 1fr; }
  .ds-steps { grid-template-columns: 1fr; gap: 22px; }
  .ds-step:not(:last-child)::after { content: "\2193"; top: auto; bottom: -21px; right: auto; left: 28px; }
  .ds-ring { grid-template-columns: 1fr; grid-template-areas: none; gap: 10px; }
  .ds-ring .ds-node, .ds-ring .ds-hub { grid-area: auto !important; }
  .ds-ring-line { display: none; }
  .ds-hub { width: 130px; justify-self: center; margin-bottom: 6px; }
}


/* Diagrams sit in the reading column: tighten spacing to fit */
.ds-panel { padding: 22px; }
.ds-steps { gap: 24px; }
.ds-step { padding: 18px 16px; }
.ds-step:not(:last-child)::after { right: -19px; }
.ds-gate, .ds-chip { font-size: 11.5px; white-space: nowrap; }
.ds-ring { gap: 18px 10px; }

.context { max-width: 660px; color: var(--text); }
.context + .ds-panel { margin-top: 28px; }

/* ===== Navigation: inline links on desktop, hamburger menu at 767px and below ===== */
.menu { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.menu a { text-decoration: none; color: var(--muted); }
.menu a:hover, .menu a[aria-current="page"] { color: var(--text); }
.menu a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--rule); border-radius: 50%;
  background: transparent; color: var(--text); cursor: pointer;
}
.menu-toggle:hover { border-color: var(--accent); color: var(--accent); }
.menu-bars { position: relative; width: 16px; height: 12px; }
.menu-bars span {
  position: absolute; left: 0; width: 100%; height: 1.75px; border-radius: 2px;
  background: currentColor; transition: transform .25s ease, opacity .2s ease, top .25s ease;
}
.menu-bars span:nth-child(1) { top: 0; }
.menu-bars span:nth-child(2) { top: 5px; }
.menu-bars span:nth-child(3) { top: 10px; }
.menu-toggle[aria-expanded="true"] .menu-bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

@media (max-width: 767px) {
  /* Header becomes a full-width bar so the dropdown can sit right under it */
  .site-header.band {
    position: relative; z-index: 30; max-width: none; flex-wrap: nowrap;
    box-shadow: none; clip-path: none; background: var(--surface);
    padding-top: 18px; padding-bottom: 18px;
  }
  .site-nav { width: auto; gap: 10px; justify-content: flex-end; }
  .theme-toggle { width: 40px; height: 40px; order: 2; }
  .menu-toggle { display: inline-flex; order: 3; }

  /* Without JS the links simply wrap; with JS they become the dropdown */
  .js .menu {
    display: none; order: 1;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 4px 16px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .25);
  }
  .js .menu.is-open { display: flex; animation: menu-in .22s ease; }
  .js .menu li + li { border-top: 1px solid var(--rule); }
  .js .menu a {
    display: block; padding: 16px 0;
    font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em;
    color: var(--text);
  }
  .js .menu a[aria-current="page"] { text-decoration: none; color: var(--accent); }
  .js .menu a[aria-current="page"]::before { content: "/// "; }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .menu-bars span { transition: none; }
  .js .menu.is-open { animation: none; }
}

/* ===== O2 / Three case study: real screens ===== */
.hero-mosaic {
  display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 10px;
  margin: 0 0 28px;
}
.hero-mosaic img {
  width: 100%; height: 260px; object-fit: cover; object-position: center top;
  border-radius: 8px; border: 1px solid var(--rule); background: #fff; display: block;
}
.hero-mosaic img:first-child { object-fit: contain; background: #0b0b0b; }

.estate {
  list-style: none; margin: 24px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
}
.estate li {
  border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px;
  font-size: 15px; color: var(--muted);
}
.estate li strong { display: block; font-family: var(--font-display); font-size: 15px; color: var(--text); margin-bottom: 4px; }
.estate-bar {
  margin: 10px 0 0 !important; padding: 12px 16px; border-radius: 8px;
  background: var(--accent); color: var(--bg); font-size: 15px;
}
.estate-bar span { font-family: var(--font-display); font-weight: 700; margin-right: 10px; }

.proof { padding: 48px 0 8px; border-top: 1px solid var(--rule); margin-top: 40px; }
.proof h2 { font-size: clamp(22px, 3vw, 28px); margin: 0 0 16px; }

.shots { display: grid; gap: 12px; margin: 24px 0; }
.shots-2 { grid-template-columns: 1fr 1fr; }
.shots img, .shot-wide img {
  display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--rule);
}
.shots-2 img { height: 320px; object-fit: cover; object-position: center top; }
.shot-wide { margin: 24px 0; }
.shot-wide figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }

.moves { list-style: none; margin: 8px 0 0; padding: 0; }
.moves li { padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 17px; }
.moves li:first-child { border-top: 1px solid var(--rule); }
.moves li strong { font-weight: 500; }
.moves li strong::before { content: "\2192\00a0"; color: var(--accent); font-family: var(--font-display); }

.proof-stats {
  list-style: none; margin: 24px 0 0; padding: 20px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px;
  background: var(--surface); border-radius: 8px;
  font-size: 14px; color: var(--muted);
}
.proof-stats strong {
  display: block; font-family: var(--font-display); font-size: 26px; font-weight: 700;
  letter-spacing: -0.03em; color: var(--text); line-height: 1.2;
}

.quote { margin: 24px 0 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); }
.quote p { font-family: var(--font-display); font-size: 17px; line-height: 1.5; margin: 0 0 8px; }
.quote cite { font-style: normal; font-size: 14px; color: var(--muted); }

@media (max-width: 640px) {
  .hero-mosaic { grid-template-columns: 1fr 1fr; }
  .hero-mosaic img { height: 200px; }
  .hero-mosaic img:last-child { grid-column: 1 / -1; }
  .shots-2 { grid-template-columns: 1fr; }
  .shots-2 img { height: auto; }
}

/* O2 / Three v2: managed columns + timeline */
.managed { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.managed li { border: 1px solid var(--rule); border-radius: 8px; padding: 18px; font-size: 15px; color: var(--muted); line-height: 1.5; }
.managed li strong { display: block; font-family: var(--font-display); font-size: 15px; color: var(--text); margin-bottom: 8px; }

.timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 28px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--rule); }
.phase {
  position: relative; display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; align-items: start;
  padding: 0 0 40px;
}
.phase::before {
  content: ""; position: absolute; left: -28px; top: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.phase-tag { font-family: var(--font-display); font-size: 13px; color: var(--accent); margin: 0 0 6px; }
.phase h2 { font-size: 22px; margin: 0 0 10px; }
.phase-text p { margin: 0 0 14px; font-size: 16px; }
.phase img { width: 100%; height: 220px; object-fit: cover; object-position: center top; border-radius: 8px; border: 1px solid var(--rule); display: block; }
.phase-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.phase-stats span { font-size: 13px; color: var(--muted); background: var(--surface); border-radius: 6px; padding: 6px 10px; }
.phase-stats b { font-family: var(--font-display); color: var(--text); font-size: 15px; margin-right: 4px; }

@media (max-width: 640px) {
  .managed { grid-template-columns: 1fr; }
  .phase { grid-template-columns: 1fr; gap: 14px; }
  .phase img { height: 200px; }
}

.phase-text-only { grid-template-columns: 1fr; }
.phase-text-only .phase-text { max-width: 620px; }

/* Work page: image leads each project so it reads with its own title */
.project { padding: 56px 0 48px; }
.project > figure:first-child { margin: 0 0 22px; }
