/* Desktop: 1184px column on a dotted page ground, sections 160px apart.
   Mobile (≤760px): Figma "mobile" frames — 24px side padding, 80px between sections, single column.
   Tokens mirror the Portfolio-DS Figma variables (Responsive collection: Desktop / Mobile modes). */
:root {
  --page: #f8f8f8;
  --white: #ffffff;
  --text: #2c2c2c;
  --muted: #858585;
  --accent: #ff0000;
  --accent-200: #ff9999;
  --border: #dddddd;
  --border-strong: #b1b1b1;
  --bullet: #b1b1b1;
  --toggle: #eeeeee;
  --toggle-hover: #e7e7e7;
  --disabled: #c7c7c7;
  --btn-dark: #585858;
  --btn-hover: #c7c7c7;
  --btn-active: #e0e0e0;
  --dot: #dcdcdc;
  --font: "Chakra Petch", "Rajdhani", ui-sans-serif, system-ui, sans-serif;

  --h1: 48px; --h1-lh: 56px; --h1-ps: 32px;
  --h2: 32px; --h2-lh: 40px;
  --h3: 24px; --h3-lh: 32px;
  --intro: 28px; --intro-lh: 36px;
  --lg: 20px; --lg-lh: 28px;
  --md: 16px; --md-lh: 24px;
  --sm: 14px; --sm-lh: 20px;
  --xs: 12px; --xs-lh: 16px;

  --wrap: 1184px;
  --gutter: 16px;
  --section-gap: 160px;
  --inner-gap: 80px;
  --hover-dur: 300ms; --hover-ease: linear;
  color-scheme: light;
}
@media (max-width: 760px) {
  :root {
    --h1: 36px; --h1-lh: 44px; --h1-ps: 24px;
    --intro: 20px; --intro-lh: 28px;
    --gutter: 24px;
    --section-gap: 80px;
    --inner-gap: 40px;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background-color: var(--page);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.3px);
  background-size: 24px 24px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--md);
  line-height: var(--md-lh);
  padding-inline: var(--gutter);
  padding-block: 40px 0;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page { display: flex; flex-direction: column; align-items: center; gap: 80px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; }
.body { display: flex; flex-direction: column; gap: var(--section-gap); width: 100%; }
@media (max-width: 760px) { .page { gap: 56px; } }

/* ---------- header ---------- */
.header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  width: 100%; max-width: var(--wrap);
}
.nav {
  position: relative; background: var(--white); padding: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.nav__menu { display: contents; }
.nav-primary { display: flex; gap: 8px; position: absolute; left: 50%; transform: translateX(-50%); }
.nav-secondary { display: flex; gap: 8px; }
.menu-button { display: none; }
.tab, .btn {
  font: 600 var(--md)/var(--md-lh) var(--font);
  color: var(--text); text-decoration: none; background: none; border: 0;
  padding: 8px 14px; display: inline-flex; align-items: center; gap: 8px; height: 40px; cursor: pointer;
  white-space: nowrap;
}
.tab:hover, .tab:active { color: var(--accent); }
.tab[aria-disabled="true"] { color: var(--disabled); cursor: not-allowed; pointer-events: none; }
.btn img { width: 20px; height: 20px; }
.tab svg { width: 16px; height: 16px; flex: none; }
.btn--ghost { background: var(--white); }
.btn--ghost:hover { background: var(--btn-hover); }
.btn--ghost:active { background: var(--btn-active); }
.btn--dark { background: var(--btn-dark); color: var(--white); }
.btn--dark:hover { background: var(--text); }
.btn--dark:active { background: var(--btn-dark); }
.btn--outline { border: 1px solid var(--text); }
.btn--outline:hover { background: var(--btn-hover); }
.btn--outline:active { background: var(--btn-active); }

/* navigation (mobile): menu icon-button opens a dropdown list aligned to the right (Figma: navigation-mobile, state=active) */
@media (max-width: 760px) {
  .menu-button {
    display: grid; place-items: center; width: 32px; height: 32px; padding: 6px;
    background: transparent; border: 0; color: var(--text); cursor: pointer;
    transition: background-color var(--hover-dur) var(--hover-ease);
  }
  .menu-button:hover { background: var(--toggle-hover); }
  .menu-button[aria-expanded="true"] { background: var(--btn-active); }
  .menu-button svg { width: 16px; height: 16px; }
  .menu-button .icon-close, .menu-button[aria-expanded="true"] .icon-menu { display: none; }
  .menu-button[aria-expanded="true"] .icon-close { display: block; }
  .nav__menu {
    display: none; position: absolute; right: 8px; top: 48px;
    background: var(--white); padding: 8px; flex-direction: column;
    box-shadow: 0 -8px 28px -8px rgba(0, 0, 0, 0.05);
  }
  .nav.is-open .nav__menu { display: flex; }
  .nav-primary, .nav-secondary { position: static; transform: none; flex-direction: column; gap: 0; }
  .nav__menu .tab { width: 100%; height: auto; padding: 8px 16px; font-weight: 400; }
  .nav__menu .tab svg { width: 20px; height: 20px; }
}

/* ---------- Type helpers ---------- */
.h1 { font-size: var(--h1); line-height: var(--h1-lh); font-weight: 700; text-transform: uppercase; }
/* Figma paragraph spacing for h1 (applies between paragraphs only; the hero title uses line breaks) */
.h1 + .h1, .h1 p + p { margin-top: var(--h1-ps); }
.h2 { font-size: var(--h2); line-height: var(--h2-lh); font-weight: 700; }
.h3 { font-size: var(--h3); line-height: var(--h3-lh); font-weight: 700; }
.intro { font-size: var(--intro); line-height: var(--intro-lh); }
.lg { font-size: var(--lg); line-height: var(--lg-lh); }
.sm { font-size: var(--sm); line-height: var(--sm-lh); }
.label { font-size: var(--sm); line-height: var(--sm-lh); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.eyebrow { font-size: var(--xs); line-height: var(--xs-lh); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.caption { font-size: var(--xs); line-height: 18px; }
.accent { color: var(--accent); }
.center { text-align: center; }

/* ---------- Shared pieces ---------- */
.section { display: flex; flex-direction: column; align-items: center; gap: var(--inner-gap); width: 100%; max-width: var(--wrap); margin-inline: auto; scroll-margin-top: 80px; }
.h2-header { display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; max-width: 584px; }
.h2-header::after { content: ""; width: 40px; height: 4px; background: var(--accent); }
.rule { width: 24px; height: 1px; background: var(--accent); flex: none; }
.rule--40 { width: 40px; }
.tags { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; }
.tags .sq { width: 6px; height: 6px; background: var(--accent); flex: none; }
.narrow { max-width: 584px; width: 100%; }
.message { border-inline: 1px solid var(--accent); padding: 0 8px; text-align: center; max-width: 584px; }
.intro-block { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.divider { background: var(--border); flex: none; }

.list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.list li { display: flex; gap: 12px; align-items: flex-start; }
.list li::before { content: ""; width: 6px; height: 6px; background: var(--bullet); flex: none; margin-top: 9px; }

.card-group { display: grid; gap: 16px; width: 100%; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 960px) { .cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; min-width: 0; }
.card__head { border-left: 1px solid var(--accent); height: 36px; display: flex; align-items: center; padding: 0 16px; }
.card__sep { padding: 0 16px; height: 8px; display: flex; align-items: center; }
.card__sep::before { content: ""; width: 100%; height: 1px; background: var(--border); }
.card__body { border-left: 1px solid var(--border-strong); padding: 16px; flex: 1; }

@media (max-width: 760px) {
  .tags { flex-direction: column; gap: 8px; }
  .tags > span:not(.sq) { text-align: center; }
  .cols-2, .cols-3, .cols-5 { grid-template-columns: minmax(0, 1fr); }
  .cols-5, .about .cols-2 { gap: 24px; }
  .intro-block { gap: 16px; }
}

/* ---------- Images with graceful fallback ---------- */
.shot { display: block; position: relative; width: 100%; max-width: 100%; background: transparent; overflow: hidden; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot--top img { object-position: top; }
.shot.missing img { display: none; }
.shot.missing {
  background: repeating-linear-gradient(135deg, #efefef 0 10px, #f6f6f6 10px 20px);
  border: 1px dashed var(--border-strong);
  display: grid; place-items: center;
}
.shot.missing::after {
  content: attr(data-label);
  font: 600 var(--xs)/var(--xs-lh) var(--font); text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); padding: 8px; text-align: center;
}

/* icon-button (outline) */
.icon-btn {
  width: 32px; height: 32px; border: 1px solid var(--text); background: transparent; color: var(--text);
  display: grid; place-items: center; cursor: pointer; padding: 0; flex: none;
}
.icon-btn:hover { background: var(--btn-hover); }
.icon-btn:active { background: var(--btn-active); }
.icon-btn img, .icon-btn svg { width: 16px; height: 16px; }

/* Disabled (button and icon-button, all types) */
.btn:disabled, .btn[aria-disabled="true"], .icon-btn:disabled { cursor: not-allowed; color: var(--disabled); }
.btn--ghost:disabled, .btn--ghost[aria-disabled="true"] { background: transparent; }
.btn--dark:disabled, .btn--dark[aria-disabled="true"] { background: var(--disabled); color: var(--page); }
.btn--outline:disabled, .btn--outline[aria-disabled="true"], .icon-btn:disabled { background: var(--page); border-color: var(--disabled); }
.icon-btn:disabled img, .btn--outline:disabled img { opacity: 0.35; }

/* Hover interaction (Figma: While hovering → hover variant, Smart Animate, Linear, 300ms) */
.btn, .icon-btn, .toggle button {
  transition: background-color var(--hover-dur) var(--hover-ease),
              color var(--hover-dur) var(--hover-ease),
              border-color var(--hover-dur) var(--hover-ease);
}
@media (prefers-reduced-motion: reduce) {
  .btn, .icon-btn, .toggle button, .back-to-top { transition: none; }
}

/* floating-button/back-to-top (mobile only): appears after scrolling past the hero */
.back-to-top {
  position: fixed; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 9;
  width: 40px; height: 40px; padding: 8px; border: 0; cursor: pointer;
  background: var(--btn-dark); color: var(--white);
  box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.36);
  display: none; place-items: center;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: background-color var(--hover-dur) var(--hover-ease), opacity 200ms ease, transform 200ms ease;
}
.back-to-top svg { width: 20px; height: 20px; }
.back-to-top:hover { background: var(--text); }
.back-to-top:active { background: var(--btn-dark); }
.back-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
@media (max-width: 760px) { .back-to-top { display: grid; } }

/* ---------- footer ---------- */
.footer {
  background: var(--white); padding: 40px; width: 100%; max-width: var(--wrap);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  scroll-margin-top: 80px;
}
.footer .h1 { white-space: pre-line; }
.contacts { display: flex; gap: 16px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .footer { padding: 24px 24px 40px; flex-direction: column; align-items: flex-start; }
}

/* ---------- Home ---------- */
.hero { min-height: 100vh; min-height: calc(100vh - 176px); padding-block: 0 96px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 80px; text-align: center; }
.hero .heading { display: flex; flex-direction: column; gap: 24px; max-width: 784px; }
@media (max-width: 760px) {
  .hero { min-height: calc(100svh - 176px); padding-block: 0 40px; gap: 40px; }
  .hero .heading { gap: 16px; }
}

.project { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; width: 100%; }
.project__text { width: 384px; flex: none; display: flex; flex-direction: column; gap: 40px; align-items: flex-start; }
.project__heading { display: flex; flex-direction: column; gap: 24px; }
.title-group { display: flex; flex-direction: column; gap: 8px; }
.project .shot { width: 684px; aspect-ratio: 684 / 427; flex: 0 1 auto; }
@media (max-width: 1100px) { .project { flex-direction: column; } .project__text { width: 100%; max-width: 584px; } .project .shot { width: 100%; } }
@media (max-width: 760px) {
  .project { align-items: center; text-align: center; }
  .project__text { display: contents; }
  .project__heading { order: 1; align-items: center; width: 100%; }
  .title-group { align-items: center; }
  .project .shot { order: 2; }
  .project .message, .project .btn { order: 3; }
  .project .btn { height: 32px; padding: 6px 12px; font-size: var(--sm); line-height: var(--sm-lh); }
  .project .btn img { width: 16px; height: 16px; }
}

/* companies (Experience at a Glance) */
.companies { display: flex; gap: 40px; width: 100%; }
.company { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.companies > .divider { width: 1px; align-self: stretch; }
.logo { height: 40px; display: flex; align-items: center; }
.logo img { height: 40px; width: auto; }
.logo .akamai { width: 100px; height: 41px; aspect-ratio: 250 / 102; }
@media (max-width: 860px) and (min-width: 761px) {
  .companies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .companies > .divider { display: none; }
}
@media (max-width: 760px) {
  .companies { flex-direction: column; gap: 24px; }
  .companies > .divider { width: 100%; height: 1px; }
  .company { display: grid; grid-template-columns: 128px minmax(0, 1fr); column-gap: 40px; row-gap: 8px; align-items: start; }
  .company .eyebrow { grid-column: 1; grid-row: 1; }
  .company .logo { grid-column: 1; grid-row: 2; }
  .company .list { grid-column: 2; grid-row: 1 / span 2; }
}

/* outside of work */
.outside { display: flex; gap: 40px; align-items: flex-end; max-width: 784px; width: 100%; }
.outside .portrait { width: 240px; aspect-ratio: 240 / 253; flex: none; background: transparent; }
.outside .portrait img { object-fit: cover; object-position: center bottom; } /* Figma: fill width, crop the top */
.outside__text { display: flex; flex-direction: column; gap: 32px; min-width: 0; flex: 1; }
.outside__heading { display: flex; flex-direction: column; gap: 8px; }
.outside__heading .title { font-weight: 600; }
.location { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 760px) {
  .outside { flex-direction: column; align-items: center; text-align: center; }
  .outside__text { display: contents; }
  .outside__heading { order: 1; }
  .outside__heading .title { font-size: var(--h3); line-height: var(--h3-lh); font-weight: 700; }
  .outside .portrait { order: 2; width: 216px; aspect-ratio: 216 / 228; }
  .location { order: 3; align-items: center; }
}

/* ---------- Project page ---------- */
.project-hero { min-height: calc(80vh - 176px); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 80px; text-align: center; }
.project-hero .h1 { max-width: 784px; }
@media (max-width: 760px) { .project-hero { min-height: calc(100svh - 176px); padding-bottom: 40px; gap: 40px; } }

.about { display: flex; gap: 80px; width: 100%; align-items: flex-start; }
.about__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 80px; }
.about__text .copy { display: flex; flex-direction: column; gap: 24px; }
.about__image { width: 552px; aspect-ratio: 552 / 449; flex: 0 1 auto; }
@media (max-width: 1100px) { .about { flex-direction: column; gap: 48px; } .about__image { width: 100%; } }
@media (max-width: 760px) {
  .about { gap: 40px; }
  .about__image { order: -1; aspect-ratio: 340 / 220; }
  .about__text { gap: 40px; }
  .about__text .copy { align-items: center; text-align: center; gap: 16px; }
}

.sub { display: flex; flex-direction: column; gap: 40px; align-items: center; width: 100%; }
.sub--tight { gap: 24px; }
@media (max-width: 760px) { .sub { gap: 24px; } }

.personas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; width: 100%; max-width: 784px; }
@media (max-width: 760px) { .personas { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.persona { display: flex; flex-direction: column; gap: 8px; }
.persona__who { display: flex; gap: 16px; align-items: center; font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 999px; overflow: hidden; background: var(--border); position: relative; flex: none; display: grid; place-items: center; font-size: var(--xs); font-weight: 600; }
.avatar--warm { background: var(--accent-200); }
.avatar img { position: absolute; left: 0; top: 1px; width: 32px; height: 32px; object-fit: cover; }
.bubble { filter: drop-shadow(0 8px 4px rgba(0,0,0,0.05)); }
.bubble__tip { padding-left: 10px; height: 8px; }
.bubble__tip img { width: 12px; height: 8px; }
.bubble__body { background: var(--white); padding: 8px 12px; }

.split { display: flex; gap: 40px; width: 100%; }
.split > .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.split > .col--list { gap: 16px; justify-content: center; }
.split > .divider { width: 1px; }
@media (max-width: 860px) { .split { flex-direction: column; gap: 24px; } .split > .divider { width: 100%; height: 1px; } }
@media (max-width: 760px) { .split > .col:first-child { align-items: center; text-align: center; gap: 16px; } }

/* IA trees */
.trees { display: flex; gap: 16px; align-items: flex-start; }
.trees-scroll { width: 100%; overflow-x: auto; padding-bottom: 8px; }
.trees--old { width: max-content; min-width: 100%; justify-content: space-between; }
.trees--new { width: max-content; margin-inline: auto; gap: 24px; }
.tree { display: flex; flex-direction: column; gap: 4px; }
.tree__title { padding: 4px 8px; font-size: var(--sm); line-height: var(--sm-lh); font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 8px; display: flex; flex-direction: column; gap: 2px; }
.tree li { position: relative; padding-left: 14px; font-size: var(--sm); line-height: var(--sm-lh); white-space: nowrap; }
.tree li::before { content: ""; position: absolute; left: 0; top: 0; bottom: -2px; border-left: 1px solid var(--border-strong); }
.tree li::after { content: ""; position: absolute; left: 0; top: 10px; width: 6px; border-top: 1px solid var(--border-strong); }
.tree li.end::before { bottom: auto; height: 11px; }
.tree li.l2 { padding-left: 30px; }
.tree li.l2::before, .tree li.l2::after { left: 16px; }
.tree li.pl { background: linear-gradient(var(--border-strong), var(--border-strong)) 0 0 / 1px calc(100% + 2px) no-repeat; }
@media (max-width: 760px) {
  .trees-scroll { overflow: visible; padding: 0; display: flex; justify-content: center; }
  .trees--old, .trees--new { flex-direction: column; gap: 16px; width: 236px; min-width: 0; margin: 0; }
}

/* tab-bar: tabs + previous/next arrows (arrows on mobile only) */
.tab-bar { display: flex; align-items: center; justify-content: center; gap: 16px; width: 100%; }
.tab-bar > .icon-btn { display: none; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; row-gap: 8px; }
.tabs button {
  font: 600 var(--sm)/var(--sm-lh) var(--font); color: var(--text); background: none; border: 0;
  border-left: 1px solid var(--border); height: 24px; padding: 0 16px; cursor: pointer; white-space: nowrap; flex: none;
}
.tabs button[aria-selected="true"] { color: var(--accent); border-left-color: var(--accent); }
.tabs button:hover { color: var(--accent); }
@media (max-width: 760px) {
  .tab-bar > .icon-btn { display: grid; }
  .tabs {
    flex: 1; min-width: 0; flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
}

/* booking steps: desktop = text column + media; mobile = title/toggle row, image, details */
.step {
  display: grid; width: 100%;
  grid-template-columns: 384px minmax(0, 684px); justify-content: space-between; column-gap: 40px; row-gap: 24px;
  grid-template-areas: "title media" "toggle media" "details media";
  grid-template-rows: auto auto 1fr;
}
.step__title { grid-area: title; }
.step > .toggle { grid-area: toggle; justify-self: start; margin-top: 16px; }
.step__details { grid-area: details; }
.step__details > div { display: flex; flex-direction: column; gap: 16px; }
.step__media { grid-area: media; display: flex; flex-direction: column; align-items: flex-end; gap: 24px; min-width: 0; }
.step__media .shot { aspect-ratio: 684 / 427; }
@media (max-width: 1100px) and (min-width: 761px) {
  .step { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "toggle" "details" "media"; grid-template-rows: none; }
}
@media (max-width: 760px) {
  .step {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: none;
    grid-template-areas: "title toggle" "media media" "details details";
  }
  .step > .toggle { margin-top: 0; align-self: center; }
  .step__media .zoom { display: none; }
}

.toggle { display: inline-flex; }
.toggle button {
  font: 600 var(--sm)/var(--sm-lh) var(--font); background: none; border: 0; height: 32px; padding: 0 8px;
  color: var(--muted); cursor: pointer;
}
.toggle button[aria-pressed="true"] { background: var(--toggle); color: var(--text); cursor: default; }
.toggle button:not([aria-pressed="true"]):not(:disabled):hover { background: var(--toggle-hover); }
.toggle button:disabled { color: var(--disabled); cursor: not-allowed; }

/* final design */
.final-panel { display: flex; flex-direction: column; align-items: center; gap: 40px; width: 100%; }
.final { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; width: 100%; align-items: start; }
.final > .col { display: flex; flex-direction: column; align-items: flex-end; gap: 24px; min-width: 0; }
.final .shot { background: transparent; }
@media (max-width: 860px) { .final { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .final-panel { align-items: stretch; gap: 24px; }
  .final { gap: 24px; }
  .final .zoom { display: none; }
}

/* Lightbox: light frosted overlay, step title on top, close at top right, Before/After toggle when the step has both */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(248, 248, 248, 0.8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px;
  padding: 40px 24px;
}
.lightbox__head { display: flex; flex-direction: column; align-items: center; gap: 24px; flex: none; }
.lightbox__title { margin: 0; font-size: var(--h3); line-height: var(--h3-lh); font-weight: 700; color: var(--text); text-align: center; }
.lightbox__close {
  position: absolute; top: 16px; right: 24px; width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center; border: 0; background: #f8f8f8; color: var(--text); cursor: pointer;
}
.lightbox__close:hover { background: var(--toggle-hover); }
.lightbox__close:active { background: var(--toggle); }
.lightbox__close:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.lightbox__close svg { width: 16px; height: 16px; }
.lightbox__media { flex: 0 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.lightbox__media img { display: block; max-width: 100%; width: auto; height: auto; object-fit: contain;
  /* viewport minus: 80px padding, 32px title, 40px gap (plus 24px gap and 32px toggle for Before/After) */
  max-height: calc(100vh - 152px); max-height: calc(100dvh - 152px); }
.lightbox--toggle .lightbox__media img { max-height: calc(100vh - 208px); max-height: calc(100dvh - 208px); }
.lightbox__media .shot { width: min(80vw, 900px); aspect-ratio: 16 / 10; }
.lightbox .toggle { flex: none; }

/* ---------- Reveal from bottom ---------- */
/* Only hidden once the script has run, so text is never lost if JS is off. */
.reveal-on [data-reveal] { opacity: 0; transform: translateY(24px); }
.reveal-on [data-reveal].is-in {
  animation: reveal-up 1s cubic-bezier(0.22, 1, 0.70, 1) both;
  animation-delay: calc(var(--d, 0ms) + 120ms);
}
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(120px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-on [data-reveal] { opacity: 1; transform: none; }
  .reveal-on [data-reveal].is-in { animation: none; }
}

/* HQ Design System case study */
.ds-lead { max-width: 784px; }
.ds-text { max-width: 784px; width: 100%; }
.ds-about { align-items: flex-start; }
.ds-about__image { width: 552px; aspect-ratio: 552 / 344; flex: 0 1 auto; }
.ds-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; width: 100%; align-items: start; }
.ds-media__shot { aspect-ratio: 1.6; }
.ds-message { margin: 0; }
.ds-row { display: flex; justify-content: space-between; gap: 40px; width: 100%; align-items: flex-start; }
.ds-row__text { width: 384px; flex: none; display: flex; flex-direction: column; gap: 24px; }
.ds-row__text .h3, .ds-row__text p { margin: 0; }
.ds-row__shot { width: 684px; flex: 0 1 auto; }
.ds-row__shot--layers { aspect-ratio: 684 / 468; }
.ds-row__shot--styles { aspect-ratio: 684 / 303; }
.ds-wide { width: 100%; }
.ds-wide--starter { aspect-ratio: 1184 / 678; border-radius: 5px; }
.ds-wide--outcome { aspect-ratio: 1184 / 696; }
@media (max-width: 1100px) {
  .ds-about { flex-direction: column; gap: 48px; }
  .ds-about__image { width: 100%; }
  .ds-row { flex-direction: column; gap: 40px; align-items: center; }
  .ds-row__text { width: 100%; max-width: 784px; align-items: center; text-align: center; }
  .ds-row__shot { width: 100%; }
}
@media (max-width: 760px) {
  .ds-lead { font-size: 24px; line-height: 32px; }
  .ds-about { gap: 40px; }
  .ds-about .ds-about__image { order: -1; aspect-ratio: 552 / 344; }
  .ds-media { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .ds-message { width: 100%; }
  .ds-row__text { gap: 24px; }
}
