@media (min-width: 1800px) {
  :root {
    --shell: min(100% - 7rem, 104rem);
  }

  .site-header,
  .site-footer {
    padding-inline: max(3.5rem, calc((100vw - 104rem) / 2));
  }

  .chapter-rail,
  .chapter-hud {
    right: max(3.5rem, calc((100vw - 104rem) / 2));
  }

  .chapter-hud {
    left: max(3.5rem, calc((100vw - 104rem) / 2));
  }
}

@media (min-width: 1241px) {
  .chapter-frame {
    padding-right: 10rem;
  }
}

@media (min-width: 1025px) {
  .analytics-preferences {
    right: max(1.5rem, calc((100vw - 94rem) / 2), var(--safe-right));
    bottom: calc(6.5rem + var(--safe-bottom));
  }
}

@media (max-width: 1240px) {
  .chapter-rail {
    display: none;
  }

  .hero-copy {
    max-width: 100%;
  }

  .process-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-track li:nth-child(2n) {
    border-right: 0;
  }

  .process-track li:nth-child(n + 3) {
    border-top: 1px solid var(--hairline-soft);
  }

  .fallback-assembly,
  .fallback-orbit {
    left: 72%;
  }
}

@media (max-width: 1024px) {
  :root {
    --shell: min(100% - 2.5rem, 72rem);
  }

  .site-header {
    grid-template-columns: 1fr auto;
    padding-inline: 1.25rem;
  }

  .desktop-nav,
  .header-cta {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .chapter {
    padding-top: calc(var(--header-h) + 3rem);
  }

  .chapter-frame--split {
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
    align-content: center;
  }

  .principles-panel,
  .systems-readout {
    width: min(100%, 39rem);
    margin-left: auto;
  }

  .service-row {
    grid-template-columns: minmax(14rem, 0.78fr) minmax(0, 1.22fr);
    gap: 1rem 2.5rem;
  }

  .service-row__identity {
    grid-row: span 2;
  }

  .service-row__capabilities {
    grid-column: 2;
  }

  .work-placeholder {
    grid-template-columns: 1fr;
  }

  .work-placeholder__visual {
    min-height: 19rem;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }

  .faq,
  .social-follow {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .site-footer {
    grid-template-columns: 1fr 1fr;
    padding-inline: 1.25rem;
  }

  .site-footer__brand {
    grid-column: 1;
    grid-row: 1;
  }

  .site-footer > p {
    grid-column: 1;
    grid-row: 2;
  }

  .site-footer__channels {
    grid-column: 2;
    grid-row: 1;
  }

  .site-footer__legal {
    grid-column: 2;
    grid-row: 2;
  }

  .chapter-hud {
    right: 1.25rem;
    left: 1.25rem;
  }

  .chapter-controls {
    right: 1.25rem;
    top: calc(var(--header-h) + 0.75rem);
    bottom: auto;
  }

  .fallback-assembly {
    left: 75%;
    width: min(51vw, 34rem);
  }

  .fallback-orbit {
    left: 75%;
  }
}

@media (max-width: 820px) {
  :root {
    --shell: min(100% - 2rem, 46rem);
    --header-h: 4.9rem;
  }

  .prototype-flag {
    display: none;
  }

  .chapter,
  .chapter--architecture,
  .chapter--process,
  .chapter--contact {
    min-height: auto;
    padding: calc(var(--header-h) + 4rem) 0 7rem;
  }

  .chapter--hero {
    min-height: 100svh;
    padding-bottom: 2rem;
  }

  .chapter-frame {
    min-height: auto;
  }

  .chapter--hero .chapter-frame {
    min-height: calc(100svh - var(--header-h) - 6rem);
  }

  .chapter::before {
    background:
      linear-gradient(180deg, rgba(4, 5, 6, 0.56), rgba(4, 5, 6, 0.86) 55%, rgba(4, 5, 6, 0.97));
    opacity: 0.86;
  }

  .hero-copy {
    margin-top: auto;
  }

  .hero-title {
    font-size: clamp(3.2rem, 15.5vw, 7rem);
  }

  .hero-statement {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
  }

  .hero-statement p {
    font-size: 1rem;
  }

  .hero-statement span {
    max-width: 31rem;
    font-size: 0.78rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .button {
    min-width: 0;
  }

  .scroll-cue {
    display: none;
  }

  .chapter-title {
    font-size: clamp(2.55rem, 9.5vw, 5rem);
  }

  .service-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding-block: 1.5rem;
  }

  .service-row__identity {
    grid-row: auto;
  }

  .service-row__description,
  .service-row__capabilities {
    grid-column: 1;
    padding-left: 3rem;
  }

  .services-closing {
    align-items: flex-start;
  }

  .process-policy,
  .contact-meta {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

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

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

  .contact-title {
    font-size: clamp(3rem, 11vw, 6rem);
  }

  .faq {
    margin-top: 6rem;
  }

  .chapter-hud {
    grid-template-columns: auto 1fr;
  }

  .chapter-hud__title {
    justify-self: end;
  }

  .chapter-hud__coords {
    display: none;
  }

  .fallback-scene,
  #webgl-canvas {
    opacity: 0.62;
  }

  .webgl-ready #webgl-canvas {
    opacity: 0.68;
  }

  .fallback-assembly {
    top: 35%;
    left: 74%;
    width: min(72vw, 30rem);
  }

  .fallback-orbit {
    top: 35%;
    left: 73%;
  }

  .fallback-orbit--outer {
    width: 76vw;
  }

  .fallback-orbit--inner {
    width: 54vw;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .site-footer__brand,
  .site-footer > p,
  .site-footer__channels,
  .site-footer__legal {
    grid-column: 1;
    grid-row: auto;
  }

  .analytics-preferences {
    bottom: calc(6.5rem + var(--safe-bottom));
  }

  .analytics-consent {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .analytics-consent__actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 700px) and (max-width: 820px) and (min-height: 900px) {
  #root:has(.analytics-consent) .chapter--hero .chapter-frame {
    padding-bottom: calc(16.5rem + var(--safe-bottom));
  }
}

@media (max-width: 560px) {
  :root {
    --shell: calc(100% - 1.5rem);
  }

  html {
    scrollbar-width: none;
  }

  ::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .site-header {
    padding-inline: 0.75rem;
  }

  .brand-lockup__type {
    display: none;
  }

  .brand-lockup__mark {
    width: 2.35rem;
    height: 2.35rem;
  }

  .autoplay-control__label {
    display: none;
  }

  .autoplay-control {
    width: 2.75rem;
    padding: 0;
  }

  .mobile-menu {
    padding-inline: 0.85rem;
  }

  .hero-meta {
    gap: 0.75rem;
  }

  .hero-meta__desktop {
    display: none;
  }

  .hero-title {
    font-size: clamp(3.2rem, 17vw, 5.1rem);
    letter-spacing: 0.01em;
  }

  .hero-title__secondary {
    font-size: 0.43em;
    letter-spacing: 0.035em;
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }

  .button {
    min-height: 3.2rem;
  }

  .chapter {
    padding-top: calc(var(--header-h) + 3.4rem);
    padding-bottom: 5.8rem;
  }

  .chapter-title {
    margin-top: 1.35rem;
    font-size: clamp(2.15rem, 10vw, 3.4rem);
  }

  .chapter-summary {
    margin-top: 1.4rem;
    font-size: 0.9rem;
    line-height: 1.7;
  }

  .services-list {
    margin-top: 2.6rem;
  }

  .service-row {
    gap: 0.9rem;
    padding-block: 1.35rem;
  }

  .service-row__identity {
    grid-template-columns: 1.9rem minmax(0, 1fr);
    gap: 0.65rem;
  }

  .service-row__number {
    font-size: 0.46rem;
  }

  .service-row h3 {
    max-width: none;
    font-size: clamp(1.25rem, 6vw, 1.65rem);
  }

  .service-row__description,
  .service-row__capabilities {
    padding-left: 2.55rem;
  }

  .service-row__description {
    font-size: 0.78rem;
    line-height: 1.68;
  }

  .service-row__capabilities li {
    padding: 0.45rem 0.55rem;
    font-size: 0.45rem;
  }

  .services-closing {
    display: grid;
    gap: 0.75rem;
  }

  .services-cta {
    width: 100%;
    justify-content: space-between;
  }

  .chapter-index {
    font-size: 0.5rem;
  }

  .principles-panel,
  .systems-readout {
    margin-left: 0;
  }

  .systems-readout dl > div {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .process-track {
    grid-template-columns: 1fr;
  }

  .process-track li,
  .process-track li:nth-child(3) {
    min-height: 0;
    display: grid;
    grid-template-columns: 1.7rem 1fr;
    gap: 0.8rem;
    border-top: 1px solid var(--hairline-soft);
    border-right: 0;
    padding: 1.2rem 0.25rem;
  }

  .process-track li:first-child {
    border-top: 0;
  }

  .process-track li::before {
    top: -0.28rem;
    left: 0;
  }

  .process-track li > div {
    margin-top: 0;
  }

  .process-track p {
    font-size: 0.75rem;
  }

  .work-placeholder__visual {
    min-height: 14rem;
  }

  .contact-title {
    margin-top: 1.4rem;
    font-size: clamp(2.65rem, 12vw, 4rem);
  }

  .contact-card {
    min-height: 10rem;
    padding: 1.25rem;
  }

  .contact-card strong {
    font-size: 1.75rem;
  }

  .contact-card em {
    max-width: 15rem;
    overflow-wrap: anywhere;
  }

  .faq {
    grid-template-columns: 1fr;
    margin-top: 4.5rem;
    padding-top: 2.5rem;
  }

  .social-follow,
  .direct-contact {
    margin-top: 4.5rem;
    padding-top: 2.5rem;
  }

  .social-card {
    min-height: 9.5rem;
    padding: 1.25rem;
  }

  .faq-question {
    min-height: 4.2rem;
    font-size: 0.8rem;
  }

  .chapter-hud {
    right: 0.75rem;
    bottom: calc(0.75rem + var(--safe-bottom));
    left: 0.75rem;
    font-size: 0.4rem;
  }

  .chapter-controls {
    right: 0.75rem;
    top: calc(var(--header-h) + 0.6rem);
    bottom: auto;
  }

  .chapter-controls button {
    min-width: 3rem;
    min-height: 2.75rem;
  }

  .chapter-hud__number i {
    width: 1.5rem;
  }

  .chapter-hud__title {
    max-width: 11rem;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .intro-modules {
    width: 78vw;
    height: 28vw;
  }

  .intro-lockup {
    gap: 0.7rem;
  }

  .intro-lockup img {
    width: 2.7rem;
    height: 2.7rem;
  }

  .intro-lockup__name {
    font-size: 0.82rem;
  }

  .intro-lockup__studio {
    font-size: 0.42rem;
  }

  .site-footer {
    padding-inline: 0.75rem;
  }

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

  .analytics-consent {
    right: max(0.5rem, var(--safe-right));
    bottom: max(0.5rem, var(--safe-bottom));
    left: max(0.5rem, var(--safe-left));
    width: auto;
    max-height: calc(100svh - var(--header-h) - 1.5rem);
    grid-template-columns: 1fr;
    gap: 0.65rem;
    overflow-y: auto;
    padding: 0.85rem;
  }

  .analytics-consent__signal {
    display: none;
  }

  .analytics-consent__content {
    padding-right: 2rem;
  }

  .analytics-consent__content h2 {
    margin-top: 0.45rem;
    font-size: 1.05rem;
  }

  .analytics-consent__content > p:last-of-type {
    margin-top: 0.45rem;
    font-size: 0.72rem;
    line-height: 1.5;
  }

  .analytics-consent__content a {
    margin-top: 0.55rem;
  }

  .analytics-consent__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .analytics-consent__button {
    min-height: 2.75rem;
    padding: 0.6rem 0.5rem;
  }

  .analytics-preferences {
    position: static;
    width: fit-content;
    min-width: 2.9rem;
    margin: 1rem max(0.75rem, var(--safe-right)) calc(1.25rem + var(--safe-bottom)) auto;
    padding: 0 0.8rem;
  }
}

@media (max-width: 560px) and (max-height: 700px) {
  .site-footer > p {
    max-width: calc(100% - 8rem);
  }
}

@media (max-width: 360px) {
  .analytics-consent__actions {
    grid-template-columns: 1fr;
  }
}

@media (pointer: coarse) {
  .button,
  .contact-card,
  .autoplay-control,
  .menu-toggle,
  .mobile-menu nav a,
  .faq-question {
    min-height: 2.75rem;
  }

  .site-footer a {
    display: inline-flex;
    align-items: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding-inline: 0.35rem;
  }

  .contact-card:hover,
  .button:hover {
    transform: none;
  }
}

body[data-quality="medium"] .scene-grain,
body[data-quality="adaptive"] .scene-grain {
  opacity: 0.014;
}

body[data-quality="medium"] .principles-panel,
body[data-quality="medium"] .systems-readout,
body[data-quality="medium"] .work-placeholder,
body[data-quality="adaptive"] .principles-panel,
body[data-quality="adaptive"] .systems-readout,
body[data-quality="adaptive"] .work-placeholder {
  backdrop-filter: blur(6px);
}

body[data-quality="low"] .scene-grain {
  display: none;
}

body[data-quality="low"] .site-header.is-compact,
body[data-quality="low"].menu-open .site-header,
body[data-quality="low"] .principles-panel,
body[data-quality="low"] .systems-readout,
body[data-quality="low"] .work-placeholder {
  backdrop-filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .analytics-consent,
  .analytics-preferences {
    animation: none;
  }

  .analytics-consent__button,
  .analytics-consent__close,
  .analytics-preferences {
    transition-duration: 0.01ms;
  }
}

@media (min-width: 1025px) and (max-height: 800px) {
  .chapter-hud {
    bottom: 0.5rem;
  }
}

@media (max-height: 700px) and (min-width: 821px) {
  .chapter {
    padding-top: calc(var(--header-h) + 2rem);
    padding-bottom: 5rem;
  }

  .hero-title {
    font-size: clamp(3.5rem, 9vw, 8rem);
  }

  .hero-statement {
    margin-top: 1.4rem;
  }

  .hero-actions {
    margin-top: 1.2rem;
  }

  .process-track li > div {
    margin-top: 3rem;
  }

  .process-track li {
    min-height: 15rem;
  }
}
