/* ------------------------------------------------------------------
   Portfolio — homepage
   Same editorial system as styles/case-study.css. No frameworks, no
   webfonts, no CDN, no build step.

   Tokens and shared primitives (.wrap, .section, .eyebrow, .prose,
   .points, .btn, .foot ...) are mirrored from case-study.css on
   purpose: the approved case study is left byte-for-byte untouched, so
   this file carries its own copy. If a token changes here, change it
   there too.
   ------------------------------------------------------------------ */

:root {
  --paper:      #FBFAF7;
  --paper-2:    #F4F2ED;
  --card:       #FFFFFF;
  --ink:        #16191C;
  --ink-2:      #3C4249;
  /* --muted is two shades darker than the case study's #6C7278 so that the
     small uppercase labels still clear 4.5:1 on the tinted background
     (#F4F2ED), not only on the paper background. */
  --muted:      #666C73;
  --rule:       #E4E0D8;
  --rule-soft:  #EDEAE3;
  --accent:     #1B3A57;
  --accent-2:   #2C5F8A;
  --accent-soft:#EDF2F6;

  --serif: Charter, "Iowan Old Style", "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  --shot-w: 352px;
  --nav-h: 60px;
  --gutter: clamp(20px, 5vw, 56px);
  --wrap: 1120px;
  --prose: 68ch;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

/* the sticky masthead must not cover an anchor target */
[id] { scroll-margin-top: calc(var(--nav-h) + 18px); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------------------------------------------------------------- layout */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(52px, 8vw, 100px); }
.section + .section { border-top: 1px solid var(--rule-soft); }
.section--tint { background: var(--paper-2); }

.prose { max-width: var(--prose); }
.prose p { margin: 0 0 1.1em; color: var(--ink-2); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------------- headings */

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); }

h1 {
  font-size: clamp(2.05rem, 1.3rem + 3.1vw, 3.55rem);
  line-height: 1.06;
  letter-spacing: -0.021em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.5rem, 1.14rem + 1.5vw, 2.2rem);
  line-height: 1.16;
  letter-spacing: -0.016em;
  margin: 0 0 0.7em;
  text-wrap: balance;
}

h3 {
  font-size: clamp(1.06rem, 1rem + 0.32vw, 1.2rem);
  line-height: 1.32;
  letter-spacing: -0.01em;
  margin: 0 0 0.45em;
}

.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 22px;
}
.eyebrow::before {
  content: attr(data-n);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule);
}

.lede {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.28rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 60ch;
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--rule-soft);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: var(--nav-h);
}
.nav__mark {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav__mark:hover { color: var(--accent); }
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(15px, 2.6vw, 30px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding-block: 6px;
  white-space: nowrap;
}
.nav__links a:hover { color: var(--accent); }
/* Narrow phones drop the middle item rather than hiding the whole menu
   behind a script-driven toggle. Every link left is a real section. */
@media (max-width: 459px) { .nav__links li[data-secondary] { display: none; } }

/* ------------------------------------------------------------------ hero */

.hero { padding-block: clamp(40px, 6vw, 76px) clamp(46px, 7vw, 84px); }
.hero__grid { display: grid; gap: clamp(34px, 5vw, 60px); align-items: center; }

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) clamp(280px, 28vw, 366px); }
}

.hero__kicker {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 26px;
}

.hero h1 { max-width: 19ch; margin-bottom: 0.42em; }
.hero__name {
  display: block;
  font-family: var(--sans);
  font-size: clamp(0.94rem, 0.88rem + 0.3vw, 1.08rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--accent);
  margin-bottom: 0.85em;
}
.hero__lede { max-width: 58ch; margin: 0 0 34px; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 13px; }

/* portrait ------------------------------------------------------------- */

.portrait { justify-self: start; width: 100%; max-width: 300px; }
@media (min-width: 900px) { .portrait { justify-self: stretch; max-width: none; } }

.portrait__frame {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 8px;
  box-shadow: 0 1px 1px rgba(22, 25, 28, 0.03), 0 18px 40px -30px rgba(22, 25, 28, 0.5);
}
.portrait img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 2px;
  background: var(--paper-2);
}

/* ------------------------------------------------------------ meta strip */

.meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  margin: 38px 0 0;
  max-width: 620px;
}
.meta div { background: var(--paper); padding: 15px 18px; }
.meta dt {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 6px;
}
.meta dd { margin: 0; font-size: 0.9rem; line-height: 1.45; color: var(--ink-2); }
@media (min-width: 620px) { .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------------- point list */

.points { list-style: none; margin: 24px 0 0; padding: 0; max-width: 72ch; }
.points li {
  position: relative;
  padding: 13px 0 13px 22px;
  border-top: 1px solid var(--rule-soft);
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.55;
}
.points li:last-child { border-bottom: 1px solid var(--rule-soft); }
.points li::before {
  content: "";
  position: absolute; left: 0; top: 22px;
  width: 6px; height: 1px; background: var(--accent-2);
}
.points b { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- cards */

.cards { display: grid; gap: 0 clamp(28px, 4vw, 56px); margin: 40px 0 0; padding: 0; list-style: none; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.cards li { padding: 24px 0; border-top: 1px solid var(--rule); }
.cards li::before {
  content: attr(data-n);
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  margin-bottom: 11px;
}
.cards h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.005em;
  margin-bottom: 0.4em;
}
.cards p { margin: 0; font-size: 0.93rem; color: var(--ink-2); }

/* ---------------------------------------------------------- featured work */

.work { display: grid; gap: clamp(30px, 4.5vw, 56px); align-items: start; margin-top: 38px; }
/* Centred, not top-aligned: the phone capture is much taller than the copy
   beside it, and start-alignment leaves a dead column under the text. */
@media (min-width: 900px) {
  .work { grid-template-columns: var(--shot-w) minmax(0, 1fr); align-items: center; }
}

.work__figure { margin: 0; width: 100%; max-width: var(--shot-w); }

.shot {
  display: block;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 20px;
  padding: 7px;
  box-shadow: 0 1px 1px rgba(22, 25, 28, 0.03), 0 16px 34px -26px rgba(22, 25, 28, 0.45);
  width: 100%;
}
.shot img { border-radius: 14px; width: 100%; background: var(--paper-2); }

figcaption {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 13px;
  text-align: left;
}
figcaption b { color: var(--ink-2); font-weight: 600; }

.work__title { margin-top: -0.14em; }

.positioning {
  display: flex; flex-wrap: wrap; gap: 9px;
  margin: 0 0 26px; padding: 0; list-style: none;
}
.positioning li {
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #DDE6ED;
  border-radius: 999px;
  padding: 7px 15px;
}

.badge {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.63rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 13px;
  margin: 0 0 18px;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-2); flex: none;
}

.actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.93rem; font-weight: 600;
  padding: 13px 24px; border-radius: 3px;
  text-decoration: none; border: 1px solid var(--accent);
  transition: background-color 180ms ease, color 180ms ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #12293D; color: #fff; }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent); }
.btn__ext { font-size: 0.85em; opacity: 0.75; }

/* On narrow phones the two buttons cannot sit side by side. A single
   max-content column stacks them at one shared width instead of leaving a
   ragged right edge. */
@media (max-width: 459px) {
  .hero__actions, .actions {
    display: grid;
    grid-template-columns: max-content;
    gap: 12px;
  }
  .btn { justify-content: center; }
}

.note {
  font-size: 0.85rem;
  color: var(--muted);
  border-left: 2px solid var(--rule);
  padding-left: 14px;
  margin: 34px 0 0;
  max-width: 68ch;
}
.note strong { color: var(--ink-2); font-weight: 600; }

/* --------------------------------------------------------------- approach */

.steps {
  list-style: none; counter-reset: s;
  margin: 40px 0 0; padding: 0;
  display: grid; gap: 0 clamp(28px, 4vw, 56px);
}
@media (min-width: 700px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.steps li { counter-increment: s; padding: 22px 0; border-top: 1px solid var(--rule); }
.steps li::before {
  content: counter(s, decimal-leading-zero);
  display: block;
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  color: var(--accent-2);
  margin-bottom: 10px;
}
.steps h3 {
  font-family: var(--sans); font-size: 0.98rem; font-weight: 650;
  letter-spacing: -0.005em; margin-bottom: 0.4em;
}
.steps p { margin: 0; font-size: 0.92rem; color: var(--ink-2); }

.callout {
  background: var(--accent-soft);
  border: 1px solid #DCE5EC;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: clamp(22px, 3vw, 30px);
  margin-top: 44px;
  max-width: 78ch;
}
.callout h3 { margin-top: 0; font-family: var(--serif); font-size: 1.22rem; }
.callout p { color: var(--ink-2); margin: 0 0 1em; }
.callout p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ about */

.about { display: grid; gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (min-width: 900px) { .about { grid-template-columns: minmax(0, 1fr) 300px; } }

.about__facts { margin: 0; padding: 0; }
.about__facts div { padding: 14px 0; border-bottom: 1px solid var(--rule-soft); }
.about__facts div:first-child { border-top: 1px solid var(--rule); }
.about__facts dt {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 5px;
}
.about__facts dd { margin: 0; font-size: 0.92rem; color: var(--ink-2); line-height: 1.5; }

/* ----------------------------------------------------------------- stack */

.stack { display: grid; gap: clamp(26px, 3.2vw, 44px); margin-top: 40px; }
@media (min-width: 640px) { .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .stack { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.stack h3 {
  font-family: var(--sans); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  padding-bottom: 12px; border-bottom: 1px solid var(--rule); margin: 0;
}
.stack ul { list-style: none; margin: 0; padding: 0; }
.stack li {
  padding: 12px 0; border-bottom: 1px solid var(--rule-soft);
  font-size: 0.9rem; color: var(--ink-2);
}

/* --------------------------------------------------------------- contact */

.contact h2 { max-width: 20ch; }
.contact__mail {
  display: inline-block;
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 3px;
  word-break: break-word;
}
.contact__mail:hover { color: var(--accent); border-bottom-color: var(--accent); }

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

.foot {
  border-top: 1px solid var(--rule);
  padding-block: 34px 44px;
  font-size: 0.8rem;
  color: var(--muted);
}
.foot__top {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  align-items: baseline; justify-content: space-between;
  margin-bottom: 22px;
}
.foot__name { font-family: var(--serif); font-size: 1rem; font-weight: 600; color: var(--ink); margin: 0; }
.foot__role { margin: 3px 0 0; font-size: 0.8rem; color: var(--muted); }
.foot p { margin: 0 0 6px; max-width: 78ch; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent); }

/* ----------------------------------------------------------------- motion */

/* The only motion on this page is hover feedback and the browser's own
   smooth scrolling. Both degrade to nothing. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
