/* =====================================================================
   1. BASE VARIABLES
   ===================================================================== */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #2f2b2a;
  --muted: #5d5653;
  --line: transparent;
  --red: #a91815;
  --clay: #a91815;
  --focus: #a91815;
  --shadow: none;
  --max: 1360px;

  /* Heading scale — change these values to resize headings site-wide.
       Each tier is reused by several selectors, and redefined per
       breakpoint at the bottom of this file (see MEDIA QUERIES). */
  --h1: 4rem; /* Hero h1: home, page, contact, case */
  --h2: 2.6rem; /* Standard section h2 */
  --h2-feature: 3.8rem; /* Large feature h2: person-section, sentiments, recommendations, cv */
  --h2-case-section: 3rem; /* Case study custom-section h2 */
  --h2-gallery: 3.2rem; /* Gallery heading h2 */
  --h2-contact: 3.4rem; /* Contact form intro h2 */
}

/* =====================================================================
     2. RESET AND GLOBAL ELEMENTS
     ===================================================================== */
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
  line-height: 1.55;
}

body,
button,
input,
textarea,
select {
  color: var(--ink);
}

strong,
b,
.nav__links,
.nav__dropdown-menu,
.text-link,
.filter-chip,
.project-card__tags,
.eyebrow,
.brand,
.icon-link {
  color: var(--ink);
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

p,
li,
figcaption,
.prose p,
.project-card__body p,
.project-card__body span,
.result-count,
.case-meta p,
.case-content p,
.quote-card figcaption,
.site-footer {
  color: var(--ink);
}

/* =====================================================================
     3. ACCESSIBILITY HELPERS
     ===================================================================== */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  background: var(--ink);
  color: var(--surface);
  left: 1rem;
  padding: 0.75rem 1rem;
  position: absolute;
  top: 0.75rem;
  transform: translateY(-140%);
  z-index: 20;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

/* =====================================================================
     4. NAVIGATION
     ===================================================================== */
.site-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr auto;
  margin: 0 auto;
  max-width: var(--max);
  min-height: 76px;
  padding: 0 1.25rem;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 700;
}

.brand__mark {
  align-items: center;
  border: 1px solid var(--red);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand__mark,
.brand__name {
  display: none;
}

.brand__name,
.nav__links {
  font-size: 0.92rem;
}

.brand__logo {
  height: 44px;
  object-fit: contain;
  width: 168px;
}

.nav__links {
  align-items: center;
  display: flex;
  gap: 1.35rem;
  justify-content: center;
  font-weight: 600;
}

.nav__links a[aria-current="page"] {
  color: var(--red);
}

.nav__dropdown {
  position: relative;
}

.nav__dropdown-menu {
  background: var(--surface);
  border: 0;
  box-shadow: none;
  display: grid;
  gap: 0.15rem;
  left: 50%;
  min-width: 210px;
  opacity: 0;
  padding: 0.8rem;
  pointer-events: none;
  position: absolute;
  top: 100%;
  transform: translate(-50%, 0);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 2;
  font-weight: 600;
}

.nav__dropdown::after {
  content: "";
  display: block;
  height: 0.9rem;
  left: 50%;
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
  width: 210px;
  z-index: 1;
}

.nav__dropdown:hover .nav__dropdown-menu,
.nav__dropdown:focus-within .nav__dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.nav__dropdown-menu a {
  padding: 0.55rem 0.65rem;
  color: var(--ink);
  font-weight: 600;
}

.nav__icons {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: end;
}

.icon-link {
  align-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--red);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  padding: 0;
  transition: color 160ms ease, transform 160ms ease;
  width: 42px;
}

.icon-link svg {
  display: block;
  height: 42px;
  overflow: visible;
  width: 42px;
}

.icon-link__circle {
  fill: transparent;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  transition: fill 160ms ease, stroke 160ms ease;
}

.icon-link__mark {
  fill: transparent;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  transition: stroke 160ms ease;
}

.icon-link:hover,
.icon-link:focus-visible {
  color: var(--surface);
  transform: rotate(-2deg);
}

.icon-link:hover .icon-link__circle,
.icon-link:focus-visible .icon-link__circle {
  fill: var(--red);
  stroke: var(--red);
}

.icon-link:hover .icon-link__mark,
.icon-link:focus-visible .icon-link__mark {
  stroke: var(--surface);
}

.nav-toggle {
  background: transparent;
  border: 0;
  display: none;
  gap: 0.45rem;
  justify-self: end;
  padding: 0.4rem;
}

.nav-toggle span:not(.sr-only) {
  background: var(--ink);
  display: block;
  height: 1px;
  width: 24px;
}

/* =====================================================================
     5. BACK TO TOP BUTTON
     ===================================================================== */
.back-to-top {
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--red);
  border-radius: 50%;
  bottom: 1.25rem;
  color: var(--red);
  display: inline-flex;
  font-size: 1.35rem;
  font-weight: 700;
  height: 44px;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 1.25rem;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease,
    color 160ms ease;
  width: 44px;
  z-index: 9;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--red);
  color: var(--surface);
}

/* =====================================================================
     6. SHARED PAGE STRUCTURE
     ===================================================================== */
.hero,
.page-hero,
.contact-hero,
.case-hero,
.section,
.split-section,
.about-layout {
  margin: 0 auto;
  max-width: var(--max);
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.section,
.split-section,
.about-layout {
  padding-bottom: 2rem;
  padding-top: 2rem;
}

.section--tight {
  padding-top: 0;
}

.page-hero,
.contact-hero {
  padding-bottom: 3.5rem;
  padding-top: clamp(4.5rem, 8vw, 7rem);
}

/* Work: hero, filters and grid read as one clear sequence. */
.page-hero + .section.section--tight {
  padding-bottom: 5rem;
  padding-top: 0;
}

/* About: avoid stacked vertical padding between consecutive sections. */
.page-hero--about + .about-layout {
  padding-bottom: 4.5rem;
  padding-top: 0;
}

.about-layout + .cv-section,
.cv-section + .cv-section,
.cv-section + .recommendations {
  padding-top: 0;
}

.cv-section {
  padding-bottom: 4.5rem;
}

.recommendations--about {
  padding-bottom: 5rem;
}

/* Contact: the form starts closer to its introduction but retains room below. */
.contact-hero + .contact-form-section {
  padding-bottom: 5rem;
  padding-top: 0;
}

.section__heading {
  align-items: end;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin-bottom: 1.35rem;
}

.section__heading--simple {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.section__heading h2,
.split-section h2,
.about-layout h2,
.case-content h2,
.case-meta h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--h2);
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
}

/* =====================================================================
     7. BUTTONS, LINKS AND DECORATIVE UNDERLINES
     ===================================================================== */
.button {
  background: var(--red);
  border: 1px solid var(--red);
  color: var(--surface);
  display: inline-flex;
  justify-content: center;
  min-width: 150px;
  padding: 0.85rem 1.15rem;
}

.button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.text-link {
  background-image: url("data:image/svg+xml,%3Csvg width='180' height='16' viewBox='0 0 180 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 11C28 4 52 14 78 8C104 2 127 13 154 7C164 5 172 7 177 9' fill='none' stroke='%23A91815' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: 0 100%;
  background-repeat: repeat-x;
  background-size: 150px 12px;
  border-bottom: 0;
  color: var(--ink);
  display: inline-flex;
  font-weight: 600;
  padding-bottom: 0.5em;
}

.text-link:hover,
.text-link:focus-visible {
  animation: linkWiggle 1.25s steps(1, end) infinite;
}

.eyebrow {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 0.85rem;
  text-transform: uppercase;
}

.featured-eyebrow {
  flex-basis: 100%;
  margin-bottom: 0.15rem;
}

.scribble {
  background-image: url("data:image/svg+xml,%3Csvg width='180' height='16' viewBox='0 0 180 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 11C28 4 52 14 78 8C104 2 127 13 154 7C164 5 172 7 177 9' fill='none' stroke='%23A91815' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: 0 100%;
  background-repeat: repeat-x;
  background-size: 150px 12px;
  padding-bottom: 0.08em;
}

.scribble-link {
  position: relative;
}

/* =====================================================================
     8. HOME PAGE — HERO
     ===================================================================== */
.hero {
  align-items: end;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
  min-height: auto;
  padding-bottom: 1.25rem;
  padding-top: 6rem;
}

.hero h1,
.page-hero h1,
.contact-hero h1,
.case-hero h1 {
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--h1);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.94;
  margin: 0;
  max-width: 1120px;
  overflow-wrap: anywhere;
}

.hero__content {
  max-width: 1120px;
}

.hero__intro,
.page-hero p,
.contact-hero p,
.case-hero p {
  color: var(--ink);
  font-size: 1.2rem;
  max-width: 760px;
}

.hero__media {
  margin: 0;
}

.hero__media img {
  background: #f0ede7;
  border: 1px solid var(--line);
  min-height: 250px;
  object-fit: contain;
  padding: 2rem;
}

.hero__actions,
.contact-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.resume-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.6rem;
}

.page-hero h1,
.contact-hero h1 {
  max-width: 980px;
}

/* =====================================================================
     9. PROJECT CARDS AND GRIDS (home / work)
     ===================================================================== */
.project-grid {
  display: grid;
  gap: 2rem 1.25rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
  animation: projectFade 650ms ease both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

.project-card a {
  display: grid;
  gap: 1rem;
}

.project-card__image {
  aspect-ratio: 4 / 5;
  background: #ffffff;
  border: 0;
  margin: 0;
  overflow: hidden;
  position: relative;
}

.project-card__image img {
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
  width: 100%;
}

.project-card__image figcaption {
  background: var(--red);
  bottom: 0.8rem;
  color: var(--surface);
  font-size: 0.82rem;
  opacity: 0;
  padding: 0.45rem 0.7rem;
  position: absolute;
  right: 0.8rem;
  transition: opacity 160ms ease;
}

.project-card:hover img {
  transform: scale(1.035);
}

.project-card:hover figcaption {
  opacity: 1;
}

.project-card__body h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.5;
  margin: 0.2rem 0;
}

.project-card__body p {
  color: var(--muted);
  margin: 0;
}

.project-card__tags {
  padding-top: 0.5rem;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.project-card__body span {
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
  margin-top: 0.7rem;
}

/* =====================================================================
     10. WORK PAGE FILTERS
     ===================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.filter-chip {
  border: 0;
  color: var(--muted);
  padding: 0.55rem 0.8rem;
}

.filter-chip.is-active,
.filter-chip:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--surface);
}

.result-count {
  color: var(--muted);
  margin: 0 0 2rem;
}

/* =====================================================================
     11. SPLIT CONTENT BLOCKS
     ===================================================================== */
.split-section {
  display: grid;
  gap: 2rem;
  grid-template-columns: 0.9fr 1.1fr;
}

.strategy-list {
  display: grid;
  gap: 1rem;
}

.strategy-list p {
  margin: 0;
  padding-top: 0;
}

/* =====================================================================
     12. ABOUT PAGE
     ===================================================================== */
.about-layout {
  display: grid;
  gap: 4rem;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
}

.about-layout figure {
  margin: 0;
}

.about-layout img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  width: 100%;
}

.prose {
  max-width: 760px;
}

.prose p {
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  list-style: none;
  padding: 0;
}

.tag-list li {
  border: 0;
  padding: 0.5rem 0;
}

/* =====================================================================
     13. HOME — PERSON SECTION & SENTIMENTS
     ===================================================================== */
.person-section,
.sentiments {
  margin: 0 auto;
  max-width: var(--max);
  padding: 5.5rem 0rem;
}

.person-section {
  align-items: center;
  display: grid;
  gap: 4rem;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1fr);
}

.person-section__image {
  margin: 0;
}

.person-section__image img {
  aspect-ratio: 4 / 5;
  background: var(--surface);
  object-fit: cover;
  width: 100%;
}

.person-section__text h2,
.sentiments h2 {
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--h2-feature);
  font-weight: 400;
  line-height: 1;
  margin: 0 0 1.25rem;
  max-width: 920px;
}

.person-section__text p {
  color: var(--ink);
  font-size: 1.08rem;
  max-width: 680px;
}

.sentiment-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2.25rem;
}

.sentiment-grid p {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  line-height: 1.12;
  margin: 0;
}

/* =====================================================================
     14. RECOMMENDATIONS AND CV SECTIONS
     ===================================================================== */
.recommendations,
.cv-section {
  margin: 0 auto;
  max-width: var(--max);
  padding: 2rem 1.25rem;
}

.recommendations h2,
.cv-section h2 {
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--h2-feature);
  font-weight: 400;
  line-height: 1;
  margin: 0 0 2.25rem;
  max-width: 920px;
}

.quote-grid {
  align-items: stretch;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1.25fr 1fr 1fr;
}

.recommendations--about .quote-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quote-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin: 0;
  min-height: 320px;
  padding: 1.35rem 0 0;
}

.recommendations .quote-card {
  justify-content: flex-start;
}

.quote-card--featured {
  grid-row: span 2;
}

.recommendations--about .quote-card--featured,
.recommendations:not(.recommendations--about) .quote-card--featured {
  grid-row: auto;
}

.quote-card blockquote {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  line-height: 1.12;
  margin: 0;
  flex: 0;
}

.recommendations--about .quote-card--featured blockquote,
.recommendations:not(.recommendations--about) .quote-card--featured blockquote {
  color: var(--ink);
  font-size: 1.65rem;
}

.recommendations .quote-card blockquote {
  flex: 0;
}

.quote-card figcaption {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.9rem;
  min-height: 0;
}

.cv-section {
  display: grid;
  gap: 4rem;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
}

.cv-section__intro h2 {
  margin-bottom: 0;
}

.skill-list,
.achievement-list {
  display: grid;
  gap: 1.4rem;
}

.skill-list h3,
.achievement-list h3 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.08;
  margin: 0 0 0.35rem;
}

.skill-list p,
.achievement-list p {
  color: var(--ink);
  margin: 0;
}

/* =====================================================================
     15. CONTACT FORM
     ===================================================================== */
.contact-form-section {
  display: grid;
  gap: 3rem;
  grid-template-columns: minmax(0, 0.78fr) minmax(280px, 1fr);
  margin: 0 auto;
  max-width: var(--max);
  padding: 2rem 1.25rem 5rem;
}

.contact-form-section__intro h2 {
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--h2-contact);
  font-weight: 400;
  line-height: 1;
  margin: 0 0 1rem;
}

.contact-form-section__intro p:not(.eyebrow) {
  color: var(--ink);
  font-size: 1.08rem;
  margin: 0;
  max-width: 520px;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.45rem;
}

.contact-form span {
  color: var(--ink);
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  background: var(--surface);
  border: 1.5px solid var(--red);
  border-radius: 0;
  color: var(--ink);
  font: inherit;
  padding: 0.85rem 0.95rem;
  width: 100%;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--muted);
}

.contact-form .button {
  cursor: pointer;
  justify-self: start;
}

/* =====================================================================
     16. CASE STUDY PAGE
     ===================================================================== */
.case-hero {
  align-items: start;
  display: grid;
  gap: 3rem;
  grid-template-columns: minmax(0, 0.98fr) minmax(360px, 0.82fr);
  padding-top: 5rem;
}

.case-hero figure {
  margin: 0;
}

.case-hero img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  width: 100%;
}

.case-hero__content {
  align-self: start;
  display: grid;
  gap: 1rem;
}

.case-hero__content > .text-link {
  justify-self: start;
  margin-bottom: 0.75rem;
}

.case-hero__content > p:not(.eyebrow) {
  max-width: 680px;
}

.case-hero__media {
  margin: 0;
}

.case-hero__media img {
  aspect-ratio: 4 / 5;
  display: block;
  object-fit: cover;
  width: 100%;
}

.case-meta {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
}

.case-meta p,
.case-content p {
  color: var(--muted);
}

/* Case-page specific: overrides the generic .case-meta h2 style above
     with a compact uppercase label (Brief / Client / Tools). */
.case-meta {
  gap: 1.3rem;
  grid-template-columns: 1fr;
}

.case-meta h2 {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.28rem;
  text-transform: uppercase;
}

.case-meta p {
  margin: 0;
}

.case-content {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 auto;
  max-width: var(--max);
  padding: 3rem 1.25rem;
}

.case-content h2 {
  font-size: 2rem;
}

.case-sections {
  display: grid;
  gap: 4rem;
  margin: 0 auto;
  max-width: var(--max);
  padding: 1rem 1.25rem 4rem;
}

.case-section {
  display: grid;
  gap: 1.5rem;
}

.case-section__intro {
  max-width: 1000px;
}

.case-section__intro h2 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--h2-case-section);
  font-weight: 400;
  line-height: 1;
  margin: 0 0 1rem;
}

.case-section__intro p {
  margin: 0 0 0.85rem;
}

.case-section__intro p:last-child {
  margin-bottom: 0;
}

.case-section__media {
  margin-top: 0.5rem;
}

.case-section__media figure {
  align-items: center;
  display: grid;
  gap: 0.7rem;
  margin: 0;
}

.case-section__media img,
.case-section__media video {
  height: auto;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.case-section__media figcaption {
  color: var(--ink);
  font-size: 0.95rem;
  max-width: 58ch;
  text-align: center;
}

/* ---------------------- Case jump nav ---------------------- */
.case-jumpnav {
  background: var(--surface);
  border-top: 1px solid rgba(47, 43, 42, 0.12);
  border-bottom: 1px solid rgba(47, 43, 42, 0.12);
  display: flex;
  flex-wrap: nowrap;
  gap: 0.65rem;
  margin: 0 auto;
  max-width: var(--max);
  overflow-x: auto;
  padding: 1rem 1.25rem;
  position: sticky;
  scrollbar-width: thin;
  top: 76px;
  -webkit-overflow-scrolling: touch;
  z-index: 5;
}

.case-jumpnav a {
  border: 0;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem 0.8rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.case-jumpnav a:hover,
.case-jumpnav a.is-active {
  background: var(--red);
  color: var(--surface);
}

/* ---------------------- Prev/next project nav ---------------------- */
.project-nav {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
  margin: 0 auto;
  max-width: var(--max);
  padding: 2rem 1.25rem 5rem;
}

.project-nav a {
  background: var(--surface);
  border: 0;
  display: grid;
  justify-content: space-around;
  gap: 0.35rem;
  padding: 1rem;
}

.project-nav span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

/* ---------------------- Project gallery ---------------------- */
.visual-gallery {
  padding-bottom: 5rem;
}

.visual-gallery__heading {
  justify-content: flex-start;
}

.visual-gallery__heading h2 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--h2-gallery);
  font-weight: 400;
  line-height: 1;
  margin: 0;
}

.visual-gallery__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visual-gallery figure {
  align-items: center;
  background: #ffffff;
  border: 0;
  display: grid;
  gap: 0.7rem;
  margin: 0;
}

.visual-gallery img {
  height: auto;
  object-fit: contain;
  width: 100%;
}

.visual-gallery video {
  display: block;
  height: auto;
  justify-self: center;
  max-height: 80vh;
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.visual-gallery__item--embed iframe {
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
  width: 100%;
}

.visual-gallery figcaption {
  color: var(--ink);
  font-size: 0.95rem;
  max-width: 58ch;
  text-align: center;
}

.visual-gallery__item--wide {
  grid-column: 1 / -1;
}

.visual-gallery__item--wide figcaption {
  justify-self: center;
  max-width: 72ch;
  text-align: center;
  width: min(100%, 72ch);
}

.visual-gallery__item--wide video {
  max-width: 100%;
  width: 100%;
}

.visual-gallery__item--video:not(.visual-gallery__item--wide) {
  justify-self: center;
  max-width: 420px;
  width: 100%;
}

.visual-gallery__item--video:not(.visual-gallery__item--wide) video {
  width: 100%;
}

/* ---------------------- Image lightbox ---------------------- */
.media-zoom {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  padding: 0;
  width: 100%;
}

.media-zoom img {
  transition: opacity 160ms ease, transform 160ms ease;
}

.media-zoom:hover img,
.media-zoom:focus-visible img {
  opacity: 0.9;
  transform: scale(1.01);
}

.image-lightbox {
  background: transparent;
  border: 0;
  max-height: 92vh;
  max-width: 94vw;
  padding: 0;
}

.image-lightbox::backdrop {
  background: rgba(47, 43, 42, 0.88);
}

.image-lightbox__image {
  display: block;
  height: auto;
  max-height: 88vh;
  max-width: 90vw;
  object-fit: contain;
  width: auto;
}

.image-lightbox__close {
  align-items: center;
  background: var(--red);
  border: 0;
  border-radius: 50%;
  color: var(--surface);
  cursor: pointer;
  display: inline-flex;
  font-family: Arial, sans-serif;
  font-size: 1.75rem;
  height: 42px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 0.04em;
  position: fixed;
  right: 1.25rem;
  top: 1.25rem;
  width: 42px;
}

/* =====================================================================
     17. FOOTER
     ===================================================================== */
.site-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  justify-content: center;
  margin: 0 auto;
  max-width: var(--max);
  padding: 1.5rem 1.25rem 2.5rem;
  padding-top: 2.5rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.footer-timeline {
  align-items: center;
  color: var(--red);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  margin: 0;
  max-width: 100%;
  padding: 0;
  row-gap: 0.5rem;
  width: 100%;
}

.footer-timeline li {
  align-items: center;
  color: var(--red);
  display: flex;
  flex: 0 0 auto;
  font-size: clamp(0.64rem, 1.15vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.footer-arrow {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='20' viewBox='0 0 60 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 12C10 6 18 16 26 10C34 4 40 13 48 9' fill='none' stroke='%23A91815' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M40 3C44 5.5 47 7.5 48 9' fill='none' stroke='%23A91815' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M40 17C44 13.5 47 11 48 9' fill='none' stroke='%23A91815' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 40px 16px;
  flex: 0 0 40px;
  height: 16px;
  margin: 0 0.35rem;
  width: 40px;
}

/* =====================================================================
     18. KEYFRAMES
     ===================================================================== */
@keyframes projectFade {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes linkWiggle {
  0% {
    background-image: url("data:image/svg+xml,%3Csvg width='180' height='16' viewBox='0 0 180 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 11C28 4 52 14 78 8C104 2 127 13 154 7C164 5 172 7 177 9' fill='none' stroke='%23A91815' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
    background-position: 0 100%;
  }
  25% {
    background-image: url("data:image/svg+xml,%3Csvg width='180' height='16' viewBox='0 0 180 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 9C26 13 48 5 73 10C101 15 122 4 151 10C163 12 171 8 177 6' fill='none' stroke='%23A91815' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
    background-position: 0 100%;
  }
  50% {
    background-image: url("data:image/svg+xml,%3Csvg width='180' height='16' viewBox='0 0 180 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 10C25 7 51 12 76 7C102 3 126 12 153 8C164 6 172 11 177 10' fill='none' stroke='%23A91815' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
    background-position: 0 100%;
  }
  75% {
    background-image: url("data:image/svg+xml,%3Csvg width='180' height='16' viewBox='0 0 180 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 8C30 12 52 6 79 11C104 15 126 5 154 9C165 11 172 7 177 8' fill='none' stroke='%23A91815' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
    background-position: 0 100%;
  }
  100% {
    background-image: url("data:image/svg+xml,%3Csvg width='180' height='16' viewBox='0 0 180 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 11C28 4 52 14 78 8C104 2 127 13 154 7C164 5 172 7 177 9' fill='none' stroke='%23A91815' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
    background-position: 0 100%;
  }
}

/* =====================================================================
     19. MEDIA QUERIES — TABLET (max-width: 880px)
     ===================================================================== */
@media (max-width: 880px) {
  /* Heading scale */
  :root {
    --h2: 2.2rem;
    --h2-feature: 3rem;
  }

  /* Navigation */
  .nav {
    grid-template-areas:
      "brand icons toggle"
      "menu menu menu";
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 76px auto;
    min-height: auto;
  }

  .brand {
    grid-area: brand;
  }

  .nav-toggle {
    display: grid;
    grid-area: toggle;
    justify-self: end;
  }

  .nav__icons {
    grid-area: icons;
    justify-self: end;
  }

  .nav__links {
    align-items: stretch;
    background: var(--surface);
    display: none;
    grid-area: menu;
    justify-content: start;
    padding: 1rem 0;
  }

  .nav__links.is-open {
    display: grid;
  }

  .nav__dropdown-menu {
    border: 0;
    box-shadow: none;
    opacity: 1;
    padding: 0.4rem 0 0 1rem;
    pointer-events: auto;
    position: static;
    transform: none;
  }

  .nav__dropdown:hover .nav__dropdown-menu,
  .nav__dropdown:focus-within .nav__dropdown-menu {
    opacity: 1;
    transform: none;
  }

  /* Shared page structure */
  .hero,
  .case-hero,
  .about-layout,
  .split-section,
  .person-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-bottom: 1rem;
    padding-top: 2rem;
  }

  /* Project cards and grids */
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Recommendations and CV */
  .quote-grid,
  .cv-section {
    grid-template-columns: 1fr;
  }

  .quote-card,
  .quote-card--featured {
    grid-row: auto;
    min-height: auto;
  }

  .quote-card--featured blockquote {
    font-size: 3rem;
  }

  /* Case study */
  .case-hero,
  .case-content {
    grid-template-columns: 1fr;
  }

  .case-hero {
    gap: 2rem;
  }

  .case-content {
    padding: 3rem 1.25rem;
  }

  .case-meta {
    grid-template-columns: 1fr;
  }

  .case-sections {
    padding: 0 1.25rem 3rem;
  }

  .case-jumpnav {
    /* no changes at this breakpoint, kept for reference */
  }

  /* Contact form */
  .contact-form-section {
    grid-template-columns: 1fr;
  }

  /* Home page */
  body[data-page="work"] .page-hero {
    /* handled at min-width: 621px below */
  }
}

@media (min-width: 621px) {
  body[data-page="work"] .page-hero {
    padding-bottom: 3rem;
  }
}

/* =====================================================================
     20. MEDIA QUERIES — MOBILE (max-width: 620px)
     ===================================================================== */
@media (max-width: 620px) {
  /* Heading scale */
  :root {
    --h1: 2rem;
    --h2: 2rem;
    --h2-feature: 2rem;
    --h2-case-section: 2rem;
    --h2-gallery: 2rem;
    --h2-contact: 2rem;
  }

  /* Navigation */
  .brand__name {
    display: none;
  }

  .brand__logo {
    height: 38px;
    width: 136px;
  }

  .icon-link,
  .icon-link svg {
    height: 40px;
    width: 40px;
  }

  /* Shared page structure */
  .hero,
  .page-hero,
  .contact-hero,
  .case-hero,
  .section,
  .split-section,
  .about-layout,
  .person-section,
  .sentiments,
  .project-nav {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .section,
  .person-section,
  .recommendations,
  .cv-section,
  .about-layout {
    padding-bottom: 1rem;
    padding-top: 1rem;
  }

  .section__heading {
    align-items: start;
    display: grid;
  }

  .section__heading--simple {
    align-items: center;
    display: flex;
    gap: 1rem;
  }

  .hero {
    padding-bottom: 0.5rem;
  }

  .hero h1,
  .page-hero h1,
  .contact-hero h1,
  .case-hero h1 {
    line-height: 1;
  }

  .page-hero,
  .contact-hero {
    /* Final value: overrides the 3rem/2rem pairing above intentionally. */
    padding-bottom: 2rem;
    padding-top: 3rem;
  }

  .page-hero + .section.section--tight,
  .page-hero--about + .about-layout,
  .cv-section,
  .recommendations--about,
  .contact-hero + .contact-form-section {
    padding: 0 1rem 2.5rem;
  }

  /* Project cards and grids */
  .project-grid,
  .visual-gallery__grid,
  .project-nav,
  .sentiment-grid {
    grid-template-columns: 1fr;
  }

  .sentiment-grid p {
    font-size: 1.45rem;
  }

  /* Home page */
  .person-section,
  .sentiments {
    padding: 4rem 1rem;
  }

  /* Recommendations and CV */
  .recommendations,
  .cv-section {
    padding: 4rem 1rem;
  }

  .quote-grid,
  .recommendations--about .quote-grid {
    grid-template-columns: 1fr;
  }

  .quote-card {
    min-height: auto;
    padding-top: 0.35rem;
  }

  .quote-card figcaption {
    min-height: auto;
  }

  .quote-card blockquote,
  .quote-card--featured blockquote {
    font-size: 1.65rem;
  }

  /* Case study */
  .case-hero {
    padding-bottom: 2.5rem;
    padding-top: 3rem;
  }

  .case-content {
    gap: 2.25rem;
    padding: 2.5rem 1rem;
  }

  .case-sections {
    gap: 3rem;
    padding: 0 1rem 2.5rem;
  }

  .case-jumpnav {
    gap: 0.4rem;
    padding: 1rem;
  }

  .visual-gallery__item--video:not(.visual-gallery__item--wide) {
    max-width: 100%;
  }

  /* Contact form */
  .contact-form-section {
    gap: 2rem;
    padding: 1rem 1rem 4rem;
  }

  /* Footer */
  .site-footer {
    gap: 1rem;
    padding-bottom: 2rem;
    padding-top: 2rem;
  }

  .footer-timeline {
    row-gap: 0.6rem;
    padding: 0 0.5rem;
  }

  .footer-arrow {
    background-size: 28px 12px;
    flex: 0 0 28px;
    height: 12px;
    width: 28px;
  }
}
