/* ==========================================================================
   Nooshin Boroomand — Portfolio
   Visual language carried over from the 2021 site: Muli/Mulish throughout,
   heavy 800 headings, navy headings on gray body text, the pink accent,
   soft-shadow cards at 5px radius, and the fixed left sidebar.

   Two deliberate departures from the original, both for WCAG 2.1 AA:
   - the pink is #e70d3f in light mode (the original #f21e4e is 4.14:1 on
     white, which fails AA for normal text) and #f32b5a in dark mode
   - focus outlines are visible; the original set outline:none globally
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  --font: "Mulish", "Muli", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;

  /* Type scale — the original 40/32/28/24/20/16, made fluid */
  --fs-display: clamp(2rem, 1.3rem + 3.2vw, 3.25rem);
  --fs-h1: clamp(1.75rem, 1.35rem + 1.8vw, 2.5rem);
  --fs-h2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --fs-h3: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --fs-h5: 1.25rem;
  --fs-lede: clamp(1.0625rem, 1rem + 0.4vw, 1.1875rem);
  --fs-body: 1rem;
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;

  --fw-normal: 400;
  --fw-600: 600;
  --fw-700: 700;
  --fw-800: 800;
  --fw-900: 900;

  --lh-base: 1.618;
  --lh-tight: 1.25;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.875rem;
  --sp-7: 2.5rem;
  --sp-8: 3.5rem;
  --sp-9: 4.375rem;
  --sp-10: 6rem;

  /* Layout */
  --sidebar-w: 100px;
  --topbar-h: 64px;
  --container: 1280px;
  --gutter: 2.5rem;
  --measure: 68ch;

  --radius: 5px;
  --radius-circle: 50%;

  --ease: ease;
  --dur: 0.3s;
  --dur-slow: 0.6s;

  /* Color — light */
  --bg: #ffffff;
  --bg-light: #f8f9fa;
  --surface: #ffffff;
  --heading: #152035;
  --text: #454545;
  --muted: #6c757d;
  --border: #eeeeee;
  --border-control: #8a8a92;

  --accent: #e70d3f;
  --accent-decor: #f21e4e;
  --on-accent: #ffffff;
  --accent-soft: rgba(231, 13, 63, 0.08);
  --btn-hover-bg: #343a40;

  --shadow: 0 5px 20px 0 rgba(69, 67, 96, 0.1);
  --shadow-lg: 0 8px 30px 0 rgba(69, 67, 96, 0.14);
  --overlay: rgba(34, 34, 34, 0.55);
  --hero-scrim: rgba(255, 255, 255, 0.58);
  --focus: #152035;
}

/* Dark — system preference, unless the visitor explicitly chose light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c10;
    /* kept distinct from --surface so cards stay perceivable on tinted
       sections; the original theme used one value for both */
    --bg-light: #101116;
    --surface: #16161d;
    --heading: #ffffff;
    --text: rgba(255, 255, 255, 0.8);
    --muted: rgba(255, 255, 255, 0.7);
    --border: #262630;
    --border-control: #6d6d75;

    --accent: #f32b5a;
    --accent-decor: #f32b5a;
    --on-accent: #0b0c10;
    --accent-soft: rgba(243, 43, 90, 0.14);
    --btn-hover-bg: #343a40;

    --shadow: none;
    --shadow-lg: none;
    --overlay: rgba(11, 12, 16, 0.65);
    --hero-scrim: rgba(11, 12, 16, 0.82);
    --focus: #ffffff;
  }
}

/* Dark — explicit choice wins in both directions */
:root[data-theme="dark"] {
  --bg: #0b0c10;
  --bg-light: #101116;
  --surface: #16161d;
  --heading: #ffffff;
  --text: rgba(255, 255, 255, 0.8);
  --muted: rgba(255, 255, 255, 0.7);
  --border: #262630;
  --border-control: #6d6d75;

  --accent: #f32b5a;
  --accent-decor: #f32b5a;
  --on-accent: #0b0c10;
  --accent-soft: rgba(243, 43, 90, 0.14);
  --btn-hover-bg: #343a40;

  --shadow: none;
  --shadow-lg: none;
  --overlay: rgba(11, 12, 16, 0.65);
  --hero-scrim: rgba(11, 12, 16, 0.82);
  --focus: #ffffff;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--sp-7);
  overflow-x: hidden;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font);
  font-weight: var(--fw-800);
  line-height: var(--lh-tight);
  color: var(--heading);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

a:hover {
  color: var(--accent);
}

ul,
ol {
  padding: 0;
  list-style: none;
}

/* Visible focus — the original template disabled outlines globally */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background-color: var(--accent-soft);
  color: var(--heading);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   3. Utilities
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

@media (min-width: 48rem) {
  .container {
    padding-inline: var(--gutter);
  }
}

.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;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 2000;
  padding: var(--sp-2) var(--sp-4);
  background-color: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-sm);
  font-weight: var(--fw-700);
  border-radius: var(--radius);
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-color: var(--focus);
}

.measure {
  max-width: var(--measure);
}

.eyebrow {
  font-size: var(--fs-xs);
  font-weight: var(--fw-700);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow-muted {
  color: var(--muted);
}

.lede {
  font-size: var(--fs-lede);
  color: var(--text);
}

.section {
  padding-block: var(--sp-9);
}

.section-light {
  background-color: var(--bg-light);
}

/* Section title with the pink bar at its left */
.section-head {
  margin-bottom: var(--sp-7);
}

.section-title {
  position: relative;
  padding-left: 14px;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 3px;
  border-radius: 2px;
  background-color: var(--accent-decor);
}

.section-title h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-800);
}

.section-title p {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: var(--sp-1);
}

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */

.btn-custom {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px 24px;
  background-color: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-body);
  font-weight: var(--fw-700);
  line-height: 24px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.btn-custom:hover,
.btn-custom:focus-visible {
  background-color: var(--btn-hover-bg);
  color: #ffffff;
}

.btn-outline {
  background-color: transparent;
  color: var(--heading);
  border: 1px solid var(--border-control);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background-color: var(--btn-hover-bg);
  border-color: var(--btn-hover-bg);
  color: #ffffff;
}

.link-accent {
  color: var(--accent);
  font-weight: var(--fw-700);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.link-accent svg {
  transition: transform var(--dur) var(--ease);
}

.link-accent:hover {
  color: var(--accent);
}

.link-accent:hover svg {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   5. Sidebar (the old header-left)
   -------------------------------------------------------------------------- */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background-color: var(--bg);
  border-right: 1px solid var(--border);
  z-index: 999;
  transition: background-color var(--dur) var(--ease);
}

.sidebar-logo {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  width: 40px;
  height: 40px;
  margin: auto;
  border-radius: var(--radius-circle);
  background-color: var(--accent);
  color: var(--on-accent);
  font-size: 18px;
  font-weight: var(--fw-800);
  line-height: 40px;
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(231, 13, 63, 0.2), 0 2px 4px -1px rgba(231, 13, 63, 0.12);
  transition: transform var(--dur) var(--ease);
}

.sidebar-logo:hover {
  color: var(--on-accent);
  transform: scale(1.06);
}

/* Rotated vertical nav strip, as on the original site */
.sidebar-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vh;
  height: var(--sidebar-w);
  transform-origin: left top;
  transform: rotate(-90deg) translateX(-100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav ul {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: var(--sp-6);
}

.sidebar-nav a {
  display: block;
  padding: var(--sp-2) var(--sp-1);
  font-size: var(--fs-body);
  font-weight: var(--fw-700);
  color: var(--text);
  white-space: nowrap;
}

.sidebar-nav a:hover,
.sidebar-nav a[aria-current] {
  color: var(--accent);
}

.sidebar-actions {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-circle);
  color: var(--text);
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: block;
  }
}

/* Hamburger — desktop hides it */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 1px solid var(--border-control);
  border-radius: var(--radius);
  color: var(--heading);
  cursor: pointer;
}

.menu-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.menu-toggle .icon-close {
  display: none;
}

.sidebar[data-open="true"] .menu-toggle .icon-open {
  display: none;
}

.sidebar[data-open="true"] .menu-toggle .icon-close {
  display: block;
}

/* Main content is inset by the sidebar width */
.main {
  margin-left: var(--sidebar-w);
  transition: margin-left var(--dur) var(--ease);
}

/* --- Mobile: sidebar becomes a top bar with a drawer --------------------- */
@media (max-width: 61.99rem) {
  .sidebar {
    width: 100%;
    height: var(--topbar-h);
    border-right: 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: var(--sp-5);
  }

  .sidebar-logo {
    position: static;
    margin: 0;
  }

  .sidebar-actions {
    position: static;
    gap: var(--sp-3);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .sidebar-nav {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    transform: none;
    background-color: var(--bg);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: var(--sp-8);
  }

  .sidebar[data-open="true"] .sidebar-nav {
    display: flex;
  }

  .sidebar-nav ul {
    flex-direction: column;
    gap: var(--sp-6);
    text-align: center;
  }

  .sidebar-nav a {
    font-size: var(--fs-h3);
    font-weight: var(--fw-800);
    color: var(--heading);
  }

  .main {
    margin-left: 0;
    padding-top: var(--topbar-h);
  }
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */

/* Full-viewport hero over a photograph, as on the original site. The scrim
   is opaque enough that every text/background pair still clears AA no matter
   which part of the image sits behind it. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding-block: var(--sp-10);
  background-color: var(--bg-light);
  background-image: url("../img/bg/hero-bg.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Set to the lightest value that still clears AA everywhere, measured against
   the composited pixels behind each text element (light 0.55 / dark 0.78 are
   the floors; these carry a small margin). */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--hero-scrim);
}

.hero > .container {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-inner {
  max-width: 780px;
}

/* Social icons, top-left of the hero */
.social-home {
  position: absolute;
  top: var(--sp-6);
  left: 0;
  right: 0;
  z-index: 2;
}

.social-home ul {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.social-home a,
.social-sidebar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-circle);
  color: var(--text);
}

.social-home a:hover,
.social-sidebar a:hover {
  color: var(--accent);
}

/* Social icons stacked at the foot of the sidebar, above the theme toggle */
.social-sidebar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5.25rem;
}

.social-sidebar ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}

/* The top bar has no room for them; the hero strip covers this on mobile */
@media (max-width: 61.99rem) {
  .social-sidebar {
    display: none;
  }
}

.hero h6 {
  font-size: var(--fs-body);
  font-weight: var(--fw-400);
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

.hero h1 {
  font-size: var(--fs-display);
  font-weight: var(--fw-900);
  line-height: 1.15;
  margin-bottom: var(--sp-5);
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-lede {
  max-width: 620px;
  margin-bottom: var(--sp-6);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-7);
}

.my-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}

/* Pinned to the bottom edge of the hero on wide screens, in flow below it
   on small ones so it can never overlap the headline */
@media (min-width: 62rem) {
  .hero-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--sp-6);
    z-index: 2;
  }

  .hero-bottom .my-info {
    border-top: 0;
    padding-top: 0;
  }
}

.my-info .item p:first-child {
  font-weight: var(--fw-700);
  color: var(--heading);
  font-size: var(--fs-sm);
  margin-bottom: 2px;
}

.my-info .item p:last-child,
.my-info .item a {
  font-size: var(--fs-sm);
  color: var(--text);
}

.my-info .item a:hover {
  color: var(--accent);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  padding: 4px 14px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-700);
  color: var(--accent);
  background-color: var(--surface);
  border: 1px solid var(--accent-soft);
  border-radius: 100px;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--radius-circle);
  background-color: var(--accent);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   7. Work cards
   -------------------------------------------------------------------------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
  gap: var(--sp-6);
}

/* Four case studies read better as 2x2 than as three-plus-one, and the larger
   cards give the screenshots room */
@media (min-width: 62rem) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.work-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.work-card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background-color: var(--bg-light);
}

.work-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}

.work-card:hover .work-card-media img {
  transform: scale(1.2);
}

.work-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--overlay);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease);
}

.work-card:hover .work-card-overlay,
.work-card:focus-within .work-card-overlay {
  opacity: 1;
}

.work-card-overlay span {
  color: #ffffff;
  font-weight: var(--fw-700);
  font-size: var(--fs-sm);
  border: 1px solid #ffffff;
  border-radius: var(--radius);
  padding: 6px 16px;
}

.work-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--sp-5);
}

.work-card-body .eyebrow {
  margin-bottom: var(--sp-2);
}

.work-card h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-800);
  margin-bottom: var(--sp-3);
}

.work-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.work-card h3 a {
  color: var(--heading);
}

.work-card h3 a:hover {
  color: var(--accent);
}

.work-card h3 a:focus-visible {
  outline: none;
}

.work-card h3 a:focus-visible::after {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.work-card-summary {
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.tag {
  font-size: var(--fs-xs);
  font-weight: var(--fw-600);
  color: var(--muted);
  background-color: var(--bg-light);
  border-radius: 100px;
  padding: 3px 12px;
  white-space: nowrap;
}

.work-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--muted);
  font-weight: var(--fw-600);
}

.work-card-meta .arrow {
  margin-left: auto;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   8. Compact list — secondary projects
   -------------------------------------------------------------------------- */

.compact-list {
  display: grid;
  gap: var(--sp-5);
}

.compact-item {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-5);
}

@media (min-width: 62rem) {
  .compact-item {
    display: grid;
    grid-template-columns: minmax(0, 16rem) minmax(0, 1fr) auto;
    gap: var(--sp-5);
    align-items: start;
  }
}

.compact-item h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-800);
  margin-bottom: var(--sp-2);
}

.compact-item p {
  font-size: var(--fs-sm);
}

.compact-item-meta {
  font-size: var(--fs-xs);
  font-weight: var(--fw-600);
  color: var(--muted);
  white-space: nowrap;
  margin-top: var(--sp-2);
}

@media (min-width: 62rem) {
  .compact-item-meta {
    margin-top: 0;
    text-align: right;
  }
}

/* --------------------------------------------------------------------------
   9. Mini cards — earlier work
   -------------------------------------------------------------------------- */

.mini-grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.mini-card {
  position: relative;
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-5);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.mini-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.mini-card-media {
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background-color: var(--bg-light);
  margin: calc(var(--sp-5) * -1) calc(var(--sp-5) * -1) var(--sp-5);
  border-radius: var(--radius) var(--radius) 0 0;
}

.mini-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}

.mini-card:hover .mini-card-media img {
  transform: scale(1.08);
}

.mini-card h3 {
  font-size: var(--fs-h5);
  font-weight: var(--fw-800);
  margin-bottom: var(--sp-2);
}

.mini-card h3 a {
  color: var(--heading);
}

.mini-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.mini-card h3 a:hover {
  color: var(--accent);
}

.mini-card h3 a:focus-visible {
  outline: none;
}

.mini-card h3 a:focus-visible::after {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.mini-card p {
  font-size: var(--fs-sm);
}

/* --------------------------------------------------------------------------
   10. About
   -------------------------------------------------------------------------- */

.about-grid {
  display: grid;
  gap: var(--sp-7);
}

@media (min-width: 62rem) {
  .about-grid {
    grid-template-columns: 20rem 1fr;
    gap: var(--sp-8);
    align-items: start;
  }
}

.about-portrait {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
  background-color: var(--bg-light);
}

.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-body .about-lead {
  font-size: var(--fs-h5);
  font-weight: var(--fw-800);
  margin-bottom: var(--sp-4);
}

.about-body p + p {
  margin-top: var(--sp-4);
}

.about-body p {
  max-width: var(--measure);
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.capabilities {
  display: grid;
  gap: var(--sp-5);
  margin-top: var(--sp-7);
}

@media (min-width: 48rem) {
  .capabilities {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-6);
  }
}

.capability {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-5);
}

.capability h3 {
  font-size: var(--fs-xs);
  font-weight: var(--fw-800);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

.capability p {
  font-size: var(--fs-sm);
}

/* --------------------------------------------------------------------------
   11. Contact & footer
   -------------------------------------------------------------------------- */

.contact-title {
  font-size: var(--fs-h1);
  font-weight: var(--fw-800);
  margin-bottom: var(--sp-4);
  max-width: 22ch;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.site-footer {
  margin-left: var(--sidebar-w);
  padding-block: var(--sp-6);
  background-color: var(--bg-light);
  color: var(--muted);
  font-size: var(--fs-sm);
  border-top: 1px solid var(--border);
  transition: margin-left var(--dur) var(--ease);
}

@media (max-width: 61.99rem) {
  .site-footer {
    margin-left: 0;
  }
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   12. Case study pages
   -------------------------------------------------------------------------- */

.case-hero {
  padding-block: var(--sp-8) var(--sp-7);
  background-color: var(--bg-light);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-700);
  color: var(--muted);
  margin-bottom: var(--sp-5);
}

.back-link:hover {
  color: var(--accent);
}

.case-title {
  font-size: var(--fs-h1);
  font-weight: var(--fw-800);
  max-width: 22ch;
  margin-block: var(--sp-3) var(--sp-4);
}

.case-lede {
  max-width: 62ch;
}

.case-summary {
  display: grid;
  gap: var(--sp-5);
  margin-top: var(--sp-6);
  padding: var(--sp-5);
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (min-width: 48rem) {
  .case-summary {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-6);
  }
}

.case-summary dt {
  font-size: var(--fs-xs);
  font-weight: var(--fw-800);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}

.case-summary dd {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-700);
  color: var(--heading);
}

.outcome-list {
  display: grid;
  gap: var(--sp-5);
  margin-top: var(--sp-7);
}

@media (min-width: 48rem) {
  .outcome-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.outcome {
  padding-left: 14px;
  position: relative;
}

.outcome::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 3px;
  border-radius: 2px;
  background-color: var(--accent-decor);
}

.outcome strong {
  display: block;
  font-size: var(--fs-h3);
  font-weight: var(--fw-800);
  color: var(--heading);
  margin-bottom: var(--sp-1);
}

.outcome span {
  font-size: var(--fs-sm);
}

/* Long-form prose */
.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: var(--sp-4);
}

.prose h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-800);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-4);
  scroll-margin-top: var(--sp-7);
  position: relative;
  padding-left: 14px;
}

.prose h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 3px;
  border-radius: 2px;
  background-color: var(--accent-decor);
}

.prose h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-800);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
}

.prose strong {
  color: var(--heading);
  font-weight: var(--fw-800);
}

.prose a {
  color: var(--accent);
  font-weight: var(--fw-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose ul {
  display: grid;
  gap: var(--sp-3);
}

.prose ul li {
  position: relative;
  padding-left: var(--sp-5);
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 2px;
  border-radius: 1px;
  background-color: var(--accent-decor);
}

.prose ol {
  list-style: decimal;
  padding-left: var(--sp-5);
  display: grid;
  gap: var(--sp-3);
}

.prose ol li {
  padding-left: var(--sp-2);
}

.prose ol li::marker {
  color: var(--accent);
  font-weight: var(--fw-800);
}

blockquote {
  margin-block: var(--sp-6);
  padding: var(--sp-5);
  background-color: var(--bg-light);
  border-left: 3px solid var(--accent-decor);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--fs-lede);
  font-weight: var(--fw-600);
  color: var(--heading);
}

.figure {
  margin-block: var(--sp-7);
}

.figure img,
.figure .placeholder {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
}

.figure figcaption {
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--muted);
  max-width: var(--measure);
}

.figure-wide {
  max-width: var(--container);
}

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  min-height: 10rem;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-light);
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(108, 117, 125, 0.07) 10px,
    rgba(108, 117, 125, 0.07) 20px
  );
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-600);
  text-align: center;
}

.placeholder span {
  display: block;
  max-width: 34ch;
  line-height: 1.5;
}

.figure-pair {
  display: grid;
  gap: var(--sp-5);
  margin-block: var(--sp-7);
}

@media (min-width: 48rem) {
  .figure-pair {
    grid-template-columns: 1fr 1fr;
  }
}

.figure-pair .figure {
  margin-block: 0;
}

.note {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  margin-block: var(--sp-6);
  background-color: var(--bg-light);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  max-width: var(--measure);
}

.note svg {
  flex-shrink: 0;
  margin-top: 0.25em;
  color: var(--accent);
}

.case-next {
  padding-block: var(--sp-8);
  background-color: var(--bg-light);
}

.case-next a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.case-next h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-800);
  max-width: 24ch;
}

.case-next a:hover h2 {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   13. Hero on small screens
   -------------------------------------------------------------------------- */

@media (max-width: 61.99rem) {
  .hero {
    min-height: calc(100vh - var(--topbar-h));
    padding-block: var(--sp-10) var(--sp-8);
  }

  .social-home {
    top: var(--sp-5);
  }

  .social-home ul {
    gap: var(--sp-3);
  }
}

/* --------------------------------------------------------------------------
   14. Contact form
   -------------------------------------------------------------------------- */

.contact-form {
  display: grid;
  gap: var(--sp-4);
  max-width: 40rem;
  margin-top: var(--sp-6);
}

@media (min-width: 48rem) {
  .contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
  }
}

.form-group label {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-700);
  color: var(--heading);
}

.form-group .req {
  color: var(--accent);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-control);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.form-control::placeholder {
  color: var(--muted);
}

.form-control:hover {
  border-color: var(--heading);
}

.form-control:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--accent);
}

textarea.form-control {
  resize: vertical;
  min-height: 8rem;
}

/* Native validation styling only after the field has been interacted with */
.form-control:user-invalid {
  border-color: var(--accent);
}

.form-error {
  display: none;
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-600);
  color: var(--accent);
}

.form-control:user-invalid ~ .form-error {
  display: block;
}

.form-status {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: var(--fw-600);
}

.form-status:empty {
  display: none;
}

.form-status[data-state="success"] {
  background-color: var(--surface);
  border-left: 3px solid var(--accent-decor);
  color: var(--heading);
  box-shadow: var(--shadow);
}

.form-status[data-state="error"] {
  background-color: var(--surface);
  border-left: 3px solid var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.contact-form button[type="submit"] {
  justify-self: start;
}

.contact-form button[aria-busy="true"] {
  opacity: 0.7;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   15. Case study reading column
   The narrow blocks (title, lede, prose, captions) carry max-widths, which
   left-aligned them inside the full-width container. Centering them makes the
   article sit in the middle of the page while figures keep their full width.
   -------------------------------------------------------------------------- */

article .container {
  max-width: 68rem;
}

/* One reading column, so every text block shares the same left and right edge.
   A single rem width rather than the ch-based measure, because ch is relative
   to each element's own font size and would give the title a different edge. */
article .case-title,
article .case-lede,
article .prose,
article .note,
article .figure figcaption {
  max-width: 38rem;
  margin-inline: auto;
}

/* The kicker and back link join the same column. margin-left rather than a
   width, so the link's click target stays the size of the link. */
article .case-hero .eyebrow {
  max-width: 38rem;
  margin-inline: auto;
}

article .back-link {
  margin-left: calc(50% - 19rem);
}

/* Figures stay full width so the work is still shown large */
article .figure-wide {
  max-width: 100%;
}

@media (max-width: 61.99rem) {
  article .case-title,
  article .case-lede,
  article .prose,
  article .note,
  article .figure figcaption,
  article .case-hero .eyebrow {
    max-width: 100%;
  }
  article .back-link {
    margin-left: 0;
  }
}

/* --------------------------------------------------------------------------
   16. Inline diagrams
   Redrawn flows, so they stay sharp and follow the theme.
   -------------------------------------------------------------------------- */

.diagram {
  padding: var(--sp-6) var(--sp-5);
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.diagram svg {
  width: 100%;
  height: auto;
  display: block;
  color: var(--text);
}

.diagram .d-node rect {
  fill: var(--bg-light);
  stroke: var(--heading);
  stroke-width: 1.5;
}

.diagram .d-node text {
  fill: var(--heading);
  font-family: var(--font);
  font-size: 19px;
  font-weight: 700;
  text-anchor: middle;
}

.diagram .d-line path {
  fill: none;
  stroke: var(--heading);
  stroke-width: 1.5;
}

.diagram .d-label text {
  fill: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  text-anchor: middle;
}
