/* Phone-first refinements shared by the home, work, and project pages. */
@media (max-width: 600px) {
  :root {
    --shell: calc(100% - 24px);
  }

  html {
    overflow-x: clip;
    scroll-padding-top: 82px;
  }

  body.home-page {
    width: 100%;
    overflow-x: clip;
  }

  body.home-page::before {
    background:
      linear-gradient(180deg, rgba(8, 8, 7, 0.76), rgba(8, 8, 7, 0.9)),
      linear-gradient(90deg, rgba(8, 8, 7, 0.18), rgba(8, 8, 7, 0.5)),
      url("/assets/bg.jpeg") 50% center / cover no-repeat;
  }

  body.home-page {
    --building-scale: 1.16;
  }

  .loader__mark {
    width: min(300px, 88vw);
    justify-items: center;
  }

  .loader__brand {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .loader__brand .loader__logo {
    width: min(82px, 24vw);
    flex: 0 0 auto;
  }

  .loader__wordmark {
    width: min(124px, 34vw);
    flex: 0 0 auto;
  }

  .loader__line {
    width: min(230px, 72vw);
  }

  .topbar,
  .topbar.is-scrolled {
    top: 8px;
    width: calc(100vw - 16px);
    min-height: 62px;
    padding: 6px 8px;
    border-radius: 2px;
    background: rgba(8, 8, 7, 0.9);
    backdrop-filter: blur(18px);
  }

  .home-page .topbar,
  .home-page .topbar.is-scrolled {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .home-page .topbar > .brand {
    grid-column: 2;
    justify-self: center;
  }

  .home-page .topbar > .topbar__actions {
    grid-column: 3;
    justify-self: end;
  }

  .brand {
    max-width: 128px;
    gap: 6px;
  }

  .brand__icon {
    width: 36px;
    height: 44px;
  }

  .brand__wordmark {
    width: 76px;
  }

  .topbar__actions {
    gap: 7px;
  }

  .language button {
    min-width: 31px;
    min-height: 34px;
  }

  .menu-toggle {
    width: 38px;
    height: 38px;
  }

  .menu-panel {
    padding: 104px 18px max(24px, env(safe-area-inset-bottom));
  }

  .menu-panel nav a {
    min-height: 66px;
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 11px 0;
  }

  .menu-panel nav strong {
    font-size: clamp(2.05rem, 10.5vw, 3.3rem);
    line-height: 0.88;
  }

  .menu-panel > p {
    max-width: 260px;
    line-height: 1.5;
  }

  .hero,
  .hero__content {
    min-height: max(520px, 86svh);
  }

  .hero__content {
    left: 0;
    width: 100%;
    max-width: 100vw;
    align-items: flex-start;
    justify-content: center;
    margin: 0;
    padding: 86px max(20px, env(safe-area-inset-right)) 42px
      max(20px, env(safe-area-inset-left));
  }

  .hero__media video {
    object-position: 56% center;
  }

  .hero__object {
    right: -18vw;
    bottom: -7vw;
    width: min(88vw, 430px);
    opacity: 0.42;
  }

  .hero__veil {
    background:
      linear-gradient(90deg, rgba(5, 5, 4, 0.82), rgba(5, 5, 4, 0.25)),
      linear-gradient(180deg, rgba(5, 5, 4, 0.22), rgba(5, 5, 4, 0.86));
  }

  .hero .kicker {
    width: 100%;
    max-width: 280px;
    font-size: 0.63rem;
    line-height: 1.5;
  }

  .hero h1 {
    max-width: 100%;
    margin-top: 18px;
    font-size: clamp(3.35rem, 16.5vw, 4.9rem);
    letter-spacing: -0.035em;
    line-height: 0.8;
  }

  .hero h1.hero-title-art {
    width: 100%;
    margin-top: 12px;
  }

  .hero-title-art img {
    max-height: 38svh;
  }

  .hero__bottom {
    width: 100%;
    margin-top: 18px;
  }

  .hero__bottom > p {
    width: 100%;
    max-width: 440px;
    font-size: 0.88rem;
    line-height: 1.55;
  }

  .hero__index {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .manifesto-strip__group {
    gap: 14px;
    padding: 10px 8px;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }

  .disciplines,
  .process {
    padding-block: 76px;
  }

  .section-heading {
    gap: 18px;
    padding-bottom: 28px;
  }

  .section-heading h2,
  .process__intro h2 {
    font-size: clamp(2.65rem, 13vw, 3.7rem);
    line-height: 0.88;
  }

  .discipline-list {
    margin-top: 24px;
  }

  .discipline {
    scroll-margin-top: 82px;
  }

  .discipline::after {
    background: linear-gradient(90deg, rgba(8, 8, 7, 0.93), rgba(8, 8, 7, 0.5));
  }

  .discipline button {
    min-height: 82px;
    grid-template-columns: 30px minmax(0, 1fr) 22px;
    gap: 6px;
    padding: 9px 0;
  }

  .discipline button strong {
    font-size: clamp(2.1rem, 10.8vw, 3rem);
    line-height: 0.84;
    overflow-wrap: anywhere;
  }

  .discipline__body {
    gap: 15px;
    margin-left: 30px;
    padding-right: 8px;
  }

  .discipline.is-open .discipline__body {
    max-height: 390px;
    padding-bottom: 28px;
  }

  .discipline__body p {
    font-size: 0.86rem;
    line-height: 1.55;
  }

  .discipline__body a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-self: start;
  }

  .process {
    gap: 30px;
  }

  .process__intro .kicker {
    margin-top: 24px;
  }

  .process__steps li {
    min-height: auto;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    padding: 25px 0;
  }

  .process__steps strong {
    font-size: 1.85rem;
  }

  .process__steps p {
    margin-top: 9px;
    font-size: 0.83rem;
    line-height: 1.55;
  }

  .section {
    width: calc(100% - 20px);
    gap: 24px;
    padding: 72px 0 28px;
    scroll-margin-top: 82px;
  }

  .section__copy {
    padding-left: 16px;
  }

  h2 {
    font-size: clamp(2.35rem, 11.5vw, 3rem);
    line-height: 0.94;
  }

  .section__copy > p:not(.eyebrow) {
    font-size: 0.9rem;
    line-height: 1.58;
  }

  .button {
    width: 100%;
    min-height: 50px;
  }

  .about-panel,
  .contact-card {
    padding: 20px;
  }

  .about-panel {
    min-height: 0;
    gap: 42px;
  }

  .about-panel__intro strong {
    font-size: 1.8rem;
  }

  .about-panel__intro p {
    margin-top: 17px;
    font-size: 0.88rem;
    line-height: 1.58;
  }

  .about-panel__statements {
    margin-top: 18px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .stats div {
    padding-right: 0;
  }

  .stats div + div {
    margin-top: 0;
  }

  .contact-card {
    gap: 20px;
  }

  .contact-card__details {
    gap: 14px;
    padding-bottom: 20px;
  }

  .contact-card__details a,
  .contact-card__details span {
    overflow-wrap: anywhere;
  }

  .contact-form {
    gap: 13px;
  }

  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    min-height: 50px;
    padding: 12px;
    font-size: 16px;
  }

  .collab-contact {
    padding-top: 112px;
  }

  .collab-contact h1 {
    font-size: clamp(2.25rem, 10.5vw, 3.25rem);
    line-height: 0.92;
  }

  .collab-contact .section__copy {
    padding-left: 18px;
  }

  .site-footer {
    width: calc(100% - 16px);
    margin-top: 26px;
    margin-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .site-footer__panel {
    gap: 20px;
    padding: 22px 16px;
  }

  .site-footer__socials {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .site-footer__social {
    min-height: 82px;
  }

  .site-footer__social-icon {
    width: 34px;
    height: 34px;
  }

  .site-footer__bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding-top: 17px;
  }

  .site-footer__collab-cta {
    width: 100%;
    margin-top: 10px;
    margin-left: 0;
    padding-inline: 14px;
  }

  /* Work and individual project headers retain a useful back action on phones. */
  .topbar--project {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .topbar--project .brand {
    width: 40px;
    max-width: 40px;
  }

  .topbar--project .brand__wordmark {
    display: none;
  }

  .topbar--project .project-back {
    display: inline-flex;
    min-width: 0;
    justify-self: center;
    gap: 5px;
  }

  .topbar--project .project-back strong {
    overflow: hidden;
    max-width: 112px;
    font-size: 0.56rem;
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .work-main {
    padding-top: 78px;
  }

  .work-hero {
    min-height: min(680px, calc(100svh - 78px));
    padding-block: 58px 28px;
  }

  .work-hero h1 {
    margin-top: 12px;
    font-size: clamp(3.15rem, 15vw, 4.8rem);
    line-height: 0.78;
    overflow-wrap: anywhere;
  }

  .work-hero__intro {
    margin-top: 25px;
    font-size: 0.9rem;
    line-height: 1.58;
  }

  .work-hero__footer {
    gap: 18px;
    margin-top: 34px;
  }

  .work-tabs {
    gap: 17px;
    padding: 0 0 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .work-tabs::-webkit-scrollbar {
    display: none;
  }

  .work-tabs a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    scroll-snap-align: start;
  }

  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 38px 10px;
    padding-block: 62px;
  }

  .work-card figure {
    width: 100%;
    aspect-ratio: 16 / 10;
  }

  .work-card__meta {
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 9px 0;
    font-size: 0.5rem;
    letter-spacing: 0.08em;
  }

  .work-card__content {
    gap: 8px;
    padding-top: 12px;
  }

  .work-card__type {
    font-size: 0.54rem;
    letter-spacing: 0.1em;
  }

  .work-card h2 {
    font-size: clamp(1.35rem, 6.2vw, 1.85rem);
    line-height: 0.92;
  }

  .work-card__description {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.72rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .work-card__action {
    min-height: 36px;
    gap: 6px;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
  }

  .work-contact {
    padding-block: 68px;
  }

  .work-contact > a {
    align-items: flex-start;
    gap: 12px;
    font-size: clamp(2.6rem, 13vw, 4rem);
  }

  .work-page .footer {
    width: calc(100% - 16px);
    gap: 18px;
    margin-bottom: 8px;
  }

  .work-page .footer nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-hero__content {
    right: 14px;
    bottom: 8vh;
    left: 14px;
    gap: 18px;
  }

  .project-hero__content h1 {
    font-size: clamp(3.4rem, 16vw, 5rem);
    line-height: 0.78;
    overflow-wrap: anywhere;
  }

  .project-hero__meta {
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 18px;
  }

  .project-hero__description {
    max-width: 100%;
    padding: 13px 14px;
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .project-hero__counter {
    right: 14px;
    bottom: 14px;
  }

  .project-intro {
    gap: 22px;
    padding-block: 72px;
  }

  .project-intro h2 {
    font-size: clamp(2.55rem, 13vw, 3.6rem);
  }

  .project-intro > div > p {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .project-intro dl {
    gap: 12px;
    margin-top: 34px;
  }

  .project-gallery {
    padding-top: 12px;
    padding-bottom: 36px;
  }

  .project-gallery__track figure,
  .project-gallery__track figure:nth-child(n) {
    width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .project-gallery__controls {
    min-height: 62px;
  }

  .project-gallery__button {
    min-height: 48px;
    gap: 7px;
    font-size: 0.6rem;
    letter-spacing: 0.09em;
  }

  .project-gallery__thumbs {
    gap: 7px;
    padding-top: 8px;
  }

  .project-gallery__thumbs button {
    flex-basis: 96px;
  }

  .project-description {
    padding-bottom: 72px;
  }

  .project-description__body {
    padding-top: 24px;
  }

  .project-description__body p {
    font-size: 0.9rem;
    line-height: 1.65;
  }

}

@media (max-width: 380px) {
  .topbar--project .project-back strong {
    max-width: 86px;
  }

  .hero h1 {
    font-size: clamp(3rem, 15.8vw, 3.75rem);
  }

  .discipline button strong {
    font-size: 2rem;
  }

  .work-hero h1 {
    font-size: 3rem;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .hero,
  .hero__content {
    min-height: 100svh;
  }

  .hero__content {
    padding-top: 90px;
    padding-bottom: 34px;
  }

  .hero h1 {
    font-size: clamp(3rem, 11vw, 4.5rem);
  }

  .hero__bottom {
    margin-top: 16px;
  }

  .menu-panel {
    padding-top: 86px;
  }

  .menu-panel nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }
}
