/*
 * Responsive tiers (desktop first):
 * default       >= 1536px  wide desktop
 * desktop       <= 1535px
 * laptop        <= 1279px
 * tablet        <= 1023px
 * tablet/mobile <=  767px
 * mobile        <=  639px
 * small mobile  <=  479px
 */

/* Desktop and laptop. */
@media (min-width: 1536px) {
  .intro__orb {
    bottom: 12vh;
  }
}

@media (max-width: 1535px) {
  .scene__island-group {
    bottom: -10em;
  }
}

/* Laptop and small desktop. */
@media (max-width: 1279px) {
  .site-header {
    padding-inline: 3.2rem;
  }

  .site-nav {
    gap: 3.2em;
  }

  .scene__title {
    gap: 5em;
  }
}

/* Tablet landscape and below. */
@media (max-width: 1023px) {
  :root {
    --header-height: 7.2rem;
  }

  .site-header {
    overflow: visible;
    padding-inline: 2.4rem;
  }

  .brand img {
    width: 15rem;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.1rem);
    right: 1.6rem;
    display: grid;
    min-width: 20rem;
    padding: 1rem 2rem;
    gap: 0;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.94);
    border-radius: 0 0 0.8rem 0.8rem;
    box-shadow: 0 1rem 3rem rgba(20, 65, 98, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-1rem);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .site-nav a {
    padding: 1.2rem 0;
  }

  .scene {
    --content-left: 3%;
    --content-right: 47%;
    font-size: 1vw;
  }

  .scene--left {
    --content-left: 47%;
    --content-right: 3%;
  }

  .scene__title {
    top: calc(var(--header-height) + 10vh);
    gap: 3em;
  }

  #hapacol .scene__title {
    right: 6%;
    left: 6%;
  }

  .scene__island-group,
  .scene--right .scene__island-group {
    bottom: 0;
    width: 92em;
  }

  .scene__character {
    bottom: -2em;
    width: 54em;
  }

  .scene__detail {
    top: calc(var(--header-height) + 18vh);
  }

  .scene__copy {
    font-size: 1.6em;
  }
}

/* Keep the proportional desktop menu when browser zoom narrows the CSS viewport. */
@media (min-width: 768px) and (max-width: 1023px) and (hover: hover) and (pointer: fine) {
  :root {
    --header-height: 5vw;
  }

  .site-header {
    overflow: clip;
    padding-inline: 3.2em;
  }

  .brand img {
    width: 14.4em;
  }

  .menu-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    display: flex;
    min-width: 0;
    padding: 0;
    gap: 3.2em;
    color: inherit;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .site-nav a {
    padding: 0.8em 0;
  }
}

/* Tablet portrait and large mobile. */
@media (max-width: 767px) {
  .intro {
    --intro-tagline-width: 31em;
    --intro-orb-width: 41em;
    height: 180svh;
    font-size: 1rem;
  }

  .intro__background {
    object-position: 58% bottom;
  }

  .intro__tower {
    bottom: 3vh;
    left: -12em;
    width: 48em;
    opacity: 0.7;
  }

  .intro__tagline {
    top: calc(var(--header-height) + 7vh);
    left: 50%;
    width: var(--intro-tagline-width);
    height: 21.1em;
    transform: translateX(-50%);
  }

  .intro__orb {
    top: calc(var(--header-height) + 39vh);
    right: -22%;
    bottom: auto;
    width: var(--intro-orb-width);
  }

  .scene {
    --content-left: 2%;
    --content-right: 29%;
    font-size: 1.5vw;
  }

  .scene--left {
    --content-left: 29%;
    --content-right: 2%;
  }

  .scene__transition-cloud {
    left: -10%;
    width: 120%;
    transform: translateY(-44%);
  }

  .scene__background {
    object-position: center top;
  }

  .scene__title {
    top: calc(var(--header-height) + 8vh);
    right: 4%;
    left: 4%;
    gap: 1.8em;
  }

  #hapacol .scene__title {
    right: 4%;
    left: 4%;
  }

  .scene__title-part {
    height: 7em;
  }

  .scene__island-group,
  .scene--right .scene__island-group {
    bottom: 6vh;
    width: 65em;
  }

  #hapacol .scene__island-group {
    bottom: 6vh;
    width: 56em;
  }

  .scene__character {
    bottom: -2em;
    width: 46em;
    max-width: 78%;
  }

  .scene--left .scene__character {
    left: -4em;
  }

  .scene--right .scene__character {
    right: -4em;
  }

  .scene__detail {
    top: calc(var(--header-height) + 19vh);
    padding: 1.4em;
    background: rgba(255, 255, 255, 0.54);
    border-radius: 1.2em;
    backdrop-filter: blur(0.8em);
  }

  .scene__logo {
    max-width: 17em;
    max-height: 6em;
    margin-bottom: 1em;
  }

  .scene__copy {
    display: -webkit-box;
    overflow: hidden;
    font-size: 1.35em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
  }

  .scene__scroll-hint span {
    display: none;
  }
}

/* Standard mobile. */
@media (max-width: 639px) {
  .site-header {
    padding-inline: 1.6rem;
  }

  .site-nav {
    right: 1.2rem;
    left: 1.2rem;
    min-width: 0;
  }

  .intro {
    --intro-tagline-width: 29em;
    --intro-orb-width: 39em;
  }

  .intro__tower {
    left: -14em;
    width: 46em;
  }

  .scene__title {
    gap: 1.5em;
  }
}

/* Small mobile. */
@media (max-width: 479px) {
  .intro {
    --intro-tagline-width: 27em;
    --intro-orb-width: 36em;
  }

  .intro__tower {
    width: 42em;
  }

  .intro__orb {
    right: -26%;
  }

  .scene__title {
    gap: 1.2em;
  }

  .scene__detail {
    padding: 1.2em;
  }

  .scene__copy {
    font-size: 1.25em;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scene__character {
    opacity: 1;
  }

  .scene__island {
    opacity: 0;
  }

  .scene__logo,
  .scene__copy {
    opacity: 1;
  }

  .scene__title {
    top: calc(var(--header-height) + 4vh);
    right: var(--content-right);
    left: var(--content-left);
    gap: 1.6em;
  }
}
