/*
 * Grandir en silence — styles v2
 *
 */

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

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/atkinsonhyperlegiblenext-v7.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  font-family:
    "Atkinson Hyperlegible Next",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: #fff;
  background: #000;

  --app-width: 100dvw;
  --app-height: 100dvh;

  /* Logo resting opacity (kept in sync with JavaScript). */
  --logo-base-opacity: 0.9;

  /* Animation durations kept in sync with JavaScript. */
  --text-fade-duration: 1600ms;
  --logo-return-duration: 1000ms;

  /* Vertical position computed dynamically by JavaScript. */
  --typewriter-y: 0px;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;

  color: #fff;
  background: #000;

  overflow: hidden;
  overscroll-behavior: none;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

.app {
  position: relative;
  isolation: isolate;

  width: var(--app-width, 100vw);
  height: var(--app-height, 100vh);
  min-width: 0;
  min-height: 0;

  color: #fff;
  background: #000;

  overflow: hidden;

  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
}

.app__content {
  position: relative;

  width: 100%;
  height: 100%;

  overflow: hidden;

  padding:
    clamp(24px, 6vw, 34px)
    clamp(20px, 5vw, 32px);

  padding-bottom:
    calc(
      clamp(72px, 12vh, 92px) +
      env(safe-area-inset-bottom, 0px)
    );
}

.app__footer {
  position: absolute;
  z-index: 3;

  left: 50%;
  bottom:
    calc(
      16px +
      env(safe-area-inset-bottom, 0px)
    );

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;

  width: calc(100% - 40px);
  max-width: 360px;

  gap: 4px 7px;
  margin: 0;

  color: rgb(255 255 255 / 42%);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.03em;
  text-align: center;

  transform: translateX(-50%);

  user-select: none;
  pointer-events: none;
}

.footer-link {
  color: inherit;
  text-decoration: none;

  pointer-events: auto;

  transition:
    color 220ms ease,
    opacity 220ms ease;
}

.footer-link:hover {
  color: #fff;
}

.footer-link:focus-visible {
  color: #fff;
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

.footer-link:active {
  opacity: 0.8;
}

.logo {
  position: absolute;
  inset: 50% auto auto 50%;

  width: min(100%, 320px);
  height: auto;

  transform: translate(-50%, -50%);
  opacity: var(--logo-base-opacity);

  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.logo.is-returning {
  transition:
    opacity var(--logo-return-duration)
    cubic-bezier(0.22, 1, 0.36, 1);
}

.typewriter {
  position: absolute;
  z-index: 1;

  top: 50%;
  left: clamp(20px, 5vw, 32px);
  right: clamp(20px, 5vw, 32px);

  width: auto;
  max-width: 34rem;
  margin: 0 auto;

  color: #fff;

  font-size: clamp(1rem, 4.2vw, 1.15rem);
  font-weight: 400;
  line-height: 1.55;
  text-align: left;

  overflow-wrap: anywhere;
  white-space: pre-line;

  opacity: 1;
  transform: translateY(var(--typewriter-y));

  transition:
    transform 950ms cubic-bezier(0.22, 1, 0.36, 1);

  pointer-events: none;
}

.typewriter.is-fading {
  opacity: 0;

  transition:
    opacity var(--text-fade-duration) ease-in-out,
    transform 950ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sr-only {
  position: absolute;

  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;

  overflow: hidden;
  white-space: nowrap;

  border: 0;
  clip-path: inset(50%);
}

@media (min-width: 700px) and (min-height: 700px) {
  body {
    display: grid;
    place-items: center;
  }

  .app {
    width: min(402px, 100dvw);
    height: min(874px, 100dvh);
    max-width: 100%;
    max-height: 100%;

    border: 1px solid #161616;
    border-radius: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo,
  .typewriter {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-height: 620px) {
  .app__content {
    padding-bottom:
      calc(
        62px +
        env(safe-area-inset-bottom, 0px)
      );
  }

  .app__footer {
    bottom:
      calc(
        10px +
        env(safe-area-inset-bottom, 0px)
      );

    font-size: 0.63rem;
  }
}
