/* ==========================================================================
 Tokens (shared with the main site palette — see /css/style.css)
 ========================================================================== */

:root {
  color-scheme: light dark;

  --page-bg: #ffffff;
  --page-bg-secondary: rgb(255 255 255 / 0.5);
  --text-main: #161616;
  --text-muted: rgb(0 0 0 / 0.55);
  --text-soft: rgb(0 0 0 / 0.4);

  --glass-bg: rgb(200 200 200 / 0.35);
  --glass-bg-hover: rgb(0 0 0 / 1);

  --sheet-bg: rgb(0 0 0 / 0.03);
  --levitated-button-bg: rgb(241 241 241 / 0.6);

  --icon-filter: brightness(0) opacity(0.55);
  --icon-filter-hover: brightness(0) invert(1) opacity(0.8);

  --selection-bg: rgb(0 0 0 / 0.3);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: #141414;
    --page-bg-secondary: rgb(0 0 0 / 0.5);
    --text-main: #f5f5f5;
    --text-muted: rgb(255 255 255 / 0.6);
    --text-soft: rgb(255 255 255 / 0.45);

    --glass-bg: rgb(120 120 120 / 0.28);
    --glass-bg-hover: rgb(255 255 255 / 1);

    --sheet-bg: rgb(255 255 255 / 0.045);
    --levitated-button-bg: rgb(42 42 42 / 0.6);

    --icon-filter: brightness(0) invert(1) opacity(0.65);
    --icon-filter-hover: brightness(0) opacity(0.85);

    --selection-bg: rgb(255 255 255 / 0.25);
  }
}

/* ==========================================================================
 Base
 ========================================================================== */

* {
  box-sizing: border-box;
}

::-moz-selection {
  background: var(--selection-bg);
  text-shadow: none;
}

::selection {
  background: var(--selection-bg);
  text-shadow: none;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display",
  "Segoe UI", sans-serif;
  background: var(--page-bg);
  color: var(--text-main);
}

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

img,
video {
  max-width: 100%;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

/* ==========================================================================
 Layout
 ========================================================================== */

.detail-main {
  --content-pad: clamp(20px, 6vw, 48px);

  max-width: 900px;
  margin: 0 auto;
  padding: clamp(90px, 14vw, 140px) var(--content-pad) clamp(160px, 20vw, 210px);
}

@media (min-width: 900px) {
  .detail-main {
    max-width: 1160px;
  }
}

/* ==========================================================================
 Hero
 ========================================================================== */

@keyframes rise-in {
  from {
    opacity: 0;
    filter: blur(16px);
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

/* Same rise as above, but on the standalone `translate` property instead
   of `transform` — used by elements that also need `transform`/`scale`
   free for their own interaction states (e.g. a press effect), since a
   fill-mode:both animation otherwise keeps pinning `transform` in the
   cascade even after it finishes, blocking later class-driven changes. */
@keyframes rise-in-translate {
  from {
    opacity: 0;
    filter: blur(16px);
    translate: 0 18px;
  }
  to {
    opacity: 1;
    filter: blur(0);
    translate: 0 0;
  }
}

.detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(28px, 4vw, 40px);

  margin-bottom: clamp(120px, 15vw, 200px);
}

.detail-hero-text {
  width: 100%;
}

.detail-hero h1 {
  font-size: clamp(34px, 6vw, 60px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 14px;

  animation: rise-in 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.detail-hero-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 20px;

  animation: rise-in 900ms cubic-bezier(0.22, 1, 0.36, 1) 60ms both;
}

/* Product Page CTA + App Store button, side by side. A block-level flex
   row spans the full width of .detail-hero-text, so it needs its own
   justify-content to stay centred with the rest of the hero text in the
   narrow/column layout (text-align alone only affects inline content). */
.detail-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 0;
}

/* Product Page CTA — same look as the floating .detail-back pill, just
   inline in the hero and shown immediately (no entrance transition). */
.detail-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  height: 50px;
  padding: 0 18px 0 14px;
  margin: 0;

  border: 1px solid rgb(127 127 127 / 0.10);
  border-radius: 999px;
  background: var(--levitated-button-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);

  box-shadow:
    0 12px 30px rgb(0 0 0 / 0.10),
    0 4px 10px rgb(0 0 0 / 0.06);

  white-space: nowrap;

  font-size: 19px;
  font-weight: 400;
  color: var(--text-muted);

  cursor: pointer;

  transition:
    background 240ms ease,
    color 240ms ease,
    scale 240ms ease;

  animation: rise-in-translate 900ms cubic-bezier(0.22, 1, 0.36, 1) 90ms both;
}

.detail-hero-cta img {
  width: 15px;
  height: 21px;
  margin-left: 7px;
  margin-right: 3px;
  margin-top: 2px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--icon-filter);
  transition: filter 200ms ease;
}

/* Storefront icon is closer to square than the Product Page pointer icon,
   so it needs its own size instead of sharing .detail-hero-cta img's. */
.detail-hero-cta img.detail-hero-cta-icon-storefront {
  width: 20px;
  height: 20px;
}

.detail-hero-cta:hover {
  background: var(--glass-bg-hover);
  color: var(--page-bg);
}

.detail-hero-cta:hover img {
  filter: var(--icon-filter-hover);
}

.detail-hero-cta.is-pressed,
.detail-hero-cta:hover.is-pressed {
  scale: 0.85;

  transition:
    scale 420ms cubic-bezier(0.22, 1, 0.36, 1),
    background 240ms ease,
    color 240ms ease;
}

/* Circular icon-link button — companion to the CTA in the hero, same
   materials (App Store, storefront map link, etc). */
.detail-hero-icon-link {
  display: grid;
  place-items: center;
  flex: 0 0 auto;

  width: 50px;
  height: 50px;

  border: 1px solid rgb(127 127 127 / 0.10);
  border-radius: 999px;
  background: var(--levitated-button-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);

  box-shadow:
    0 12px 30px rgb(0 0 0 / 0.10),
    0 4px 10px rgb(0 0 0 / 0.06);

  cursor: pointer;

  transition:
    background 240ms ease,
    scale 240ms ease;

  animation: rise-in-translate 900ms cubic-bezier(0.22, 1, 0.36, 1) 90ms both;
}

.detail-hero-icon-link img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--icon-filter);
  transition: filter 200ms ease;
}

.detail-hero-icon-link:hover {
  background: var(--glass-bg-hover);
}

.detail-hero-icon-link:hover img {
  filter: var(--icon-filter-hover);
}

.detail-hero-icon-link.is-pressed,
.detail-hero-icon-link:hover.is-pressed {
  scale: 0.85;

  transition:
    scale 420ms cubic-bezier(0.22, 1, 0.36, 1),
    background 240ms ease;
}

.detail-hero-image {
  order: -1;
  width: 100%;

  animation: rise-in 1000ms cubic-bezier(0.22, 1, 0.36, 1) 160ms both;
}

.detail-hero-image picture,
.detail-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Introduction footnote — clamped to two lines with an expand/collapse control */

.detail-hero-intro {
  position: relative;
  margin-top: 28px;

  animation: rise-in 900ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}

.detail-hero-intro.is-expanded {
  padding-bottom: 30px;
  transition: padding-bottom 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-hero-intro-text {
  --intro-line: 22px;

  margin: 0;
  text-align: left;

  font-size: clamp(14px, 1.3vw, 15px);
  font-weight: 400;
  line-height: var(--intro-line);
  color: var(--text-muted);

  max-height: calc(var(--intro-line) * 2);
  overflow: hidden;

  transition: max-height 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-hero-intro-more {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 22px;
  padding: 0 0 0 28px;

  display: inline-flex;
  align-items: center;

  border: none;
  background: linear-gradient(to right, transparent, var(--page-bg) 45%);

  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-main);
  cursor: pointer;

  transition: color 200ms ease;
}

.detail-hero-intro.is-expanded .detail-hero-intro-more {
  padding-left: 0;
  background: none;
}

.detail-hero-intro-more:hover {
  color: var(--text-muted);
}

@media (min-width: 900px) {
  .detail-hero {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: clamp(40px, 6vw, 80px);
  }

  .detail-hero-text,
  .detail-hero-image {
    flex: 1 1 0;
    width: auto;
  }

  .detail-hero-image {
    order: 0;
  }

  .detail-hero-actions {
    justify-content: flex-start;
  }
}

/* ==========================================================================
 Article sections
 ========================================================================== */

.article-section {
  display: flex;
  flex-direction: column;

  opacity: 0;
  filter: blur(10px);
  transform: translateY(28px);

  transition:
    opacity 800ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 900ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.article-section.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.article-section + .article-section {
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: clamp(48px, 6vw, 72px);
  border-top: 1px solid rgb(128 128 128 / 0.18);
}

.article-text {
  min-width: 0;
}

.article-section h2 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 600;
}

.article-section p {
  margin: 24px 0 0;
  max-width: 100%;
  color: var(--text-muted);
  font-size: clamp(16px, 1.4vw, 18px);
  font-weight: 400;
  line-height: 1.55;
}

/* Wide screens: text left, media right — media pins in place while the
   (usually taller) text column scrolls past it. */
@media (min-width: 900px) {
  .article-section:has(.article-media) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: clamp(40px, 5vw, 64px);
  }

  .article-media {
    position: sticky;
    top: clamp(24px, 4vw, 48px);
    align-self: start;
    margin-top: 0;
  }

  .article-media .article-image-single,
  .article-media .article-image-pager,
  .article-media .sketchfab-embed-wrapper {
    margin-top: 0;
  }

  .article-media .article-image-single,
  .article-media .sketchfab-embed-wrapper {
    margin-left: 0;
    margin-right: 0;
  }

  .article-media .article-image-single picture,
  .article-media .article-image-single img,
  .article-media .article-image-single .article-video {
    padding-left: 0;
    padding-right: 0;
  }

  .article-media .sketchfab-embed-wrapper iframe {
    padding-left: 0;
    padding-right: 0;
  }

  .article-media .article-image-caption {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Images */

.article-image-single {
  margin-top: clamp(20px, 2.4vw, 32px);
  margin-left: calc(-1 * var(--content-pad));
  margin-right: calc(-1 * var(--content-pad));
}

.article-image-pager {
  margin-top: clamp(20px, 2.4vw, 32px);
}

.article-image-single picture {
  display: block;
  overflow: hidden;
}

.article-image-single picture,
.article-image-single img,
.article-image-single .article-video {
  width: 100%;
  padding-left: calc(1/2 * var(--content-pad));
  padding-right: calc(1/2 * var(--content-pad));
  height: auto;
  display: block;
}

/* Sketchfab 3D embed — same bleed/padding treatment as .article-image-single
   so it lines up with the other media widths in the article column. */
.sketchfab-embed-wrapper {
  margin-top: clamp(20px, 2.4vw, 32px);
  margin-left: calc(-1 * var(--content-pad));
  margin-right: calc(-1 * var(--content-pad));
}

.sketchfab-embed-wrapper iframe {
  width: 100%;
  aspect-ratio: 4 / 3;
  padding-left: calc(1/2 * var(--content-pad));
  padding-right: calc(1/2 * var(--content-pad));
  box-sizing: border-box;
  display: block;
  border: none;
}

/* Multi-image pager */

.article-image-track {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.article-image-track::-webkit-scrollbar {
  display: none;
}

.article-image-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  margin: 0;
  line-height: 0;
}

.article-image-slide picture,
.article-image-slide img {
  width: 100%;
  height: auto;
  display: block;
}

/* Single image caption re-indented to align with text (compensates for negative margins) */
.article-image-caption {
  padding-left: var(--content-pad);
  padding-right: var(--content-pad);
}

/* Captions */

.article-image-caption {
  display: block;
  margin-top: 10px;

  font-size: clamp(12px, 1vw, 14px);
  font-weight: 400;
  color: var(--text-soft);
  line-height: 1.4;
}

/* Pager footer: captions on the left, prev/next controls on the right */

.article-pager-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}

.article-pager-captions {
  position: relative;
  min-height: 1.4em;
  flex: 1 1 auto;
  min-width: 0;
}

.article-pager-caption-item {
  display: block;
  position: absolute;
  inset: 0;

  font-size: clamp(12px, 1vw, 14px);
  font-weight: 400;
  color: var(--text-soft);
  line-height: 1.4;

  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.article-pager-caption-item.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Prev/next controls */

.article-pager-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-pager-btn {
  width: 28px;
  height: 28px;
  padding: 0;

  display: grid;
  place-items: center;

  border: 1px solid rgb(127 127 127 / 0.14);
  border-radius: 999px;
  background: var(--sheet-bg);

  cursor: pointer;

  transition:
    background 200ms ease,
    border-color 200ms ease,
    transform 200ms ease,
    opacity 200ms ease;
}

.article-pager-btn img {
  width: 8px;
  height: 13px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--icon-filter);
  transition: filter 200ms ease;
}

.article-pager-btn:hover:not(:disabled) {
  background: var(--glass-bg-hover);
  border-color: transparent;
}

.article-pager-btn:hover:not(:disabled) img {
  filter: var(--icon-filter-hover);
}

.article-pager-btn:active:not(:disabled) {
  transform: scale(0.88);
}

.article-pager-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ==========================================================================
 Floating bottom back button
 Mirrors .back-link in myschoolapp/css/legal.css — same sizing, timing and
 press animation, with the site's neutral hover instead of legal's accent.
 ========================================================================== */

.detail-actions {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);

  display: flex;
  align-items: center;

  z-index: 70;
}

.detail-back {
  width: 56px;
  height: 56px;
  margin-right: 12px;

  display: grid;
  place-items: center;

  border: 1px solid rgb(127 127 127 / 0.10);
  border-radius: 999px;
  background: var(--levitated-button-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);

  box-shadow:
    0 12px 30px rgb(0 0 0 / 0.10),
    0 4px 10px rgb(0 0 0 / 0.06);

  cursor: pointer;

  opacity: 0;
  filter: blur(20px);
  transform: translateY(120px) scale(0);

  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 900ms cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 900ms cubic-bezier(0.16, 1, 0.3, 1),
    background 240ms ease,
    box-shadow 260ms ease;
}

.detail-actions.is-visible .detail-back {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

.detail-back img {
  width: 16px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--icon-filter);
  transition:
    filter 200ms ease,
    opacity 260ms ease;
}

.detail-back:hover {
  background: var(--glass-bg-hover);
}

.detail-back:hover img {
  filter: var(--icon-filter-hover);
}

.detail-back.is-pressed,
.detail-back:hover.is-pressed {
  transform: translateY(0) scale(0.85);

  transition:
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    background 240ms ease;
}

.detail-back:focus-visible {
  outline: 2px solid var(--text-main);
  outline-offset: 3px;
}

/* ==========================================================================
 Scroll status pill — appears once the hero has scrolled out of view,
 showing the project name and the article section currently in focus.
 ========================================================================== */

.detail-status {
  position: relative;
  z-index: 1;

  height: 56px;
  width: fit-content;
  max-width: 0;
  margin-right: 0;
  overflow: hidden;

  border: 1px solid rgb(127 127 127 / 0.10);
  border-radius: 999px;
  background: var(--levitated-button-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);

  box-shadow:
    0 12px 30px rgb(0 0 0 / 0.10),
    0 4px 10px rgb(0 0 0 / 0.06);

  opacity: 0;
  filter: blur(20px);
  transform: translateY(120px) scale(0);

  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 900ms cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 900ms cubic-bezier(0.16, 1, 0.3, 1),
    max-width 900ms cubic-bezier(0.32, 1.2, 0.64, 1),
    margin-right 900ms cubic-bezier(0.32, 1.2, 0.64, 1),
    box-shadow 260ms ease,
    background 240ms ease,
    width 480ms cubic-bezier(0.34, 1.15, 0.64, 1),
    height 480ms cubic-bezier(0.34, 1.15, 0.64, 1),
    border-radius 480ms cubic-bezier(0.34, 1.15, 0.64, 1);
}

.detail-status.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
  /* Never let the pill (plus the fixed-size back/menu buttons around it)
     push the floating bar past the viewport edges. */
  max-width: min(320px, calc(100vw - 168px));
  margin-right: 12px;
}

.detail-status:hover:not(.is-open) {
  background: var(--glass-bg-hover);
}

.detail-status:hover:not(.is-open) .detail-status-toggle img {
  filter: var(--icon-filter-hover);
}

.detail-status:hover:not(.is-open) .detail-status-project {
  color: var(--page-bg-secondary);
}

.detail-status:hover:not(.is-open) .detail-status-section {
  color: var(--page-bg);
}

.detail-status.is-pressed:not(.is-open),
.detail-status:hover.is-pressed:not(.is-open) {
  transform: translateY(0) scale(0.85);

  transition:
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    background 240ms ease;
}

/* Expanding to the section list morphs this same pill — width/height/
   radius grow together with the icon+label cross-fading into the list,
   exactly like .detail-menu. */

.detail-status.is-open {
  z-index: 2;
  width: 280px;
  max-width: 280px;
  border-radius: 26px;
}

/* Guard used while JS swaps .detail-status between flex-flow and
   absolute positioning (open/close), so that switch is instant — only
   width/height/border-radius should visibly animate, not the position
   itself. Applied for a single forced reflow, then removed. */
.detail-status.is-snapping {
  transition: none !important;
}

.detail-status-toggle {
  all: unset;
  box-sizing: border-box;
  height: 56px;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 0 20px 0 18px;
  white-space: nowrap;
  cursor: pointer;

  opacity: 1;
  filter: blur(0);

  transition:
    opacity 260ms ease,
    filter 260ms ease;
}

.detail-status.is-open .detail-status-toggle {
  position: absolute;
  inset: 0;
  opacity: 0;
  filter: blur(14px);
  pointer-events: none;
}

.detail-status-toggle img {
  width: 30px;
  height: 26px;
  flex: 0 0 auto;
  object-fit: contain;
  pointer-events: none;
  filter: var(--icon-filter);
}

.detail-status-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.detail-status-project,
.detail-status-section {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-status-project {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-soft);
  transition: color 200ms ease;
}

.detail-status-section {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);

  transition: opacity 200ms ease;
}

.detail-status-section.is-changing {
  opacity: 0;
}

/* Expandable section list — cross-fades in as the pill morphs into a
   panel, same technique as .detail-menu-list. */

.detail-status-list {
  position: absolute;
  inset: 0;
  overflow-y: auto;

  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;

  opacity: 0;
  filter: blur(14px);
  pointer-events: none;

  transition:
    opacity 260ms ease,
    filter 260ms ease;
}

.detail-status.is-open .detail-status-list {
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
  transition-delay: 160ms;
}

.detail-status-item {
  display: flex;
  align-items: center;
  flex-shrink: 0;

  height: 44px;
  padding: 0 12px;
  border: none;
  border-radius: 14px;
  background: none;

  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  cursor: pointer;

  transition:
    background 200ms ease,
    color 200ms ease;
}

.detail-status-item:hover {
  background: var(--sheet-bg);
  color: var(--text-main);
}

.detail-status-item.is-current {
  background: var(--sheet-bg);
  color: var(--text-main);
  font-weight: 600;
}

.detail-status-toggle:focus-visible,
.detail-status-item:focus-visible {
  outline: 2px solid var(--text-main);
  outline-offset: 2px;
}

/* Invisible placeholder that reserves the pill's collapsed footprint in the
   flex row while .detail-status is pulled out to position:absolute for its
   open/expanded state — keeps the back and menu buttons from being pushed. */
.detail-status-slot {
  width: 0;
  height: 56px;
  margin-right: 0;
  flex: 0 0 auto;
  visibility: hidden;
}

/* ==========================================================================
 Project switcher — a circular button that expands into a rounded-rect
 menu listing all projects. Icon and list cross-fade with a blur transition.
 ========================================================================== */

.detail-menu-slot {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  visibility: hidden;
}

.detail-menu {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;

  width: 56px;
  height: 56px;
  overflow: hidden;

  border: 1px solid rgb(127 127 127 / 0.10);
  border-radius: 999px;
  background: var(--levitated-button-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);

  box-shadow:
    0 12px 30px rgb(0 0 0 / 0.10),
    0 4px 10px rgb(0 0 0 / 0.06);

  opacity: 0;
  filter: blur(20px);
  transform: translateY(120px) scale(0);

  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 900ms cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 900ms cubic-bezier(0.16, 1, 0.3, 1),
    background 240ms ease,
    width 480ms cubic-bezier(0.34, 1.15, 0.64, 1),
    height 480ms cubic-bezier(0.34, 1.15, 0.64, 1),
    border-radius 480ms cubic-bezier(0.34, 1.15, 0.64, 1);
}

.detail-actions.is-visible .detail-menu {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

.detail-menu:hover:not(.is-open) {
  background: var(--glass-bg-hover);
}

.detail-menu:hover:not(.is-open) .detail-menu-toggle img {
  filter: var(--icon-filter-hover);
}

.detail-menu.is-pressed:not(.is-open),
.detail-menu:hover.is-pressed:not(.is-open) {
  transform: translateY(0) scale(0.85);

  transition:
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    background 240ms ease;
}

.detail-menu.is-open {
  z-index: 2;
  width: 260px;
  height: 208px;
  border-radius: 26px;
}

.detail-menu-toggle {
  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  border: none;
  background: none;
  padding: 0;
  cursor: pointer;

  opacity: 1;
  filter: blur(0);

  transition:
    opacity 260ms ease,
    filter 260ms ease;
}

.detail-menu-toggle img {
  width: 28px;
  height: 24px;
  margin-top: 2px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--icon-filter);
}

.detail-menu.is-open .detail-menu-toggle {
  opacity: 0;
  filter: blur(14px);
  pointer-events: none;
}

.detail-menu-list {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;

  opacity: 0;
  filter: blur(14px);
  pointer-events: none;

  transition:
    opacity 260ms ease,
    filter 260ms ease;
}

.detail-menu.is-open .detail-menu-list {
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
  transition-delay: 160ms;
}

.detail-menu-item {
  display: flex;
  align-items: center;

  height: 44px;
  padding: 0 12px;
  border-radius: 14px;

  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  transition:
    background 200ms ease,
    color 200ms ease;
}

.detail-menu-item:hover {
  background: var(--sheet-bg);
  color: var(--text-main);
}

.detail-menu-item.is-current {
  background: var(--sheet-bg);
  color: var(--text-main);
  font-weight: 600;
}

.detail-menu-toggle:focus-visible,
.detail-menu-item:focus-visible {
  outline: 2px solid var(--text-main);
  outline-offset: 2px;
}

/* Whichever of back/status/menu isn't the one being interacted with is
   disabled while another is open — only its shadow, icon and text dim,
   the pill itself stays fully opaque. */

.detail-actions:has(.detail-menu.is-open) .detail-back,
.detail-actions:has(.detail-menu.is-open) .detail-status,
.detail-actions:has(.detail-status.is-open) .detail-back,
.detail-actions:has(.detail-status.is-open) .detail-menu {
  pointer-events: none;
  box-shadow:
    0 12px 30px rgb(0 0 0 / 0.03),
    0 4px 10px rgb(0 0 0 / 0.02);
}

.detail-actions:has(.detail-menu.is-open) .detail-back img,
.detail-actions:has(.detail-menu.is-open) .detail-status-toggle,
.detail-actions:has(.detail-status.is-open) .detail-back img,
.detail-actions:has(.detail-status.is-open) .detail-menu-toggle {
  opacity: 0.4;
}

/* ==========================================================================
 Responsive
 ========================================================================== */

@media (max-width: 500px) {
  .detail-main {
    --content-pad: 20px;
  }

  .detail-menu.is-open {
    width: min(260px, calc(100vw - 96px));
  }

  .detail-status.is-open {
    width: min(280px, calc(100vw - 48px));
    max-width: min(280px, calc(100vw - 48px));
  }

  .detail-status-project,
  .detail-status-section {
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  .detail-hero-eyebrow,
  .detail-hero h1,
  .detail-hero-cta,
  .detail-hero-intro,
  .detail-hero-image {
    animation: none;
  }

  .detail-back,
  .detail-menu {
    transition-delay: 0ms !important;
  }

  .detail-hero-intro-text,
  .detail-hero-intro.is-expanded {
    transition: none;
  }

  .article-section {
    transition: none;
  }

  .detail-status,
  .detail-status-toggle,
  .detail-status-section,
  .detail-status-list,
  .detail-status-item,
  .detail-menu,
  .detail-menu-toggle,
  .detail-menu-list,
  .detail-menu-item {
    transition: none;
  }
}
