/* =========================================================
   FONTS — Manrope (self-hosted, variable-weight family)
   ========================================================= */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* =========================================================
   TOKENS
   ========================================================= */
:root {
  --color-heading: #2E4150;
  --color-body: #818A92;
  --color-body-soft: #A6ADB3;
  --color-bg: #FFFFFF;
  --color-placeholder: #F1F1F1;
  --color-placeholder-hover: #E9E9E9;
  --color-border: #ECECEC;
  --color-accent: #F1480A;

  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container-max: 1920px;
  --gutter: 24px;
  --sidebar-width: 400px;

  /* Index page grid — 6 columns, 30px gutter, 25px margins */
  --index-margin: 25px;
  --index-gutter: 30px;
  --index-columns: 6;

  --header-height: 60px;

  --ease: cubic-bezier(0.65, 0, 0.35, 1);
}

@media (max-width: 900px) {
  :root {
    --gutter: 20px;
  }
}

/* =========================================================
   PRELOADER — shown once per session on first entry via index.html
   ========================================================= */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}

.preloader__logo {
  width: 56px;
  height: auto;
  animation: preloader-pulse 1.3s ease-in-out infinite;
}

@keyframes preloader-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.86); opacity: 0.55; }
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* If this session already saw the preloader, skip it entirely — no flash. */
html.preload-skip .preloader {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .preloader__logo {
    animation: none;
  }
}

/* =========================================================
   DARK MODE — toggled by the logo-dot button in the header.
   Every color in the site is a var() against these tokens,
   so redefining them here is enough to flip the whole page.
   ========================================================= */
body.is-dark {
  --color-heading: #F2F3F4;
  --color-body: #B7BEC4;
  --color-body-soft: #7C8790;
  --color-bg: #0B0C0D;
  --color-placeholder: #1A1C1E;
  --color-placeholder-hover: #232628;
  --color-border: #2A2D30;
}

body.is-dark {
  background: var(--color-bg);
}

body.is-dark .site-header {
  background: rgba(11, 12, 13, 0.88);
}

body.nav-open.is-dark .site-header,
body.is-dark .mobile-nav {
  background: var(--color-bg);
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-body);
  background: var(--color-bg);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

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

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

/* Inline links inside running text (not buttons, CTAs, or nav)
   need a visible affordance, or they're indistinguishable from
   plain text given the global reset above. */
.project-section p a,
.project-step p a,
.project-icon-card__text a,
.project-concept-card__text a,
.project-edge-case__text a,
.project-quote__text a,
.project-callout p a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--color-border);
  transition: text-decoration-color 0.25s var(--ease), color 0.25s var(--ease);
}

.project-section p a:hover,
.project-step p a:hover,
.project-icon-card__text a:hover,
.project-concept-card__text a:hover,
.project-edge-case__text a:hover,
.project-quote__text a:hover,
.project-callout p a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, p {
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

/* =========================================================
   ACCESSIBILITY HELPERS
   ========================================================= */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--color-heading);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 200;
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 12px;
}

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

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(var(--index-columns), 1fr);
  column-gap: var(--index-gutter);
  align-items: start;
  max-width: var(--container-max);
  margin: 0 auto;
  height: var(--header-height);
  padding: 20px var(--index-margin) 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.logo {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-heading);
  white-space: nowrap;
}

/* .main-nav becomes a pass-through so each link lands in its
   own grid column, flush with the column's left edge — same
   grid the index page content uses below. */
.main-nav {
  display: contents;
}

.main-nav .nav-link:nth-child(1) { grid-column: 2; grid-row: 1; justify-self: start; }
.main-nav .nav-link:nth-child(2) { grid-column: 3; grid-row: 1; justify-self: start; }
.main-nav .nav-link:nth-child(3) { grid-column: 4; grid-row: 1; justify-self: start; }

.nav-link {
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  color: var(--color-body);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: relative;
  padding-bottom: 3px;
  transition: color 0.25s var(--ease);
}

.nav-link:hover,
.nav-link:active,
.nav-link.is-active {
  color: var(--color-accent);
}

/* ---------------------------------------------------------
   Header links — Contact / LinkedIn+CV blocks
   (new shared header, used across every page)
--------------------------------------------------------- */
.header-links {
  display: contents;
}

.header-links__group:nth-child(1) {
  grid-column: 5;
  grid-row: 1;
  justify-self: start;
}

.header-links__group:nth-child(2) {
  grid-column: 6;
  grid-row: 1;
  justify-self: start;
}

.header-links__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

.header-links__label {
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  color: var(--color-body);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color 0.25s var(--ease);
}

a.header-links__label:hover,
a.header-links__label:active {
  color: var(--color-accent);
}

.header-links__value {
  font-size: 12px;
  line-height: 1;
  color: var(--color-body);
  transition: color 0.25s var(--ease);
}

.header-links__value:hover,
.header-links__value:active {
  color: var(--color-accent);
}

/* ---------------------------------------------------------
   Logo dot — dark-mode toggle button at the far right of the
   header. Outline (light background / dark text) is the
   default and unpressed state; clicking it fills the dot and
   switches the whole site to a dark background / light text.
--------------------------------------------------------- */
.logo-dot {
  grid-column: 6;
  grid-row: 1;
  justify-self: end;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}

.logo-dot:hover {
  transform: scale(1.15);
}

.logo-dot__icon {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* ---------------------------------------------------------
   Hamburger toggle (tablet and below — see breakpoints
   legend at the top of the RESPONSIVE section)
--------------------------------------------------------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
}

.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-heading);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease), background 0.25s var(--ease);
}

.nav-toggle:hover .nav-toggle__bar {
  background: var(--color-accent);
}

body.nav-open .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------------------------------------------------------
   Mobile nav drawer + overlay (tablet and below)
   Hidden entirely on desktop; see RESPONSIVE section for
   the breakpoint that brings them to life.
--------------------------------------------------------- */
.mobile-nav {
  display: none;
}

.nav-overlay {
  display: none;
}

/* =========================================================
   LAYOUT
   ========================================================= */
.layout {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 28px var(--gutter) 64px;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar {
  flex: 0 0 var(--sidebar-width);
  position: sticky;
  top: calc(var(--header-height) + 16px);
  display: flex;
  flex-direction: column;
  padding-right: 16px;
  padding-bottom: 80px;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intro {
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-heading);
  font-weight: 400;
  text-wrap: pretty;
}

.intro--current {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
  animation: statusPulse 2.4s ease-in-out infinite;
}

@keyframes statusPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot {
    animation: none;
  }
}

.credit {
  position: fixed;
  left: var(--gutter);
  bottom: 32px;
  font-size: 12px;
  color: var(--color-body-soft);
  z-index: 60;
}

/* =========================================================
   ABOUT PAGE — lock viewport, no scroll
   ========================================================= */
html.has-about,
body.is-about {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html.has-about .sidebar {
  height: calc(100vh - var(--header-height) - 92px);
  min-height: 0;
}

/* =========================================================
   ABOUT — bouncing photo (DVD-screensaver style)
   ========================================================= */
.about-visual {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: calc(100vh - var(--header-height) - 92px);
  overflow: hidden;
}

.about-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: clamp(220px, 26vw, 420px);
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  overflow: hidden;
  background: var(--color-placeholder);
  will-change: transform;
}

.about-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  html.has-about,
  body.is-about {
    height: auto;
    overflow: visible;
    overscroll-behavior: auto;
  }

  html.has-about .sidebar {
    height: auto;
  }

  .about-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: auto;
    padding: 40px 0;
  }

  .about-stage {
    position: relative;
  }
}

/* =========================================================
   WORK GRID (masonry via CSS columns)
   ========================================================= */
.work {
  flex: 1 1 auto;
  min-width: 0;
}

.project {
  width: 100%;
  margin-bottom: 36px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.project:last-child {
  margin-bottom: 0;
}

.project.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.project__image {
  display: block;
  overflow: hidden;
  border-radius: 2px;
}

.project__media {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s var(--ease), filter 0.4s var(--ease);
}

.project:hover .project__media {
  filter: brightness(0.96);
}

/* =========================================================
   INDEX PAGE — 6-column grid layout
   6 columns, 30px gutter, 25px margins. Cards span 2-4
   columns each (via data-span) and keep their natural image
   height, so widths and heights vary card to card.
   ========================================================= */
.index-layout {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 28px var(--index-margin) 64px;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.index-top {
  display: grid;
  grid-template-columns: repeat(var(--index-columns), 1fr);
  column-gap: var(--index-gutter);
  margin-bottom: 56px;
}

.index-top__intro {
  grid-column: 4 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 460px;
}

.index-toolbar {
  display: grid;
  grid-template-columns: repeat(var(--index-columns), 1fr);
  column-gap: var(--index-gutter);
  align-items: baseline;
  margin-bottom: 56px;
}

#view-toggle {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.view-toggle__icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

#view-toggle[data-view="index"] .view-toggle__icon--index {
  display: inline-flex;
}

#view-toggle[data-view="thumbnail"] .view-toggle__icon--thumbnail {
  display: inline-flex;
}

.index-toolbar__filter {
  grid-column: 2 / -1;
  display: flex;
  align-items: baseline;
  gap: 32px;
}

.index-toolbar__btn {
  border: none;
  background: none;
  padding: 0;
  font-size: 13px;
  color: var(--color-body-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color 0.25s var(--ease);
}

.index-toolbar__btn:hover,
.index-toolbar__btn.is-active {
  color: var(--color-heading);
}

/* ---------------------------------------------------------
   Filter panel — opens beside the toolbar buttons when
   "Filter" is clicked. Two columns (Category / Year), each a
   header plus a list of clickable, multi-select options.
--------------------------------------------------------- */
.filter-panel {
  display: flex;
  align-items: baseline;
  gap: 64px;
}

.filter-panel[hidden] {
  display: none;
}

.filter-panel__group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-panel__label {
  font-size: 13px !important;
  font-weight: 500;
  line-height: 1;
  color: var(--color-heading);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.filter-panel__item {
  display: block;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  font-size: 13px !important;
  line-height: 1;
  color: var(--color-body-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color 0.2s var(--ease);
}

.filter-panel__item:hover,
.filter-panel__item.is-selected {
  color: var(--color-accent);
}

.work-grid-masonry {
  display: grid;
  grid-template-columns: repeat(var(--index-columns), 1fr);
  gap: var(--index-gutter);
  align-items: start;
}

.work-grid-masonry .project {
  grid-column: span 6;
  margin-bottom: 0;
}

.work-grid-masonry .project[data-span="2"] { grid-column: span 2; }
.work-grid-masonry .project[data-span="3"] { grid-column: span 3; }
.work-grid-masonry .project[data-span="4"] { grid-column: span 4; }

/* ---------------------------------------------------------
   Thumbnail View — toggled by the "Index View" button.
   Same project cards, reflowed into a single-column list:
   a fixed-width thumbnail beside title/category/year + desc.
--------------------------------------------------------- */
.work.is-thumbnail .work-grid-masonry {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.work.is-thumbnail .work-grid-masonry .project {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 32px;
  width: 100%;
}

.work.is-thumbnail .project__image {
  flex: 0 0 300px;
  width: 300px;
}

.work.is-thumbnail .project__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 0;
}

.work.is-thumbnail .project__meta {
  flex: 0 0 auto;
}

.work.is-thumbnail .project__desc {
  max-width: 56ch;
}

.project__body {
  display: flex;
  gap: 56px;
  padding-top: 14px;
}

.project[data-project="blindspot"] .project__body,
.project[data-project="azucrinacao"] .project__body {
  gap: 20px;
}

.project__meta {
  flex: 0 0 150px;
  min-width: 0;
}

.project__title,
.project__category,
.project__year {
  display: inline;
}

.project__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-heading);
  line-height: 1.5;
}

.project__title::after {
  content: "/";
  font-weight: 400;
  color: var(--color-body-soft);
}

.project__title a {
  transition: color 0.25s var(--ease);
}

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

.project__category,
.project__year {
  font-size: 13px;
  color: var(--color-body-soft);
  line-height: 1.5;
}

.project__category::after {
  content: ",";
}

.project__desc {
  flex: 1 1 auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-body);
  text-wrap: pretty;
}

/* =========================================================
   PROJECT PAGE — shared template for case study pages
   (Authorship, Alice, Azucrinação, Maisedu, All in a Chain)
   ========================================================= */
.project-layout {
  align-items: stretch;
}

.project-nav {
  flex: 0 0 var(--sidebar-width);
  position: sticky;
  top: calc(var(--header-height) + 16px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100vh - var(--header-height) - 92px);
  padding-right: 16px;
}

.project-nav__inner {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.project-nav__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-body-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: fit-content;
  transition: color 0.25s var(--ease);
}

.project-nav__back:hover,
.project-nav__back:active {
  color: var(--color-accent);
}

.project-nav__title {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-heading);
  max-width: 26ch;
  text-wrap: balance;
}

.project-nav__top {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-body-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: fit-content;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.project-nav__top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.project-nav__top:hover,
.project-nav__top:active {
  color: var(--color-accent);
}

.project-nav__icon {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
  transition: transform 0.25s var(--ease);
}

.project-nav__back:hover .project-nav__icon,
.project-nav__back:active .project-nav__icon {
  transform: translateX(-3px);
}

.project-nav__top:hover .project-nav__icon,
.project-nav__top:active .project-nav__icon {
  transform: translateY(-3px);
}

.project-content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 760px;
}

.project-hero {
  margin: 0 0 40px;
}

.project-hero__media {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 64px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--color-border);
}

.project-meta__item {
  flex: 0 1 auto;
  min-width: 0;
}

.project-meta__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-heading);
  margin-bottom: 8px;
}

.project-meta__value {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-body-soft);
}

.project-meta__value a {
  color: var(--color-accent);
  transition: opacity 0.25s var(--ease);
}

.project-meta__value a:hover,
.project-meta__value a:active {
  opacity: 0.7;
}

.project-overview {
  max-width: 640px;
  margin-bottom: 64px;
}

.project-overview__title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 24px;
}

.project-overview p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-body);
  text-wrap: pretty;
}

.project-overview p + p {
  margin-top: 20px;
}

.project-overview--note {
  max-width: none;
  margin-top: 32px;
  margin-bottom: 0;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.project-overview--note p {
  font-style: italic;
}

.project-section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-body);
  text-wrap: pretty;
}

.project-section p + p {
  margin-top: 20px;
}

.project-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.project-gallery--single {
  grid-template-columns: 1fr;
}

.project-gallery--cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.project-gallery--cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.project-gallery__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  grid-column: span 2;
}

.project-gallery__full {
  grid-column: 1 / -1;
}

.project-gallery__pair img {
  display: block;
  width: 100%;
  height: auto;
}

.project-gallery + .project-gallery {
  margin-top: 20px;
}

.project-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.project-gallery img.project-gallery__full {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 640px;
  margin: 0 auto;
}

.project-video-card__caption {
  font-size: 13px;
  color: var(--color-body);
  text-align: center;
}

/* ---- inline YouTube embed (plays directly on the page) ---- */
.project-video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  border-radius: 2px;
  overflow: hidden;
  background: #000;
}

.project-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.project-video-embed__footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  margin-bottom: 40px;
}

.project-video-embed__footer .project-video-card__caption {
  text-align: left;
}

.project-video-embed__link {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
  white-space: nowrap;
  transition: opacity 0.25s var(--ease);
}

.project-video-embed__link:hover,
.project-video-embed__link:active {
  opacity: 0.7;
}

/* ---- small autoplaying phone-screen clips (onboarding, flow demos) ---- */
.project-phone-clip {
  width: 100%;
  margin: 48px 0;
  padding: 56px 24px;
  background: var(--color-placeholder);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.project-phone-clip video {
  width: 220px;
  max-width: 100%;
  display: block;
  border-radius: 14px;
}

.project-phone-clip figcaption {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--color-body-soft);
  text-align: center;
}

/* ---- dark variant: for clips whose content (video/mockup) is
   already black, so the placeholder box doesn't fight it with a
   light grey frame ---- */
.project-phone-clip--dark {
  background: #0B0C0D;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.project-phone-clip--dark figcaption {
  color: #C9CDD1;
}

/* ---- previous / next project pager (end of every project page) ---- */
.project-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 64px;
  padding-top: 32px;
}

.project-pager__link {
  display: inline-flex;
  align-items: flex-end;
  gap: 10px;
  transition: color 0.25s var(--ease);
}

.project-pager__link--next {
  margin-left: auto;
  text-align: right;
}

.project-pager__arrow {
  font-size: 16px;
  color: var(--color-body-soft);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}

.project-pager__link:hover .project-pager__arrow {
  color: var(--color-accent);
}

.project-pager__link--prev:hover .project-pager__arrow {
  transform: translateX(-3px);
}

.project-pager__link--next:hover .project-pager__arrow {
  transform: translateX(3px);
}

.project-pager__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-pager__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-body-soft);
}

.project-pager__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
  transition: color 0.25s var(--ease);
}

.project-pager__link:hover .project-pager__name {
  color: var(--color-accent);
}

/* =========================================================
   PROJECT PAGE — TECH / INTERACTION VARIANT
   Richer case-study layout (Ting and similar): sidebar with
   section nav, CTA links, stat cards, theory/outcome cards,
   callouts, and simple bar/donut charts.
   ========================================================= */

/* ---- sidebar section nav ---- */
.project-nav__sections {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 8px;
}

.project-nav__section-link {
  font-size: 13px;
  color: var(--color-body-soft);
  padding: 6px 0;
  transition: color 0.25s var(--ease);
}

.project-nav__section-link:hover,
.project-nav__section-link:active,
.project-nav__section-link.is-active {
  color: var(--color-accent);
}

/* ---- CTA links (View Prototype / Read Paper) ---- */
.project-cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 64px;
}

.project-cta-link {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-heading);
  padding: 12px 24px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.project-cta-link:hover,
.project-cta-link:active {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ---- sections + eyebrow numbering for major sections ---- */
.project-section {
  margin-bottom: 64px;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.project-section__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-body-soft);
  margin-bottom: 12px;
}

.project-step {
  margin-bottom: 40px;
}

.project-step:last-child {
  margin-bottom: 0;
}

.project-step__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 16px;
}

/* ---- callouts ("In one sentence", "Design principle"...) ---- */
.project-callout {
  border-left: 1px solid var(--color-accent);
  padding: 2px 0 2px 28px;
  margin: 44px 0;
  background: none;
  border-radius: 0;
}

.project-callout__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-body-soft);
  margin-bottom: 12px;
}

.project-callout p {
  font-size: 18px;
  line-height: 1.55;
  font-weight: 500;
  color: var(--color-heading);
  text-wrap: pretty;
  letter-spacing: -0.01em;
}

/* ---- full-width and paired images ---- */
.project-full-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  margin: 32px 0;
}

.project-images-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 32px 0;
}

.project-images-row--stacked {
  grid-template-columns: 1fr;
}

.project-images-row img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

/* ---- benchmarking comparison list ---- */
.project-benchmark-list {
  margin: 20px 0;
  border-top: 1px solid var(--color-border);
}

.project-benchmark-item {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.project-benchmark-item__name {
  flex: 0 0 200px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-heading);
}

.project-benchmark-item__gap {
  flex: 1 1 240px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-body);
}

/* ---- UX flow diagram (vertical numbered stepper) ---- */
.project-flow {
  display: flex;
  flex-direction: column;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}

.project-flow__step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 9px 0;
  position: relative;
}

.project-flow__step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 30px;
  bottom: -9px;
  width: 1px;
  background: var(--color-border);
}

.project-flow__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.project-flow__label {
  font-size: 13px;
  line-height: 20px;
  color: var(--color-heading);
}

.project-flow__label small {
  color: var(--color-body-soft);
  font-size: 11px;
  margin-left: 4px;
}

/* ---- stat cards (The Problem) ---- */
.project-stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}

.project-stat-card {
  padding: 24px 4px 0 0;
  border-top: 1px solid var(--color-border);
  background: none;
  border-radius: 0;
}

.project-stat-card__figure {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.project-stat-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 8px;
}

.project-stat-card__text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-body);
  text-wrap: pretty;
}

/* ---- concept cards (rejected ideation paths) ---- */
.project-concept-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}

.project-concept-card {
  padding: 20px 4px 0 0;
  border-top: 1px solid var(--color-border);
  background: none;
  border-radius: 0;
}

.project-concept-card__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 10px;
}

.project-concept-card__why {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-body-soft);
  margin-bottom: 6px;
}

.project-concept-card__text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-body);
  text-wrap: pretty;
}

/* ---- edge cases (numbered ethical/risk scenarios) ---- */
.project-edge-cases {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 32px 0;
}

.project-edge-case {
  display: flex;
  gap: 20px;
}

.project-edge-case__num {
  flex: 0 0 auto;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-accent);
}

.project-edge-case__body {
  flex: 1 1 auto;
}

.project-edge-case__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 6px;
}

.project-edge-case__text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-body);
  text-wrap: pretty;
}

/* ---- theory / outcome icon cards ---- */
.project-icon-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}

.project-icon-card__icon {
  display: block;
  font-size: 20px;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.project-icon-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 8px;
}

.project-icon-card__text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-body);
  text-wrap: pretty;
}

/* ---- charts (bar + donut) ---- */
.project-charts-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 32px 0;
}

.project-chart__caption {
  display: block;
  font-size: 12px;
  color: var(--color-body-soft);
  margin-bottom: 16px;
}

.project-chart__row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.project-chart__label {
  flex: 0 0 150px;
  font-size: 12px;
  color: var(--color-body);
}

.project-chart__track {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 999px;
  background: var(--color-placeholder);
  overflow: hidden;
}

.project-chart__fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-chart__fill--muted {
  background: var(--color-border);
}

.project-chart__pct {
  flex: 0 0 36px;
  font-size: 12px;
  color: var(--color-heading);
  text-align: right;
}

.project-chart__pct--muted {
  color: var(--color-body-soft);
}

.project-donut {
  display: flex;
  align-items: center;
  gap: 24px;
}

.project-donut__svg {
  width: 140px;
  height: 140px;
  flex: 0 0 140px;
}

.project-donut__legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.project-legend__dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.project-legend__pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-heading);
  margin-right: 6px;
}

.project-legend__label {
  font-size: 12px;
  color: var(--color-body-soft);
}

/* ---- reveal on scroll (project-step, cards, callouts, charts...) ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- reading progress bar (project pages) ---- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 999;
  pointer-events: none;
  background: transparent;
}

.reading-progress__fill {
  height: 100%;
  width: 100%;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .reading-progress__fill {
    transition: none;
  }
}

/* ---- AI-generation disclosure note (sits at the end of
   Takeaways, after the closing callout) ---- */
.project-disclosure {
  font-size: 12px;
  font-style: italic;
  color: var(--color-body-soft);
  margin: 32px 0 0;
}

/* ---- pull quotes (research interviews, etc.) ---- */
.project-quote {
  padding: 4px 0 4px 32px;
  margin: 36px 0;
  background: none;
  border-radius: 0;
  border-left: 1px solid var(--color-border);
}

.project-quote__mark {
  display: block;
  font-family: Georgia, serif;
  font-size: 40px;
  line-height: 1;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.project-quote__text {
  font-size: 15px;
  line-height: 1.6;
  font-style: italic;
  color: var(--color-heading);
  margin-bottom: 12px;
  text-wrap: pretty;
}

.project-quote__source {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-body-soft);
}

/* ---- emotional colour system blocks ---- */
.project-color-system {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0;
}

.project-color-block {
  padding: 20px;
  border-radius: 2px;
  background: var(--color-placeholder);
}

.project-color-block__dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-bottom: 12px;
  background: var(--color-accent);
}

.project-color-block__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 8px;
}

.project-color-block__desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-body);
  text-wrap: pretty;
}

/* ---- affinity board: clustered research notes, built in
   HTML/CSS rather than exported as an image, so the content
   stays authentic and editable ---- */
.affinity-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin: 32px 0;
}

.affinity-cluster {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.affinity-cluster__label {
  display: inline-block;
  width: fit-content;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-heading);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--cluster-color, var(--color-accent));
  margin-bottom: 2px;
}

.affinity-note {
  background: var(--color-placeholder);
  border-radius: 2px;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-body);
  box-shadow: 0 1px 3px rgba(46, 65, 80, 0.08);
}

/* ---- story carousel: simple arrow-navigated slideshow,
   no scroll-linking — click prev/next to advance ---- */
.story-carousel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 8px;
}

.story-carousel__viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  border-radius: 2px;
}

.story-carousel__track {
  display: flex;
  transition: transform 0.45s var(--ease);
}

.story-carousel__frame {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
}

.story-carousel__frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  cursor: zoom-in;
}

.story-carousel__frame figcaption {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-body-soft);
}

.story-carousel__nav {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--color-heading);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), opacity 0.25s var(--ease);
}

.story-carousel__nav:hover:not(:disabled) {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.story-carousel__nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.story-carousel__counter {
  text-align: center;
  font-size: 12px;
  color: var(--color-body-soft);
  margin-bottom: 32px;
}

@media (max-width: 640px) {
  .story-carousel {
    gap: 8px;
  }

  .story-carousel__nav {
    width: 32px;
    height: 32px;
  }
}

/* =========================================================
   SITE FOOTER — small screens only. Desktop has no footer by
   design (contact info lives in .header-links); below 1024px
   that block hides, so this carries the same contact links
   as a normal footer at the end of the page content instead
   of stuffing them into the hamburger drawer.
   ========================================================= */
.site-footer {
  display: none;
}

@media (max-width: 1024px) {
  .site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px var(--gutter) 56px;
  }

  .site-footer__contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
  }

  .site-footer__link {

    font-size: 13px;
    color: var(--color-body);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: color 0.25s var(--ease);
  }

  .site-footer__link:hover,
  .site-footer__link:active {
    color: var(--color-accent);
  }

  .site-footer__credit {
    font-size: 12px;
    color: var(--color-body-soft);
  }
}

/* Same reasoning as .back-to-top above: the fun page's drag
   canvas is still active in this range, so its footer (which
   sits after the canvas in document order) isn't reachable —
   suppress it until the page becomes a normal scrolling list. */
@media (min-width: 769px) and (max-width: 1024px) {
  body.is-fun .site-footer {
    display: none;
  }
}

/* =========================================================
   CUSTOM CURSOR (project hover)
   ========================================================= */
.cursor-ball {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 999;
}

.cursor-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--color-accent);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease), background 0.3s var(--ease);
  will-change: width, height, margin;
}

.cursor-ball.is-active .cursor-dot {
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  background: var(--color-accent);
}

.cursor-label {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease), opacity 0.2s var(--ease);
  will-change: width, height, margin;
}

.cursor-ball.is-active .cursor-label {
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  opacity: 1;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease), opacity 0.25s var(--ease) 0.1s;
}

.has-custom-cursor,
.has-custom-cursor * {
  cursor: none !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
/* =========================================================
   RESPONSIVE

   Breakpoint legend (desktop-first — base styles above are
   the desktop layout, each query below overrides for
   narrower screens):

     1150px  → project pages: sidebar shrinks, 3-col grids → 2
     1080px  → index grid drops from 6 columns to 2
     1024px  → tablet and below: hamburger nav takes over
     860px   → sidebar stacks above the work/about content
     768px   → fun page canvas becomes a static scrolling list
     640px   → compact header + spacing for phones
   ========================================================= */
@media (pointer: coarse), (hover: none) {
  .cursor-ball {
    display: none !important;
  }
}

/* ---------------------------------------------------------
   1150px — project pages: the fixed 400px sidebar next to
   project-content leaves too little room in this range
   (tablets like iPad/Surface land here before the 860px
   stack kicks in), so the sidebar narrows and the 3-column
   stat/icon card grids drop to 2 columns.
--------------------------------------------------------- */
@media (max-width: 1150px) {
  :root {
    --sidebar-width: 280px;
  }

  .project-stat-cards,
  .project-icon-cards,
  .project-concept-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .affinity-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------------------------------------------------------
   1024px — hamburger navigation
--------------------------------------------------------- */
@media (max-width: 1024px) {
  .site-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 var(--gutter);
  }

  .main-nav,
  .header-links {
    display: none;
  }

  /* The footer carries the credit line on small screens now. */
  .credit {
    display: none;
  }

  .logo-dot {
    order: 1;
    margin-left: auto;
    margin-right: 20px;
  }

  .nav-toggle {
    display: flex;
    order: 2;
  }

  body.nav-open .site-header {
    background: var(--color-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: min(320px, 86vw);
    padding: 32px;
    gap: 24px;
    background: var(--color-bg);
    box-shadow: -16px 0 40px rgba(46, 65, 80, 0.1);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    z-index: 200;
  }

  body.nav-open .mobile-nav {
    transform: translateX(0);
  }

  .mobile-nav__link {
    font-size: 22px;
    font-weight: 500;
    color: var(--color-heading);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 6px 0;
    transition: color 0.25s var(--ease);
  }

  .mobile-nav__link:hover,
  .mobile-nav__link:active,
  .mobile-nav__link.is-active {
    color: var(--color-accent);
  }

  .nav-overlay {
    display: block;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(46, 65, 80, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
    z-index: 150;
  }

  body.nav-open .nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open {
    overflow: hidden;
  }
}

/* ---------------------------------------------------------
   1080px — index grid: 6 columns → 2 columns
--------------------------------------------------------- */
@media (max-width: 1080px) {
  .work-grid-masonry {
    grid-template-columns: repeat(2, 1fr);
  }

  .work-grid-masonry .project,
  .work-grid-masonry .project[data-span="2"],
  .work-grid-masonry .project[data-span="3"],
  .work-grid-masonry .project[data-span="4"] {
    grid-column: span 2;
  }

  .index-top {
    display: block;
  }

  .index-top__intro {
    grid-column: auto;
    max-width: none;
  }

  .index-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 24px;
  }

  #view-toggle {
    display: none;
  }

  .index-toolbar__filter {
    grid-column: auto;
    flex-basis: 100%;
    gap: 24px;
    flex-wrap: wrap;
  }
}

/* ---------------------------------------------------------
   1080px — work grid: two columns → one
--------------------------------------------------------- */
@media (max-width: 1080px) {
  .project {
    margin-bottom: 48px;
  }

  .project:last-child {
    margin-bottom: 0;
  }

  /* Stacked reading order: Ting, Fluid, Blindspot, Authorship,
     Alice, Azucrinação, Card, Maisedu, All in a Chain. */
  .project[data-project="ting"]        { order: 1; }
  .project[data-project="fluid"]       { order: 2; }
  .project[data-project="blindspot"]   { order: 3; }
  .project[data-project="authorship"]  { order: 4; }
  .project[data-project="alice"]       { order: 5; }
  .project[data-project="azucrinacao"] { order: 6; }
  .project[data-project="card"]        { order: 7; }
  .project[data-project="maisedu"]     { order: 8; }
  .project[data-project="chain"]       { order: 9; }
}

/* ---------------------------------------------------------
   860px — sidebar stacks above content
--------------------------------------------------------- */
@media (max-width: 860px) {
  .layout {
    flex-direction: column;
  }

  .project-meta {
    flex-direction: column;
    gap: 24px;
  }

  .sidebar {
    position: relative;
    top: 0;
    min-height: 0;
    flex: 1 1 auto;
    width: 100%;
    padding-right: 0;
    padding-bottom: 48px;
    margin-bottom: 48px;
  }

  .project-nav {
    position: relative;
    top: 0;
    min-height: 0;
    flex: 1 1 auto;
    width: 100%;
    padding-right: 0;
    padding-bottom: 0;
    margin-bottom: 32px;
  }

  /* .project-nav__top is a fixed floating button at every
     width now (see base rule) — no override needed here. */

  /* A vertical list of 8 jump-links doesn't work stacked above
     the content on mobile — it pushes the hero image way down
     and reads like a wall of text. A compact, horizontally
     scrollable strip keeps the same jump-to-section function
     without dominating the screen. */
  .project-nav__sections {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 20px;
    margin-top: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .project-nav__sections::-webkit-scrollbar {
    display: none;
  }

  .project-nav__section-link {
    flex: 0 0 auto;
    padding: 4px 0;
    white-space: nowrap;
  }

  html.has-about .sidebar {
    height: auto;
  }

  .sidebar-inner {
    gap: 10px;
  }

  html.has-about,
  body.is-about {
    height: auto;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .about-visual {
    width: 100%;
    height: 60vh;
    min-height: 60vh;
  }

  .project-stat-cards,
  .project-icon-cards,
  .project-concept-cards,
  .project-charts-pair,
  .project-images-row,
  .project-color-system {
    grid-template-columns: 1fr;
  }

  .affinity-board {
    grid-template-columns: 1fr;
  }

  .project-donut {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------------------------------------------------------
   640px — compact header + spacing for phones
--------------------------------------------------------- */
@media (max-width: 640px) {
  :root {
    --header-height: 54px;
  }

  .site-header {
    padding: 0 20px;
  }

  .logo {
    font-size: 12px;
  }

  .work.is-thumbnail .work-grid-masonry .project {
    flex-direction: column;
  }

  .work.is-thumbnail .project__image {
    width: 100%;
    flex: none;
  }

  .layout {
    padding: 32px 20px 96px;
  }

  .index-layout {
    padding: 32px 20px 96px;
  }

  .project-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 16px;
    row-gap: 24px;
  }

  .work-grid-masonry {
    grid-template-columns: 1fr;
  }

  .work-grid-masonry .project,
  .work-grid-masonry .project[data-span="2"],
  .work-grid-masonry .project[data-span="3"],
  .work-grid-masonry .project[data-span="4"] {
    grid-column: span 1;
  }

  .index-top {
    margin-bottom: 40px;
  }

  .index-toolbar {
    flex-wrap: wrap;
    margin-bottom: 40px;
  }

  .filter-panel {
    flex-basis: 100%;
    gap: 40px;
  }

  .mobile-nav {
    width: 100%;
  }

  .project__body {
    flex-direction: column;
    gap: 8px;
  }

  .project__meta {
    flex: none;
  }

  .project__desc {
    max-width: none;
  }

  .project-chart__row {
    flex-wrap: wrap;
  }

  .project-chart__label {
    flex: 1 1 100%;
  }

  .project-chart__track {
    flex: 1 1 auto;
  }

  .project-gallery,
  .project-gallery--cols-3,
  .project-gallery--cols-4 {
    grid-template-columns: 1fr;
  }

  .project-callout {
    padding-left: 18px;
    margin: 36px 0;
  }

  .project-callout p {
    font-size: 16px;
  }

  .project-phone-clip {
    padding: 40px 20px;
  }

  .project-phone-clip video {
    width: 168px;
  }

  .project-video-embed__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* =========================================================
   FUN PAGE — Infinite Draggable Canvas
   ========================================================= */
html.has-fun,
body.is-fun {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.fun-viewport {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.fun-card {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.45s var(--ease), filter 0.3s var(--ease);
  perspective: 900px;
  perspective-origin: 50% 50%;
}

.fun-card.is-visible {
  opacity: 1;
}

.fun-card:hover {
  filter: drop-shadow(0 8px 28px rgba(46, 65, 80, 0.12));
}

.fun-card--m { width: 260px; }
.fun-card--l { width: 320px; }

.fun-card-inner {
  width: 100%;
  will-change: transform;
}

.fun-card-fig {
  width: 100%;
  margin: 0 0 9px 0;
  display: block;
  border-radius: 2px;
}

.fun-card-fig img,
.fun-card-fig video {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.fun-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fun-card-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-heading);
  display: block;
  text-wrap: balance;
}

.fun-card-desc {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-body);
  display: block;
  text-wrap: pretty;
}

.fun-card-desc a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fun-card-desc a:hover {
  color: var(--color-heading);
}

.fun-hint {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-body-soft);
  opacity: 0.85;
  pointer-events: none;
  z-index: 10;
  margin: 0;
  white-space: nowrap;
  transition: opacity 0.9s var(--ease);
}

.fun-hint.hidden {
  opacity: 0;
}

.fun-hint-cross {
  position: relative;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.fun-hint-cross::before,
.fun-hint-cross::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.fun-hint-cross::before {
  width: 1px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.fun-hint-cross::after {
  height: 1px;
  width: 100%;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

/* Cursor states specific to the fun canvas */
.cursor-ball.is-photo-hover .cursor-dot {
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
}

.cursor-ball.is-grabbing .cursor-dot {
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  background: var(--color-heading);
  border-radius: 50%;
}

@media (hover: none) and (pointer: coarse) {
  .fun-viewport {
    cursor: default;
  }
}

@media (max-width: 768px) {
  html.has-fun,
  body.is-fun {
    height: auto !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
  }

  .fun-viewport {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    height: auto;
    overflow: visible;
    padding: 32px var(--gutter) 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    cursor: default;
    perspective: none;
    touch-action: auto;
  }

  .fun-card {
    position: relative !important;
    width: 100% !important;
    max-width: 480px;
    transform: none !important;
    opacity: 1 !important;
    perspective: none;
    margin-bottom: 56px;
  }

  .fun-card:last-child {
    margin-bottom: 0;
  }

  .fun-card-inner {
    transform: none !important;
  }

  .fun-card-fig {
    width: 100%;
    margin-bottom: 14px;
  }

  .fun-hint {
    display: none;
  }
}
/* ---------------------------------------------------------
   Fun page — lightbox (click a card to view full-screen)
--------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: rgba(255, 255, 255, 0.97);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease);
  cursor: zoom-out;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__content {
  max-width: 1100px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  cursor: default;
}

.lightbox__media {
  max-width: 100%;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__media img,
.lightbox__media video {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 2px;
}

.lightbox__caption {
  text-align: center;
}

.lightbox__title {
  display: block;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-heading);
}

.lightbox__desc {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--color-body);
  margin-top: 2px;
}

.lightbox__close {
  position: absolute;
  top: 32px;
  right: 32px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-size: 30px;
  line-height: 1;
  font-family: var(--font-body);
  color: var(--color-heading);
  cursor: pointer;
  transition: color 0.25s var(--ease);
}

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

body.lightbox-open {
  overflow: hidden;
}

.fun-card {
  cursor: zoom-in;
}

/* ---------------------------------------------------------
   Project lightbox — click any image inside a case study to
   view it full-screen and step through every image on the
   page with the arrow buttons, arrow keys, or side clicks.
--------------------------------------------------------- */
.project-content img {
  cursor: zoom-in;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  font-family: var(--font-body);
  color: var(--color-heading);
  cursor: pointer;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

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

.lightbox__prev {
  left: 16px;
}

.lightbox__prev:hover {
  transform: translateY(-50%) translateX(-3px);
}

.lightbox__next {
  right: 16px;
}

.lightbox__next:hover {
  transform: translateY(-50%) translateX(3px);
}

.lightbox__counter {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--color-body-soft);
  text-align: center;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .lightbox {
    padding: 24px 52px;
  }

  .lightbox__close {
    top: 16px;
    right: 16px;
  }

  .lightbox__nav {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .lightbox__prev {
    left: 6px;
  }

  .lightbox__next {
    right: 6px;
  }
}