:root {
  --ink: #1B2432;
  --parchment: #F5EFE4;
  --hover-panel: #EFE5D2;

  /* Decorative-only vermilion (ticks, arcs, borders) — no text ever sits directly
     on/as this shade, so it only needs to clear the 3:1 non-text contrast floor. */
  --vermilion: #E05A1F;

  /* Text/button-fill vermilion variants, darkened or lightened from --vermilion
     to clear 4.5:1 against their specific background (see contrast audit in PRD). */
  --vermilion-text: #B8450F;       /* vermilion text or button-fill on parchment/hover-panel */
  --vermilion-text-hover: #96330A; /* hover/darker state for the above */
  --vermilion-on-ink: #E56B36;     /* vermilion text on the dark ink background (nav hover) */

  --mustard: #E8A33D;
  --mustard-text: #925E11; /* darkened from --mustard for text use — raw #E8A33D is only 1.88:1 on parchment */
  --steel: #7A9BC4;
  --steel-text: #426794;  /* darkened from --steel for text use — raw #7A9BC4 is only 2.51:1 on parchment */
  --muted: #43506b;
  --keyword: #6d5f3e;      /* was #8a7a55 in the design file — too low contrast, see README a11y #6 */
  --footer-muted: #b8c0cf;
  --fine-print: #8a94a8;
  --tag-bg: #EDE5D4;
  --tag-text: #5f5644;     /* 5.78:1 on --tag-bg */

  --font-heading: 'Josefin Sans', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1280px;
  --header-height: 66px; /* fallback; main.js measures and overrides the real value */
}

* { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; } /* 1rem = the browser/OS text-size preference, default 16px */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  padding-top: var(--header-height);
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 22px;
}

h1, h2, h3 { font-family: var(--font-heading); margin: 0; }
p { margin: 0; } /* every gap is set explicitly per class — see the margin-collapse note in PRD/README */

main, section, footer, #main { scroll-margin-top: var(--header-height); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px; top: -48px;
  background: var(--ink);
  color: var(--parchment);
  padding: 10px 16px;
  font: 600 0.8125rem var(--font-body);
  z-index: 100;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

a { color: inherit; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font: 700 0.75rem var(--font-heading);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: none;
  transform: skewX(-12deg);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn span { display: block; transform: skewX(12deg); }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* Button padding tuned against measured rendered height, not assumed line-height:
   the `font:` shorthand above resets line-height to `normal` rather than inheriting
   body's 1.6, so text content is ~14px tall, not 12px*1.6. 1rem (no border) / 0.9375rem
   (1px border) both measure ~46px real height, clearing the 44px touch-target minimum. */
.btn-primary {
  background: var(--ink);
  color: var(--parchment);
  padding: 1rem 1.5625rem;
}
.btn-primary:hover, .btn-primary:focus-visible { background: var(--vermilion-text); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.9375rem 1.5625rem;
}
.btn-secondary:hover, .btn-secondary:focus-visible { background: var(--mustard); }

.btn-fill-vermilion {
  background: var(--vermilion-text);
  color: var(--parchment);
  padding: 1rem 1.5625rem;
}
.btn-fill-vermilion:hover, .btn-fill-vermilion:focus-visible { background: var(--vermilion-text-hover); }

.btn-outline-light {
  background: transparent;
  color: var(--parchment);
  border: 1px solid var(--parchment);
  padding: 0.9375rem 1.5625rem;
}
.btn-outline-light span { display: block; transform: skewX(12deg); }
.btn-outline-light:hover, .btn-outline-light:focus-visible {
  background: var(--mustard);
  border-color: var(--mustard);
  color: var(--ink);
}

.btn-block { display: block; width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--ink);
  color: var(--parchment);
  transition: transform .28s ease;
}
.site-header.is-hidden { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}
.header-inner {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 16px;
}
.logo img { height: 18px; display: block; }

.site-nav {
  display: none;
  gap: 24px;
  font: 600 0.75rem var(--font-body);
  letter-spacing: .08em;
}
.site-nav a { text-decoration: none; color: var(--parchment); transition: color .18s ease; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--mustard); }
.site-nav a.nav-contact { color: var(--mustard); }
.site-nav a.nav-contact:hover, .site-nav a.nav-contact:focus-visible { color: var(--vermilion-on-ink); }

/* ---------- Case studies nav dropdown ---------- */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 300px;
  margin-top: 18px;
  padding: 8px 0;
  background: var(--ink);
  border: 1px solid rgba(240, 233, 217, .18);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .28);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .nav-dropdown-menu { transition: none; }
}
.nav-dropdown-menu a {
  display: block;
  padding: 11px 20px;
  font: 600 0.6875rem var(--font-body);
  letter-spacing: .02em;
  line-height: 1.4;
  color: var(--parchment);
  border-left: 2px solid transparent;
}
.nav-dropdown-menu a + a { border-top: 1px solid rgba(240, 233, 217, .1); }
.nav-dropdown-menu a:hover, .nav-dropdown-menu a:focus-visible {
  background: rgba(240, 233, 217, .06);
  color: var(--mustard);
  border-left-color: var(--vermilion);
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 14px 11px; /* 44x44 min touch target (WCAG 2.5.5 / design README a11y #8) around a 22x16 icon */
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  cursor: pointer;
}
.menu-toggle span { width: 22px; height: 2px; background: var(--parchment); display: block; }
.menu-toggle span:last-child { width: 14px; background: var(--mustard); }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { width: 22px; transform: translateY(-7px) rotate(-45deg); background: var(--parchment); }

.mobile-menu {
  position: absolute;
  top: 100%; left: 0; right: 0;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  padding: 0 22px 20px;
  box-shadow: 0 8px 16px rgba(0,0,0,.15);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a {
  color: var(--parchment);
  text-decoration: none;
  font: 600 0.8125rem var(--font-body);
  letter-spacing: .08em;
  padding: 12px 0;
  border-top: 1px solid rgba(245,239,228,.15);
}

.mobile-submenu-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: none;
  border-top: 1px solid rgba(245,239,228,.15);
  color: var(--parchment);
  font: 600 0.8125rem var(--font-body);
  letter-spacing: .08em;
  padding: 12px 0;
  cursor: pointer;
  text-align: left;
}
.mobile-submenu-caret {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-right: 2px solid var(--parchment);
  border-bottom: 2px solid var(--parchment);
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.mobile-submenu-toggle[aria-expanded="true"] .mobile-submenu-caret { transform: rotate(-135deg); }
@media (prefers-reduced-motion: reduce) {
  .mobile-submenu-caret { transition: none; }
}
.mobile-submenu-list {
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
}
.mobile-submenu-list[hidden] { display: none; }
.mobile-submenu-list a {
  border-top: none;
  padding: 10px 0 10px 16px;
  font: 500 0.75rem var(--font-body);
  letter-spacing: .02em;
  opacity: .8;
}

/* ---------- Hero ---------- */
.hero { padding-block: 88px 32px; }
.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: left;
}

.hero-copy {
  width: 100%;
  min-width: 0;
}

.eyebrow {
  font: 700 0.75rem var(--font-heading);
  letter-spacing: .22em;
  border-bottom: 2px solid var(--vermilion);
  padding-bottom: 4px;
  display: inline-block;
  margin: 0 0 30px;
}

.hero-copy h1 {
  font: 700 2.125rem/1.08 var(--font-heading);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.hero-welcome {
  font: 400 0.875rem/1.6 var(--font-body);
  margin: 15.4px 0 22px; /* 14px and 20px, both +10% */
  max-width: 62ch;
}

.hero-cta { display: flex; flex-direction: column; gap: 14px; }
.hero-cta .btn { width: 100%; }

/* Portrait composition — mobile-first (8a) dimensions, scaled up at desktop breakpoint */
.hero-portrait {
  position: relative;
  width: 270px;
  height: 248px;
  flex: none;
  order: -1; /* mobile: image above the hero copy; reset to DOM order at desktop */
}
.portrait-quarter {
  position: absolute; left: 4px; bottom: 0;
  width: 100px; height: 100px;
  background: var(--ink);
  border-radius: 0 0 0 100px;
}
.portrait-arc {
  position: absolute; left: 31px; top: 7px;
  width: 199px; height: 199px;
  border-radius: 50%;
  border: 13px solid var(--vermilion);
  border-top-color: transparent;
  border-right-color: transparent;
  transform: rotate(45deg);
}
.portrait-counter-arc {
  position: absolute; left: 14px; top: -10px;
  width: 232px; height: 232px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  border-bottom-color: transparent;
  border-left-color: transparent;
  transform: rotate(45deg);
}
.portrait-ladder {
  position: absolute; left: 258px; top: 101px;
  width: 29px; height: 81px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 6px);
  transform: rotate(45deg);
  transform-origin: center;
}
.portrait-diamond {
  position: absolute; right: 17px; top: 10px;
  width: 24px; height: 24px;
  background: var(--mustard);
  transform: rotate(45deg);
}
.portrait-photo {
  position: absolute; left: 52px; top: 28px;
  width: 157px; height: 157px;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid var(--parchment);
}
.portrait-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Case studies ---------- */
.case-studies { padding-block: 58px 40px; }
.case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
}
.case-card {
  position: relative;
  padding-top: 12px;
  transition: background-color .18s ease, box-shadow .18s ease;
}
@media (prefers-reduced-motion: reduce) {
  .case-card { transition: none; }
}
.case-card::before {
  content: '';
  position: absolute; left: 0; top: 0;
  width: 100%; height: 1px;
  background: var(--ink);
}
.case-card::after {
  content: '';
  position: absolute; left: 0; top: -4px;
  width: 48px; height: 8px;
  transform: skewX(-30deg);
}
.case-card:nth-of-type(6n+1)::after { background: var(--vermilion); }
.case-card:nth-of-type(6n+2)::after { background: var(--mustard); }
.case-card:nth-of-type(6n+3)::after { background: var(--steel); }
.case-card:nth-of-type(6n+4)::after { background: var(--ink); }
.case-card:nth-of-type(6n+5)::after { background: var(--vermilion); }
.case-card:nth-of-type(6n+6)::after { background: var(--mustard); }

.case-card:hover, .case-card:has(.case-title-link:focus-visible), .case-card:has(.case-request-link:focus-visible) {
  background: var(--hover-panel);
  box-shadow: 0 0 0 14px var(--hover-panel);
}

.case-category {
  font: 600 0.625rem var(--font-body);
  letter-spacing: .14em;
  color: var(--muted);
  margin: 8px 0;
}

.case-thumb {
  height: 170px;
  position: relative;
  overflow: hidden;
}
.case-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.case-thumb-top img { object-position: top; }
.case-thumb-uxacumen-pos img { object-position: center -18px; }
.case-thumb-crossdiscipline-pos img { object-position: center -10px; }
.case-thumb-scale-70 img { object-fit: contain; transform: scale(.7); background: var(--parchment); }

.case-card h3 {
  font: 700 1rem/1.3 var(--font-heading);
  margin-top: 12px;
}
.case-title-link {
  color: inherit;
  text-decoration: none;
}
.case-title-link::after {
  content: '';
  position: absolute;
  inset: 0;
}
.case-title-link:hover, .case-title-link:focus-visible { text-decoration: underline; }

.case-blurb {
  font: 400 0.78125rem/1.55 var(--font-body);
  color: var(--muted);
  margin: 6px 0 8px;
}

.case-read-more {
  font: 700 0.6875rem var(--font-heading);
  letter-spacing: .1em;
  color: var(--vermilion-text);
}
.case-card:hover .case-read-more { color: var(--vermilion-text-hover); }

.case-request-link { color: inherit; text-decoration: none; }
.case-request-link::after { content: ''; position: absolute; inset: 0; }
.case-request-link:hover, .case-request-link:focus-visible { text-decoration: underline; }

.case-extra { display: none; }
.case-extra.is-open { display: block; }

.show-more-btn {
  border: 1px solid var(--ink);
  font: 700 0.75rem var(--font-heading);
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 0.9375rem 1.5625rem;
  transform: skewX(-12deg);
  text-align: center;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  width: 100%;
  margin-top: 30px;
}
.show-more-btn span { display: block; transform: skewX(12deg); }
.show-more-btn:hover, .show-more-btn:focus-visible { background: var(--mustard); }

/* ---------- Experience ---------- */
.experience { padding-block: 8px 40px; }
.section-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 52px;
}
.section-heading-row h2 {
  font: 700 1.25rem var(--font-heading);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.heading-rule { flex: 1; height: 1px; background: var(--ink); }
.heading-tick { width: 32px; height: 8px; background: var(--vermilion); transform: skewX(-30deg); flex: none; }

.experience-list { list-style: none; margin: 0; padding: 0; }

.role-row {
  position: relative;
  padding: 16px 0;
  border-top: 1px solid var(--ink);
}
.role-row::before {
  content: '';
  position: absolute; left: 0; top: -4px;
  width: 38px; height: 8px;
  transform: skewX(-30deg);
}
.role-row:nth-of-type(6n+1)::before { background: var(--vermilion); }
.role-row:nth-of-type(6n+2)::before { background: var(--mustard); }
.role-row:nth-of-type(6n+3)::before { background: var(--steel); }
.role-row:nth-of-type(6n+4)::before { background: var(--ink); }
.role-row:nth-of-type(6n+5)::before { background: var(--vermilion); }
.role-row:nth-of-type(6n+6)::before { background: var(--mustard); }
.role-title { font: 700 0.9375rem/1.3 var(--font-heading); margin: 0; }
.role-title .contract-note { font: 400 0.75rem var(--font-body); color: var(--muted); }
.role-meta { font: 500 0.75rem/1.5 var(--font-body); color: var(--muted); margin-top: 2px; }
.role-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.keyword-tag {
  font: 600 0.625rem/1.6 var(--font-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 4px 9px;
}

.prior-work { padding: 14px 0 0; border-top: 1px solid var(--ink); }
.prior-work-label {
  font: 700 0.6875rem var(--font-heading);
  letter-spacing: .18em;
  color: var(--muted);
  margin-bottom: 8px;
}
.prior-work-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.prior-work-title { font: 700 0.8125rem/1.35 var(--font-heading); }
.prior-work-title .contract-note { font: 400 0.6875rem var(--font-body); color: var(--muted); }
.prior-work-meta { font: 500 0.71875rem var(--font-body); color: var(--muted); margin-top: 2px; }

.role-extra { display: none; }
.role-extra.is-open { display: grid; }
.prior-work.role-extra.is-open { display: block; }

.download-resume-btn { margin-top: 8px; margin-bottom: 30px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--parchment);
  padding-block: 36px;
  position: relative;
  overflow: hidden;
}

.footer-heading-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
}
.footer-heading-row h2 {
  font: 700 1.5rem var(--font-heading);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.footer-heading-row .heading-rule { background: var(--parchment); opacity: .35; }

.footer-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.footer-name-title { font: 700 1.25rem var(--font-heading); text-transform: uppercase; letter-spacing: .04em; }
.footer-role { font: 600 0.8125rem var(--font-heading); letter-spacing: .18em; color: var(--mustard); margin-top: 8px; text-transform: uppercase; }
.footer-location { font: 400 0.84375rem var(--font-body); color: var(--footer-muted); margin-top: 6px; }

.footer-actions { display: flex; flex-direction: column; gap: 12px; }

.footer-bottom {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 28px 0 0;
}
.footer-copyright, .footer-credit {
  font: 400 0.75rem var(--font-body);
  color: var(--fine-print);
  margin: 0;
}
.footer-credit { font-size: 0.6875rem; }

/* ================= Desktop (≥768px), per 7a spec ================= */
@media (min-width: 768px) {
  .container { padding-inline: 48px; }

  .site-nav { display: flex; }
  .menu-toggle, .mobile-menu { display: none; }

  .hero { padding-block: 90px 36px; }
  .hero-grid {
    flex-direction: row;
    align-items: center;
    gap: 44px;
  }
  .hero-copy { flex: 1; min-width: 0; }
  .hero-copy h1 { font-size: 2.875rem; }
  .hero-welcome { font-size: 0.90625rem; max-width: 82ch; }
  .hero-cta { flex-direction: row; }
  .hero-cta .btn { width: auto; }

  .hero-portrait { width: 310px; height: 284px; order: 0; }
  .portrait-quarter { left: 5px; width: 114px; height: 114px; border-radius: 0 0 0 114px; }
  .portrait-arc { left: 36px; top: 8px; width: 228px; height: 228px; border-width: 15px; }
  .portrait-counter-arc { left: 16px; top: -11px; width: 266px; height: 266px; }
  .portrait-ladder { left: 296px; top: 116px; width: 33px; height: 93px; }
  .portrait-diamond { right: 20px; top: 11px; width: 28px; height: 28px; }
  .portrait-photo { left: 60px; top: 32px; width: 180px; height: 180px; border-width: 6px; }

  .case-studies { padding-block: 62px 56px; }
  .case-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 64px 44px; }
  .case-card { padding-top: 14px; }
  .case-card::after { width: 56px; height: 9px; }
  .case-category { font-size: 0.65625rem; margin: 10px 0; }
  .case-thumb { height: 150px; }
  .case-card h3 { font-size: 1.0625rem; margin-top: 14px; }
  .case-blurb { font-size: 0.8125rem; margin: 8px 0 10px; }
  .case-read-more { font-size: 0.75rem; }
  .case-extra { display: block !important; }
  .show-more-btn[data-group="cases"] { display: none; }

  .experience { padding-block: 12px 56px; }
  .section-heading-row h2 { font-size: 1.5rem; }
  .heading-tick { width: 40px; height: 9px; }
  .role-row { padding: 18px 0 16px; }
  .role-row::before { width: 44px; height: 9px; top: -5px; }
  .role-title { font-size: 1.0625rem; }
  .role-title .contract-note { font-size: 0.8125rem; }
  .role-meta { font-size: 0.8125rem; }
  .keyword-tag { font-size: 0.6875rem; }
  .prior-work { padding-top: 18px; }
  .prior-work-label { font-size: 0.75rem; margin-bottom: 10px; }
  .prior-work-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .prior-work-title { font-size: 0.875rem; }
  .prior-work-meta { font-size: 0.78125rem; }
  .role-extra { display: grid !important; }
  .prior-work.role-extra { display: block !important; }
  .show-more-btn[data-group="roles"] { display: none; }
  .download-resume-btn { display: inline-block; width: auto; margin-top: 32px; }

  .site-footer { padding-block: 48px; }
  .footer-heading-row h2 { font-size: 1.875rem; }
  .footer-heading-row .heading-tick { width: 40px; height: 9px; }
  .footer-row { flex-direction: row; justify-content: space-between; align-items: center; }
  .footer-name-title { font-size: 1.25rem; }
  .footer-role { font-size: 0.8125rem; }
  .footer-location { font-size: 0.84375rem; }
  .footer-actions { flex-direction: row; align-items: center; gap: 20px; }
  .footer-actions .btn { width: auto; }
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: baseline; margin-top: 38px; }
}
