:root {
  --color-text: #333333;
  --color-primary: #2957f0;
  --color-muted: #8a8a8a;
  --color-surface: #f2f4fc;
  --color-border: #e6e6e6;
  --color-bg: #ffffff;
  --font-heading: "Bitter", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --page-max: 1440px;
  --page-pad: clamp(1.25rem, 4vw, 2.5rem);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

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

h1,
h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

/* Header */

.site-header {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.75rem var(--page-pad) 0;
  display: flex;
  align-items: center;
}

.logo {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: box-shadow 0.2s ease;
}

.logo:hover {
  box-shadow: 0 4px 16px rgba(41, 87, 240, 0.45);
}

/* Hero */

.hero {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 5.5rem) var(--page-pad) clamp(3rem, 7vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__title {
  font-size: clamp(2rem, 4.5vw, 3.5rem); /* ~56px max */
  font-weight: 500;
  max-width: none;
}

.hero__subtitle {
  margin-top: 1.25rem;
  max-width: 52ch;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--color-text);
}

.hero__media {
  display: flex;
  justify-content: flex-end;
}

.hero__photo {
  width: min(100%, 520px);
  aspect-ratio: 1;
  object-fit: contain;
}

/* Projects */

.projects {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad) clamp(3rem, 7vw, 5rem);
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: center;
}

.project__media {
  background: var(--color-surface);
  border-radius: 0.35rem;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  display: grid;
  place-items: center;
  min-height: 360px;
}

.project__media img {
  width: 100%;
  max-width: 780px;
  object-fit: contain;
}

.project__title {
  font-size: clamp(1.55rem, 2.5vw, 2rem);
}

.project__desc {
  margin-top: 1rem;
  font-size: 0.98rem;
  line-height: 1.65;
}

.project__meta {
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 4.25rem;
  width: 100%;
}

.project__meta > div {
  flex: 0 1 auto;
}

.project__meta dt {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-muted);
}

.project__meta dd {
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
  font-weight: 500;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.75rem;
  padding: 0.7rem 1.15rem;
  border: 1.5px solid var(--color-primary);
  border-radius: 4px;
  color: var(--color-primary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-outline span {
  font-size: 0.95rem;
  line-height: 1;
}

/* Connect */

.connect {
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--page-pad) clamp(3rem, 7vw, 5rem);
  text-align: center;
}

.connect__title {
  font-size: clamp(1.85rem, 3vw, 2.4rem);
}

.connect__text {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.7;
}

.connect__links {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.connect__icon {
  color: var(--color-text);
  transition: color 0.2s ease, transform 0.2s ease;
}

.connect__icon:hover {
  color: var(--color-primary);
  transform: translateY(-2px);
}

/* Footer */

.site-footer {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.5rem var(--page-pad) 2.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a,
.footer-copy {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.footer-nav a:hover {
  color: var(--color-text);
}

.footer-copy {
  margin: 0;
}

/* Back to top */

.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 50;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

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

.back-to-top:hover {
  transform: translateY(-2px);
}

.back-to-top__icon {
  width: 1.15rem;
  height: 1.15rem;
  background-color: #111111;
  -webkit-mask: url("assets/icons/arrow-up.svg") center / contain no-repeat;
  mask: url("assets/icons/arrow-up.svg") center / contain no-repeat;
}

/* Zoomable case study images */

.is-zoomable {
  cursor: zoom-in;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  color: #111111;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__stage {
  position: relative;
  z-index: 1;
  width: min(100vw, 1200px);
  height: min(100vh, 100dvh);
  padding: 4rem 1rem 1.5rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  place-items: center;
  overscroll-behavior: contain;
}

.lightbox__img {
  display: block;
  max-width: 100%;
  height: auto;
  transform-origin: center center;
  transition: transform 0.2s ease;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

/* Responsive */

@media (max-width: 900px) {
  .hero,
  .project {
    grid-template-columns: 1fr;
  }

  .hero {
    text-align: left;
    padding-top: 3rem;
  }

  .hero__title {
    max-width: none;
  }

  .hero__media {
    order: -1;
    justify-content: center;
  }

  .hero__photo {
    width: min(100%, 360px);
  }

  .project__media {
    min-height: 280px;
  }
}

@media (max-width: 560px) {
  .project__meta {
    flex-direction: column;
    gap: 0.85rem;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Case study — hero */

.case-hero {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--page-pad) clamp(3rem, 7vw, 5rem);
}

.case-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem; /* 14px */
  font-weight: 500;
  color: var(--color-text);
  transition: color 0.2s ease;
}

.case-back:hover {
  color: var(--color-primary);
}

.case-back__icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: url("assets/icons/arrow-left.svg") center / contain no-repeat;
  mask: url("assets/icons/arrow-left.svg") center / contain no-repeat;
}

.case-hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: none;
  white-space: nowrap;
}

.case-meta {
  margin: clamp(2rem, 4vw, 2.75rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 3vw, 3rem);
  row-gap: 1.5rem;
}

.case-meta__item dt {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-muted);
}

.case-meta__item dd {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
}

.case-meta__item--role dd {
  max-width: none;
}

.case-meta__line {
  display: block;
}

.case-meta__line--primary {
  white-space: nowrap;
}

.case-hero__media {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--color-surface);
  border-radius: 0.5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  place-items: center;
}

.case-hero__media img {
  width: 100%;
  max-width: 1100px;
  object-fit: contain;
}

@media (max-width: 760px) {
  .case-hero__title {
    white-space: normal;
  }

  .case-meta {
    grid-template-columns: 1fr;
    row-gap: 1.25rem;
  }

  .case-meta__item dd {
    max-width: none;
  }

  .case-meta__line--primary {
    white-space: normal;
  }
}

/* Case study — NDA banner */

.nda-banner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad) clamp(3rem, 7vw, 5rem);
}

.nda-banner__inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  border-radius: 0.4rem;
}

.nda-banner__icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.15rem;
}

.nda-banner__text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
}

/* Case study — body + TOC */

.case-body {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad) clamp(4rem, 8vw, 6rem);
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.case-toc {
  position: sticky;
  top: 2rem;
  padding-top: 0.25rem;
}

.case-toc__title {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.case-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.case-toc__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  transition: color 0.2s ease;
}

.case-toc__chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: url("assets/icons/chevron-right.svg") center / contain no-repeat;
  mask: url("assets/icons/chevron-right.svg") center / contain no-repeat;
  opacity: 0;
}

.case-toc__link:hover {
  color: var(--color-primary);
}

.case-toc__link.is-active {
  color: var(--color-primary);
  font-weight: 600;
}

.case-toc__link.is-active .case-toc__chevron {
  opacity: 1;
}

.case-content {
  min-width: 0;
}

.case-section {
  scroll-margin-top: 2rem;
}

.case-section + .case-section {
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
}

.case-section__title {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
}

.case-section__copy {
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
  max-width: none;
  width: 100%;
}

.case-section__copy p {
  font-size: 1rem;
  line-height: 1.7;
}

.case-callout {
  margin-top: 1.75rem;
  padding: 0 0 0 1.25rem;
  background: transparent;
  border-radius: 0;
  border-left: 3px solid var(--color-primary);
}

.case-callout p {
  font-family: var(--font-heading);
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  font-style: normal;
  line-height: 1.55;
  color: var(--color-text);
}

.case-quote {
  margin: 1.25rem 0 0;
  margin-inline: 0;
  padding: 0;
  border-left: none;
}

.case-quote p {
  font-weight: 500;
  font-size: 1.25rem; /* 20px */
}

.case-quote__attr {
  margin-top: 1rem;
  margin-inline: 0;
  padding: 0;
}

.case-quote__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.case-quote__role {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.4;
}

.case-section__lede {
  margin: 1.75rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}

.research-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.discovery-figure {
  margin-top: 1.75rem;
}

.discovery-figure + .case-section__lede {
  margin-top: 1.75rem;
}

.discovery-grid {
  margin-top: 1.25rem;
}

.research-card {
  padding: 1.5rem;
  background: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 0.4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.research-card__icon-wrap {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background: var(--color-surface);
  border-radius: 0.35rem;
}

.research-card__icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.research-card__text {
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
}

.research-card__title {
  margin: 1rem 0 0;
  font-family: var(--font-body);
  font-size: 1.125rem; /* 18px */
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}

.research-card__title + .research-card__text {
  margin-top: 0.65rem;
}

.constraints-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.outcome-metrics {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.outcome-metric__value {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.outcome-metric__text {
  margin-top: 0.65rem;
  font-size: 1rem; /* 16px */
  line-height: 1.6;
}

.outcome-media {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  display: grid;
  gap: clamp(2.5rem, 5vw, 3.5rem);
}

.reflections-list {
  margin-top: 1.5rem;
  display: grid;
  gap: 1.25rem;
}

.reflection-card {
  padding: 1.5rem;
  background: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 0.4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.reflection-card .research-card__title {
  margin-top: 1rem;
}

.reflection-card .research-card__text {
  margin-top: 0.65rem;
  font-size: 1rem;
}

@media (max-width: 700px) {
  .research-grid,
  .constraints-grid,
  .outcome-metrics {
    grid-template-columns: 1fr;
  }
}

.process-list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.case-section .outcome-media {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.process-intro-follow {
  margin-top: 1.25rem;
}

.process-list li {
  position: relative;
  padding-left: 1.15rem;
  font-size: 1rem;
  line-height: 1.5;
}

.process-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--color-text);
}

.process-block {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.process-block__label {
  margin: 0 0 1.25rem;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.process-figure {
  margin: 0;
}

.process-figure__frame {
  background: var(--color-surface);
  border-radius: 0.5rem;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  display: grid;
  place-items: center;
}

.process-figure__frame--pair {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
  align-items: center;
}

.process-figure__frame img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.process-figure__caption {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.process-block .case-section__copy {
  margin-top: 1.5rem;
}

.process-notes {
  margin-top: clamp(2rem, 4vw, 2.75rem);
  display: grid;
  gap: 1.25rem;
}

.process-note {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 0.4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.process-note p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .process-figure__frame--pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .case-body {
    grid-template-columns: 1fr;
  }

  .case-toc {
    position: static;
    padding-bottom: 1.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
  }

  .case-toc__list {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.75rem;
  }

  .case-toc__link,
  .case-toc__link:hover,
  .case-toc__link.is-active {
    color: var(--color-primary);
    font-weight: 500;
  }

  .case-toc__chevron,
  .case-toc__link.is-active .case-toc__chevron {
    display: none;
  }
}

