/* Shared palette, typography, navigation, footer, and contact across the portfolio. */
:root {
  --ink: #111111;
  --muted: #555555;
  --paper: #ffffff;
  --dark: #0a0a0a;
  --accent: #b85a24;
  --line: #dddddd;
  --header-height: 108px;
  --reading-progress: 0;
  --focus-color: var(--accent);
  --page-width: 1320px;
  --frame-gutter: 12px;
  --background: #ffffff;
  --foreground: #111111;
  --subtle: #666666;
  --surface: #f1f0ef;
  --surface-2: #ecebea;
}
* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 18px); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'Onest', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; border: 0; }
a, button { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: #ffffff; }
:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 5px; }
.page-width { width: min(var(--page-width), calc(100% - 112px)); margin-inline: auto; }
.section-space { padding-block: 110px; }
em { font-family: inherit; font-style: normal; font-weight: 600; }
h2 { font-size: clamp(40px, 4.45vw, 64px); line-height: 1.09; letter-spacing: -.055em; font-weight: 600; }
h2 em { color: var(--accent); font-size: inherit; letter-spacing: inherit; }
.section-top { display: flex; justify-content: space-between; align-items: baseline; gap: 30px; margin-bottom: 70px; }
.section-label, .eyebrow, .micro-label { font-size: 11px; font-weight: 500; letter-spacing: .08em; line-height: 1.5; }
.section-label { display: inline-flex; align-items: center; gap: 15px; color: #444444; }
.section-label > span { display: inline-flex; align-items: center; gap: 15px; color: var(--accent); }
.section-label > span:after { content: ''; height: 1px; width: 40px; background: currentColor; }
.section-aside { font-size: 12px; color: var(--muted); }
.large-copy { font-size: 25px; line-height: 1.55; letter-spacing: -.035em; }
.text-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 32px; background: none; border-bottom: 1px solid currentColor; padding: 0 0 9px; font-size: 13px; font-weight: 500; transition: color .25s; }
.text-link > span { font-size: 21px; }
.text-link:hover { color: var(--accent); }
.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 25px; padding: 7px 7px 7px 23px; min-height: 54px; font-size: 13px; font-weight: 500; border: 1px solid transparent; border-radius: 999px; background: var(--dark); color: #ffffff; transition: background .25s, color .25s, transform .25s; }
.button > span { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; background: #ffffff; color: var(--ink); font-size: 21px; line-height: 1; }
.button:hover { background: var(--accent); transform: translateY(-2px); }
.button-dark { background: var(--dark); color: #ffffff; }
.button-light { background: #ffffff; color: var(--ink); }
.button-light > span { background: var(--dark); color: #ffffff; }
.button-light:hover { background: var(--accent); color: var(--ink); }
.button-outline { background: transparent; color: var(--ink); border-color: #1111113b; }
.button-outline > span { background: transparent; color: inherit; }
.button-outline:hover { background: #ffffff; border-color: var(--accent); color: var(--accent); }
.quiet-link { display: inline-flex; align-items: center; gap: 20px; font-size: 13px; font-weight: 500; border: 1px solid var(--line); border-radius: 999px; padding: 17px 24px; transition: border-color .25s, color .25s; }
.quiet-link:hover { color: var(--accent); border-color: currentColor; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 200; background: var(--paper); color: var(--dark); padding: 12px 18px; border-radius: 8px; transform: translateY(-180%); }
.skip-link:focus { transform: none; }

/* The pale header is the same on the homepage and every case study. */
.site-header { position: sticky; top: 0; z-index: 50; margin-inline: var(--frame-gutter); padding-block: var(--frame-gutter); background: var(--paper); color: var(--ink); }
.header-inner.page-width { width: 100%; }
.header-inner { min-height: 84px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; padding-inline: clamp(28px, 3vw, 58px); background: var(--surface-2); border-radius: 28px; transition: box-shadow .25s; }
.site-header.is-scrolled .header-inner { box-shadow: 0 8px 24px #00000008; }
.brand { display: inline-flex; gap: 12px; align-items: center; justify-self: start; white-space: nowrap; }
.brand img { width: 39px; height: auto; }
.brand > span { font-size: 15px; line-height: 1.4; font-weight: 600; letter-spacing: -.035em; }
.desktop-nav { display: flex; gap: 24px; align-items: center; justify-self: end; font-size: 13px; white-space: nowrap; }
.desktop-nav a { position: relative; padding: 15px 0; color: #444444; transition: color .25s; }
.desktop-nav a:hover, .desktop-nav a[aria-current] { color: var(--accent); }
.desktop-nav a[aria-current]:after { content: ''; position: absolute; bottom: 7px; left: 0; width: 100%; height: 1px; background: currentColor; }
.header-tools { display: none; align-items: center; justify-content: flex-end; gap: 10px; }
.menu-toggle { min-height: 40px; display: none; align-items: center; justify-content: center; gap: 9px; border: 1px solid #ffffffb3; border-radius: 15px; background: #ffffff8c; padding: 10px 14px; font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; transition: background .2s, color .2s; }
.menu-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.menu-toggle:hover, .menu-toggle[aria-expanded=true] { background: #ffffff; color: var(--accent); }
.mobile-nav { display: none; position: absolute; right: clamp(16px, 3vw, 58px); top: calc(100% + 8px); width: min(360px, calc(100% - 32px)); max-height: calc(100dvh - var(--header-height) - 26px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface-2); border: 1px solid #ffffff; border-radius: 24px; padding: 16px 26px; box-shadow: 0 18px 55px #0000001f; }
.mobile-nav a { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 13px 2px; font-size: 18px; font-weight: 500; letter-spacing: -.025em; border-bottom: 1px solid #11111112; }
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a:after { content: '↗'; font-size: 20px; }
.mobile-nav a:hover, .mobile-nav a[aria-current] { color: var(--accent); }
.reading-progress { position: absolute; bottom: var(--frame-gutter); left: 28px; width: calc(100% - 56px); height: 2px; transform: scaleX(var(--reading-progress)); transform-origin: left; background: var(--accent); }

/* Shared contact and footer panel. */
.contact-section { --focus-color: var(--accent); margin: 12px var(--frame-gutter) var(--frame-gutter); border-radius: 28px; background: var(--dark); color: #ffffff; padding: 75px 0 28px; }
.contact-section .section-label { color: #cccccc; }
.contact-section .section-label > span { color: var(--accent); }
.contact-section .section-aside { color: #bbbbbb; }
.contact-section .section-top { margin-bottom: 60px; }
.contact-section h2 { font-size: clamp(30px, 4.5vw, 68px); white-space: nowrap; letter-spacing: -.055em; font-weight: 600; }
.contact-section h2 em { color: var(--accent); }
.contact-actions { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 38px 0 75px; }
.contact-email { font-size: 19px; letter-spacing: -.025em; padding-bottom: 10px; border-bottom: 1px solid #555555; }
.contact-email > span { margin-left: 40px; color: var(--accent); }
.contact-section a:hover { color: var(--accent); }
.contact-section .button-light:hover { color: var(--ink); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 28px; border-top: 1px solid #ffffff30; padding-top: 27px; font-size: 11px; color: #bbbbbb; }
.footer-brand { display: flex; gap: 17px; align-items: center; }
.footer-brand img { width: 34px; height: auto; filter: invert(1); }
.footer-bottom nav { display: flex; gap: 25px; }
.contact-dialog { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 24px; padding: 38px; width: min(510px, calc(100% - 32px)); max-height: calc(100svh - 40px); overflow: auto; box-shadow: 0 24px 90px #0003; }
.contact-dialog::backdrop { background: #00000088; backdrop-filter: blur(6px); }
body:has(.contact-dialog[open]) { overflow: hidden; }
.dialog-close { min-height: 44px; min-width: 44px; position: absolute; right: 15px; top: 12px; background: none; font-size: 28px; line-height: 1; }
.contact-dialog h2 { font-size: 33px; margin: 17px 0 26px; }
.contact-dialog form { display: grid; gap: 17px; }
.contact-dialog label { display: block; font-size: 12px; font-weight: 500; }
.contact-dialog input, .contact-dialog textarea { display: block; width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; font-size: 14px; color: var(--ink); }
.contact-dialog textarea { resize: vertical; }
.form-note, .form-status { font-size: 12px; line-height: 1.65; color: #666666; }
.form-status a { text-decoration: underline; }
.form-submit { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 7px 7px 7px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; }
.form-submit > span { display: grid; place-items: center; width: 36px; height: 36px; background: #ffffff; color: var(--ink); border-radius: 50%; font-size: 20px; }
.form-submit:hover { background: var(--accent); }
@media(min-width:1700px) {
  :root { --page-width: 1440px; }
  .desktop-nav { font-size: 14px; gap: 30px; }
  .menu-toggle { font-size: 11px; }
}
@media(max-width:1150px) {
  .page-width { width: calc(100% - 72px); }
  .desktop-nav { gap: 20px; font-size: 12px; }
}
@media(max-width:1100px) {
  .header-tools { display: flex; }
  .menu-toggle { display: inline-flex; }
  .mobile-nav:not([hidden]) { display: block; }
  .header-inner { grid-template-columns: 1fr auto; }
  .desktop-nav { display: none; }
}
@media(max-width:800px) {
  :root { --header-height: 96px; }
  .page-width { width: calc(100% - 48px); }
  .header-inner { min-height: 72px; padding-inline: 24px; border-radius: 24px; }
  .section-space { padding-block: 75px; }
  .section-top { margin-bottom: 45px; }
  .section-aside { font-size: 10px; max-width: 230px; text-align: right; line-height: 1.6; }
  .contact-section { padding-block: 60px 25px; border-radius: 24px; }
  .contact-section .section-top { margin-bottom: 40px; }
  .contact-section h2 { font-size: 4.65vw; }
  .contact-email { font-size: 15px; }
  .contact-email > span { margin-left: 20px; }
  .contact-actions { gap: 25px; padding-bottom: 60px; }
  .contact-actions .button { font-size: 12px; gap: 16px; }
  .footer-bottom { flex-wrap: wrap; font-size: 10px; }
}
@media(max-width:600px) {
  .header-inner { gap: 16px; }
}
@media(max-width:520px) {
  :root { --frame-gutter: 8px; --header-height: 88px; }
  .page-width { width: calc(100% - 40px); }
  .header-inner { padding-inline: 16px; }
  .brand img { width: 32px; }
  .brand { gap: 9px; }
  .brand > span { font-size: 13px; }
  .menu-toggle { padding-inline: 11px; gap: 7px; }
  .mobile-nav { right: 8px; width: calc(100% - 16px); border-radius: 20px; }
  .section-space { padding-block: 59px; }
  .section-top { margin-bottom: 35px; }
  .section-label { font-size: 10px; gap: 12px; }
  .section-label > span { gap: 12px; }
  .section-label > span:after { width: 25px; }
  .section-aside { display: none; }
  h2 { font-size: 37px; line-height: 1.13; }
  .large-copy { font-size: 22px; }
  .text-link { font-size: 12px; }
  .contact-section { padding-top: 54px; }
  .contact-section .section-top { margin-bottom: 30px; }
  .contact-section h2 { font-size: 36px; white-space: normal; }
  .contact-actions { align-items: flex-start; flex-direction: column; gap: 30px; padding-top: 26px; padding-bottom: 45px; }
  .contact-email { font-size: 14px; }
  .contact-email > span { margin-left: 12px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 25px; font-size: 10px; }
  .footer-bottom nav { gap: 24px; }
  .contact-dialog { padding: 30px 23px; }
  .contact-dialog h2 { font-size: 29px; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  *, *:before, *:after { animation: none !important; transition: none !important; }
}

/* Vector arrows keep their visual centre across browser fonts. */
.button > span svg,.text-link > span svg,span[aria-hidden="true"] > svg{display:block;width:22px;height:22px}
@media(max-width:600px){
  .button{max-width:100%;gap:16px;line-height:1.4;text-align:left}
  .button > span{align-self:center}
}

/* Keep the contact address and its arrow together at every breakpoint. */
.contact-email { display: inline-flex; align-items: center; flex-wrap: nowrap; gap: clamp(10px,2vw,28px); white-space: nowrap; max-width: 100%; }
.contact-email > span { display: inline-flex; flex: 0 0 auto; margin-left: 0; }
.contact-email > span svg { display: block; width: 1.25em; height: 1.25em; }
@media(max-width:380px) { .contact-email { font-size: 12px; gap: 8px; } }

/* Shared resume action and matching outlined-button focus state. */
.desktop-nav .header-resume { padding: 12px 17px; border: 1px solid currentColor; border-radius: 999px; color: var(--accent); }
.button-outline:focus-visible { color: var(--accent); border-color: var(--accent); }

/* Resume button interaction states. */
.desktop-nav .header-resume { transition: background .2s, color .2s, border-color .2s, transform .2s; }
.desktop-nav .header-resume:hover,
.desktop-nav .header-resume:focus-visible { background: var(--dark); color: #fff; border-color: var(--dark); transform: translateY(-2px); }
.desktop-nav .header-resume:active { transform: translateY(0) scale(.98); }
.mobile-nav .header-resume:hover,
.mobile-nav .header-resume:focus-visible,
.mobile-nav .header-resume:active { color: var(--accent); background: #ffffff; }
@media(prefers-reduced-motion:reduce) { .desktop-nav .header-resume { transition: none; } .desktop-nav .header-resume:hover, .desktop-nav .header-resume:focus-visible, .desktop-nav .header-resume:active { transform: none; } }

/* Legal links sit beside the social links in the shared footer. */
@media(max-width:900px) { .footer-bottom .footer-legal { order: 3; } }
