/* ============================================================
   nickmcintosh.co — "The evidence is the room"
   Palette: Paper #F6F5F1 · Ink #14181F · Slate #5A6170
            Ultramarine #2743D8 · Hairline #E2E0D8
   Type:    Instrument Serif (display) · Instrument Sans (body)
            Spline Sans Mono (locators, evidence tags)
   ============================================================ */

:root {
  --paper: #F6F5F1;
  --ink: #14181F;
  --slate: #5A6170;
  --ultra: #2743D8;
  --hairline: #E2E0D8;
  --scrim: rgba(12, 15, 22, 0.55);
  --max: 1200px;
  --pad: clamp(20px, 5vw, 64px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ultra); color: var(--paper); }

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

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

/* ---------- type roles ---------- */

.display {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.mono {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--pad);
  mix-blend-mode: normal;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.nav.scrolled {
  background: rgba(246, 245, 241, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--hairline);
}
.nav .wordmark {
  font-family: "Instrument Serif", serif;
  font-size: 20px;
  text-decoration: none;
}
.nav.on-photo:not(.scrolled) { color: var(--paper); }
.nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav ul a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.85;
}
.nav ul a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 720px) {
  .nav ul { gap: 16px; }
  .nav ul li:nth-child(n+4) { display: none; }
}

/* ---------- hero (home) ---------- */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  color: var(--paper);
  isolation: isolate;
}
.hero .bg {
  position: absolute; inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center 68%;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(12,15,22,0.72) 0%, rgba(12,15,22,0.28) 55%, rgba(12,15,22,0) 78%),
    linear-gradient(to top, rgba(12,15,22,0.88) 0%, rgba(12,15,22,0.42) 50%, rgba(12,15,22,0.5) 100%);
}
.hero .inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(48px, 8vh, 96px);
}
.hero .eyebrow {
  color: rgba(246,245,241,0.95);
  text-shadow: 0 1px 12px rgba(12,15,22,0.6);
  margin-bottom: 20px;
}
.hero .eyebrow .fellow { color: #AEB9FF; }
.hero h1 {
  font-size: clamp(44px, 7.5vw, 104px);
  max-width: 16ch;
  text-wrap: balance;
}
.hero .sub {
  margin-top: 28px;
  max-width: 52ch;
  font-size: clamp(16px, 1.6vw, 19px);
  color: rgba(246,245,241,0.9);
}
.hero .photo-credit {
  position: absolute;
  right: var(--pad);
  bottom: 20px;
  font-size: 11px;
  color: rgba(246,245,241,0.55);
}

/* ---------- generic sections ---------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 11vh, 140px) var(--pad) 0;
}
.section:last-of-type { padding-bottom: clamp(72px, 11vh, 140px); }

.kicker {
  color: var(--ultra);
  margin-bottom: 18px;
}

.section h2 {
  font-size: clamp(34px, 4.4vw, 58px);
  max-width: 20ch;
  margin-bottom: 28px;
  text-wrap: balance;
}

.lede {
  font-size: clamp(19px, 2.1vw, 24px);
  line-height: 1.5;
  max-width: 58ch;
}
.lede em { font-style: italic; }

.body-copy {
  max-width: 62ch;
  color: var(--ink);
}
.body-copy p + p { margin-top: 1.2em; }
.muted { color: var(--slate); }

/* ---------- evidence strip (signature) ---------- */

.evidence {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 64px;
  border-top: 1px solid var(--ink);
}
.evidence .cell {
  padding: 28px 24px 32px 0;
  border-bottom: 1px solid var(--hairline);
}
.evidence .num {
  font-family: "Instrument Serif", serif;
  font-size: clamp(38px, 4.5vw, 60px);
  line-height: 1;
}
.evidence .what {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 500;
}
.evidence .source {
  margin-top: 10px;
  color: var(--slate);
  font-size: 11px;
}
.evidence .source::before {
  content: "▸ ";
  color: var(--ultra);
}
@media (max-width: 900px) {
  .evidence { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .evidence { grid-template-columns: 1fr; }
}

/* ---------- rooms (case study index) ---------- */

.rooms { margin-top: 56px; display: grid; gap: 64px; }

.room {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: end;
  text-decoration: none;
}
.room:nth-child(even) { grid-template-columns: 0.85fr 1.15fr; }
.room:nth-child(even) .room-media { order: 2; }

.room-media {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--ink);
}
.room-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}
.room:hover .room-media img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) {
  .room:hover .room-media img { transform: none; }
}
.room-media.typographic {
  display: flex;
  align-items: flex-end;
  padding: 28px;
  color: var(--paper);
}
.room-media.typographic .big {
  font-family: "Instrument Serif", serif;
  font-size: clamp(56px, 7vw, 110px);
  line-height: 0.95;
}
.room-media.arlemp { background: linear-gradient(135deg, #10141C 0%, #1B2440 70%, #24357F 100%); }
.room-media.community { background: linear-gradient(135deg, #10141C 0%, #232013 70%, #4A3D14 100%); }
.room-media.council { background: linear-gradient(135deg, #10141C 0%, #241320 70%, #55182F 100%); }

.room-text .locator { color: var(--slate); margin-bottom: 14px; }
.room-text .locator b { color: var(--ultra); font-weight: 500; }
.room-text h3 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.08;
  margin-bottom: 14px;
}
.room-text p { color: var(--ink); max-width: 46ch; }
.room-text .go {
  display: inline-block;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ultra);
}
.room:hover .go { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 820px) {
  .room, .room:nth-child(even) { grid-template-columns: 1fr; align-items: start; }
  .room:nth-child(even) .room-media { order: 0; }
}

/* ---------- modes (speaking & advisory) ---------- */

.modes {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
}
.modes .mode {
  padding: 28px 28px 36px 0;
  border-bottom: 1px solid var(--hairline);
}
.modes h3 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: 26px;
  margin: 14px 0 10px;
}
.modes p { font-size: 15.5px; color: var(--slate); max-width: 34ch; }
@media (max-width: 820px) { .modes { grid-template-columns: 1fr; } }

/* ---------- record list ---------- */

.record { margin-top: 56px; border-top: 1px solid var(--ink); }
.record li {
  list-style: none;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.record .yr { color: var(--slate); }
.record .yr.up { color: var(--ultra); }
.record .ev { font-size: 17px; }
.record .role { color: var(--slate); font-size: 14px; text-align: right; }
@media (max-width: 640px) {
  .record li { grid-template-columns: 1fr; gap: 4px; }
  .record .role { text-align: left; }
}

/* ---------- writing ---------- */

.writing-list { margin-top: 48px; display: grid; gap: 0; border-top: 1px solid var(--ink); }
.writing-list a {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
}
.writing-list .outlet { color: var(--slate); }
.writing-list .title {
  font-family: "Instrument Serif", serif;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.2;
}
.writing-list a:hover .title { color: var(--ultra); }
@media (max-width: 640px) {
  .writing-list a { grid-template-columns: 1fr; gap: 6px; }
}

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

.footer {
  margin-top: clamp(80px, 12vh, 150px);
  background: var(--ink);
  color: var(--paper);
}
.footer .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 9vh, 110px) var(--pad);
}
.footer .big-line {
  font-size: clamp(32px, 5vw, 64px);
  max-width: 18ch;
  text-wrap: balance;
}
.footer .contacts {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
}
.footer .contacts a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(246,245,241,0.35);
  padding-bottom: 2px;
  font-size: 16px;
}
.footer .contacts a:hover { border-color: var(--paper); }
.footer .fine {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(246,245,241,0.16);
  color: rgba(246,245,241,0.55);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- case study pages ---------- */

.case-hero {
  position: relative;
  min-height: 74vh;
  display: flex;
  align-items: flex-end;
  color: var(--paper);
  isolation: isolate;
}
.case-hero .bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; }
.case-hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(12,15,22,0.85) 0%, rgba(12,15,22,0.2) 55%, rgba(12,15,22,0.4) 100%);
}
.case-hero.typographic { background: var(--ink); min-height: 56vh; }
.case-hero.typographic::after { background: none; }
.case-hero .inner {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 140px var(--pad) 64px;
}
.case-hero .locator { color: rgba(246,245,241,0.75); margin-bottom: 18px; }
.case-hero .locator b { color: #AEB9FF; font-weight: 500; }
.case-hero h1 {
  font-size: clamp(38px, 5.6vw, 72px);
  max-width: 18ch;
  text-wrap: balance;
}
.case-hero .dek {
  margin-top: 20px;
  font-size: clamp(17px, 1.8vw, 20px);
  color: rgba(246,245,241,0.88);
  max-width: 55ch;
}

.case-body {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(56px, 8vh, 96px) var(--pad) 0;
}
.case-body .figures {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 56px;
}
.case-body .figures .f { font-size: 15px; }
.case-body .figures .f b {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: 24px;
  margin-right: 6px;
}
.case-body h2 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 40px);
  margin: 64px 0 20px;
}
.case-body h2:first-of-type { margin-top: 0; }
.case-body p { max-width: 66ch; }
.case-body p + p { margin-top: 1.2em; }
.case-body figure { margin: 48px 0; }
.case-body figure img { width: 100%; }
.case-body figcaption { margin-top: 10px; color: var(--slate); font-size: 13px; }
.case-body blockquote {
  margin: 48px 0;
  padding-left: 24px;
  border-left: 3px solid var(--ultra);
  font-family: "Instrument Serif", serif;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.3;
}
.case-body blockquote footer {
  margin-top: 12px;
  font-family: "Instrument Sans", sans-serif;
  font-size: 14px;
  color: var(--slate);
}
.case-body ul.qs { margin: 24px 0 24px 20px; max-width: 60ch; }
.case-body ul.qs li { margin-bottom: 10px; }

.engage {
  margin-top: 72px;
  padding: 32px 0 0;
  border-top: 1px solid var(--ink);
}
.engage .mono { color: var(--ultra); }
.engage p {
  margin-top: 12px;
  font-family: "Instrument Serif", serif;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.3;
  max-width: 30ch;
}
.engage a { color: var(--ultra); }

.case-nav {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px var(--pad) 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.case-nav a { text-decoration: none; font-weight: 600; font-size: 15px; }
.case-nav a:hover { color: var(--ultra); }

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: none; }
