/* ============================================
   Matt Brownell — Portfolio
   Design system: editorial-financial. Navy ink on
   cool paper, brass + teal accents, serif display
   paired with a grotesque body and a mono "dateline"
   utility face — the vocabulary of a financial
   publication, not a fintech product.
   ============================================ */

:root {
  --paper: #f3f4f0;
  --paper-warm: #eceee7;
  --card: #ffffff;
  --ink: #1c2b22;
  --ink-soft: #4f5c53;
  --ink-faint: #889186;
  --line: #dbe0d6;
  --line-strong: #b7c2b6;
  --gold: #a8842f;
  --gold-dim: #bd9a52;
  --teal: #1f5c40;
  --teal-dim: #2b7454;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --max: 780px;
  --max-wide: 1040px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--teal-dim); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

.wrap {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 28px;
}

.wrap--narrow {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- dateline / eyebrow: the signature motif ---------- */
.dateline {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- axis-tick divider ---------- */
.axis-rule {
  border: none;
  height: 1px;
  background: var(--line);
  margin: 44px 0;
  position: relative;
}
.axis-rule::before,
.axis-rule::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 1px;
  height: 7px;
  background: var(--line-strong);
}
.axis-rule::before { left: 0; }
.axis-rule::after { right: 0; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 245, 241, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.nav-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 11px;
}
.monogram {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--gold);
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14.5px;
}
.nav-links a {
  position: relative;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-links a:hover { color: var(--teal); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ---------- hero ---------- */
.hero {
  padding: 76px 0 24px;
}
.hero .dateline { margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.05;
}
.hero-role {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 620px;
  margin-bottom: 0;
}
.hero-links {
  margin-top: 28px;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.03em;
}
.hero-links a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 2px;
}
.hero-links a:hover { color: var(--teal); border-color: var(--teal); }

/* ---------- section headers ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: 27px;
}
.section-kicker {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.section-note {
  color: var(--ink-soft);
  font-size: 15.5px;
  max-width: 560px;
  margin-top: -14px;
  margin-bottom: 30px;
}

/* ---------- case study cards (featured) ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) {
  .feature-grid { grid-template-columns: 1fr; }
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 30px 28px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.feature-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}
.feature-card .dateline { margin-bottom: 16px; }
.feature-card h3 {
  font-size: 22px;
  margin-bottom: 10px;
}
.feature-card p {
  color: var(--ink-soft);
  font-size: 15px;
  flex-grow: 1;
}
.feature-card .cta {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--teal);
  margin-top: 18px;
}

/* ---------- link list items (with thumbnail) ---------- */
.link-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 720px) {
  .link-list { grid-template-columns: 1fr; }
}
.link-item {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 3px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.link-list a.link-item:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}
.link-list a.link-item:hover .link-title { color: var(--teal); }

.link-thumb {
  aspect-ratio: 16 / 9.2;
  position: relative;
  overflow: hidden;
  background: var(--ink);
}
.link-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.link-thumb--noimg {
  background: linear-gradient(155deg, var(--ink) 0%, #1d2f52 60%, var(--ink) 100%);
}

.link-body {
  padding: 18px 20px 22px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.link-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}
.link-meta-outlet {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.link-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--ink);
  line-height: 1.25;
}
.link-desc {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 0;
}

/* ---------- media embeds (case studies) ---------- */
.media-frame {
  margin: 36px 0;
  border: 1px solid var(--line);
  background: #0e1626;
  border-radius: 3px;
  overflow: hidden;
}
.media-frame video-embed,
.video-embed {
  position: relative;
  padding-top: 56.25%;
  height: 0;
}
.video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}
.media-frame img {
  display: block;
  width: 100%;
  height: auto;
}
.media-caption {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  padding: 12px 4px 0;
}

/* ---------- case study body ---------- */
.cs-header { padding-top: 56px; padding-bottom: 8px; }
.cs-header .dateline { margin-bottom: 20px; }
.cs-header h1 { font-size: clamp(30px, 4.5vw, 44px); }
.cs-hero {
  margin: 24px 0 32px;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.cs-hero img { width: 100%; height: auto; display: block; }
.cs-hero-caption {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin: 10px 0 0;
}
.cs-dek {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 620px;
}
.cs-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.cs-meta div {
  font-size: 14px;
}
.cs-meta .cs-meta-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.cs-body { padding: 8px 0 40px; }
.cs-body h2 {
  font-size: 22px;
  margin-top: 44px;
}
.cs-body p { color: var(--ink-soft); font-size: 16.5px; }
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 11px 20px;
  text-decoration: none;
  border-radius: 2px;
  margin-top: 6px;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-group { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }

.cs-back {
  display: inline-block;
  margin: 40px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}
.cs-back:hover { color: var(--teal); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 60px;
  margin-top: 40px;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-faint);
}
footer a { color: var(--ink-soft); }

/* ---------- homepage byline + destination tiles ---------- */
.byline {
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 76px 0 8px;
}
.byline-avatar {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--gold-dim);
}
.byline-text .dateline { margin-bottom: 14px; }
.byline-text h1 {
  font-size: clamp(38px, 5.5vw, 52px);
  line-height: 1;
  margin-bottom: 14px;
}
.byline-text .tagline {
  font-size: 17.5px;
  color: var(--ink-soft);
  max-width: 480px;
  margin: 0;
}

.dest-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-bottom: 40px;
}
.dest-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 40px 20px;
  border: 1px solid var(--line);
  border-radius: 3px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.dest-nav a:hover {
  border-color: var(--gold-dim);
  transform: translateY(-3px);
}
.dest-icon {
  width: 36px;
  height: 36px;
  color: var(--gold);
}
.dest-label {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 27px;
}
.dest-sub {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .byline { flex-direction: column; text-align: center; }
  .byline-text .dateline { justify-content: center; }
  .byline-text .tagline { margin: 0 auto; }
  .dest-nav { grid-template-columns: 1fr; }
}

/* ---------- page masthead (portfolio / case studies index pages) ---------- */
.page-header { padding-top: 40px; padding-bottom: 32px; }
.page-header .dateline { margin-bottom: 14px; font-size: 15px; }
.page-header h1 { font-size: clamp(34px, 5vw, 48px); margin: 0 0 12px; }
.page-dek {
  font-size: 17.5px;
  color: var(--ink-soft);
  max-width: 620px;
}
.page-dek--wide {
  max-width: 820px;
}
.page-dek + .page-dek {
  margin-top: -8px;
}
.page-header--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.page-header--row h1 { margin-bottom: 0; }
.page-jumps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
}
.page-jumps a {
  font-family: var(--mono);
  font-size: 14.5px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.page-jumps a:hover { color: var(--teal); }
.page-jumps a::after { content: "↓"; color: var(--gold); }
@media (max-width: 640px) {
  .page-jumps { text-align: left; }
  .page-jumps a { justify-content: flex-start; }
}

/* ---------- pull quote ---------- */
.pull-quote {
  position: relative;
  margin: 44px 0;
  padding: 6px 0 6px 34px;
  border-left: 2px solid var(--gold);
}
.pull-quote::before {
  content: "\201C";
  position: absolute;
  left: -6px;
  top: -22px;
  font-family: var(--serif);
  font-size: 64px;
  color: var(--gold-dim);
  line-height: 1;
}
.pull-quote p {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 24px;
  color: var(--ink);
  line-height: 1.4;
  margin: 0;
}

/* ---------- before / after comparison ---------- */
.figure-float {
  float: right;
  width: 340px;
  margin: 6px 0 24px 32px;
}
.figure-float.figure-float--big {
  width: 400px;
}
.figure-float.figure-float--left {
  float: left;
  margin: 6px 32px 24px 0;
}
.figure-float figcaption {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 10px;
}
.figure-float img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  display: block;
}
.cs-body h2,
.cs-body .pull-quote {
  clear: both;
}
@media (max-width: 680px) {
  .figure-float,
  .figure-float.figure-float--left {
    float: none;
    width: 100%;
    margin: 24px 0;
  }
}

.clear-figure { clear: both; }
