/* Tipografías locales: la app tiene que funcionar sin señal, así que no se
   piden a un servidor externo. Los acentos del español caen en el subconjunto
   latino; el extendido queda por si entra un nombre con tipografía rara. */

@font-face {
  font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/EBGaramond-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/EBGaramond-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/EBGaramond-400italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/EBGaramond-400italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "EB Garamond"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/EBGaramond-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../assets/fonts/EBGaramond-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/IBMPlexMono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/IBMPlexMono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/IBMPlexMono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--desk);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--size-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  border-radius: var(--radius);
  cursor: pointer;
}

/* Marco de la app. En el teléfono ocupa toda la pantalla; en la computadora se
   limita al tamaño del bezel del prototipo para revisar el diseño. */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  max-width: 412px;
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
}

@media (min-width: 460px) and (min-height: 900px) {
  .app {
    height: 892px;
    margin-top: calc((100dvh - 892px) / 2);
    border: 1px solid var(--rule-40);
  }
}

/* Grano de papel sobre toda la app, por encima del fondo y por debajo del texto */
.app::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  background-size: var(--grain-size);
  pointer-events: none;
  z-index: 2;
}

/* Lámina desvaída al fondo de la app. Va anclada al marco y no al cuerpo con
   desplazamiento: si no, se estira a todo el alto del contenido y la ilustración
   crece hasta competir con el texto. El velo va encima de la imagen, que es lo
   que la apaga. */
.app::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--veil-body), var(--veil-body)),
    url("../assets/backgrounds/fondo-tenue.jpg");
  background-size: auto, cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: .3;
  pointer-events: none;
  z-index: 0;
}

/* Cuerpo con desplazamiento propio: el encabezado y la barra de pestañas no se mueven */
.app__body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.app__screen {
  position: relative;
  padding: var(--sp-16) var(--sp-18) var(--sp-22);
}

/* Filetes ------------------------------------------------------------------ */

.rule {
  height: 1px;
  background: var(--rule-22);
}

/* Doble filete del encabezado del onboarding */
.rule--double {
  height: 5px;
  background:
    linear-gradient(var(--rule-22), var(--rule-22)) top / 100% 1px no-repeat,
    linear-gradient(var(--rule-22), var(--rule-22)) bottom / 100% 1px no-repeat;
}

/* Placa grabada: borde exterior, 2px de aire, borde interior */
.plate {
  border: 1px solid var(--rule-40);
  padding: var(--sp-2);
}

.plate__inner {
  border: 1px solid var(--rule-18);
}

/* Texto --------------------------------------------------------------------- */

.kicker {
  font-family: var(--mono);
  font-size: var(--mono-kicker);
  letter-spacing: var(--track-wide);
  color: var(--ink-60);
  text-transform: uppercase;
}

.label {
  font-family: var(--mono);
  font-size: var(--mono-sm);
  letter-spacing: var(--track-wide);
  color: var(--ink-60);
  text-transform: uppercase;
}

.meta {
  font-family: var(--mono);
  font-size: var(--mono-detail);
  color: var(--ink-55);
}

/* Accesibilidad ------------------------------------------------------------ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
