/* ==========================================================================
   Beyond the Label — coming soon page
   ========================================================================== */

/* Tokens
   ========================================================================== */

:root {
  --ink: #20264d;          /* page background */
  --ink-deep: #171c3b;     /* shadows, text on the sticker */
  --marigold: #f6c445;     /* the sticker */
  --marigold-pale: #fbe6a8; /* underside of the peeled corner */
  --lilac: #f1edff;        /* main text */
  --lilac-soft: #b3b1dc;   /* secondary text */

  --font: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --title-size: clamp(4.25rem, min(21vw, 24vh), 17rem);
}

/* The peel amount is animated, so it needs a registered type */
@property --peel {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

/* Base
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--gutter);
  background: var(--ink);
  color: var(--lilac);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: hidden;
}

p {
  margin: 0;
}

a {
  color: var(--marigold);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--lilac);
}

a:focus-visible {
  outline: 3px solid var(--marigold);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Masthead and footer
   ========================================================================== */

.masthead,
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
}

.masthead__name {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.masthead__status {
  color: var(--marigold);
  font-weight: 600;
}

.footer {
  color: var(--lilac-soft);
  font-size: 0.875rem;
}

/* Hero
   ========================================================================== */

.hero {
  align-self: center;
  padding-block: clamp(2rem, 6vh, 5rem);
}

.title {
  margin: 0;
  font-size: var(--title-size);
  font-weight: 800;
  font-variation-settings: "opsz" 96;
  line-height: 0.85;
  letter-spacing: -0.045em;
}

.title__beyond {
  display: block;
  margin-left: -0.04em; /* optical alignment with the text below */
  position: relative;
  z-index: 2; /* the descender of the y reaches past the label */
}

/* The sticker: a label that is starting to come unstuck */

.sticker {
  --peel: 0.42em;

  display: block;
  width: fit-content;
  position: relative;
  z-index: 1;
  margin-top: 0.24em;
  margin-left: 0.55em;
  font-size: 0.5em;
  letter-spacing: -0.03em;
  line-height: 1;
  transform: rotate(-5deg);
  transform-origin: 0 0;
  filter: drop-shadow(0 0.06em 0 var(--ink-deep))
          drop-shadow(0 0.18em 0.3em rgba(10, 13, 34, 0.45));
}

.sticker__face {
  display: block;
  position: relative;
  padding: 0.2em 0.42em 0.3em 0.36em;
  background: var(--marigold);
  color: var(--ink-deep);
  border-radius: 0.07em;
  white-space: nowrap;
  /* cut away the bottom-right corner where the sticker has lifted */
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--peel)),
    calc(100% - var(--peel)) 100%,
    0 100%
  );
}

/* the folded-back corner, showing the paler underside */
.sticker__face::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: var(--peel);
  height: var(--peel);
  background: linear-gradient(
    135deg,
    var(--marigold-pale) 0%,
    var(--marigold-pale) 38%,
    #e2ac2c 50%,
    transparent 50%
  );
  border-top-left-radius: 0.07em;
}

/* Intro copy
   ========================================================================== */

.intro {
  max-width: 34rem;
  margin-top: clamp(2.5rem, 7vw, 4.5rem);
}

.intro__lead {
  font-size: clamp(1.375rem, 1.1rem + 1.4vw, 2rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.intro__note {
  margin-top: 1.25rem;
  color: var(--lilac-soft);
  font-size: 1.0625rem;
  text-wrap: pretty;
}

/* Page-load moment: the label goes on flat, then starts to peel
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .sticker {
    animation: unstick 1.1s cubic-bezier(0.2, 0.9, 0.25, 1.15) 0.5s both;
  }

  @keyframes unstick {
    from {
      --peel: 0px;
      transform: rotate(0deg);
    }
    to {
      --peel: 0.42em;
      transform: rotate(-5deg);
    }
  }
}

/* Small screens
   ========================================================================== */

@media (max-width: 30rem) {
  .sticker {
    margin-left: 0.3em;
    font-size: 0.56em;
  }
}

/* Short, wide screens (phones in landscape) */
@media (max-height: 34rem) and (orientation: landscape) {
  :root {
    --title-size: clamp(3.5rem, 26vh, 9rem);
  }

  .hero {
    padding-block: 2rem;
  }
}
