.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  box-sizing: border-box;
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  overflow: visible;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition:
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  margin-top: calc(-1 * env(safe-area-inset-top, 0px));
  height: calc(100% + env(safe-area-inset-top, 0px));
  background: transparent;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition:
    opacity 0.3s var(--ease),
    background-color 0.3s var(--ease);
  pointer-events: none;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header.is-scrolled::before {
  background: var(--nav-bg);
  opacity: 1;
}

.site-header.is-menu-open {
  border-bottom-color: var(--line);
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.site-header.is-menu-open::before {
  opacity: 0;
}

.site-header__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: var(--space-4);
  overflow: visible;
}

.site-header__brand {
  position: relative;
  z-index: 50;
  display: inline-flex;
  align-items: flex-start;
  align-self: flex-start;
  padding-top: 0.65rem;
  text-decoration: none;
  overflow: visible;
  transition: padding-top 0.35s var(--ease);
}

.site-header__logo {
  display: block;
  height: clamp(4.5rem, 9vw, 6rem);
  width: auto;
  transition: height 0.35s var(--ease);
}

.site-header__logo img {
  display: block;
  height: clamp(4.5rem, 9vw, 6rem);
  width: auto;
  transition: height 0.35s var(--ease);
}

.site-header.is-scrolled .site-header__brand {
  align-self: center;
  align-items: center;
  padding-top: 0;
}

.site-header.is-scrolled .site-header__logo,
.site-header.is-scrolled .site-header__logo img {
  height: 2.4rem;
}

@media (max-width: 719px) {
  .site-header {
    height: auto;
    min-height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  }

  .site-header__inner {
    height: auto;
    min-height: var(--nav-h);
    align-items: center;
    padding-block: 0.45rem;
  }

  .site-header__brand {
    align-self: center;
    align-items: center;
    padding-top: 0;
  }

  .site-header__drawer {
    padding-top: calc(5.4rem + env(safe-area-inset-top, 0px) + var(--space-6));
  }

  .site-header.is-scrolled {
    height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
    min-height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  }

  .site-header.is-scrolled .site-header__inner {
    height: var(--nav-h);
    min-height: var(--nav-h);
    padding-block: 0;
  }

  .site-header.is-scrolled .site-header__drawer {
    padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + var(--space-6));
  }
}

@media (min-width: 900px) {
  .site-header__logo,
  .site-header__logo img {
    height: clamp(5.5rem, 8.5vw, 7.25rem);
  }
}

.site-header__brand-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.site-header__brand.is-fallback .site-header__logo {
  display: none;
}

.site-header__brand.is-fallback .site-header__brand-text {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.site-header__nav {
  display: none;
  flex: 1;
  justify-content: center;
}

.site-header__links {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header__links a {
  color: var(--ink-secondary);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.site-header__links a:hover {
  color: var(--ink);
}

.site-header__links a[href$='#timeline']:hover,
.site-header__drawer-links a[href$='#timeline']:hover {
  color: var(--cube-green);
}

.site-header__links a[href$='#stories']:hover,
.site-header__drawer-links a[href$='#stories']:hover {
  color: var(--cube-red);
}

.site-header__links a[href$='#catalog']:hover,
.site-header__drawer-links a[href$='#catalog']:hover {
  color: var(--cube-blue);
}

.site-header__links a[href$='#contact']:hover,
.site-header__drawer-links a[href$='#contact']:hover {
  color: var(--cube-yellow);
}

.site-header__actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.site-header__social {
  position: relative;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}

.site-header__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  color: var(--ink-secondary);
  text-decoration: none;
}

.site-header__social a:hover {
  color: var(--ink);
}

.site-header__social svg {
  width: 1.1rem;
  height: 1.1rem;
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line-strong);
}

.lang-toggle button {
  min-width: 2.4rem;
  min-height: 2.2rem;
  padding: 0 0.55rem;
  color: var(--ink-tertiary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.lang-toggle button.is-active {
  background: var(--ink);
  color: var(--bg);
}

.site-header__menu {
  position: relative;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--line-strong);
}

.burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 1.1rem;
}

.burger i {
  display: block;
  width: 100%;
  height: 1.5px;
  background: currentColor;
}

.site-header__drawer {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + var(--space-6)) var(--space-5)
    calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  transform: translateY(-0.5rem);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease),
    visibility 0.25s var(--ease);
}

.site-header__drawer.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.site-header__drawer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header__drawer-links a {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.site-header__drawer .lang-toggle {
  align-self: flex-start;
  margin-top: auto;
}

@media (max-width: 899px) {
  .site-header {
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
  }

  .site-header::before {
    background: var(--nav-bg);
    opacity: 1;
  }

  .site-header.is-menu-open {
    background: var(--bg);
  }

  .site-header.is-menu-open::before {
    opacity: 0;
  }
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  .site-header,
  .site-header.is-scrolled {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom-color: var(--line);
  }

  .site-header::before,
  .site-header.is-scrolled::before {
    background: var(--bg);
    opacity: 1;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .site-header.is-menu-open {
    background: var(--bg);
  }

  .site-header.is-menu-open::before {
    opacity: 0;
  }
}

@media (min-width: 900px) {
  .site-header__nav {
    display: flex;
  }

  .site-header__actions {
    margin-left: 0;
  }

  .site-header.is-menu-open {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom-color: transparent;
  }

  .site-header.is-menu-open.is-scrolled {
    border-bottom-color: var(--line);
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .site-header.is-menu-open.is-scrolled::before {
    opacity: 1;
  }

  .site-header__drawer {
    position: absolute;
    inset: auto;
    top: calc(100% + 0.4rem);
    right: 0;
    left: auto;
    z-index: 45;
    width: auto;
    min-width: 7.5rem;
    padding: var(--space-3);
    border: 1px solid var(--line-strong);
    background: var(--bg-elevated);
    box-shadow: 0 12px 40px color-mix(in srgb, var(--ink) 18%, transparent);
    transform: translateY(-0.35rem);
  }

  .site-header__drawer.is-open {
    transform: translateY(0);
  }

  .site-header__drawer-links {
    display: none;
  }

  .site-header__drawer .lang-toggle {
    margin-top: 0;
  }
}

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: calc(100svh - var(--nav-h) - env(safe-area-inset-top, 0px));
  padding-block: clamp(4rem, 12vh, 8rem) clamp(4rem, 10vh, 7rem);
  overflow: hidden;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.75rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.hero__tagline {
  margin: var(--space-4) 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink-secondary);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5) var(--space-7);
  margin-top: var(--space-7);
}

.hero__stat {
  display: grid;
  gap: 0.2rem;
}

.hero__stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.hero__stat-label {
  color: var(--ink-secondary);
  font-size: 0.9rem;
}

.hero__langs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: var(--space-5) 0 0;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.hero__flags {
  font-size: 1.3rem;
  letter-spacing: 0.12em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-7);
}

.hero__cta {
  transition:
    background-color 0.25s var(--ease),
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.hero__cta--evolution:hover {
  border-color: var(--cube-green);
  color: var(--cube-green);
}

.hero__cta--work:hover {
  border-color: var(--cube-red);
  color: var(--cube-red);
}

.think__body {
  margin-top: var(--space-4);
  font-size: 1.05rem;
}

.think .eyebrow::before {
  background: var(--cube-yellow);
}

.work .eyebrow::before {
  background: var(--cube-red);
}

.principles .eyebrow::before {
  background: var(--cube-blue);
}

.timeline .eyebrow::before {
  background: var(--cube-green);
}

.tech .eyebrow::before {
  background: var(--cube-orange);
}

.catalog .eyebrow::before {
  background: var(--cube-blue);
}

.think__domains {
  margin-top: var(--space-8);
}

.think__domains ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.think__domains li {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.think__domains li::before {
  content: '';
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.8rem;
  border-radius: 2px;
  background: var(--cube-yellow);
}

.think__domains li:nth-child(5n + 2)::before {
  background: var(--cube-red);
}

.think__domains li:nth-child(5n + 3)::before {
  background: var(--cube-blue);
}

.think__domains li:nth-child(5n + 4)::before {
  background: var(--cube-green);
}

.think__domains li:nth-child(5n + 5)::before {
  background: var(--cube-orange);
}

.think__closing {
  margin: var(--space-8) 0 0;
  max-width: 30rem;
  color: var(--ink-secondary);
  font-size: 1.125rem;
}

@media (min-width: 900px) {
  .think__domains ul {
    grid-template-columns: repeat(5, 1fr);
    border-top: 0;
    gap: var(--space-4);
  }

  .think__domains li {
    border-bottom: 0;
    border-top: 1px solid var(--line);
    padding-top: var(--space-5);
    font-size: clamp(1.35rem, 1.8vw, 1.85rem);
  }
}

.work__header {
  max-width: 40rem;
  margin-bottom: var(--space-8);
}

.case {
  position: relative;
  padding-block: var(--space-9);
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.case__inner {
  position: relative;
  z-index: 2;
}

.case--cube .case__inner {
  pointer-events: none;
}

.case--cube .case__inner > * {
  pointer-events: auto;
}

@media (min-width: 900px) {
  .case--cube .case__inner {
    max-width: calc(100% - 22rem);
  }
}

.case__intro {
  max-width: 36rem;
  margin-bottom: var(--space-8);
}

.case__accent {
  display: block;
  width: 2.5rem;
  height: 0.2rem;
  margin-bottom: var(--space-5);
}

.case__index {
  margin: 0 0 var(--space-4);
  color: var(--ink-tertiary);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.case__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.case__title--logo {
  max-width: min(100%, 28rem);
}

.case__title-logo {
  display: block;
  width: auto;
  height: clamp(3.25rem, 8vw, 5rem);
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.case__subtitle {
  margin: var(--space-4) 0 0;
  color: var(--ink-secondary);
  font-size: 1.15rem;
}

.case--deep {
  padding-block: var(--space-10, var(--space-9));
}

.case__highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-6);
  margin: 0 0 var(--space-8);
  max-width: none;
}

.case__highlight {
  margin: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.case__highlight dt {
  margin: 0 0 0.35rem;
  color: var(--ink-tertiary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case__highlight dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.case__highlights:has(.case__highlight-logos) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5) var(--space-6);
  max-width: none;
}

.case__highlight:has(.case__highlight-logos) {
  margin: 0;
  padding: 0;
  border: 0;
  flex: 0 0 calc(50% - var(--space-6) / 2);
  max-width: calc(50% - var(--space-6) / 2);
}

.case__highlight-logos {
  display: block;
  min-height: 0;
  width: 100%;
}

.case__highlight-logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.case__highlight:has(.case__highlight-logos) dt {
  display: none;
}

/* Chronological case timeline (e.g. Magic Globe) */
.case__timeline {
  --timeline-count: 5;
  --timeline-dot: 0.85rem;
  --timeline-line: 2px;
  list-style: none;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin: 0 0 var(--space-8);
  padding: 0;
  border: 0;
}

.case__timeline-node {
  position: relative;
  display: grid;
  grid-template-columns: var(--timeline-dot) minmax(0, 1fr);
  column-gap: 0.9rem;
  align-items: start;
  margin: 0;
  min-width: 0;
}

.case__timeline-dot {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: var(--timeline-dot);
  height: var(--timeline-dot);
  margin-top: 1.35rem;
  flex: 0 0 var(--timeline-dot);
  border: 0;
  border-radius: 50%;
  background: var(--node-color, var(--ink));
  box-shadow: none;
}

.case__timeline-node:not(:last-child) .case__timeline-dot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(100% + 3px);
  width: var(--timeline-line);
  height: calc(var(--space-5) + 1.35rem + var(--timeline-dot));
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--node-color) 55%, transparent);
}

.case__timeline-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 0.4rem;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
}

a.case__timeline-card:hover .case__timeline-media {
  border-color: color-mix(in srgb, var(--node-color) 60%, var(--line-strong));
}

a.case__timeline-card:hover .case__timeline-what {
  color: color-mix(in srgb, var(--node-color) 40%, var(--ink));
}

.case__timeline-media {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--node-color) 40%, var(--line));
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--node-color) 18%, #0c0c0c);
  color: var(--node-color);
  transition: border-color 0.15s ease;
}

.case__timeline-icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.case__timeline-icon svg {
  width: 2.35rem;
  height: 2.35rem;
}

.case__timeline-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

.case__timeline-when {
  color: var(--ink-tertiary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case__timeline-what {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  transition: color 0.15s ease;
}

@media (min-width: 900px) {
  .case__timeline {
    --timeline-dot: 0.9rem;
    grid-template-columns: repeat(var(--timeline-count), minmax(0, 1fr));
    gap: 0;
    align-items: start;
  }

  /* One continuous rail through every node — not per-card stubs */
  .case__timeline::before {
    content: '';
    position: absolute;
    top: calc(var(--timeline-dot) / 2 - var(--timeline-line) / 2);
    left: calc(100% / var(--timeline-count) / 2);
    right: calc(100% / var(--timeline-count) / 2);
    height: var(--timeline-line);
    border-radius: 999px;
    background: linear-gradient(
      90deg,
      #ff5356 0%,
      #ffd000 25%,
      #33cc66 50%,
      #0e34c7 75%,
      #eb681a 100%
    );
    z-index: 0;
    pointer-events: none;
  }

  .case__timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.55rem;
  }

  .case__timeline-node:not(:last-child) .case__timeline-dot::after {
    content: none;
  }

  .case__timeline-dot {
    margin-top: 0;
  }

  .case__timeline-card {
    width: 100%;
    text-align: center;
    gap: 0.35rem;
    justify-items: center;
  }

  .case__timeline-media {
    width: min(100%, 7.25rem);
    aspect-ratio: 1;
  }

  .case__timeline-thumb {
    object-fit: cover;
  }

  .case__timeline-icon svg {
    width: 2.35rem;
    height: 2.35rem;
  }

  .case__timeline-what {
    max-width: 11rem;
  }
}

@media (min-width: 900px) {
  .case__highlights:has(.case__highlight-logos) {
    flex-wrap: nowrap;
    gap: var(--space-5) var(--space-7);
  }

  .case__highlight:has(.case__highlight-logos) {
    flex: 0 0 auto;
    max-width: none;
  }

  .case__highlight-logos {
    width: auto;
  }

  .case__highlight-logo {
    height: 60px;
    max-width: none;
  }
}

.case__chapters,
.case__gallery {
  margin: 0 0 var(--space-8);
}

.case__chapters-label,
.case__gallery-label {
  margin: 0 0 var(--space-4);
  color: var(--ink-tertiary);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.case__chapters-more {
  width: min(100%, 48rem);
  margin: var(--space-7) 0 0;
  padding-left: 2.75rem;
  padding-right: 1.15rem;
  justify-content: flex-start;
  gap: 0.65rem;
}

.case__chapters-more-label {
  color: var(--ink);
}

.case__chapters-more-meta {
  color: var(--ink-tertiary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.case__chapters-more-meta::before {
  content: '·';
  margin-right: 0.65rem;
  color: var(--ink-tertiary);
}

.case__chapters-more-icon {
  margin-left: auto;
  color: var(--ink-secondary);
  font-size: 1rem;
  line-height: 1;
}

.case__chapters-more[hidden] {
  display: none !important;
}

.case--yellow {
  --case-accent: var(--cube-yellow);
}

.case--green {
  --case-accent: var(--cube-green);
}

.case--blue {
  --case-accent: var(--cube-blue);
}

.case--red {
  --case-accent: var(--cube-red);
}

.case--coral {
  --case-accent: var(--cube-coral);
}

.case--orange {
  --case-accent: var(--cube-orange);
}

.case__chapter-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-7);
  max-width: 48rem;
  counter-reset: case-chapter;
}

.case__chapter-list:has(.case__chapter-figure--glue) {
  max-width: none;
}

.case__chapter-list--more {
  margin-top: var(--space-7);
  counter-reset: case-chapter 4;
}

/* `display: grid` on .case__chapter-list beats the UA [hidden] rule */
.case__chapter-list--more[hidden] {
  display: none !important;
}

.case__chapter-list--more:has(.case__chapter-figure--glue) {
  max-width: none;
}

.case__chapter {
  position: relative;
  padding-left: 2.75rem;
  counter-increment: case-chapter;
}

.case__chapter::before {
  content: counter(case-chapter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.15rem;
  color: var(--ink-tertiary);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.case__chapter h4 {
  margin: 0 0 var(--space-3);
  max-width: 40rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.case__chapter p {
  margin: 0;
  max-width: 40rem;
  color: var(--ink-secondary);
  font-size: 1.05rem;
  line-height: 1.65;
}

.case__chapter-steps {
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-6);
}

.case__chapter-step {
  margin: 0;
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--line);
}

.case__chapter-step h5 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.case__chapter-step p {
  margin: 0;
  max-width: 40rem;
  color: var(--ink-secondary);
  font-size: 1.02rem;
  line-height: 1.65;
}

.case__chapter-figure {
  margin: var(--space-5) 0 0;
  max-width: 40rem;
}

.case__chapter-figure:not(.case__chapter-figure--carousel):not(.case__chapter-figure--photo) img,
.case__chapter-figure:not(.case__chapter-figure--carousel):not(.case__chapter-figure--photo) video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--bg);
}

.case__chapter-figure--diagram img {
  object-fit: contain;
  background: #f7f7f5;
}

.case__chapter-figure:not(.case__chapter-figure--diagram):not(.case__chapter-figure--compare):not(.case__chapter-figure--tall):not(.case__chapter-figure--carousel):not(.case__chapter-figure--photo) img,
.case__chapter-figure:not(.case__chapter-figure--diagram):not(.case__chapter-figure--compare):not(.case__chapter-figure--tall):not(.case__chapter-figure--carousel):not(.case__chapter-figure--photo) video {
  max-height: 22rem;
  object-fit: contain;
  object-position: top left;
  background: #0a0a0a;
}

.case__chapter-figure--tall {
  max-width: 18rem;
}

.case__chapter-figure--tall img,
.case__chapter-figure--tall video {
  width: 100%;
  height: auto;
  background: #fff;
}

.case__chapter-figure--photo {
  max-width: 40rem;
  width: 100%;
}

.case__chapter-figure-photo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 20rem;
  min-height: 20rem;
  max-height: 20rem;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #111111;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
}

.case__chapter-figure-photo-card img,
.case__chapter-figure-photo-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0.85rem;
  background: transparent;
}

.case__chapter-figure-photo-card--cover img,
.case__chapter-figure-photo-card--cover video {
  object-fit: cover;
}

.case__chapter-figure--compare {
  max-width: 32rem;
}

.case__chapter-figure--compare.case__chapter-figure--screens {
  max-width: none;
}

.case__chapter-figure--compare.case__chapter-figure--glue {
  width: 100%;
  max-width: none;
}

.case__chapter-figure-pairs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  padding: var(--space-5);
  border: 1px solid var(--line);
  background: #111111;
}

.case__chapter-figure--no-arrow .case__chapter-figure-pairs,
.case__chapter-figure--screens.case__chapter-figure--no-arrow .case__chapter-figure-pairs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}

.case__chapter-figure--glue .case__chapter-figure-pairs {
  display: grid;
  /* portrait ~0.68 · landscape ~1.79 → same height when both width:100% */
  grid-template-columns: minmax(0, 0.68fr) minmax(0, 1.79fr);
  width: 100%;
  gap: 0;
  align-items: stretch;
  padding: 0;
  border: 0;
  background: #0a0a0a;
  overflow: hidden;
}

.case__chapter-figure--glue .case__chapter-figure-pair {
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: none;
  min-width: 0;
}

.case__chapter-figure--glue .case__chapter-figure-pair-frame {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #0a0a0a;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

.case__chapter-figure--glue .case__chapter-figure-pair-frame img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: #0a0a0a;
  pointer-events: none;
}

.case__chapter-figure-compare-arrow {
  align-self: center;
  padding-top: 1.75rem;
  color: var(--ink-tertiary);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1;
}

.case__chapter-figure-pair {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
}

.case__chapter-figure-pair-label {
  margin: 0 0 var(--space-3);
  min-height: 2.5rem;
  color: var(--ink-tertiary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.35;
}

.case__chapter-figure-pair-frame {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: var(--space-3);
  border: 1px solid rgba(10, 10, 10, 0.1);
  background: #fff;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

.case__chapter-figure-pair-frame img {
  display: block;
  width: 100%;
  max-width: 13rem;
  height: auto;
  border: 0;
  box-shadow: none;
  background: #fff;
  pointer-events: none;
}

.case__chapter-figure--screens .case__chapter-figure-pair-frame {
  padding: var(--space-2);
  background: #0a0a0a;
  border-color: rgba(255, 255, 255, 0.08);
}

.case__chapter-figure--screens .case__chapter-figure-pair-frame img {
  max-width: none;
  height: auto;
  background: transparent;
}

.case__chapter-figure--screens .case__chapter-figure-pair-label {
  min-height: 0;
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 560px) {
  .case__chapter-figure-pairs {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .case__chapter-figure--no-arrow .case__chapter-figure-pairs,
  .case__chapter-figure--screens.case__chapter-figure--no-arrow .case__chapter-figure-pairs {
    grid-template-columns: 1fr;
  }

  .case__chapter-figure-compare-arrow {
    padding-top: 0;
    transform: rotate(90deg);
  }

  .case__chapter-figure-pair {
    width: 100%;
    max-width: 14rem;
  }

  .case__chapter-figure--screens .case__chapter-figure-pair {
    max-width: none;
  }

  .case__chapter-figure--glue .case__chapter-figure-pairs {
    grid-template-columns: 1fr;
  }

  .case__chapter-figure--glue .case__chapter-figure-pair,
  .case__chapter-figure--glue .case__chapter-figure-pair:first-child {
    width: 100%;
    max-width: none;
  }

  .case__chapter-figure--glue .case__chapter-figure-pair-frame img,
  .case__chapter-figure--glue .case__chapter-figure-pair:first-child .case__chapter-figure-pair-frame img {
    width: 100%;
    max-width: none;
    height: auto;
  }
}

.case__chapter-figure--carousel {
  position: relative;
  max-width: 40rem;
  width: 100%;
}

.case__chapter-figure-viewport {
  position: relative;
  width: 100%;
  height: calc(20rem + var(--space-3) + 4.5rem);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.case__chapter-figure-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

.case__chapter-figure-slide[hidden] {
  display: none !important;
}

.case__chapter-figure-slide-media {
  display: flex;
  flex: 0 0 min(32rem, 70vh);
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(32rem, 70vh);
  min-height: 0;
  max-height: min(32rem, 70vh);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #111111;
}

.case__chapter-figure-slide-media img,
.case__chapter-figure-slide-media video {
  display: block;
  box-sizing: border-box;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0.85rem;
  background: transparent;
}

.case__chapter-figure-slide-media img[src$=".svg"] {
  padding: 0.75rem;
  background: #f7f7f5;
}

.case__chapter-figure-slide-media--cover img,
.case__chapter-figure-slide-media--cover video {
  object-fit: cover;
}

.case__chapter-figure-slide-copy {
  display: flex;
  flex: 0 0 4.5rem;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.35rem;
  width: 100%;
  height: 4.5rem;
  min-height: 0;
  max-height: 4.5rem;
  overflow: hidden;
}

.case__chapter-figure-slide-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.case__chapter-figure-slide-desc {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case__chapter-figure-controls {
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.case__chapter-figure-status {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.3;
}

.case__chapter-figure-nav {
  position: static;
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.5rem;
  background: var(--bg-elevated);
  color: var(--ink);
  box-shadow: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.case__chapter-figure-nav:hover,
.case__chapter-figure-nav:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.case__chapter-figure-nav--prev,
.case__chapter-figure-nav--next {
  left: auto;
  right: auto;
  top: auto;
}

.case__chapter-figure-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: var(--space-3);
}

.case__chapter-figure-dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line-strong);
  cursor: pointer;
}

.case__chapter-figure-dot.is-active {
  background: var(--ink);
}

.case__chapter-figure figcaption {
  margin: var(--space-3) 0 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .case__chapter-figure-viewport {
    height: calc(14rem + var(--space-3) + 4.5rem);
  }

  .case__chapter-figure-slide-media,
  .case__chapter-figure-photo-card {
    flex-basis: 14rem;
    height: 14rem;
    max-height: 14rem;
    border-radius: 0.7rem;
  }
}

.modal__chapter-figure--carousel {
  position: relative;
  max-width: none;
}

.modal__chapter-figure-viewport {
  position: relative;
  width: 100%;
  height: calc(14.5rem + var(--space-3) + 4.1rem);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.modal__chapter-figure-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

.modal__chapter-figure-slide[hidden] {
  display: none !important;
}

.modal__chapter-figure-slide-media {
  display: flex;
  flex: 0 0 min(24rem, 55vh);
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(24rem, 55vh);
  min-height: 0;
  max-height: min(24rem, 55vh);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #111111;
}

.modal__chapter-figure-slide-media img,
.modal__chapter-figure-slide-media video {
  display: block;
  box-sizing: border-box;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
}

.modal__chapter-figure-slide-media img[src$=".svg"] {
  padding: 0.65rem;
  background: #f7f7f5;
}

.modal__chapter-figure-slide-media--cover img,
.modal__chapter-figure-slide-media--cover video {
  object-fit: cover;
}

.modal__chapter-figure-slide-copy {
  display: flex;
  flex: 0 0 4.1rem;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.3rem;
  width: 100%;
  height: 4.1rem;
  min-height: 0;
  max-height: 4.1rem;
  overflow: hidden;
}

.modal__chapter-figure-slide-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.modal__chapter-figure-slide-desc {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal__chapter-figure-controls {
  display: grid;
  grid-template-columns: 2.4rem 1fr 2.4rem;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.modal__chapter-figure-status {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.3;
}

.modal__chapter-figure-nav {
  position: static;
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.45rem;
  background: var(--bg-elevated);
  color: var(--ink);
  box-shadow: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.modal__chapter-figure-nav--prev,
.modal__chapter-figure-nav--next {
  left: auto;
  right: auto;
  top: auto;
}

.modal__chapter-figure-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: var(--space-3);
}

.modal__chapter-figure-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line-strong);
  cursor: pointer;
}

.modal__chapter-figure-dot.is-active {
  background: var(--ink);
}

.modal__chapter-figure figcaption {
  margin: var(--space-3) 0 0;
  color: var(--ink-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.case__gallery-track {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-3);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.case__gallery-item {
  flex: 0 0 min(78%, 28rem);
  margin: 0;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  background: var(--surface-2, #f4f4f2);
  overflow: hidden;
}

.case__gallery-item img,
.case__gallery-item video,
.case__gallery-item iframe {
  display: block;
  width: 100%;
  height: 16rem;
  object-fit: cover;
  background: #111;
}

.case__gallery-item--diagram img,
.case__gallery-item img[src$=".svg"] {
  object-fit: contain;
  background: #f7f7f5;
  padding: 0.75rem;
  height: 14rem;
}

.case__grid {
  display: grid;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

@media (min-width: 700px) {
  .case__highlights {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: none;
  }

  .case__gallery-item {
    flex-basis: min(42%, 22rem);
  }
}

.case__block h4 {
  margin: 0 0 var(--space-3);
  color: var(--ink-tertiary);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.case__block p {
  margin: 0;
  max-width: 34rem;
  color: var(--ink-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}

.case__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-8);
}

.rubik-embed {
  position: absolute;
  z-index: 0;
  top: 1.5rem;
  right: max(1rem, 4vw);
  width: 22rem;
  height: 22rem;
  pointer-events: none;
}

.rubik-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  background: transparent;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.rubik-stage:active {
  cursor: grabbing;
}

.rubik-stage .cube {
  background: transparent !important;
}

@media (max-width: 899px) {
  .case--cube {
    padding-top: calc(var(--space-9) + 16rem);
  }

  .case--cube .case__inner {
    max-width: none;
  }

  .rubik-embed {
    top: 0.5rem;
    right: 50%;
    translate: 50% 0;
    width: min(18rem, 80vw);
    height: min(18rem, 80vw);
  }
}

@media (min-width: 900px) {
  .case__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-7) var(--space-8);
  }
}

.catalog {
  border-top: 1px solid var(--line);
}

.catalog__header {
  max-width: 40rem;
  margin-bottom: var(--space-6);
}

.catalog__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-7);
}

.catalog__filter {
  min-height: 2.25rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line-strong);
  color: var(--ink-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition:
    border-color 0.2s var(--ease),
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.catalog__filter:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.catalog__filter.is-active {
  border-color: var(--filter-color, var(--ink));
  background: color-mix(in srgb, var(--filter-color, var(--ink)) 12%, transparent);
  color: var(--ink);
}

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

.catalog-card {
  --era-color: var(--cube-blue);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 11.5rem;
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-top: 3px solid var(--era-color);
  background: var(--bg-elevated);
  cursor: pointer;
  transition:
    transform 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.catalog-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.catalog-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.catalog-card--classified {
  /* Always dark — ignores site theme */
  --bg: #0f171f;
  --bg-elevated: #121212;
  --ink: #f5f5f2;
  --ink-secondary: #a3a3a0;
  --ink-tertiary: #6f6f6c;
  --line: rgba(245, 245, 242, 0.1);
  --line-strong: rgba(245, 245, 242, 0.18);
  --focus: #f5f5f2;
  color-scheme: dark;
  border-style: dashed;
  background: var(--bg);
  color: var(--ink);
  opacity: 0.88;
}

.catalog-card--classified .catalog-card__lang,
.catalog-card--classified .catalog-card__links a {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}

.user_coder {
  width: fit-content;
  max-width: 100%;
  color: #00ffff;
  font-weight: bold;
  background-image: url('../gifs/sparkle12.gif');
  text-shadow: 0 0.15rem 0.5rem #00ff66;
}

.catalog-card__title.user_coder {
  flex: none;
}

.catalog-card[data-era='design'] {
  --era-color: #f5617f;
}

.catalog-card[data-era='hardware'] {
  --era-color: #ffd22b;
}

.catalog-card[data-era='ideyou'] {
  --era-color: #ff5356;
}

.catalog-card[data-era='teaching'] {
  --era-color: #9900cc;
}

.catalog-card[data-era='platform'] {
  --era-color: #0076f3;
}

.catalog-card__top {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  min-width: 0;
}

.catalog-card__top--wordmark {
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.catalog-card__mono {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 6px;
  overflow: hidden;
  color: #0a0a0a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.catalog-card__mono.is-light {
  color: #fff;
}

.catalog-card__mark {
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  isolation: isolate;
  background: var(--mark-bg, #0a0a0a);
}

.catalog-card__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

.catalog-card__mark--icon {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  box-sizing: border-box;
}

.catalog-card__mark--icon.is-padded {
  padding: 0.3rem;
}

/* .it wordmarks (notify / barcode / scan / print) — separate from icon marks */
.catalog-card__wordmark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: flex-start;
  height: 2.75rem;
  width: auto;
  max-width: calc(100% - 5.75rem);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 0;
  overflow: visible;
}

.catalog-card__wordmark img {
  display: block;
  width: auto;
  max-width: none;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  object-fit: contain;
  object-position: left center;
}

/* Bake-out the black plate in *-light.png on dark UI */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .catalog-card__wordmark .wordmark__light {
    mix-blend-mode: lighten;
  }
}

[data-theme='dark'] .catalog-card__wordmark .wordmark__light {
  mix-blend-mode: lighten;
}

.catalog-card__logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.catalog-card__logo--boxed {
  padding: 0.2rem;
  box-sizing: border-box;
  background: inherit;
}

.catalog-card__title {
  margin: 0;
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.catalog-card__badge {
  flex: none;
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--era-color);
  border-radius: 0;
  background: transparent;
  color: var(--era-color);
  font: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.catalog-card__top--wordmark .catalog-card__badge {
  margin-left: 0;
}

.catalog-card__badge:hover {
  background: color-mix(in srgb, var(--era-color) 14%, transparent);
}

.catalog-card__desc {
  margin: 0;
  flex: 1;
  color: var(--ink-secondary);
  font-size: 0.95rem;
  line-height: 1.45;
}

.catalog-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: var(--space-5);
}

.catalog-card__lang {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-tertiary);
  font-size: 0.8rem;
}

.catalog-card__lang::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--era-color);
}

.catalog-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-left: auto;
}

.catalog-card__links a,
.catalog-card__links button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-secondary);
  font: inherit;
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.catalog-card__links a:hover,
.catalog-card__links button:hover {
  color: var(--ink);
}

.catalog-card--classified .catalog-card__links a,
.catalog-card--classified .catalog-card__links button {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}

.catalog-card[hidden] {
  display: none;
}

.principles__list {
  margin: var(--space-8) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.principles__item {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: var(--space-4);
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--line);
}

.principles__num {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-top: 0.2rem;
  border-radius: 6px;
  background: var(--cube-yellow);
  color: #0a0a0a;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.principles__item:nth-child(5n + 2) .principles__num {
  background: var(--cube-red);
  color: #fff;
}

.principles__item:nth-child(5n + 3) .principles__num {
  background: var(--cube-blue);
  color: #fff;
}

.principles__item:nth-child(5n + 4) .principles__num {
  background: var(--cube-green);
}

.principles__item:nth-child(5n + 5) .principles__num {
  background: var(--cube-orange);
  color: #fff;
}

.principles__item h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.principles__item p {
  margin: var(--space-3) 0 0;
  max-width: 34rem;
  color: var(--ink-secondary);
}

.timeline__list {
  margin: var(--space-8) 0 0;
  padding: 0;
  list-style: none;
}

.timeline__item {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  column-gap: var(--space-5);
  align-items: stretch;
}

.timeline__body {
  grid-row: 1;
  padding-bottom: var(--space-8);
  max-width: 34rem;
}

.timeline__rail {
  position: relative;
  grid-row: 1;
  grid-column: 2;
  display: flex;
  justify-content: center;
  align-self: stretch;
  width: 1.25rem;
  min-height: 100%;
}

.timeline__item--left .timeline__body {
  grid-column: 1;
  justify-self: end;
  text-align: end;
}

.timeline__item--right .timeline__body {
  grid-column: 3;
  justify-self: start;
  text-align: start;
}

.timeline__item--left .timeline__chips {
  justify-content: flex-end;
}

.timeline__rail::before {
  content: '';
  position: absolute;
  top: 0.55rem;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: var(--line-strong);
}

.timeline__item:last-child .timeline__rail::before {
  display: none;
}

.timeline__dot {
  position: relative;
  z-index: 1;
  flex: none;
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--era-color, var(--cube-yellow));
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline__item[data-era='design'] {
  --era-color: #f5617f;
}

.timeline__item[data-era='hardware'] {
  --era-color: #ffd22b;
}

.timeline__item[data-era='ideyou'] {
  --era-color: #ff5356;
}

.timeline__item[data-era='teaching'] {
  --era-color: #9900cc;
}

.timeline__item[data-era='platform'] {
  --era-color: #0076f3;
}

.timeline__years {
  margin: 0 0 var(--space-2);
  color: var(--ink-tertiary);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.timeline__body h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.timeline__headline {
  margin: var(--space-2) 0 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 500;
}

.timeline__lead {
  margin: var(--space-3) 0 0;
  color: var(--ink-secondary);
}

.timeline__context {
  margin: var(--space-4) 0 0;
  color: var(--ink-secondary);
  font-size: 1rem;
  line-height: 1.65;
}

.timeline__context + .timeline__context {
  margin-top: var(--space-5);
}

.timeline__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}

.timeline__chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--era-color, var(--line-strong)) 55%, var(--line-strong));
  color: var(--ink-secondary);
  font-size: 0.82rem;
  text-decoration: none;
  transition:
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.timeline__chip:hover {
  border-color: var(--era-color, var(--ink));
  background: color-mix(in srgb, var(--era-color, var(--ink)) 10%, transparent);
  color: var(--ink);
}

.timeline__story {
  display: inline-flex;
  margin-top: var(--space-4);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  color: var(--ink-secondary);
}

.timeline__story:hover {
  color: var(--ink);
}

.timeline__invite {
  margin-top: var(--space-5);
}

.timeline__item--left .timeline__invite {
  margin-inline-start: auto;
}

@media (max-width: 800px) {
  .timeline__item {
    grid-template-columns: auto 1fr;
    column-gap: var(--space-4);
  }

  .timeline__rail {
    grid-column: 1;
  }

  .timeline__item--left .timeline__body,
  .timeline__item--right .timeline__body {
    grid-column: 2;
    justify-self: start;
    text-align: start;
    max-width: none;
  }

  .timeline__item--left .timeline__chips {
    justify-content: flex-start;
  }
}

.tech {
  border-top: 1px solid var(--line);
}

.tech__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-top: var(--space-7);
}

.tech__group-label {
  margin: 0 0 0.75rem;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tech__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.35rem;
  background: var(--badge, #555);
  color: var(--badge-ink, #fff);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.tech-badge:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.tech-badge__icon {
  display: block;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.tech-badge__icon--invert {
  filter: brightness(0) invert(1);
}

.tech-badge__icon--dark {
  filter: brightness(0);
}

.contact {
  border-top: 1px solid var(--line);
  padding-bottom: var(--space-9);
}

.contact__title {
  max-width: 12ch;
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.contact__foot {
  margin: var(--space-9) 0 0;
  color: var(--ink-tertiary);
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  visibility: hidden;
  opacity: 0;
  transition:
    visibility 0s 0.25s,
    opacity 0.25s ease;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
  transition:
    visibility 0s,
    opacity 0.25s ease;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #000 65%, transparent);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(80vw, 72rem);
  max-height: min(90vh, 56rem);
  overflow: auto;
  padding: var(--space-6) var(--space-6) var(--space-5);
  border: 1px solid var(--line-strong);
  border-radius: 1.25rem;
  background: var(--bg-elevated);
  box-shadow: 0 24px 64px color-mix(in srgb, #000 45%, transparent);
  transform: translateY(12px);
  transition: transform 0.25s ease;
}

.modal.is-open .modal__panel {
  transform: translateY(0);
}

.modal--case .modal__panel {
  width: min(80vw, 80rem);
  max-height: min(92vh, 60rem);
  padding: var(--space-7) var(--space-7) var(--space-6);
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  color: var(--ink-secondary);
  cursor: pointer;
}

.modal__close svg {
  width: 1rem;
  height: 1rem;
}

.modal__close:hover {
  color: var(--ink);
  border-color: var(--ink-tertiary);
}

.modal__title {
  margin: 0 2.5rem 0.65rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.modal__desc {
  margin: 0 0 var(--space-5);
  color: var(--ink-secondary);
  font-size: 1rem;
  line-height: 1.55;
}

.modal__detail {
  margin: 0 0 var(--space-5);
  color: var(--ink-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: var(--space-5);
}

.modal__tech-label {
  margin: 0 0 0.55rem;
  color: var(--ink-tertiary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.modal__tech li {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-secondary);
  font-size: 0.82rem;
}

.modal__media {
  margin: 0 0 var(--space-5);
}

.modal__media-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #0a0a0a;
  min-height: 18rem;
  max-height: min(70vh, 42rem);
}

.modal__media-frame img,
.modal__media-frame video,
.modal__media-frame iframe {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(70vh, 42rem);
  object-fit: contain;
  object-position: center;
  border: 0;
}

.modal__carousel {
  position: relative;
}

.modal__carousel-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  color: var(--ink);
  cursor: pointer;
  transform: translateY(-50%);
}

.modal__carousel-nav--prev {
  left: 0.65rem;
}

.modal__carousel-nav--next {
  right: 0.65rem;
}

.modal__carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.modal__carousel-dot {
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line-strong);
  cursor: pointer;
}

.modal__carousel-dot.is-active {
  background: var(--ink);
}

.modal__highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-5);
}

.modal__highlight {
  margin: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.modal__highlight dt {
  margin: 0 0 0.25rem;
  color: var(--ink-tertiary);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.modal__highlight dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.modal__highlights:has(.modal__highlight-logos) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-5);
}

/* Modal chronological timeline — mirrors case__timeline */
.modal__timeline {
  --timeline-count: 5;
  --timeline-dot: 0.75rem;
  --timeline-line: 2px;
  list-style: none;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin: 0 0 var(--space-5);
  padding: 0;
  border: 0;
}

.modal__timeline-node {
  position: relative;
  display: grid;
  grid-template-columns: var(--timeline-dot) minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: start;
  margin: 0;
  min-width: 0;
}

.modal__timeline-dot {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: var(--timeline-dot);
  height: var(--timeline-dot);
  margin-top: 1.1rem;
  flex: 0 0 var(--timeline-dot);
  border: 0;
  border-radius: 50%;
  background: var(--node-color, var(--ink));
  box-shadow: none;
}

.modal__timeline-node:not(:last-child) .modal__timeline-dot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(100% + 3px);
  width: var(--timeline-line);
  height: calc(var(--space-4) + 1.1rem + var(--timeline-dot));
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--node-color) 55%, transparent);
}

.modal__timeline-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 0.35rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.modal__timeline-media {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--node-color) 40%, var(--line));
  border-radius: 0.6rem;
  background: color-mix(in srgb, var(--node-color) 18%, #0c0c0c);
  color: var(--node-color);
}

.modal__timeline-icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.modal__timeline-icon svg {
  width: 1.85rem;
  height: 1.85rem;
}

.modal__timeline-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

.modal__timeline-when {
  color: var(--ink-tertiary);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.modal__timeline-what {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

@media (min-width: 720px) {
  .modal__timeline {
    --timeline-dot: 0.8rem;
    grid-template-columns: repeat(var(--timeline-count), minmax(0, 1fr));
    gap: 0;
  }

  .modal__timeline::before {
    content: '';
    position: absolute;
    top: calc(var(--timeline-dot) / 2 - var(--timeline-line) / 2);
    left: calc(100% / var(--timeline-count) / 2);
    right: calc(100% / var(--timeline-count) / 2);
    height: var(--timeline-line);
    border-radius: 999px;
    background: linear-gradient(
      90deg,
      #ff5356 0%,
      #ffd000 25%,
      #33cc66 50%,
      #0e34c7 75%,
      #eb681a 100%
    );
    z-index: 0;
    pointer-events: none;
  }

  .modal__timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.35rem;
  }

  .modal__timeline-node:not(:last-child) .modal__timeline-dot::after {
    content: none;
  }

  .modal__timeline-dot {
    margin-top: 0;
  }

  .modal__timeline-card {
    width: 100%;
    text-align: center;
    gap: 0.3rem;
    justify-items: center;
  }

  .modal__timeline-media {
    width: min(100%, 5.75rem);
    aspect-ratio: 1;
  }

  .modal__timeline-thumb {
    object-fit: cover;
  }

  .modal__timeline-icon svg {
    width: 1.9rem;
    height: 1.9rem;
  }

  .modal__timeline-what {
    max-width: 9rem;
  }
}

.modal__highlight:has(.modal__highlight-logos) {
  margin: 0;
  padding: 0;
  border: 0;
  flex: 0 0 calc(50% - var(--space-5) / 2);
  max-width: calc(50% - var(--space-5) / 2);
}

.modal__highlight-logos {
  display: block;
  min-height: 0;
  width: 100%;
}

.modal__highlight-logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.modal__highlight:has(.modal__highlight-logos) dt {
  display: none;
}

@media (min-width: 900px) {
  .modal__highlights:has(.modal__highlight-logos) {
    flex-wrap: nowrap;
    gap: var(--space-4) var(--space-6);
  }

  .modal__highlight:has(.modal__highlight-logos) {
    flex: 0 0 auto;
    max-width: none;
  }

  .modal__highlight-logos {
    width: auto;
  }

  .modal__highlight-logo {
    height: 60px;
    max-width: none;
  }
}

.modal__section-label {
  margin: 0 0 var(--space-3);
  color: var(--ink-tertiary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.modal__chapters {
  margin: 0 0 var(--space-5);
}

.modal__chapters-more {
  width: 100%;
  margin: var(--space-5) 0 0;
  justify-content: flex-start;
  gap: 0.65rem;
}

.modal__chapters-more-meta {
  color: var(--ink-tertiary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.modal__chapters-more-meta::before {
  content: '·';
  margin-right: 0.65rem;
  color: var(--ink-tertiary);
}

.modal__chapters-more-icon {
  margin-left: auto;
  color: var(--ink-secondary);
  line-height: 1;
}

.modal__chapters-more[hidden] {
  display: none !important;
}

.modal__chapter-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-6);
  counter-reset: modal-chapter;
}

.modal__chapter-list--more {
  margin-top: var(--space-6);
  counter-reset: modal-chapter 4;
}

.modal__chapter-list--more[hidden] {
  display: none !important;
}

.modal__chapter {
  position: relative;
  padding-left: 2.25rem;
  counter-increment: modal-chapter;
}

.modal__chapter::before {
  content: counter(modal-chapter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.1rem;
  color: var(--ink-tertiary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.modal__chapter h4 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.modal__chapter p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.modal__chapter-steps {
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-5);
}

.modal__chapter-step {
  margin: 0;
  padding: var(--space-3) 0 0;
  border-top: 1px solid var(--line);
}

.modal__chapter-step h5 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.modal__chapter-step p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.modal__chapter-figure {
  margin: var(--space-4) 0 0;
}

.modal__chapter-figure:not(.modal__chapter-figure--carousel):not(.modal__chapter-figure--photo) img,
.modal__chapter-figure:not(.modal__chapter-figure--carousel):not(.modal__chapter-figure--photo) video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--bg);
}

.modal__chapter-figure--diagram img {
  object-fit: contain;
  background: #f7f7f5;
}

.modal__chapter-figure:not(.modal__chapter-figure--diagram):not(.modal__chapter-figure--compare):not(.modal__chapter-figure--tall):not(.modal__chapter-figure--carousel):not(.modal__chapter-figure--photo) img,
.modal__chapter-figure:not(.modal__chapter-figure--diagram):not(.modal__chapter-figure--compare):not(.modal__chapter-figure--tall):not(.modal__chapter-figure--carousel):not(.modal__chapter-figure--photo) video {
  max-height: 16rem;
  object-fit: contain;
  object-position: top left;
  background: #0a0a0a;
}

.modal__chapter-figure--tall {
  max-width: 14rem;
}

.modal__chapter-figure--tall img,
.modal__chapter-figure--tall video {
  background: #fff;
}

.modal__chapter-figure--photo {
  max-width: none;
  width: 100%;
}

.modal__chapter-figure-photo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 14.5rem;
  min-height: 14.5rem;
  max-height: 14.5rem;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #111111;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
}

.modal__chapter-figure-photo-card img,
.modal__chapter-figure-photo-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  box-shadow: none;
}

.modal__chapter-figure-photo-card--cover img,
.modal__chapter-figure-photo-card--cover video {
  object-fit: cover;
}

.modal__chapter-figure--compare {
  max-width: 28rem;
}

.modal__chapter-figure--compare.modal__chapter-figure--screens {
  max-width: none;
}

.modal__chapter-figure--compare.modal__chapter-figure--glue {
  width: 100%;
  max-width: none;
}

.modal__chapter-figure-pairs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #111111;
}

.modal__chapter-figure--no-arrow .modal__chapter-figure-pairs,
.modal__chapter-figure--screens.modal__chapter-figure--no-arrow .modal__chapter-figure-pairs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}

.modal__chapter-figure--glue .modal__chapter-figure-pairs {
  display: grid;
  grid-template-columns: minmax(0, 0.68fr) minmax(0, 1.79fr);
  width: 100%;
  gap: 0;
  align-items: stretch;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: #0a0a0a;
  overflow: hidden;
}

.modal__chapter-figure--glue .modal__chapter-figure-pair {
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: none;
  min-width: 0;
}

.modal__chapter-figure--glue .modal__chapter-figure-pair-frame {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #0a0a0a;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

.modal__chapter-figure--glue .modal__chapter-figure-pair-frame img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  object-fit: contain;
  background: #0a0a0a;
  pointer-events: none;
}

.modal__chapter-figure-compare-arrow {
  align-self: center;
  padding-top: 1.5rem;
  color: var(--ink-tertiary);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
}

.modal__chapter-figure-pair {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.modal__chapter-figure-pair-label {
  margin: 0 0 0.5rem;
  min-height: 2.25rem;
  color: var(--ink-tertiary);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.35;
}

.modal__chapter-figure-pair-frame {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0.65rem;
  border: 1px solid rgba(10, 10, 10, 0.1);
  border-radius: 0.25rem;
  background: #fff;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

.modal__chapter-figure-pair-frame img {
  display: block;
  width: 100%;
  max-width: 11rem;
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  pointer-events: none;
}

.modal__chapter-figure--screens .modal__chapter-figure-pair-frame {
  padding: 0.4rem;
  background: #0a0a0a;
  border-color: rgba(255, 255, 255, 0.08);
}

.modal__chapter-figure--screens .modal__chapter-figure-pair-frame img {
  max-width: none;
  background: transparent;
}

.modal__chapter-figure--screens .modal__chapter-figure-pair-label {
  min-height: 0;
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 560px) {
  .modal__chapter-figure-pairs {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .modal__chapter-figure--no-arrow .modal__chapter-figure-pairs,
  .modal__chapter-figure--screens.modal__chapter-figure--no-arrow .modal__chapter-figure-pairs {
    grid-template-columns: 1fr;
  }

  .modal__chapter-figure-compare-arrow {
    padding-top: 0;
    transform: rotate(90deg);
  }

  .modal__chapter-figure-pair {
    width: 100%;
    max-width: 12rem;
  }

  .modal__chapter-figure--screens .modal__chapter-figure-pair {
    max-width: none;
  }

  .modal__chapter-figure--glue .modal__chapter-figure-pairs {
    grid-template-columns: 1fr;
  }

  .modal__chapter-figure--glue .modal__chapter-figure-pair,
  .modal__chapter-figure--glue .modal__chapter-figure-pair:first-child {
    width: 100%;
    max-width: none;
  }

  .modal__chapter-figure--glue .modal__chapter-figure-pair-frame img,
  .modal__chapter-figure--glue .modal__chapter-figure-pair:first-child .modal__chapter-figure-pair-frame img {
    width: 100%;
    max-width: none;
    height: auto;
  }
}

.modal__chapter-figure figcaption {
  margin: var(--space-3) 0 0;
  color: var(--ink-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.modal__media-frame img.is-diagram {
  object-fit: contain;
  background: #f7f7f5;
}

.modal__case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-5);
}

.modal__case-block {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

.modal__case-block h4 {
  margin: 0 0 0.45rem;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.modal__case-block p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .modal {
    padding: 0;
    align-items: stretch;
  }

  .modal__panel,
  .modal--case .modal__panel {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: var(--space-5);
  }

  .modal__media-frame {
    min-height: 14rem;
    max-height: min(62vh, 28rem);
  }

  .modal__media-frame img,
  .modal__media-frame video,
  .modal__media-frame iframe {
    max-height: min(62vh, 28rem);
  }

  .modal__case-grid {
    grid-template-columns: 1fr;
  }

  .modal__highlights {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 721px) {
  .modal__highlights {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Chapter media lightbox */
.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
}

.media-lightbox.is-open {
  display: flex;
}

.media-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.78);
}

.media-lightbox__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: min(100%, 92vw);
  max-width: 92rem;
  height: min(94vh, 100%);
  max-height: 94vh;
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  background: #111111;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.media-lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.9);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.media-lightbox__nav {
  position: absolute;
  top: 42%;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.9);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.media-lightbox__nav--prev {
  left: 0.75rem;
}

.media-lightbox__nav--next {
  right: 0.75rem;
}

.media-lightbox__nav[hidden],
.media-lightbox__title[hidden],
.media-lightbox__desc[hidden] {
  display: none !important;
}

.media-lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #0a0a0a;
}

.media-lightbox__stage img,
.media-lightbox__stage video {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0.75rem;
}

.media-lightbox--pdf .media-lightbox__dialog {
  max-width: min(100%, 64rem);
}

.media-lightbox__pdf {
  display: block;
  width: 100%;
  height: 100%;
  min-height: min(78vh, 44rem);
  border: 0;
  border-radius: 0.75rem;
  background: #0a0a0a;
}

.media-lightbox--model .media-lightbox__dialog {
  max-width: min(100%, 52rem);
}

.media-lightbox__model,
.media-lightbox__model-frame,
.media-lightbox__model-host {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: min(70vh, 40rem);
  border: 0;
  border-radius: 0.75rem;
  background: #0a0a0a;
  overflow: hidden;
}

.media-lightbox__model {
  --poster-color: transparent;
}

.media-lightbox__model-stage {
  position: absolute;
  inset: 0;
}

.media-lightbox__model-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.media-lightbox__model-status,
.media-lightbox__model-fail {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.75rem;
  margin: 0;
  padding: 1.5rem;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  pointer-events: none;
}

.media-lightbox__model-fail {
  pointer-events: auto;
  background: #0a0a0a;
}

.media-lightbox__model-fail img {
  display: block;
  width: min(100%, 28rem);
  max-height: 55vh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 0.75rem;
}

.media-lightbox__model-fail a {
  color: #fff;
  text-underline-offset: 0.15em;
}

.media-lightbox__fallback {
  margin: 0;
  padding: var(--space-6);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.media-lightbox__stage img[src$=".svg"] {
  width: 100%;
  max-height: 100%;
  padding: 1rem;
  background: #f7f7f5;
}

.media-lightbox__meta {
  flex: 0 0 auto;
  padding: 0 0.25rem 0.25rem;
}

.media-lightbox__title {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.media-lightbox__desc {
  margin: 0.55rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1rem;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .media-lightbox {
    padding: 0;
    align-items: stretch;
  }

  .media-lightbox__dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    min-height: 100%;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
      max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .media-lightbox__stage {
    border-radius: 0;
  }

  .media-lightbox__stage img,
  .media-lightbox__stage video {
    border-radius: 0;
  }

  .media-lightbox__nav {
    top: auto;
    bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }

  .media-lightbox__nav--prev {
    left: 0.5rem;
  }

  .media-lightbox__nav--next {
    right: 0.5rem;
  }

  .media-lightbox__title {
    font-size: 1.15rem;
  }

  .media-lightbox__desc {
    font-size: 0.95rem;
  }
}

/* —— Stories (homepage surface) —— */
.stories .eyebrow::before {
  background: var(--cube-red);
}

.stories.section {
  padding-bottom: 0;
}

.stories__header {
  margin-bottom: var(--space-7);
}

.stories__list {
  display: grid;
  gap: 0;
}

.story-teaser {
  position: relative;
  border-top: 1px solid var(--line);
  transition: background-color 0.35s linear, color 0.35s linear;
}

.story-teaser:hover,
.story-teaser:focus-within {
  background-color: var(--wash-color);
  color: #fff;
  border-color: transparent;
}

.story-teaser.is-wash-ink-dark:hover,
.story-teaser.is-wash-ink-dark:focus-within {
  color: #0a0a0a;
}

.story-teaser__hit {
  display: block;
  color: inherit;
  text-decoration: none;
}

.story-teaser__inner {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  padding-block: clamp(3rem, 8vw, 6rem);
}

.story-teaser__index {
  margin: 0 0 var(--space-3);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ink-tertiary);
  transition: color 0.35s linear, opacity 0.35s linear;
}

.story-teaser:hover .story-teaser__index,
.story-teaser:hover .story-teaser__hook,
.story-teaser:focus-within .story-teaser__index,
.story-teaser:focus-within .story-teaser__hook {
  color: inherit;
  opacity: 0.88;
}

.story-teaser__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.story-teaser__hook {
  margin: var(--space-4) 0 0;
  max-width: 28rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-secondary);
  transition: color 0.35s linear, opacity 0.35s linear;
}

.story-teaser__cta {
  display: inline-flex;
  margin-top: var(--space-5);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.story-teaser__visual {
  position: relative;
  min-height: 14rem;
  display: grid;
  place-items: center;
}

.story-teaser__visual--cube {
  width: min(100%, 22rem);
  height: min(22rem, 58vw);
  margin-inline: auto;
  justify-self: center;
}

.story-teaser__visual--cube .rubik-stage {
  width: 100%;
  height: 100%;
}

.story-teaser--cube .story-teaser__hit {
  display: block;
  color: inherit;
  text-decoration: none;
}

.story-teaser__visual--mio {
  position: relative;
  width: min(100%, 28rem);
  height: 16rem;
  margin-inline: auto;
  overflow: visible;
}

.story-teaser__visual--platform {
  position: relative;
  width: min(100%, 28rem);
  height: 16rem;
  margin-inline: auto;
}

.story-teaser__logo {
  position: absolute;
  width: clamp(3.5rem, 10vw, 5.5rem);
  height: auto;
  border-radius: 0.85rem;
  background: #fff;
  padding: 0.45rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  transition: transform 0.55s var(--ease);
}

.story-teaser__logo--wordmark {
  display: grid;
  place-items: center;
  width: clamp(5.5rem, 14vw, 8rem);
  aspect-ratio: 1;
  overflow: hidden;
}

.story-teaser__logo--wordmark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .story-teaser__logo--wordmark {
    background: #0a0a0a;
  }
}

[data-theme='dark'] .story-teaser__logo--wordmark {
  background: #0a0a0a;
}

[data-theme='light'] .story-teaser__logo--wordmark {
  background: #fff;
}

.story-teaser__logo--bare {
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

.story-teaser__logo--1 { top: 8%; left: 8%; }
.story-teaser__logo--2 { top: 0; right: 18%; }
.story-teaser__logo--3 { top: 38%; left: 28%; }
.story-teaser__logo--4 { bottom: 12%; left: 4%; }
.story-teaser__logo--5 { bottom: 4%; right: 10%; }
.story-teaser__logo--6 { top: 42%; right: 2%; }
.story-teaser__logo--7 { top: 18%; left: 48%; }

.story-teaser__visual--mio .story-teaser__logo {
  aspect-ratio: 1;
  object-fit: contain;
  padding: 0.7rem;
  box-sizing: border-box;
}

.story-teaser:hover .story-teaser__logo--1 { transform: translate(-6px, -10px) rotate(-6deg); }
.story-teaser:hover .story-teaser__logo--2 { transform: translate(8px, -8px) rotate(5deg); }
.story-teaser:hover .story-teaser__logo--3 { transform: translate(0, 6px) scale(1.05); }
.story-teaser:hover .story-teaser__logo--4 { transform: translate(-10px, 8px) rotate(4deg); }
.story-teaser:hover .story-teaser__logo--5 { transform: translate(6px, 10px) rotate(-4deg); }
.story-teaser:hover .story-teaser__logo--6 { transform: translate(10px, -4px) rotate(7deg); }
.story-teaser:hover .story-teaser__logo--7 { transform: translate(-4px, 8px) rotate(-5deg); }

@media (min-width: 900px) {
  .story-teaser__inner {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .story-teaser--miodelivery .story-teaser__inner {
    grid-template-columns: 0.9fr 1.1fr;
  }

  .story-teaser--miodelivery .story-teaser__copy {
    order: 2;
  }

  .story-teaser--miodelivery .story-teaser__visual {
    order: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-teaser,
  .story-teaser__logo {
    transition: none;
  }
}

/* —— Dedicated case pages —— */
.case-page__bar {
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + var(--space-5));
  padding-bottom: var(--space-4);
}

.case-page__back {
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-secondary);
}

.case-page__back:hover {
  color: var(--ink);
}

.case-page__foot {
  padding-bottom: var(--space-8);
}

.case-page__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.case-page__intro {
  padding-top: var(--space-4);
}

.case-page__rubik {
  margin-top: var(--space-4);
}

.case-page__mio-constellation .case-page__constellation-logo {
  aspect-ratio: 1;
  object-fit: contain;
  padding: 0.85rem;
  box-sizing: border-box;
}

.case-page__constellation {
  position: relative;
  height: clamp(14rem, 36vw, 22rem);
  max-width: 48rem;
  margin: var(--space-6) auto 0;
}

.case-page__constellation-logo {
  position: absolute;
  width: clamp(4rem, 12vw, 6.5rem);
  height: auto;
  border-radius: 1rem;
  background: #fff;
  padding: 0.55rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
}

.case-page__constellation-logo--wordmark {
  display: grid;
  place-items: center;
  width: clamp(6rem, 16vw, 9rem);
  aspect-ratio: 1;
  overflow: hidden;
}

.case-page__constellation-logo--wordmark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .case-page__constellation-logo--wordmark {
    background: #0a0a0a;
  }
}

[data-theme='dark'] .case-page__constellation-logo--wordmark {
  background: #0a0a0a;
}

[data-theme='light'] .case-page__constellation-logo--wordmark {
  background: #fff;
}

.case-page__constellation-logo--bare {
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

.case-page__constellation-logo--1 { top: 10%; left: 8%; }
.case-page__constellation-logo--2 { top: 0; right: 22%; }
.case-page__constellation-logo--3 { top: 42%; left: 30%; }
.case-page__constellation-logo--4 { bottom: 8%; left: 6%; }
.case-page__constellation-logo--5 { bottom: 0; right: 12%; }
.case-page__constellation-logo--6 { top: 38%; right: 4%; }
.case-page__constellation-logo--7 { top: 14%; left: 42%; }

.case-page--cube .case__inner,
.case-page--miodelivery .case__inner,
.case-page--platform .case__inner {
  padding-bottom: var(--space-9);
}

.case-page__lead {
  margin: 0.75rem 0 0;
  max-width: 40ch;
  opacity: 0.8;
  font-size: 1.05rem;
  line-height: 1.5;
}
