@import "./tokens.css";

:root {
  --wyma-paper-bg: var(--neutral-200);
  --wyma-ink: var(--neutral-900);
  --wyma-content-width: 700px;
  --wyma-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --radius-full: 9999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--wyma-paper-bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

body.wyma-body {
  min-height: 100%;
  background: var(--wyma-paper-bg);
  color: var(--wyma-ink);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
}

.wyma-page {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin: 0;
  min-height: 100vh;
  padding: 100px max(20px, calc((100% - var(--wyma-content-width)) / 2));
  width: 100%;
}

.wyma-title {
  color: var(--wyma-ink);
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 58px;
  margin: 0;
  text-wrap: balance;
  width: fit-content;
}

.wyma-content {
  align-items: flex-start;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.wyma-copy {
  align-self: stretch;
  color: var(--wyma-ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 30px;
  margin: 0;
  white-space: pre-wrap;
}

.wyma-asset-button {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  overflow: hidden;
  padding: 0;
  transition: transform 180ms var(--wyma-ease);
}

.wyma-asset-button:focus-visible {
  outline: 2px solid rgb(from var(--neutral-900) r g b / 0.45);
  outline-offset: 5px;
}

.wyma-asset-button:active {
  transform: scale(0.96);
}

@media (hover: hover) and (pointer: fine) {
  .wyma-asset-button:hover {
    transform: scale(1.015);
  }
}

.wyma-asset-button img {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.wyma-wide-image {
  align-self: stretch;
  border-radius: 6px;
  flex: 0 0 auto;
  height: 373px;
  outline: 1px solid rgb(from var(--neutral-900) r g b / 0.1);
  outline-offset: -1px;
  width: 100%;
}

.wyma-wide-image img {
  border-radius: 6px;
}

.wyma-phone-pair {
  align-items: center;
  align-self: stretch;
  display: flex;
  height: 500px;
  justify-content: center;
}

.wyma-phone-pair .wyma-phone-image {
  align-self: stretch;
  flex: 1 1 0;
  min-width: 0;
  outline: 1px solid rgb(from var(--neutral-900) r g b / 0.1);
  outline-offset: -1px;
}

.wyma-phone-pair .wyma-phone-image + .wyma-phone-image {
  margin-left: -28px;
}

.wyma-single-phone {
  align-items: center;
  align-self: stretch;
  display: flex;
  height: 500px;
  justify-content: center;
}

.wyma-single-phone .wyma-phone-image {
  flex: 0 0 244px;
  height: 500px;
  outline: 1px solid rgb(from var(--neutral-900) r g b / 0.1);
  outline-offset: -1px;
  width: 244px;
}

.wyma-lightbox {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--wyma-ink);
  display: grid;
  height: 100%;
  inset: 0;
  margin: 0;
  max-height: none;
  max-width: none;
  padding: 0;
  place-items: center;
  position: fixed;
  width: 100%;
}

.wyma-lightbox:not([open]) {
  display: none;
}

.wyma-lightbox::backdrop {
  background: rgb(from var(--neutral-200) r g b / 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 240ms var(--wyma-ease);
}

.wyma-lightbox-image {
  --wyma-from-scale: 0.92;
  --wyma-from-x: 0px;
  --wyma-from-y: 0px;
  cursor: zoom-out;
  display: block;
  height: auto;
  max-height: 75vh;
  max-width: 75vw;
  object-fit: contain;
  opacity: 0;
  transform: translate(var(--wyma-from-x), var(--wyma-from-y)) scale(var(--wyma-from-scale));
  transform-origin: center;
  transition: opacity 200ms ease-out, transform 260ms var(--wyma-ease);
  outline: 1px solid rgb(from var(--neutral-900) r g b / 0.1);
  outline-offset: -1px;
  will-change: opacity, transform;
}

.wyma-lightbox-close {
  align-items: center;
  appearance: none;
  background: var(--neutral-900);
  border: 0;
  border-radius: var(--radius-full);
  color: var(--neutral-100);
  cursor: pointer;
  display: flex;
  font-size: 24px;
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 3px;
  position: fixed;
  right: 24px;
  top: 24px;
  transition: transform 160ms var(--wyma-ease), background-color 160ms ease;
  width: 36px;
  z-index: 1;
}

.wyma-lightbox-close:focus-visible {
  outline: 2px solid var(--neutral-900);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .wyma-lightbox-close:hover {
    background: var(--neutral-800);
    transform: scale(1.05);
  }
}

.wyma-lightbox-close:active {
  transform: scale(0.96);
}

.wyma-lightbox-caption {
  display: none;
}

.wyma-lightbox.is-preparing .wyma-lightbox-image {
  transition: none;
}

.wyma-lightbox.is-visible::backdrop {
  opacity: 1;
}

.wyma-lightbox.is-open .wyma-lightbox-image {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

.wyma-lightbox.is-closing .wyma-lightbox-image {
  opacity: 0;
}

@media (max-width: 767px) {
  .wyma-page {
    gap: 36px;
    padding-block: 64px;
  }

  .wyma-title {
    font-size: clamp(38px, 10vw, 48px);
    line-height: 1.2;
  }

  .wyma-copy {
    font-size: clamp(18px, 3.6vw, 24px);
    line-height: 1.25;
  }

  .wyma-wide-image {
    aspect-ratio: 700 / 373;
    height: auto;
  }

  .wyma-phone-pair {
    gap: 12px;
    height: auto;
  }

  .wyma-phone-pair .wyma-phone-image {
    align-self: auto;
    aspect-ratio: 364 / 500;
    flex: 0 1 calc((100% - 12px) / 2);
    height: auto;
  }

  .wyma-phone-pair .wyma-phone-image + .wyma-phone-image {
    margin-left: 0;
  }

  .wyma-single-phone {
    height: auto;
  }

  .wyma-single-phone .wyma-phone-image {
    aspect-ratio: 244 / 500;
    flex: 0 1 244px;
    height: auto;
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .wyma-page {
    padding-inline: 20px;
  }

  .wyma-lightbox-image {
    max-height: 75vh;
    max-width: 75vw;
  }

  .wyma-lightbox-close {
    right: 12px;
    top: 12px;
  }
}

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

  .wyma-asset-button {
    transition: none;
  }

  .wyma-asset-button:hover {
    transform: none;
  }

  .wyma-asset-button:active {
    transform: none;
  }

  .wyma-lightbox::backdrop,
  .wyma-lightbox-image,
  .wyma-lightbox-close {
    transition: none;
  }

  .wyma-lightbox-image {
    transform: none;
  }
}
