/* ============================================
   Mark Rawlins — Portfolio
   Clean rebuild. Lausanne = nav. Gilroy = body.
   ============================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Gilroy';
  src: url('Assets/gilroy-regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('Assets/gilroy-medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('Assets/gilroy-semibold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TWK Lausanne';
  src: url('Assets/TWKLausanne-300.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TWK Lausanne';
  src: url('Assets/TWKLausanne-400.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TWK Lausanne';
  src: url('Assets/TWKLausanne-500.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TWK Lausanne';
  src: url('Assets/TWKLausanne-600.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Gilroy', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: #000;
  background: #f2f2f2;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Navigation (Figma 46-11831) ---------- */
/* Lausanne font, left-aligned, short active line */
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 2rem;
  background: transparent;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__link {
  position: relative;
  display: inline-block;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #333;
  text-decoration: none;
}

.nav__link:hover {
  color: #000;
}

.nav__link--active::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 12px;
  height: 2px;
  margin-bottom: 6px;
  background: #333;
}

/* ---------- Main content ---------- */
main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

main.page--wide {
  max-width: 54rem;
}

/* ---------- Homepage (Figma 55-3848) ---------- */
.main--home {
  max-width: 75rem;
  padding: 5rem 4rem 4rem;
}

.home__hero {
  position: relative;
  margin-bottom: 5rem;
}

.home__intro {
  position: relative;
  z-index: 1;
  margin: 0 0 2rem;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 500;
  line-height: 1.4;
  color: #000;
  max-width: 48rem;
}

.home__intro a {
  color: #000;
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.home__intro a:hover {
  opacity: 0.7;
}

.home__summary {
  position: relative;
  z-index: 1;
  margin: 2rem 0 2rem;
  max-width: 32rem;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 200;
  line-height: 1.4;
  color: #000;
}

.home__name-scene {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 400px;
  margin: 0;
}

.home__name-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 0;
  pointer-events: none;
}

.home__name-scene > * {
  position: relative;
  z-index: 1;
}

.home__work {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.work-entry {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 4rem;
  padding: 3rem 0;
  align-items: start;
}

.work-entry:not(:last-child) {
  border-bottom: none;
}

.work-entry__text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 32rem;
}

.work-entry__brand {
  height: 60px;
  display: flex;
  align-items: center;
}

.work-entry__logo {
  height: 24px;
  width: auto;
  object-fit: contain;
}

.work-entry__logo--previ {
  height: 32px;
}

.work-entry__logo--vivint {
  height: 54px;
}

.work-entry__logo--nike {
  height: 29px;
}

.work-entry__info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.work-entry__title {
  margin: 0;
  font-family: 'Gilroy', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1.8;
  color: #000;
}

.work-entry__date {
  margin: 0;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.56);
}

.work-entry__sep {
  display: block;
  width: 10px;
  height: 1px;
  background: #000;
  margin: 0;
}

.work-entry__desc {
  margin: 0;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.8);
}

.work-entry__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  margin: 1rem 0;
  padding: 0 1rem;
  font-family: 'Gilroy', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.8);
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.42);
  border-radius: 240px;
  align-self: flex-start;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.work-entry__btn:hover {
  background: #000;
  color: #fff;
  border-color: #000;
}

.work-entry__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 1.5rem;
  font-family: 'Gilroy', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #000;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.work-entry__visual {
  position: relative;
  display: block;
  aspect-ratio: 5 / 3;
  min-height: clamp(320px, 40vh, 500px);
  max-height: 560px;
  border-radius: 64px;
  overflow: hidden;
  text-decoration: none;
}

.work-entry__visual-inner {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.work-entry__visual--schoolai .work-entry__visual-inner {
  background-image: url('Assets/SchoolAi_Background.jpg');
  background-size: cover;
  background-position: center;
}

.work-entry__visual--schoolai .work-entry__browser-video {
  aspect-ratio: 2770 / 1530;
}

.work-entry__visual--previ .work-entry__browser-video {
  aspect-ratio: 3256 / 1888;
}

.work-entry__visual--previ .work-entry__visual-inner {
  background-image: url('Assets/Previ_Background.jpg');
  background-color: #303030;
  background-size: cover;
}

.work-entry__visual--vivint .work-entry__visual-inner {
  background-image: url('Assets/Vivint_Background.jpg');
  background-color: #1a1a1a;
  background-size: cover;
}

.work-entry__vivint-gif {
  position: absolute;
  inset: 8%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-entry__vivint-gif img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

.work-entry__visual--nike .work-entry__visual-inner {
  background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('Assets/Nike_Background.jpg');
  background-color: #e5e5e5;
  background-size: cover;
}

/* Browser overlay (SchoolAI, Previ)
   Chrome image + video scale together; video area is 16:9 with no letterboxing. */
.work-entry__browser {
  position: absolute;
  top: 10%;
  left: 10%;
  right: 10%;
  width: auto;
  height: auto;
  max-height: 80%;
  background: #eaeaea;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 12px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.work-entry__browser-header {
  display: block;
  width: 100%;
  height: auto;
  flex-shrink: 0;
  margin: 0;
  line-height: 0;
}

/* Video area: fixed 16:9 so it scales with width; video fills with no bars (cover). */
.work-entry__browser-video {
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.work-entry__browser-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Phone overlay (Vivint) */
/* Video-only overlay (Nike) */
.work-entry__video-only {
  position: absolute;
  inset: 10%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-entry__video-only video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: 48rem;
  margin: 0 auto;
  padding: 4rem 2rem 3rem;
  background: #f2f2f2;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
}

.site-footer--home {
  max-width: 75rem;
}

/* Case study: footer spans same horizontal space as main content */
.page--case-study .site-footer {
  max-width: 1920px;
  padding-left: 2rem;
  padding-right: 2rem;
}

@media (min-width: 900px) {
  .page--case-study .site-footer {
    padding-left: 96px;
    padding-right: 96px;
  }
}

.site-footer__name {
  margin: 0 0 2rem;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 700;
  color: #000;
  letter-spacing: -0.02em;
}

.site-footer__tagline {
  margin: 0 0 8rem;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 300;
  color: #000;
  line-height: 1.5;
}

.site-footer__contact {
  margin: 0;
}

.site-footer__heading {
  margin: 0 0 0.5rem;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #000;
}

.site-footer__details {
  margin: 0;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 300;
  color: #000;
}

.site-footer__details a {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer__details a:hover {
  opacity: 0.7;
}

.site-footer__details a + a {
  margin-left: 0.5rem;
}

/* ---------- Work page ---------- */
.page-header {
  padding: 2rem 0 1.5rem;
}

.page-header__title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 500;
  color: #000;
}

.work-index {
  display: flex;
  flex-direction: column;
}

.work-index__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  color: inherit;
}

.work-index__item:hover {
  color: #525252;
}

.work-index__company {
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  color: #000;
}

.work-index__title {
  font-size: 0.9rem;
  color: #525252;
}

.work-index__note {
  margin-top: 2rem;
  font-size: 0.9rem;
  font-style: italic;
  color: #737373;
}

/* ---------- Case study pages ---------- */
.case-study__header {
  padding-bottom: 2rem;
  border-bottom: 1px solid #eee;
}

.case-study__title {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 500;
  line-height: 1.25;
  color: #000;
}

.case-study__meta {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #525252;
}

.case-study__problem,
.case-study__outcome {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

.case-study__hero-placeholder {
  margin-top: 1.5rem;
  padding: 2rem;
  background: #eee;
  border-radius: 8px;
  text-align: center;
}

.case-study__hero-placeholder p {
  margin: 0;
  font-size: 0.9rem;
  color: #737373;
}

.case-study__section {
  padding: 2rem 0;
  border-bottom: 1px solid #eee;
}

.case-study__section:last-of-type {
  border-bottom: none;
}

.case-study__section h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 500;
  color: #000;
}

.case-study__section h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #000;
}

.case-study__section p,
.case-study__section ul {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  line-height: 1.65;
}

.case-study__section ul {
  padding-left: 1.5rem;
}

.case-study__impact {
  list-style: none;
  padding-left: 0;
}

.case-study__back {
  margin-top: 2rem;
  padding-top: 1.5rem;
}

.case-study__back a {
  color: #525252;
  text-decoration: none;
}

.case-study__back a:hover {
  color: #000;
}

/* ---------- Case study landing (Figma: SchoolAI) ---------- */
.main--case-study {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}

@media (min-width: 900px) {
  .main--case-study {
    padding: 0 96px 4rem;
  }
}

.case-study--schoolai {
  padding-top: 0;
}

/* Figma 66-4308: padding 96px L/R, 80px T/B; left gap 24px; right block 503px */
.case-study__intro {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 5rem 0;
}

@media (min-width: 900px) {
  .case-study__intro {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0;
    padding: 5rem 0;
  }
}

.case-study__intro-left {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.case-study__logo {
  height: 40px;
  width: auto;
  max-width: 211px;
  object-fit: contain;
  display: block;
  align-self: flex-start;
}

.case-study__meta-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.8;
  max-width: 503px;
}

.case-study__role {
  margin: 0;
  max-width: 360px;
  font-family: 'Gilroy', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2.1px;
  text-transform: uppercase;
  color: #000;
}

.case-study__date {
  margin: 0;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.56);
}

.case-study__summary {
  margin: 0;
  max-width: 503px;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.8);
}

/* Figma 66-4838: single column, 731px width, 80px vertical padding, 18px between elements */
.case-study__problem-outcome {
  display: flex;
  flex-direction: column;
  max-width: 731px;
  padding: 5rem 0;
}

.case-study__po-block {
  display: flex;
  flex-direction: column;
}

.case-study__po-block + .case-study__po-block {
  margin-top: 2rem;
}

.case-study__po-heading {
  margin: 0 0 18px;
  font-family: 'Gilroy', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2.1px;
  text-transform: uppercase;
  color: #000;
}

.case-study__po-text {
  margin: 0 0 18px;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.8);
}

.case-study__po-block:last-child .case-study__po-text {
  margin-bottom: 0;
}

.case-study__hero {
  padding-bottom: 5rem;
}

.case-study__hero-inner {
  position: relative;
  min-height: 600px;
  border-radius: 64px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

@media (min-width: 900px) {
  .case-study__hero-inner {
    min-height: 760px;
    padding: 4.7rem 8.5rem;
  }

  .case-study--vivint .case-study__hero-inner,
  .case-study--nike .case-study__hero-inner {
    min-height: 920px;
  }
}

.case-study__hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.case-study__hero-bg--previ {
  background-image: url('Assets/Previ_Background.jpg');
  background-color: #303030;
}

.case-study__hero-bg--vivint {
  background-image: url('Assets/Vivint_Background.jpg');
  background-color: #1a1a1a;
}

.case-study__hero-bg--nike {
  background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('Assets/Nike_Background.jpg');
  background-color: #e5e5e5;
}

/* Nike: Coach block — same size as hero, background image + darkening, video in middle */
.case-study__mockup--nike-coach {
  padding: 5rem 0;
}

.case-study__nike-coach-card {
  position: relative;
  min-height: 600px;
  border-radius: 64px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

@media (min-width: 900px) {
  .case-study__nike-coach-card {
    min-height: 920px;
    padding: 4.7rem 8.5rem;
  }
}

.case-study__nike-coach-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('Assets/Nike_Coach_Background.jpg');
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Nike: image blocks (Cards, Signature Runs, Achievements 1 & 2) — same size as hero */
.case-study__mockup--nike-img {
  padding: 5rem 0;
}

.case-study__nike-img-card {
  position: relative;
  min-height: 600px;
  border-radius: 64px;
  overflow: hidden;
}

@media (min-width: 900px) {
  .case-study__nike-img-card {
    min-height: 920px;
  }
}

.case-study__nike-img-card__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.case-study__nike-img-card__bg--cards {
  background-image: url('Assets/Nike_Cards.jpg');
}

.case-study__nike-img-card__bg--signature-runs {
  background-image: url('Assets/Nike_SignatureRuns.jpg');
}

.case-study__nike-img-card__bg--achievements1 {
  background-image: url('Assets/Nike_Achievements1.jpg');
}

.case-study__nike-img-card__bg--achievements2 {
  background-image: url('Assets/Nike_Achievements2.jpg');
}

/* Nike: Achievements 3 — background image + video in white section on left (Vivint peace-card style) */
.case-study__mockup--nike-achievements3 {
  padding: 5rem 0;
}

.case-study__nike-achievements3-card {
  position: relative;
  min-height: 600px;
  border-radius: 64px;
  overflow: hidden;
}

@media (min-width: 900px) {
  .case-study__nike-achievements3-card {
    min-height: 920px;
  }
}

.case-study__nike-achievements3-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('Assets/Nike%20Achievements3.jpg');
  background-color: #fff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.case-study__nike-achievements3-video {
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8%;
  box-sizing: border-box;
}

.case-study__nike-achievements3-video video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Nike: Apple Watch block — same size as hero; background image + video overlay on middle watch */
.case-study__mockup--nike-aw {
  padding: 5rem 0;
}

.case-study__nike-aw-card {
  position: relative;
  min-height: 600px;
  border-radius: 64px;
  overflow: hidden;
}

@media (min-width: 900px) {
  .case-study__nike-aw-card {
    min-height: 920px;
  }
}

.case-study__nike-aw-bg {
  position: absolute;
  inset: 0;
  background-color: #111;
}

.case-study__nike-aw-bg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Nike: grid of looping videos — same size as hero block */
.case-study__mockup--nike-grid {
  padding: 5rem 0;
}

.case-study__nike-grid-card {
  position: relative;
  min-height: 600px;
  border-radius: 64px;
  overflow: hidden;
  background: #fff;
}

@media (min-width: 900px) {
  .case-study__nike-grid-card {
    min-height: 920px;
  }
}

.case-study__nike-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  width: 100%;
  height: 100%;
  background: #fff;
}

.case-study__nike-grid-cell {
  position: relative;
  overflow: hidden;
  background: #fff;
}

.case-study__nike-grid-cell video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* SchoolAI uses default hero-bg (no modifier); add explicit background for schoolai if needed */
.case-study--schoolai .case-study__hero-bg {
  background-image: url('Assets/SchoolAi_Background.jpg');
}

.case-study__browser {
  position: relative;
  width: 100%;
  max-width: 1240px;
  background: #eaeaea;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 24px 31px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.case-study__browser-header {
  display: block;
  width: 100%;
  height: auto;
  flex-shrink: 0;
  line-height: 0;
}

.case-study__browser-video {
  flex: none;
  width: 100%;
  aspect-ratio: 2770 / 1530;
  overflow: hidden;
}

.case-study__browser-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-study--previ .case-study__browser-video {
  aspect-ratio: 3256 / 1888;
}

/* Slight zoom to crop thin black bars at video edges (baked-in letterboxing) */
.case-study__previ-video-card .case-study__browser-video video {
  transform: scale(1.03);
  object-fit: cover;
}

/* Hero GIF (Vivint): same treatment as homepage */
.case-study__hero-gif {
  position: absolute;
  inset: 8%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-study__hero-gif img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Hero clone with tab bar (no background image) — Before/After, same scale as hero */
.case-study__mockup--vivint-hero-tabs {
  padding: 5rem 0;
}

.case-study__hero-inner--no-bg {
  background: #E3E8EB;
  transition: background-color 0.7s ease;
}

.case-study__hero-inner--no-bg .case-study__hero-tabs-pane {
  position: absolute;
  inset: 0;
  background: transparent;
}

.case-study__hero-inner--no-bg .case-study__hero-tabs-pane.is-hidden {
  display: none;
}

.case-study__hero-inner--no-bg .case-study__hero-gif {
  inset: 14% 14% 12% 14%;
  top: 5.5rem;
}

.case-study__tabs--hero {
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  position: absolute;
  z-index: 2;
}

@media (min-width: 900px) {
  .case-study__tabs--hero {
    top: 2.5rem;
  }
}

/* Hero video-only (Nike): same treatment as homepage */
.case-study__hero-video-only {
  position: absolute;
  inset: 10%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.case-study__hero-video-only video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Hero placeholder for case studies without a custom hero */
.case-study__hero-inner .case-study__hero-placeholder {
  width: 100%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f2f2;
  border-radius: 24px;
  padding: 2rem;
}

.case-study__hero-inner .case-study__hero-placeholder p {
  margin: 0;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.5);
}

.case-study__mockup {
  padding-bottom: 5rem;
}

/* Scroll-scale: cards grow slightly in view, shrink as they enter/exit (JS sets transform) */
.scroll-scale-card {
  transform-origin: center center;
  transition: transform 0.3s ease-out;
}

/* Figma 66-4907: white card 64px radius, floating pill tab bar, full-bleed image */
.case-study__mockup--2 {
  padding: 5rem 0;
}

/* Previ: second block — browser + Cotopaxi video, white background (like SchoolAI mockup blocks) */
.case-study__mockup--previ-video {
  padding: 5rem 0;
}

.case-study__previ-video-card {
  position: relative;
  background: #fff;
  border-radius: 64px;
  overflow: hidden;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

@media (min-width: 900px) {
  .case-study__previ-video-card {
    min-height: 760px;
    padding: 4.7rem 8.5rem;
  }
}

.case-study__previ-video-card .case-study__browser {
  margin: 0 auto;
  width: 100%;
}

/* Vivint: extra blocks with background images (Vision, Peace of Mind) — same size as hero */
.case-study__mockup--vivint-bg {
  padding: 5rem 0;
}

.case-study__vivint-bg-card {
  position: relative;
  min-height: 600px;
  border-radius: 64px;
  overflow: hidden;
}

@media (min-width: 900px) {
  .case-study__vivint-bg-card {
    min-height: 920px;
  }
}

.case-study__vivint-bg-card__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.case-study__vivint-bg-card__bg--from-to {
  background-image: url('Assets/Vivint_From_To.jpg');
}

.case-study__vivint-bg-card__bg--vision {
  background-image: url('Assets/Vivint_Vision.jpg');
}

.case-study__vivint-bg-card__bg--peace {
  background-image: url('Assets/Vivint_PeaceofMind.jpg');
}

/* Vivint: App blowout card — light grey bg, single image (Figma 67-6009) */
.case-study__mockup--vivint-blowout {
  padding: 5rem 0;
}

.case-study__blowout-card {
  background: #e3e8eb;
  border-radius: 64px;
  overflow: hidden;
  min-height: 920px;
  height: 920px;
  position: relative;
}

.case-study__blowout-img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Vivint: Peace of mind card — 50% white (GIF centered), 50% blue-green (copy) (Figma 67-5983) */
.case-study__mockup--vivint-peace-card {
  padding: 5rem 0;
}

.case-study__peace-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 64px;
  overflow: hidden;
  min-height: 600px;
}

@media (min-width: 900px) {
  .case-study__peace-card {
    flex-direction: row;
    min-height: 920px;
  }

  .case-study__peace-card--reversed {
    flex-direction: row-reverse;
  }
}

/* Left half: white, phone centered */
.case-study__peace-card__left {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #fff;
}

@media (min-width: 900px) {
  .case-study__peace-card__left {
    padding: 3rem;
  }
}

.case-study__peace-card__phone {
  flex-shrink: 0;
  width: 100%;
  max-width: 375px;
  border-radius: 48px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  isolation: isolate;
}

.case-study__peace-card__phone-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 375 / 812;
  object-fit: cover;
  border: none;
  border-radius: 48px;
  outline: none;
}

/* Right half: blue-green, copy */
.case-study__peace-card__right {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
  background: #4A5A59;
  color: #fff;
}

@media (min-width: 900px) {
  .case-study__peace-card__right {
    padding: 3rem 4rem;
  }
}

.case-study__peace-card__heading {
  margin: 0 0 0.75rem;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.2;
  color: #86aead;
}

.case-study__peace-card__body {
  margin: 0;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.4;
  color: #fff;
  max-width: 320px;
}

.case-study__before-after-card {
  position: relative;
  background: #fff;
  border-radius: 64px;
  overflow: hidden;
  padding: 75px 2rem 2rem;
}

@media (min-width: 900px) {
  .case-study__before-after-card {
    padding: 75px 136px 2rem;
  }
}

/* ============================================
   Before/After tab bar (reusable)
   Use inside .case-study__before-after-card. Requires script.js tab logic.
   HTML: .case-study__tabs (role=tablist) > .case-study__tab-highlight + .case-study__tab[data-tab] × 2
   Panes: .case-study__before-after-pane[data-pane] with matching data-tab value.
   ============================================ */
.case-study__tabs {
  position: absolute;
  /* Center in the vertical gap between card top and image (75px padding + 52px content margin; tab height 40px) */
  top: calc((75px + 52px) / 2 - 20px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 24px;
  z-index: 2;
}

/* Sliding pill behind active tab — true black (position/size set by JS) */
.case-study__tab-highlight {
  position: absolute;
  top: 4px;
  left: 4px;
  height: 40px;
  border-radius: 240px;
  background: #000;
  z-index: 0;
  pointer-events: none;
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.case-study__tab {
  position: relative;
  z-index: 1;
  height: 40px;
  padding: 8px 16px;
  font-family: 'Gilroy', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: rgba(0, 0, 0, 0.56);
  background: transparent;
  border: none;
  border-radius: 240px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

/* Inactive tab hover: light grey pill, darker text */
.case-study__tab:not(.case-study__tab--active):not([aria-selected="true"]):hover {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.8);
}

.case-study__tab--active,
.case-study__tab[aria-selected="true"] {
  background: transparent;
  color: #fff;
}

/* Active tab hover: darken the text slightly for feedback (pill doesn’t change) */
.case-study__tab--active:hover,
.case-study__tab[aria-selected="true"]:hover {
  color: rgba(255, 255, 255, 0.9);
}

.case-study__before-after-content {
  position: relative;
  margin-top: 52px;
  padding: 24px;
  min-height: 400px;
}

.case-study__before-after-pane {
  position: absolute;
  inset: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.case-study__before-after-pane:not(.is-hidden) {
  z-index: 1;
}

.case-study__before-after-pane.is-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none;
}

.case-study__before-after-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 6px 16px rgba(0, 0, 0, 0.08),
    0 16px 40px rgba(0, 0, 0, 0.1);
}

/* Vivint before/after: same height as other cards, no white pane background */
/* Before/after card: consistent tall height so images don't crop (SchoolAI, Vivint) */
.case-study--schoolai .case-study__before-after-card,
.case-study--vivint .case-study__before-after-card {
  min-height: 920px;
  display: flex;
  flex-direction: column;
}

.case-study--vivint .case-study__before-after-card {
  background: #E3E8EB;
}

.case-study--schoolai .case-study__before-after-content {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 5rem;
}

.case-study--schoolai .case-study__before-after-pane .case-study__before-after-img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(72vh, 640px);
  object-fit: contain;
  object-position: center;
  margin: 0 auto;
  display: block;
}

.case-study--vivint .case-study__before-after-content {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 5.5rem;
}

.case-study--vivint .case-study__before-after-pane {
  background: transparent;
  box-sizing: border-box;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Vivint Hardware: pane fills content area so image centers in card */
.case-study--vivint .case-study__before-after-pane--after,
.case-study--vivint .case-study__before-after-pane--before {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-study--vivint .case-study__before-after-pane--after .case-study__before-after-img,
.case-study--vivint .case-study__before-after-pane--before .case-study__before-after-img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(70vh, 620px);
  object-fit: contain;
  object-position: center;
  margin: 0 auto;
  display: block;
}

.case-study__mockup-inner {
  border-radius: 64px;
  overflow: hidden;
  min-height: 400px;
  background-color: #eaeaea;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Figma 66-4874: white card, 64px radius, inner padding, grid asset */
.case-study__mockup--3 {
  padding: 80px 0 5rem;
}

.case-study__mockup-inner--grid {
  background: #fff;
  padding: 2rem;
  min-height: 0;
}

@media (min-width: 900px) {
  .case-study__mockup-inner--grid {
    padding: 75px 136px;
  }
}

.case-study__grid-img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.case-study__mockup-caption {
  margin: 0;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.5);
  padding: 2rem;
}

/* Caption below image blocks — Lausanne, tasteful */
.case-study__img-caption {
  margin: 0;
  margin-top: 1.25rem;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: rgba(0, 0, 0, 0.55);
  max-width: 42rem;
}

@media (min-width: 900px) {
  .case-study__img-caption {
    margin-top: 1.5rem;
    font-size: 1rem;
  }
}

.case-study__nav {
  padding-bottom: 5rem;
}

/* Tighter spacing between card sections on smaller screens */
@media (max-width: 899px) {
  .case-study__intro {
    padding: 3rem 0;
    gap: 1.5rem;
  }

  .case-study__problem-outcome {
    padding: 3rem 0;
  }

  .case-study__po-block + .case-study__po-block {
    margin-top: 1.25rem;
  }

  .case-study__hero {
    padding-bottom: 2.5rem;
  }

  .case-study__hero-inner {
    padding: 3rem 1.5rem;
  }

  .case-study__mockup {
    padding-bottom: 2.5rem;
  }

  .case-study__mockup--2 {
    padding: 2.5rem 0;
  }

  .case-study__before-after-card {
    padding: 40px 1.5rem 1.5rem;
  }

  .case-study__tabs {
    top: calc((40px + 32px) / 2 - 20px);
  }

  .case-study__before-after-content {
    margin-top: 32px;
    padding: 16px;
  }

  .case-study__mockup--3 {
    padding: 40px 0 2.5rem;
  }

  .case-study__mockup-inner--grid {
    padding: 1.5rem;
  }

  .case-study__nav {
    padding-bottom: 2.5rem;
  }

  .case-study__to-next {
    padding-bottom: 2.5rem;
  }

  .case-study__to-next-heading {
    margin-bottom: 1.5rem;
  }
}

.case-study__back-btn {
  text-decoration: none;
}

.case-study__to-next {
  padding-bottom: 5rem;
}

.case-study__to-next-heading {
  margin: 0 0 2.5rem;
  font-family: 'Gilroy', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2.1px;
  text-transform: uppercase;
  color: #000;
}

.case-study__to-next-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

@media (min-width: 900px) {
  .case-study__to-next-links {
    gap: 2.5rem;
  }
}

.case-study__to-next-btn {
  flex: 1;
  min-width: 200px;
  min-height: 200px;
  border-radius: 24px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 4rem;
  text-decoration: none;
  transition: background 0.4s ease, transform 0.2s ease;
}

.case-study__to-next-btn:hover {
  background: #000;
  transform: scale(1.02);
}

.case-study__to-next-btn:hover .case-study__to-next-logo {
  filter: brightness(0) invert(1);
}

.case-study__to-next-logo {
  max-height: 60px;
  width: auto;
  object-fit: contain;
  filter: brightness(0);
  transition: filter 0.4s ease;
}

.case-study__to-next-logo--vivint {
  max-height: 56px;
}

/* ---------- POV page ---------- */
.pov-page {
  padding: 1.5rem 0;
}

.pov-page__title {
  margin: 0 0 1.5rem;
  font-size: 1.75rem;
  font-weight: 500;
  color: #000;
}

.pov-page__philosophy {
  margin: 0 0 0.5rem;
  font-family: 'TWK Lausanne', system-ui, sans-serif;
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 400;
  color: #000;
}

.pov-page__philosophy-desc {
  margin: 0 0 2rem;
  font-size: 1rem;
  line-height: 1.65;
  color: #525252;
}

.pov-page__subtitle {
  margin: 2rem 0 1rem;
  font-size: 1.25rem;
  font-weight: 500;
  color: #000;
}

.pov-page__model {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #000;
}

.pov-page__framework,
.pov-page__list {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.pov-page__framework li,
.pov-page__list li {
  margin-bottom: 0.5rem;
  line-height: 1.65;
}

/* ---------- About page ---------- */
.about-page {
  padding: 1.5rem 0;
}

.about-page__title {
  margin: 0 0 1.5rem;
  font-size: 1.75rem;
  font-weight: 500;
  color: #000;
}

.about-page__bio {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.7;
  color: #000;
}

.about-page__outside {
  margin: 0 0 2rem;
  font-size: 1rem;
  line-height: 1.65;
  color: #525252;
}

.about-page__links {
  display: flex;
  gap: 2rem;
}

.about-page__links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: #525252;
  text-decoration: none;
}

.about-page__links a:hover {
  color: #000;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .home__work {
    gap: 3rem;
  }

  .work-entry {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 0;
  }

  /* Flatten text block so we can reorder: body text → visual → button → tags */
  .work-entry__text {
    display: contents;
  }

  .work-entry__brand { order: 0; }
  .work-entry__info { order: 1; }
  .work-entry__sep { order: 2; }
  .work-entry__desc { order: 3; }
  .work-entry__visual { order: 4; min-height: 280px; }
  .work-entry__btn { order: 5; }
  .work-entry__tags { order: 6; }

  .work-entry__browser {
    inset: 9%;
  }

  .work-entry__video-only {
    inset: 11%;
  }
}

@media (max-width: 640px) {
  .nav {
    flex-wrap: wrap;
    padding: 1rem;
    gap: 1rem;
  }

  .nav__links {
    gap: 1.5rem;
  }

  main {
    padding: 0 1rem 2rem;
  }

  .main--home {
    padding: 2rem 1rem 2rem;
  }

  .home__intro {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .home__summary {
    font-size: 1rem;
    margin-bottom: 0;
  }

  .home__name-scene {
    height: 320px;
    margin-top: -5.5rem;
  }

  .home__hero {
    margin-bottom: 3rem;
  }

  .home__work {
    gap: 2.5rem;
  }

  .work-entry {
    padding: 2.25rem 0;
  }

  .work-entry__visual {
    border-radius: 32px;
    min-height: 220px;
  }

  .work-entry__browser {
    inset: 10%;
  }

  .work-entry__browser-video {
    min-height: 120px;
  }

  .work-entry__vivint-gif {
    inset: 8%;
  }

  .work-entry__video-only {
    inset: 12%;
  }

  .work-entry__logo--vivint {
    height: 40px;
  }

  .site-footer {
    padding: 3rem 1rem 2rem;
  }

  .site-footer__name {
    font-size: clamp(2.25rem, 10vw, 3rem);
    margin-bottom: 1.5rem;
  }

  .site-footer__tagline {
    margin-bottom: 2rem;
  }
}
