:root {
  color-scheme: light;
  --ink: #f1f2f6;
  --muted: #d1d5db;
  --background: #596273;
  --header-background: #2f3542;
  --surface: #d8f7f3;
  --line: rgba(255, 255, 255, .22);
  --accent: #287b74;
  --serif: "Noto Serif Georgian", serif;
  font-family: "Noto Serif Georgian", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--background);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.site-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  height: 88px;
  padding: 0 clamp(24px, 6vw, 88px);
  border-bottom: 1px solid var(--line);
  background: var(--header-background);
  color: var(--ink);
}

.brand-title-group {
  display: contents;
}

.brand {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-self: start;
  justify-content: center;
  border-radius: 50%;
  background: #a8f6f0;
}

.brand img {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.site-title {
  justify-self: center;
  font-size: clamp(19px, 2.7vw, 28px);
  font-weight: 700;
  letter-spacing: .12em;
  text-align: center;
}

.site-title:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.support-email {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.support-email-footer {
  display: none;
}

.support-email a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}

.support-email a:hover,
.support-email a:focus-visible {
  color: #a8f6f0;
}

.support-email a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(168, 246, 240, .3);
  border-radius: 999px;
  background: rgba(168, 246, 240, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 3px 10px rgba(0, 0, 0, .15);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease, transform .2s ease;
}

.home-link:hover,
.home-link:focus-visible {
  border-color: rgba(168, 246, 240, .82);
  background: rgba(168, 246, 240, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 5px 14px rgba(0, 0, 0, .22);
  transform: translateY(-1px);
}

.home-link:focus-visible {
  outline: 2px solid #a8f6f0;
  outline-offset: 3px;
}

.home-link:active {
  transform: translateY(0) scale(.98);
}

.map-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: min(100%, 1120px);
}

.home-nav {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.home-nav-mobile {
  display: none;
}

.map-title-row .map-title {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  max-width: 100%;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 88px);
  padding: clamp(20px, 3vw, 40px) 24px;
}

.index-page main {
  justify-content: flex-start;
  padding-top: 12px;
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  background: var(--header-background);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.footer-social h2 {
  margin: -6px 0 6px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
}

.footer-social ul {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 4px 24px;
  width: max-content;
  margin: 0;
  margin-inline: auto;
  padding: 0;
  list-style: none;
  text-align: left;
}

.footer-social li > a,
.footer-social li > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
}

.footer-social li img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.footer-social a {
  transition: color .2s ease;
}

.footer-social a:hover,
.footer-social a:focus-visible {
  color: #a8f6f0;
}

.footer-copyright {
  margin: 8px 0 0;
}

.map-title {
  width: min(100%, 1120px);
  margin: 0 0 6px;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(14px, 3.5vw, 42px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  text-align: center;
}

.index-page .map-title {
  color: inherit;
  font-family: inherit;
}

.map-title span {
  background: linear-gradient(90deg, #00ff29 0%, #b8ed00 38%, #ff9b00 68%, #ff2418 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.map-description {
  width: min(100%, 780px);
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}

.carousel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 7vw, 96px);
  width: min(100%, 1120px);
  min-height: 420px;
}

.carousel-indicators {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: -18px 0 18px;
}

.carousel-indicator {
  display: grid;
  width: 16px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  place-items: center;
}

.indicator-track {
  position: relative;
  display: block;
  width: 8px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(241, 242, 246, .45);
  transition: width .2s ease;
}

.carousel-indicator.is-active {
  width: 36px;
}

.carousel-indicator.is-active .indicator-track {
  width: 28px;
}

.indicator-progress {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #a8f6f0;
  transform: scaleX(0);
  transform-origin: left;
}

.carousel-indicator.is-active .indicator-progress {
  animation: carousel-progress 10s linear forwards;
}

.carousel-indicators.is-paused .carousel-indicator.is-active .indicator-progress {
  animation-play-state: paused;
  background: #ff8a8a;
}

.carousel-indicator:focus-visible {
  border-radius: 999px;
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@keyframes carousel-progress {
  to { transform: scaleX(1); }
}

.section-title {
  width: min(100%, 1120px);
  margin: 0;
  font-size: clamp(24px, 3.2vw, 32px);
  text-align: center;
}

.beta-title { margin-top: 8px; }

.beta-carousel {
  width: min(100%, 1120px);
  margin-top: 4px;
}

.beta-person {
  text-align: center;
}

.beta-character-viewer {
  display: block;
  width: min(100%, 240px);
  height: auto;
  margin: 0 auto;
}

.beta-person h4 {
  margin: 0;
  font-size: 16px;
}

.map-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 18px auto 0;
  padding: 13px 24px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  background: linear-gradient(145deg, #758092, #697486);
  box-shadow: 0 8px 20px rgba(30, 38, 52, .2), inset 0 1px 0 rgba(255, 255, 255, .18);
  color: var(--ink);
  font: inherit;
  text-align: center;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.maps-title {
  margin-top: 22px;
}

.map-link-button:hover,
.map-link-button:focus-visible {
  border-color: rgba(255, 255, 255, .58);
  background: linear-gradient(145deg, #808b9d, #737f91);
  box-shadow: 0 11px 24px rgba(30, 38, 52, .25), 0 0 0 3px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .22);
  transform: translateY(-2px);
}

.carousel-visual {
  position: relative;
  display: grid;
  min-height: 420px;
  overflow: hidden;
  place-items: center;
}

.character-viewer {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: min(100%, 240px);
  height: auto;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) translateX(110%);
  transition: transform .6s cubic-bezier(.22, .68, 0, 1), opacity .6s ease;
}

.character-viewer.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.character-viewer.exit-left {
  opacity: 0;
  transform: translate(-50%, -50%) translateX(-110%);
}

.character-viewer.exit-right {
  opacity: 0;
  transform: translate(-50%, -50%) translateX(110%);
}

.character-viewer.enter-left {
  opacity: 0;
  transform: translate(-50%, -50%) translateX(-110%);
}

.character-viewer.enter-right {
  opacity: 0;
  transform: translate(-50%, -50%) translateX(110%);
}

.carousel-content {
  position: relative;
  min-height: 420px;
}

.carousel-slides {
  position: absolute;
  top: 55px;
  right: 0;
  left: 0;
  display: grid;
  overflow: hidden;
}

.carousel-slide {
  grid-area: 1 / 1;
  transition: transform .6s cubic-bezier(.22, .68, 0, 1), opacity .6s ease;
}

.carousel-slide[hidden] { display: none; }

.carousel-slide.exit-right {
  opacity: 0;
  transform: translateX(110%);
}

.carousel-slide.exit-left {
  opacity: 0;
  transform: translateX(-110%);
}

.carousel-slide.enter-left {
  opacity: 0;
  transform: translateX(-110%);
}

.carousel-slide.enter-right {
  opacity: 0;
  transform: translateX(110%);
}

.carousel-slide h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: .98;
}

.carousel-slide p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.carousel-slide p.character-alias {
  margin: -8px 0 12px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

  .character-viewer,
  .carousel-slide {
    transition-duration: .6s !important;
  }
}

@media (max-width: 700px) {
  .index-page .carousel-content { min-height: 112px; }
  body:not(.index-page) .carousel-content { min-height: 184px; }

  .site-header {
    align-content: center;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: 44px auto;
    row-gap: 2px;
    height: auto;
    min-height: 88px;
    padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
    padding-block: 8px;
  }

  .brand-title-group {
    display: contents;
  }

  .support-email {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    font-size: 12px;
    white-space: normal;
    text-align: center;
  }

  .site-header .support-email {
    display: none;
  }

  .site-footer .support-email-footer {
    display: block;
    font-size: 12px;
    white-space: normal;
    text-align: center;
  }

  .shattered-header {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .home-nav-mobile {
    display: block;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .home-nav-desktop {
    display: none;
  }

  .home-nav {
    padding: 0;
  }

  .map-title-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .map-title-row .map-title {
    grid-column: 1;
    width: 100%;
  }

  .brand,
  .brand img {
    width: 44px;
    height: 44px;
  }

  .site-title {
    font-size: clamp(15px, 4.8vw, 21px);
    letter-spacing: .1em;
    white-space: nowrap;
  }

  main {
    justify-content: flex-start;
    min-height: calc(100vh - 72px);
    min-height: calc(100svh - 72px);
    padding: 24px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
  }

  .map-title {
    margin-bottom: 6px;
    font-size: clamp(12px, 3.5vw, 24px);
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .index-page .map-title {
    font-size: 42px;
  }

  body:not(.index-page) .map-title {
    font-size: 42px;
  }

  .map-description {
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.65;
  }

  .section-title { font-size: 26px; }

  .carousel {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
  }

  .carousel-visual { min-height: 230px; }

  .carousel-content {
    min-height: 250px;
    padding-inline: 4px;
    text-align: center;
  }

  .carousel-slides {
    top: 0;
    overflow: hidden;
  }

  .character-viewer,
  .beta-character-viewer {
    width: min(130px, 100%);
  }

  .carousel-slide h1 {
    margin: 0 0 14px;
    font-size: clamp(30px, 8vw, 40px);
    overflow-wrap: anywhere;
  }

  .carousel-slide p {
    max-width: 520px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.65;
  }

  .carousel-slide p.character-alias {
    margin: -6px auto 12px;
    font-size: 17px;
  }

  .carousel-indicators {
    gap: 4px;
    margin: 8px 0 18px;
  }

  .carousel-indicator,
  .carousel-indicator.is-active {
    width: 44px;
    height: 44px;
  }

  .maps-title,
  .beta-title { margin-top: 18px; }

  .map-link-button {
    width: min(100%, 340px);
    min-height: 48px;
    margin-top: 12px;
    padding: 12px 20px;
  }

  .site-footer {
    padding: 20px max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .footer-social ul { gap: 6px 20px; }

  .footer-social li > a,
  .footer-social li > span { min-height: 44px; }
}

@media (max-width: 380px) {
  .site-title {
    font-size: 15px;
    letter-spacing: .07em;
  }

  .site-footer .support-email-footer { font-size: 11px; }

  .footer-social ul { column-gap: 14px; }
}

@media (max-width: 350px) {
  body:not(.index-page) .carousel-content { min-height: 220px; }

  .shattered-header {
    grid-template-rows: 44px 44px auto;
  }

  .shattered-header .home-nav-mobile {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .shattered-header .support-email {
    grid-row: 3;
  }

  .shattered-header .site-title {
    font-size: 13px;
    letter-spacing: .04em;
  }

  .shattered-header .home-link { padding-inline: 8px; }
}

@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  main {
    justify-content: flex-start;
    min-height: calc(100vh - 72px);
    min-height: calc(100svh - 72px);
    padding-block: 16px 24px;
  }

  .carousel {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    min-height: 260px;
    gap: 24px;
  }

  .carousel-visual,
  .carousel-content { min-height: 260px; }

  .carousel-slides { top: 36px; }

  .character-viewer,
  .beta-character-viewer { width: min(170px, 100%); }

  .carousel-slide h1 { font-size: clamp(28px, 5vw, 40px); }

  .carousel-indicator,
  .carousel-indicator.is-active {
    width: 36px;
    height: 36px;
  }
}
