/* ==========================================================================
   APP
   Tokens, fonts, base elements and the shared primitives (.button, .text-link,
   .chip, .sr-only). Every component stylesheet builds on these. Colour and
   font-family are only ever used through the tokens below.
   ========================================================================== */

/* FONTS */

/* Schibsted Grotesk, variable 400 to 900, subset to Latin. It has no peso sign,
   so "Peso Sign" (Hanken Grotesk's, the same weights) is listed first in every
   stack and, through unicode-range, only ever draws that one character. */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("SchibstedGrotesk.woff2?v=02dad6e62b") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Peso Sign";
  src: url("PesoSign.woff2?v=02f4d412f8") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+20B1;
}

/* Arial resized to Schibsted Grotesk's proportions, so nothing moves when the
   web font arrives. Measured against the site's own copy. */
@font-face {
  font-family: "Schibsted Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Roboto");
  size-adjust: 98%;
  ascent-override: 98%;
  descent-override: 26%;
  line-gap-override: 0%;
}

/* TOKENS */

:root {
  --primary-color: #155e7c; /* Esquire's teal */
  --primary-color-darkened: #0e4862;
  --primary-color-lighter: #dbe9ef;
  --secondary-color: #ffb400; /* Esquire's gold: the community's colour */
  --secondary-color-darkened: #f2a900;
  --secondary-color-lighter: #ffe3a3;
  --tertiary-color: #b00004; /* the emblem's red */
  --tertiary-color-darkened: #8e0003;
  --tertiary-color-lighter: #f7dcdc;
  --ink: #0b2530; /* text, the bars, the footer */
  --ink-lighter: #1c3a46;
  --slate: #536a74; /* secondary text on paper, 5.4:1 */
  --paper: #f7f4ee; /* the page */
  --paper-darkened: #ece7dc;
  --white: #ffffff;
  --silver: #ececec; /* the emblem's light facet */
  --platinum: #d5dadd; /* the second membership's pass: brushed metal */
  --platinum-darkened: #a4adb4;
  --platinum-lighter: #f4f6f7;
  --onyx: #0d1013; /* the third membership's pass: black metal */
  --onyx-lighter: #1d2328;
  --champagne: #d9c08e; /* foil on the third membership's pass */
  --champagne-darkened: #a3824a;
  --champagne-lighter: #f5e6c4;
  --launchpad-coral: #ee5b40;
  --launchpad-pink: #f6acbb;
  --launchpad-blue: #304596;
  --header-font-family: "Peso Sign", "Schibsted Grotesk", "Schibsted Fallback", "Helvetica Neue", Arial, sans-serif;
  --body-font-family: "Peso Sign", "Schibsted Grotesk", "Schibsted Fallback", "Helvetica Neue", Arial, sans-serif;
  --accent-font-family: "Peso Sign", "Schibsted Grotesk", "Schibsted Fallback", "Helvetica Neue", Arial, sans-serif;
  --duration-xs: 120ms;
  --duration-sm: 200ms;
  --duration-md: 320ms;
  --duration-lg: 520ms;
  --duration-xl: 800ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.55, 0, 0.75, 0.15);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-screen: cubic-bezier(0.32, 0.72, 0, 1); /* a whole screen or sheet on the move */
  --ease-spring: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.077 23.9%, 1.072 25.6%, 1.035 30.1%, 1.008 33.8%, 0.991 37.6%, 0.988 41.3%, 1.002 54.1%, 1); /* a little overshoot, for things under the finger */
  --shadow-lifted: 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent), 0 18px 40px -18px color-mix(in srgb, var(--ink) 45%, transparent);
  --focus-color: var(--ink);
}

/* BASE */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--paper);
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--body-font-family);
  font-size: 16px;
  font-weight: 420;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  color: inherit;
  font-family: var(--header-font-family);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure {
  margin: 0;
}

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

img {
  height: auto;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--focus-color);
  outline-offset: 3px;
}

::selection {
  background-color: var(--secondary-color);
  color: var(--ink);
}

/* THE ICON */

.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* BUTTON */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 56px;
  padding-left: 1.625rem;
  padding-right: 1.625rem;
  border: 0;
  border-radius: 999px;
  background-color: var(--ink);
  color: var(--white);
  font-size: 17px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--duration-sm) var(--ease-out), background-color var(--duration-sm) ease;
}

.button:hover {
  background-color: var(--ink-lighter);
}

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

.button .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  transition: transform var(--duration-md) var(--ease-out);
}

.button:hover .icon {
  transform: translateX(3px);
}

.button--gold {
  background-color: var(--secondary-color);
  color: var(--ink);
}

.button--gold:hover {
  background-color: var(--secondary-color-darkened);
}

.button--light {
  background-color: var(--white);
  color: var(--ink);
}

.button--light:hover {
  background-color: var(--paper);
}

.button--hollow {
  background-color: transparent;
  color: inherit;
  box-shadow: inset 0 0 0 1.5px currentColor;
}

.button--hollow:hover {
  background-color: color-mix(in srgb, currentColor 8%, transparent);
}

.button--small {
  min-height: 40px;
  padding-left: 1.125rem;
  padding-right: 1.125rem;
  font-size: 15px;
}

.button--block {
  width: 100%;
}

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* TEXT LINK */

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 44px;
  font-size: 16px;
  font-weight: 650;
  text-decoration: none;
}

.text-link .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  transition: transform var(--duration-md) var(--ease-out);
}

.text-link:hover .icon {
  transform: translateX(3px);
}

/* CHIP */

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  border-radius: 999px;
  background-color: color-mix(in srgb, currentColor 10%, transparent);
  font-size: 13px;
  font-weight: 620;
  line-height: 1;
  white-space: nowrap;
}

/* PRICE */

/* A price in pesos: the sign is small and hung from the top of the figures. */
.price {
  display: inline-flex;
  align-items: flex-start;
  font-family: var(--accent-font-family);
  font-weight: 780;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.price span {
  margin-top: 0.12em;
  margin-right: 0.04em;
  font-size: 0.5em;
  font-weight: 700;
  letter-spacing: 0;
}

/* UTILITIES */

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding-top: 0.75rem;
  padding-right: 1rem;
  padding-bottom: 0.75rem;
  padding-left: 1rem;
  border-radius: 999px;
  background-color: var(--ink);
  color: var(--white);
  font-weight: 650;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* SCREEN */

/* Room for the floating bars, top and bottom, so nothing sits under them. */
.app-screen {
  display: block;
  min-height: 100svh;
}

/* REVEAL */

/* Content below the first screen rises in once as it is reached (Motion.js).
   Only with scripts, and never with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .is-scripted [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--duration-lg) var(--ease-out), transform var(--duration-xl) var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .is-scripted [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
  }
}
