/* ============================================================
   brian-stack.com v2 — sibling of stackmarketingco.com
   Red Rocks palette: redrock, clay, sage, sky on warm cream.
   Type: Archivo (display+body) / Instrument Serif italic (accents)
         / IBM Plex Mono (eyebrows, numbers, labels)
   ============================================================ */

:root {
  --ink: #121212;
  --cream: #FFFFFF;
  --card: #FFFFFF;
  --stone: #6B6B6B;
  --sand: #E8E8E8;
  --redrock: #B04327;
  --redrock-deep: #8F3218;
  --clay: #9A9A9A;
  --sage: #8A8A8A;
  --sky: #BFBFBF;
  --max: 1120px;
  --prose: 66ch;
  --r: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.04rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--redrock); color: var(--cream); }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

/* ---------- type ---------- */
h1, h2, h3 { font-weight: 750; line-height: 1.02; letter-spacing: -0.025em; }
h1 { font-size: clamp(3rem, 8.4vw, 6.2rem); }
h2 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.05; }
h3 { font-size: 1.4rem; line-height: 1.25; letter-spacing: -0.015em; }

.serif-accent, h1 em, h2 em, .closing h2 em {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--redrock);
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--redrock); }

a { color: inherit; text-decoration: none; }
p a, .prose a { color: var(--redrock); border-bottom: 1px solid rgba(176,67,39,.35); transition: border-color 160ms ease; }
p a:hover, .prose a:hover { border-color: var(--redrock); }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sand);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: -0.02em; font-size: 1.12rem; }
.brand span { color: var(--redrock); }
.site-nav { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.site-nav a { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--stone); transition: color 150ms ease; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--redrock); }
.nav-cta {
  background: var(--ink); color: var(--cream) !important;
  padding: 10px 20px; border-radius: 999px;
  transition: background 160ms ease;
}
.nav-cta:hover { background: var(--redrock); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.74rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 15px 28px; border-radius: 999px;
  border: 1.5px solid var(--ink);
  transition: all 160ms ease;
}
.btn:hover { background: var(--ink); color: var(--cream); transform: translateY(-1px); }
.btn--solid { background: var(--redrock); border-color: var(--redrock); color: var(--cream); }
.btn--solid:hover { background: var(--redrock-deep); border-color: var(--redrock-deep); }

/* ---------- hero ---------- */
.hero { padding: clamp(72px, 13vh, 150px) 0 clamp(48px, 8vh, 90px); }
.hero .mono { display: inline-flex; margin-bottom: 30px; }
.hero h1 { max-width: 13ch; }
.hero .lede { margin-top: 32px; max-width: 50ch; font-size: 1.22rem; line-height: 1.62; color: var(--stone); }
.hero .actions { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- marquee ---------- */
.marquee {
  border-top: 1px solid var(--sand);
  border-bottom: 1px solid var(--sand);
  overflow: hidden; white-space: nowrap;
  padding: 16px 0;
  background: var(--card);
}
.marquee .track { display: inline-block; animation: scroll 36s linear infinite; }
.marquee span {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--stone);
}
.marquee b { color: var(--redrock); font-weight: 500; padding: 0 14px; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee .track { animation: none; } }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 11vh, 130px) 0; }
.section-head { margin-bottom: 44px; }
.section-head .mono { display: inline-flex; margin-bottom: 20px; }
.section-head h2 { max-width: 18ch; }
.section-head .sub { margin-top: 18px; max-width: 54ch; color: var(--stone); font-size: 1.08rem; }

/* ---------- story ---------- */
.story { max-width: var(--prose); }
.story p + p { margin-top: 1.3em; }
.story .opener { font-size: clamp(1.4rem, 2.5vw, 1.85rem); font-weight: 640; line-height: 1.32; letter-spacing: -0.015em; }
.story .opener em { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; color: var(--redrock); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat {
  background: var(--card);
  border: 1px solid var(--sand);
  border-radius: var(--r);
  padding: 28px 26px 26px;
}
.stat .idx { display: block; margin-bottom: 22px; color: var(--clay); }
.stat .num { display: block; font-weight: 780; letter-spacing: -0.03em; font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1; }
.stat .num sup { font-size: 55%; top: -0.5em; position: relative; color: var(--redrock); }
.stat .label { margin-top: 14px; font-size: 0.92rem; line-height: 1.55; color: var(--stone); }
@media (max-width: 980px) { .stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }

/* ---------- orgs ---------- */
.orgs { display: flex; flex-wrap: wrap; gap: 12px; }
.orgs span {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.74rem; letter-spacing: 0.08em;
  color: var(--stone);
  border: 1px solid var(--sand);
  background: var(--card);
  border-radius: 999px;
  padding: 10px 18px;
}

/* ---------- work rows ---------- */
.work-list { display: grid; gap: 18px; }
.work-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px 28px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--sand);
  border-radius: var(--r);
  padding: 34px 34px 32px;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.work-row:hover {
  transform: translateY(-3px);
  border-color: var(--clay);
  box-shadow: 0 14px 34px -22px rgba(0,0,0,.28);
}
.work-row .idx { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.95rem; font-weight: 500; color: var(--clay); padding-top: 6px; }
.work-row .body .mono { display: block; margin-bottom: 10px; }
.work-row .org { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.work-row .org .mono { display: inline; margin-bottom: 0; }
.work-row .org img {
  height: 26px; width: auto; max-width: 150px; object-fit: contain;
  filter: grayscale(1); opacity: 0.75;
  transition: filter 200ms ease, opacity 200ms ease;
}
.work-row:hover .org img { filter: grayscale(0); opacity: 1; }
.work-row h3 { font-size: clamp(1.45rem, 2.6vw, 2rem); transition: color 160ms ease; }
.work-row:hover h3 { color: var(--redrock); }
.work-row .outcome { margin-top: 10px; max-width: 60ch; color: var(--stone); font-size: 0.98rem; }
.work-row .arrow { font-size: 1.5rem; color: var(--clay); padding-top: 10px; transition: transform 200ms ease, color 200ms ease; }
.work-row:hover .arrow { transform: translateX(6px); color: var(--redrock); }
.chips { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: 999px;
  padding: 6px 13px;
}
@media (max-width: 720px) {
  .work-row { grid-template-columns: 1fr; padding: 26px 24px; }
  .work-row .arrow { display: none; }
}

/* ---------- writing ---------- */
.writing-list { display: grid; gap: 16px; max-width: 820px; }
.writing-item {
  background: var(--card); border: 1px solid var(--sand); border-radius: var(--r);
  padding: 26px 28px;
  transition: transform 200ms ease, border-color 200ms ease;
}
.writing-item:hover { transform: translateY(-2px); border-color: var(--clay); }
.writing-item .mono { display: block; margin-bottom: 8px; color: var(--clay); }
.writing-item h3 { font-size: 1.28rem; }
.writing-item:hover h3 { color: var(--redrock); }
.writing-item p { margin-top: 8px; color: var(--stone); font-size: 0.95rem; }

/* ---------- case study ---------- */
.case-hero { padding: clamp(60px, 10vh, 120px) 0 clamp(36px, 6vh, 64px); }
.case-hero .mono { display: inline-flex; margin-bottom: 24px; }
.case-hero h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); max-width: 16ch; }
.case-hero .outcome { margin-top: 28px; max-width: 54ch; font-size: 1.22rem; line-height: 1.58; color: var(--stone); }
.case-meta {
  margin-top: 44px;
  display: grid; grid-template-columns: repeat(3, minmax(0,auto));
  gap: 18px; justify-content: start;
}
.case-meta > div {
  background: var(--card); border: 1px solid var(--sand); border-radius: var(--r);
  padding: 16px 22px; min-width: 180px;
}
.case-meta .mono { display: block; margin-bottom: 6px; color: var(--clay); }
.case-meta p { font-size: 0.92rem; line-height: 1.5; }
@media (max-width: 760px) { .case-meta { grid-template-columns: 1fr; } }

.prose { max-width: var(--prose); }
.prose p + p { margin-top: 1.6em; }
.prose h2 { margin: 2.3em 0 0.7em; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.prose h2 .idx { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.85rem; font-weight: 500; color: var(--clay); display: block; margin-bottom: 10px; letter-spacing: 0.1em; }

.artifact {
  margin: 2.4em 0;
  border: 1.5px dashed var(--sand);
  background: var(--card);
  border-radius: var(--r);
  padding: 64px 28px;
  text-align: center;
}
.artifact .mono { display: block; color: var(--clay); }
.artifact .note { margin-top: 8px; font-size: 0.88rem; color: var(--stone); }

.results { margin: 2.4em 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.results .stat { padding: 22px 20px; }
.results .num { font-size: clamp(1.6rem, 3vw, 2.1rem); }
@media (max-width: 680px) { .results { grid-template-columns: 1fr; } }

.hindsight {
  margin-top: 3em;
  background: var(--ink); color: var(--cream);
  border-radius: var(--r);
  padding: 38px 36px;
}
.hindsight .mono { display: block; margin-bottom: 16px; color: rgba(255,255,255,.55); }
.hindsight p { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 620; line-height: 1.38; letter-spacing: -0.015em; max-width: 30em; }
.hindsight p em { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; color: #E8907A; }

.case-next { margin-top: 3.4em; }
.case-next .mono { display: block; margin-bottom: 10px; }
.case-next a h3 { transition: color 160ms ease; font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.case-next a:hover h3 { color: var(--redrock); }

/* ---------- about ---------- */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 40px 0; }
.fact { background: var(--card); border: 1px solid var(--sand); border-radius: var(--r); padding: 18px 20px; }
.fact .mono { display: block; margin-bottom: 6px; color: var(--clay); }
.fact p { font-size: 0.95rem; font-weight: 560; }
@media (max-width: 860px) { .facts { grid-template-columns: 1fr 1fr; } }

.principles { display: grid; gap: 16px; max-width: 820px; }
.principle {
  background: var(--card); border: 1px solid var(--sand); border-radius: var(--r);
  padding: 30px 30px 28px;
  display: grid; grid-template-columns: 58px 1fr; gap: 6px 22px; align-items: start;
}
.principle .idx { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.95rem; color: var(--clay); padding-top: 4px; }
.principle h3 { margin-bottom: 8px; }
.principle p { color: var(--stone); max-width: 56ch; grid-column: 2; }
@media (max-width: 620px) { .principle { grid-template-columns: 1fr; } .principle p { grid-column: 1; } }

/* ---------- resume ---------- */
.resume-condensed { display: grid; gap: 14px; max-width: 860px; }
.resume-role {
  background: var(--card); border: 1px solid var(--sand); border-radius: var(--r);
  padding: 22px 26px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 24px;
}
.resume-role h3 { font-size: 1.14rem; }
.resume-role .mono { align-self: center; color: var(--clay); }
.resume-role p { grid-column: 1 / -1; color: var(--stone); font-size: 0.95rem; max-width: 70ch; }

.resume-group {
  background: var(--card); border: 1px solid var(--sand); border-radius: var(--r);
  padding: 22px 26px;
}
.resume-group-head {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 24px;
  padding-bottom: 18px; border-bottom: 1px solid var(--sand);
}
.resume-group-head h3 { font-size: 1.14rem; }
.resume-group-head .mono { align-self: center; color: var(--clay); }
.resume-group-head p { grid-column: 1 / -1; color: var(--stone); font-size: 0.95rem; max-width: 70ch; }
.resume-subrole {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 24px;
  padding: 16px 0 16px 18px;
  border-left: 2px solid var(--sand);
  margin-top: 16px;
}
.resume-subrole h4 { font-size: 1rem; font-weight: 700; }
.resume-subrole .mono { align-self: center; color: var(--clay); font-size: 0.85rem; }
.resume-subrole p { grid-column: 1 / -1; color: var(--stone); font-size: 0.93rem; max-width: 68ch; }
@media (max-width: 620px) {
  .resume-group-head, .resume-subrole { grid-template-columns: 1fr; }
  .resume-group-head .mono, .resume-subrole .mono { align-self: start; }
}

/* ---------- giant STACK ---------- */
.giant {
  overflow: hidden;
  padding: 20px 0 0;
  user-select: none;
}
.giant span {
  display: block;
  text-align: center;
  font-weight: 800;
  font-size: clamp(5rem, 19vw, 17rem);
  line-height: 0.82;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(0,0,0,.16);
  transform: translateY(18%);
}

/* ---------- closing ---------- */
.closing { padding: clamp(72px, 13vh, 150px) 0; }
.closing h2 { max-width: 20ch; font-size: clamp(2.2rem, 5.4vw, 4rem); }
.closing .actions { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--sand); background: var(--card); padding: 36px 0 46px; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.site-foot .mono { letter-spacing: 0.1em; }
.site-foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-foot nav a { color: var(--stone); transition: color 150ms ease; font-size: 0.88rem; }
.site-foot nav a:hover { color: var(--redrock); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 640ms ease, transform 640ms ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

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

/* ---------- brand v2: all-caps resume treatment ---------- */
.brand {
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}
.brand span { display: none; }
.brand:hover { color: var(--redrock); }

/* ---------- institution logo band (clean, no boxes) ---------- */
.logo-band { padding: clamp(36px, 6vh, 64px) 0 clamp(20px, 4vh, 40px); }
.logo-band .mono { display: block; margin-bottom: 26px; text-align: center; }
.logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 30px 56px;
}
.logos img {
  height: 40px;
  width: auto;
  opacity: 0.92;
  transition: opacity 200ms ease;
}
.logos img:hover { opacity: 1; }
@media (max-width: 720px) { .logos { gap: 22px 36px; } .logos img { height: 32px; } }

/* ---------- case study figures ---------- */
figure.shot { margin: 2.2em 0; }
figure.shot img {
  width: 100%;
  border-radius: var(--r);
  border: 1px solid var(--sand);
}
figure.shot figcaption {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--stone);
  max-width: 62ch;
}
.results--four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .results--four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .results--four { grid-template-columns: 1fr; } }

/* ---------- prose lists: real breathing room ---------- */
.prose ul {
  margin: 1.9em 0 1.9em 1.3em;
}
.prose li { line-height: 1.65; }
.prose li + li { margin-top: 0.85em; }
.prose ul + p { margin-top: 1.9em; }

/* ---------- hero with portrait ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: end;
}
.hero-photo img {
  display: block;
  width: 100%;
  max-width: 440px;
  margin: 0 0 0 auto;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .hero-photo img { max-width: 260px; margin: 0 0 8px; }
}

/* ---------- about hero with portrait ---------- */
.about-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: end;
}
.about-portrait { position: relative; max-width: 400px; margin-left: auto; width: 100%; }
.about-portrait::before {
  /* thin orbit ring peeking from behind the panel */
  content: "";
  position: absolute;
  top: 2%; right: -34px;
  width: 150px; height: 150px;
  border: 1.5px solid rgba(18,18,18,.18);
  border-radius: 50%;
}
.about-portrait .block {
  position: absolute;
  left: 0; right: 0; bottom: 0; top: 14%;
  background: var(--redrock);
  border-radius: var(--r);
  transform: rotate(-2.5deg);
}
.about-portrait .block::after {
  content: "";
  position: absolute;
  top: 24px; left: 24px;
  width: 30px; height: 4px;
  background: rgba(255,255,255,.85);
}
.about-portrait img {
  position: relative;
  display: block;
  width: 90%;
  margin: 0 auto;
  filter: drop-shadow(0 14px 26px rgba(0,0,0,.28));
}
@media (max-width: 900px) {
  .about-hero-grid { grid-template-columns: 1fr; }
  .about-portrait { margin: 24px auto 0; max-width: 300px; }
}

/* ---------- hero art: the mission target ---------- */
.hero-art { max-width: 480px; margin-left: auto; width: 100%; }
.hero-art svg { display: block; width: 100%; height: auto; }
.hero-art .journey {
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: journeydraw 1300ms 350ms ease-out forwards;
}
.hero-art .dot { opacity: 0; animation: dotin 350ms ease forwards; }
.hero-art .d1 { animation-delay: 500ms; }
.hero-art .d2 { animation-delay: 750ms; }
.hero-art .d3 { animation-delay: 1000ms; }
.hero-art .d4 { animation-delay: 1250ms; }
.hero-art .d5 { animation-delay: 1550ms; }
@keyframes journeydraw { to { stroke-dashoffset: 0; } }
@keyframes dotin { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hero-art .journey { stroke-dashoffset: 0; animation: none; }
  .hero-art .dot { opacity: 1; animation: none; }
}
@media (max-width: 900px) { .hero-art { display: none; } }

/* ---------- case study org logo ---------- */
.case-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.case-logo { height: 46px; width: auto; opacity: 0.92; }
@media (max-width: 720px) { .case-logo { height: 34px; } }
