@font-face {
  font-family: 'Kdam Thmor Pro';
  src: url('/fonts/KdamThmorPro-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --background: #2F678A;
  --primary: #489ACC;
  --active: #FEAE00;
  --text: #FFFFFF;
  --sheet: #FFFFFF;
  --text-on-sheet: #000000;
  --display: 'Kdam Thmor Pro', 'Trebuchet MS', sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --screen-left: 23.93%;
  --screen-top: 9.07%;
  --screen-width: 52.26%;
  --screen-height: 82.59%;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: #0B2A44 url('/images/background.webp') center / cover no-repeat fixed;
  color: var(--text);
  font-family: var(--display);
  line-height: 1.3;
}

a {
  color: var(--text);
}

.landing {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto;
}

.stage {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 16px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 24px;
}

.copy {
  min-width: 0;
}

.copy h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(30px, 4.4vw, 68px);
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.tagline {
  margin: 16px 0 0;
  color: var(--active);
  font-size: clamp(22px, 2.7vw, 42px);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.showcase {
  position: relative;
  width: 100%;
  min-width: 0;
  container-type: inline-size;
}

.carousel {
  --w: 30cqw;
  --phone-height: calc(var(--w) * 1080 / 798);
  --wide: calc(1080 / 798 * 1400 / 932);
  --arrow-room: calc(44px + 1cqw + 12px);
  --near: 0.8;
  --far: 0.64;
  --near-x: 0.74;
  --far-x: 1.332;
  --hidden-x: 1.75;
  --caption: 4.4em;
  --pad: 24px;
  position: relative;
  width: 100%;
  height: calc(var(--phone-height) + var(--caption) + 2 * var(--pad) + 12px);
  overflow: hidden;
}

.slide {
  position: absolute;
  left: 50%;
  top: var(--pad);
  width: var(--w);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: translateX(calc(-50% + var(--x) * var(--w))) scale(var(--s));
  transform-origin: 50% calc(var(--phone-height) / 2);
  transition: transform 0.6s ease, opacity 0.6s ease;
  z-index: var(--z);
}

.slide.wide {
  transition: transform 0.6s ease, opacity 0.6s ease, width 0.6s ease;
}

.slide[data-tier="active"] {
  --x: 0;
  --s: 1;
  --z: 5;
}

.slide.wide[data-tier="active"] {
  width: min(calc(var(--w) * var(--wide)), calc(100cqw - 2 * var(--arrow-room)));
}

.carousel:has(.slide.wide[data-tier="active"]) {
  --near-x: 1.257;
}

.carousel:has(.slide.wide[data-tier="active"]) .slide[data-tier="far-left"],
.carousel:has(.slide.wide[data-tier="active"]) .slide[data-tier="far-right"] {
  opacity: 0;
}

.slide[data-tier="near-left"] {
  --x: calc(-1 * var(--near-x));
  --s: var(--near);
  --z: 4;
}

.slide[data-tier="near-right"] {
  --x: var(--near-x);
  --s: var(--near);
  --z: 4;
}

.slide[data-tier="far-left"] {
  --x: calc(-1 * var(--far-x));
  --s: var(--far);
  --z: 3;
}

.slide[data-tier="far-right"] {
  --x: var(--far-x);
  --s: var(--far);
  --z: 3;
}

.slide[data-tier="hidden-left"],
.slide[data-tier="hidden-right"] {
  --s: 0.5;
  --z: 1;
  opacity: 0;
  pointer-events: none;
}

.slide[data-tier="hidden-left"] {
  --x: calc(-1 * var(--hidden-x));
}

.slide[data-tier="hidden-right"] {
  --x: var(--hidden-x);
}

.slide figcaption {
  position: absolute;
  top: calc(var(--phone-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(var(--w) * 2.3), 100cqw);
  text-align: center;
  font-size: clamp(15px, 2.6cqw, 20px);
  line-height: 1.3;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  transition: opacity 0.6s ease;
}

.slide:not([data-tier="active"]) figcaption {
  opacity: 0;
}

.phone {
  position: relative;
  width: 100%;
  aspect-ratio: 798 / 1080;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
}

.phone .screen {
  position: absolute;
  left: var(--screen-left);
  top: var(--screen-top);
  width: var(--screen-width);
  height: var(--screen-height);
  object-fit: cover;
  border-radius: 9% / 4.2%;
}

.phone .frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.monitor {
  width: 100%;
  height: var(--phone-height);
  display: flex;
  align-items: center;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
}

.monitor .screen {
  width: 100%;
  height: auto;
}

.arrows {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(24px + 30cqw * 1080 / 798 / 2);
  display: flex;
  justify-content: space-between;
  padding: 0 1%;
  pointer-events: none;
  transform: translateY(-50%);
  z-index: 6;
}

.arrow {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--background);
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.arrow svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.arrow:hover,
.arrow:focus-visible {
  background: var(--active);
  color: var(--text);
  outline: none;
}

.site-footer {
  padding: 12px 16px 18px;
  text-align: center;
  font-size: 13px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.site-footer p {
  margin: 0;
}

.languages {
  margin: 8px 0 0;
}

.site-footer .languages {
  margin: 8px 0 0;
}

.languages [aria-current] {
  font-weight: 700;
}

.legal-note {
  margin: 0;
  padding: 8px 16px 0;
  font-size: 13px;
}

.dialog {
  display: none;
}

.dialog:target {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 10;
}

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.sheet {
  position: relative;
  width: min(46rem, calc(100% - 32px));
  max-height: 90vh;
  margin: 5vh auto;
  overflow: auto;
  background: var(--sheet);
  color: var(--text-on-sheet);
  border-radius: 12px;
  padding: 0 24px 24px;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}

.sheet header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0 10px;
  background: var(--sheet);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.sheet h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
}

.close {
  color: var(--background);
  font-family: var(--display);
  font-size: 18px;
  text-decoration: none;
}

.legal h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
  margin: 28px 0 6px;
}

.legal h4 {
  font-size: 16px;
  margin: 18px 0 4px;
}

.legal p,
.legal li {
  overflow-wrap: anywhere;
}

.legal ul {
  padding-left: 22px;
  margin: 4px 0 12px;
}

.legal hr {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  margin: 28px 0;
}

.legal-page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.legal-page h1 {
  font-weight: 400;
  font-size: 32px;
  margin: 0 0 16px;
}

.legal-page h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
  margin: 28px 0 6px;
}

.legal-page p,
.legal-page li {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.legal-page ul,
.legal-page ol {
  padding-left: 22px;
  margin: 4px 0 12px;
}

.legal-page .back {
  margin-top: 32px;
}

.notfound {
  min-height: 100svh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 16px;
}

.notfound h1 {
  font-weight: 400;
  font-size: 40px;
  margin: 0 0 12px;
}

@media (max-width: 820px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
    padding-top: 24px;
  }

  .copy br {
    display: none;
  }

  .carousel,
  .carousel:has(.slide.wide[data-tier="active"]) {
    --w: 44cqw;
    --near-x: 0.74;
    --caption: 5.2em;
  }

  .slide[data-tier="far-left"],
  .slide[data-tier="far-right"] {
    opacity: 0;
  }

  .slide figcaption {
    width: calc(100cqw - 8px);
  }

  .arrows {
    top: calc(24px + 44cqw * 1080 / 798 / 2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide,
  .slide.wide,
  .slide figcaption {
    transition: none;
  }
}
