:root {
  --ink: #1c2128;
  --paper: #f6f4ee;
  --paper-raised: #fbfaf6;
  --slate: #5b6472;
  --line: #d9d4c6;
  --signal: #a8431f;
  --signal-bright: #e0805a;
  --diff-add: #2f6f4f;
  --diff-remove: #a13d3d;
  --steel: #2b4a63;
  --steel-soft: #dde6ec;
  --umber: #2e2018;
  --umber-line: #4a3626;
  --sand: #b9a794;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
}

/* ================= NAV ================= */
.site-nav {
  border-bottom: 2px solid var(--signal);
  background: var(--umber);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem 1.6rem;
}
.site-nav-logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--paper);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-nav-links {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.site-nav-links a {
  color: var(--sand);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}
.site-nav-links a:hover { color: var(--paper); border-bottom-color: var(--umber-line); }
.site-nav-links a.current {
  color: var(--paper);
  border-bottom-color: var(--signal-bright);
}

@media (max-width: 640px) {
  .site-nav-inner { flex-direction: column; align-items: flex-start; }
}

/* ================= HERO (homepage) ================= */
.hero {
  position: relative;
  padding: 4.5rem 0 3.5rem;
  overflow: hidden;
}
.hero-content { position: relative; z-index: 1; max-width: 660px; }
.hero-statement {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.65rem, 4.2vw, 2.5rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 1.8rem;
}
.hero-scroll {
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--steel);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.hero-scroll:hover { border-bottom-color: var(--signal); color: var(--signal); }
.hero-motif {
  position: absolute;
  right: 0;
  top: 10px;
  width: 320px;
  height: auto;
  z-index: 0;
  opacity: 0.9;
}
@media (max-width: 780px) {
  .hero-motif { display: none; }
}

.case-header-wrap {
  position: relative;
  overflow: hidden;
}

/* ================= HERO PHOTO (homepage) ================= */
.hero-photo {
  margin: 0 0 3.5rem;
  padding: 1.2rem;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  text-align: center;
}
.hero-photo img {
  display: block;
  margin: 0 auto;
  max-height: 460px;
  width: auto;
  max-width: 100%;
  border-radius: 2px;
}
.hero-photo figcaption {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--slate);
  font-style: italic;
  margin-top: 1rem;
}

/* ================= FOCUS AREAS (homepage) ================= */
.focus-areas { padding: 1rem 0 3.5rem; }
.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.8rem 2rem;
}
.focus-item { border-top: 2px solid var(--steel); padding-top: 0.8rem; }
.focus-item h3 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.4rem;
  letter-spacing: -0.005em;
}
.focus-item p { color: var(--slate); font-size: 0.92rem; max-width: 40ch; margin: 0; }

/* ================= SHARED EYEBROW + META (hero & case-study header) ================= */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.3rem;
}
.case-header .eyebrow, .page > .eyebrow { margin-top: 2.6rem; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--signal); }

.meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--slate);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
}
.meta strong { color: var(--ink); font-weight: 600; }

/* ================= CASE-STUDY HEADER ================= */
.case-header h1 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.9rem;
}
.case-header .dek {
  font-size: 1.05rem;
  color: var(--slate);
  max-width: 56ch;
  margin: 0 0 1.4rem;
}

/* ================= ABOUT PAGE ================= */
.about-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: start;
  margin: 2.6rem 0 3rem;
}
.about-header h1 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin: 0;
}
@media (max-width: 640px) {
  .about-header { grid-template-columns: 1fr; }
}

.photo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--paper-raised);
  border: 1px dashed var(--line);
  color: var(--slate);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.about-header .photo-slot { aspect-ratio: 1 / 1; border-radius: 4px; }
.about-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  border-radius: 4px;
}

.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.6rem 1.8rem;
}
.interest-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.interest-card .photo-slot { aspect-ratio: 4 / 3; border: none; border-bottom: 1px solid var(--line); }
.interest-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}
.interest-card-body { padding: 1rem 1.1rem 1.2rem; }
.interest-card-label {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  margin: 0 0 0.35rem;
}
.interest-card-body p:last-child { color: var(--slate); font-size: 0.9rem; max-width: 34ch; margin: 0; }

/* ================= SECTION BLOCKS (§ layout) ================= */
section.block {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem 2.2rem;
  padding: 3rem 0;
  border-bottom: 1px solid var(--line);
}
section.block:last-of-type { border-bottom: none; }

@media (max-width: 640px) {
  section.block { grid-template-columns: 1fr; gap: 0.6rem; }
}

.block-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  position: sticky;
  top: 5.4rem;
  align-self: start;
}
.block-label .n {
  display: block;
  font-size: 0.68rem;
  color: var(--slate);
  margin-bottom: 0.3rem;
}

.block-content > p { margin: 0 0 1rem; max-width: 68ch; }
.block-content > p:last-child { margin-bottom: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.4rem; }
.chips-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 0.8rem; margin: 1rem 0 1.4rem; }
.chips-row .chips { margin: 0; }
.chips-label {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink);
}
.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--steel-soft);
  color: var(--steel);
  padding: 0.35rem 0.7rem;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

.decision {
  padding: 1rem 1.2rem;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--steel);
  border-radius: 2px;
  margin-bottom: 0.9rem;
}
.decision:last-child { margin-bottom: 0; }
.decision-label {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0 0 0.35rem;
}
.decision p { margin: 0; color: var(--slate); font-size: 0.95rem; max-width: 62ch; }

/* diff block */
.diff {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: #16191e;
  color: #d8dde3;
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0 0.6rem;
}
.diff-caption {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--slate);
  padding: 0.5rem 1rem 0;
  background: #16191e;
  opacity: 0.7;
}
.diff-line { padding: 0.45rem 1rem; white-space: pre; overflow-x: auto; }
.diff-line.remove { background: rgba(161,61,61,0.18); color: #e7a7a3; }
.diff-line.add { background: rgba(47,111,79,0.18); color: #a9d4b8; }
.diff-line .sym { opacity: 0.8; margin-right: 0.4em; }
.pivot { font-weight: 600; color: var(--ink); }

ul.actions {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  max-width: 62ch;
}
ul.actions li {
  position: relative;
  padding-left: 1.3rem;
  margin-bottom: 0.6rem;
  color: var(--ink);
}
ul.actions li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--signal);
  font-family: var(--mono);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-bottom: 1.2rem;
}
@media (max-width: 640px) {
  .results-grid { grid-template-columns: 1fr; }
}
.result { border-top: 2px solid var(--signal); padding-top: 0.7rem; }
.result .num {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.35rem;
  display: block;
  line-height: 1.25;
}
.result .label { font-size: 0.85rem; color: var(--slate); margin-top: 0.2rem; }

.note {
  font-size: 0.88rem;
  color: var(--slate);
  font-style: italic;
  border-left: 2px solid var(--line);
  padding-left: 0.8rem;
}

.diagram-wrap {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.4rem;
}
.diagram-caption {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--slate);
  margin-top: 0.8rem;
}

/* ================= CASE INDEX (homepage) ================= */
.index-heading {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 1.4rem;
  padding-top: 0.5rem;
}

.case-entry {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.8rem 0;
  border-top: 1px solid var(--line);
}
.case-entry:last-child { border-bottom: 1px solid var(--line); }

.case-entry-inner {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 1.6rem;
  align-items: start;
}
@media (max-width: 640px) {
  .case-entry-inner { grid-template-columns: 1fr; gap: 0.5rem; }
}

.case-num { font-family: var(--mono); font-size: 0.8rem; color: var(--slate); padding-top: 0.2rem; }

.case-body .case-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--signal);
  display: block;
  margin-bottom: 0.4rem;
}
.case-body h2 {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.005em;
}
.case-body p { color: var(--slate); font-size: 0.95rem; max-width: 56ch; margin: 0 0 0.7rem; }
.case-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.case-chip {
  font-family: var(--mono);
  font-size: 0.68rem;
  background: var(--steel-soft);
  color: var(--steel);
  padding: 0.25rem 0.55rem;
  border-radius: 3px;
}

.case-arrow {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--line);
  padding-top: 0.3rem;
  transition: color 0.15s ease, transform 0.15s ease;
}
.case-entry:hover .case-arrow { color: var(--signal); transform: translateX(3px); }
.case-entry:hover .case-body h2 { color: var(--signal); }

/* ================= FOOTER ================= */
.site-footer {
  margin-top: 4rem;
  border-top: 2px solid var(--signal);
  background: var(--umber);
}
.site-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem 1.6rem;
}
.site-footer-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--paper);
  letter-spacing: -0.01em;
}
.site-footer-links {
  display: flex;
  gap: 1.2rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.site-footer-links a { color: var(--sand); text-decoration: none; border-bottom: 1px solid var(--umber-line); }
.site-footer-links a:hover { color: var(--paper); border-bottom-color: var(--signal-bright); }
