/* Ryuu Monsters — one bright studio, every dragon in it. */

/* Young Serif by Bastien Sozeau. SIL Open Font License, in fonts/LICENSE.txt.
   It comes in one weight. */
@font-face {
  font-family: "Young Serif";
  src: url("../fonts/YoungSerif-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --floor: #e9eff4;
  --ink: #0b1322;
  --ink-2: #4f5a6b;
  --ink-3: #8a94a4;
  --line: #dfe5eb;
  --cyan: #16b6e6;
  --cyan-deep: #0a86b4;
  --gut: clamp(18px, 4.2vw, 64px);
  --font: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  /* headings: a heavy old-style serif, close in spirit to the logo's lettering */
  --display: "Young Serif", Georgia, serif;
  --display-weight: 400; /* Young Serif's only weight, and already heavy */
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img { max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
::selection { background: var(--cyan); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 2px; }

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

h2 {
  margin: 0 0 .5em;
  font-family: var(--display);
  font-size: clamp(36px, 4.8vw, 72px);
  font-weight: var(--display-weight);
  font-synthesis: none;
  line-height: 1.04;
  letter-spacing: -.01em;
  text-wrap: balance;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background .25s, transform .25s var(--ease), box-shadow .25s;
}
.btn:hover { background: var(--cyan-deep); transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(10, 134, 180, .6); }
.btn__steam { flex: none; width: 1.6em; height: 1.6em; margin: 0 .6em 0 -.25em; fill: currentColor; }
.btn--small { height: 40px; padding: 0 18px; font-size: 12px; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }

/* ── Bar ─────────────────────────────────────────────────────────────────── */

.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--gut);
  pointer-events: none;
  transition: background .3s, box-shadow .3s;
}
.bar > * { pointer-events: auto; }
/* the same logo file the hero shows, so it costs no extra download */
.bar__logo {
  display: block;
  line-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .3s, transform .3s var(--ease);
}
.bar__logo img { width: auto; height: 42px; user-select: none; -webkit-user-drag: none; }
.bar .btn { opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s, background .25s, transform .25s var(--ease); }
.bar.is-down .btn { opacity: 1; visibility: visible; }
.bar.is-down { background: rgba(255, 255, 255, .84); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(14px) saturate(1.6); -webkit-backdrop-filter: blur(14px) saturate(1.6); }
.bar.is-down .bar__logo { opacity: 1; transform: none; }

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: clamp(64px, 9svh, 104px);
  overflow: hidden;
  background:
    radial-gradient(ellipse 46% 34% at 50% 24%, rgba(22, 182, 230, .07), transparent 70%),
    radial-gradient(ellipse 58% 22% at 50% 82%, #fff 0%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(180deg, #fff 0%, #fff 36%, #f2f5f8 55%, var(--floor) 100%);
}

.hero__main { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.hero__logo {
  position: relative;
  z-index: 1;
  width: min(1000px, 88vw, 96svh);
  margin: 0 auto;
  line-height: 0;
}
.hero__logo img { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }

.crowd {
  --H: clamp(280px, 50svh, 560px);
  --u: calc(var(--H) * .5);
  position: relative;
  z-index: 2;
  height: var(--H);
  margin-top: calc(var(--H) * -.22);
}
.crowd__stage {
  position: absolute;
  inset: 0 auto 0 50%;
  width: clamp(1000px, 100%, 1900px);
  transform: translateX(-50%);
}

/* A dragon, anchored at its feet. */
.d {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 100%);
  height: calc(var(--u) * var(--s, 1));
  aspect-ratio: var(--ar);
  translate: -50% -100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* the further back, the more the studio light washes it out */
  filter:
    saturate(calc(1 - var(--haze, 0) * .14))
    brightness(calc(1 + var(--haze, 0) * .06))
    contrast(calc(1 - var(--haze, 0) * .08))
    blur(calc(var(--haze, 0) * .28px));
  opacity: calc(1 - var(--haze, 0) * .07);
}
.d img {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  transition: translate .35s var(--ease);
}
/* Not drawn yet: site.js brings each one in, row by row. */
.js .d img { clip-path: inset(0 0 100% 0); }
.d::before,
.d::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}
/* contact shadow */
.d::before {
  left: 10%; right: 10%; bottom: -5%; height: 11%;
  background: radial-gradient(closest-side, rgba(11, 19, 34, .26), rgba(11, 19, 34, 0));
  transition: transform .35s var(--ease), opacity .35s;
}
/* coloured light on the floor, on hover */
.d::after {
  left: -25%; right: -25%; bottom: -14%; height: 30%;
  background: radial-gradient(closest-side, var(--tint), transparent);
  opacity: 0;
  transition: opacity .4s;
}
@media (hover: hover) {
  .d:hover img { translate: 0 -4%; }
  .d:hover::before { transform: scale(.82); opacity: .7; }
  .d:hover::after { opacity: .55; }
}

.hero__foot {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px 24px;
  padding: 18px var(--gut) clamp(22px, 4svh, 40px);
}
.hero__tag {
  margin: 0;
  max-width: 46ch;
  font-family: var(--display);
  font-size: clamp(19px, 1.7vw, 25px);
  font-weight: var(--display-weight);
  font-synthesis: none;
  line-height: 1.15;
  letter-spacing: -.01em;
}
.hero__btn { justify-self: end; }
.hero__free,
.hero__help { align-self: start; margin: 0; font-size: 13px; color: var(--ink-2); text-wrap: balance; }
.hero__free { font-size: 14px; font-weight: 650; color: var(--ink); }
.hero__help { justify-self: end; text-align: right; }

/* ── Printings ───────────────────────────────────────────────────────────── */

.print {
  --rx: 0deg;
  --ry: 0deg;
  --px: 50%;
  --py: 50%;
  position: relative;
  min-height: max(780px, 100svh);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px clamp(24px, 4vw, 72px);
  align-items: center;
  padding: clamp(80px, 10vw, 140px) var(--gut);
  overflow: hidden;
  background: linear-gradient(180deg, var(--floor), #fff 30%);
}

.print__word {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(84px, 12vw, 300px); /* site.js fits it to the width */
  font-weight: var(--display-weight);
  font-synthesis: none;
  line-height: .84;
  letter-spacing: -.01em;
  text-align: center;
  text-transform: uppercase;
  white-space: pre;
  color: color-mix(in oklab, var(--tier) 15%, #fff);
  pointer-events: none;
  user-select: none;
  transition: color .7s;
}
.print__word span { display: block; padding-top: .06em; }
.print__word span.is-in { animation: word-in .7s var(--ease) both; }
@keyframes word-in {
  from { opacity: 0; transform: translateY(.18em); letter-spacing: .02em; }
}

.print__copy { position: relative; align-self: start; max-width: 30ch; }
.print__copy h2 { font-size: clamp(30px, 3vw, 46px); }
.print__copy p { margin: 0; max-width: 34ch; color: var(--ink-2); }

.print__stage { position: relative; perspective: 1100px; }

.card {
  position: relative;
  width: clamp(240px, 26vw, 390px);
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  box-shadow:
    0 1px 2px rgba(11, 19, 34, .1),
    0 22px 44px -16px rgba(11, 19, 34, .32),
    0 70px 100px -50px color-mix(in oklab, var(--tier) 75%, transparent);
  transition: box-shadow .7s;
}
.card img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.card.is-flipping { animation: card-flip .56s var(--ease); }
@keyframes card-flip {
  0% { transform: rotateX(var(--rx)) rotateY(var(--ry)); }
  50% { transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + 90deg)) scale(.96); }
  50.01% { transform: rotateX(var(--rx)) rotateY(calc(var(--ry) - 90deg)) scale(.96); }
  100% { transform: rotateX(var(--rx)) rotateY(var(--ry)); }
}

/* Holo: a rainbow sheet that only lights where the card catches the light. */
.card__foil,
.card__glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.card__foil {
  opacity: calc(var(--foil, 0) * .75);
  mix-blend-mode: color-dodge;
  background:
    repeating-linear-gradient(118deg,
      hsl(350 90% 66%) 0%, hsl(40 95% 62%) 4%, hsl(95 80% 60%) 8%,
      hsl(185 95% 60%) 12%, hsl(260 90% 70%) 16%, hsl(350 90% 66%) 20%) ,
    repeating-linear-gradient(28deg, rgba(255, 255, 255, .0) 0 3px, rgba(255, 255, 255, .25) 3px 4px);
  background-size: 260% 260%, 100% 100%;
  background-position: var(--px) var(--py), 0 0;
  -webkit-mask-image: radial-gradient(circle at var(--px) var(--py), #000 0%, rgba(0, 0, 0, .35) 45%, transparent 80%);
          mask-image: radial-gradient(circle at var(--px) var(--py), #000 0%, rgba(0, 0, 0, .35) 45%, transparent 80%);
  filter: saturate(1.3) contrast(1.1);
  transition: opacity .6s;
}
.card__glare {
  mix-blend-mode: soft-light;
  background: radial-gradient(circle at var(--px) var(--py), rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 52%);
}

.print__ctrl {
  position: relative;
  align-self: end;
  justify-self: end;
  display: grid;
  justify-items: end;
  gap: 26px;
}

.tiers { display: grid; justify-items: end; gap: 2px; }
.tiers button {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink-3);
  transition: color .3s;
}
.tiers button::after {
  content: "";
  width: 20px;
  height: 3px;
  border-radius: 3px;
  background: var(--c);
  opacity: .35;
  transition: width .45s var(--ease), opacity .3s;
}
.tiers button:hover { color: var(--ink-2); }
.tiers button[aria-checked="true"] { color: var(--ink); }
.tiers button[aria-checked="true"]::after { width: 56px; opacity: 1; }

.redraw {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 650;
}
.redraw svg {
  width: 36px; height: 36px; padding: 9px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .6s var(--ease), box-shadow .3s;
}
.redraw:hover svg { transform: rotate(180deg); box-shadow: inset 0 0 0 1.5px var(--ink); }
.print__id { margin: 0; font-size: 13px; color: var(--ink-3); }

/* ── How it plays ────────────────────────────────────────────────────────── */

.verbs { padding: clamp(40px, 6vw, 80px) var(--gut) clamp(80px, 10vw, 140px); }
.verbs ol { margin: 0 auto; padding: 0; list-style: none; max-width: 1500px; }

.verb {
  /* room for the perched dragon, which stands well above the cap line */
  padding-top: clamp(62px, 14.1vw, 232px);
}
.verb__word {
  margin: 0;
  padding-bottom: .05em;
  border-bottom: 1.5px solid var(--ink);
  font-family: var(--display);
  font-size: clamp(44px, 15.5vw, 260px);
  font-weight: var(--display-weight);
  font-synthesis: none;
  line-height: .74;
  letter-spacing: -.01em;
  text-transform: uppercase;
  text-wrap: balance;
}
/* a phrase that wraps needs air between its lines; the perched word keeps .74 */
.verb__word--long { line-height: .9; }
.verb__word > span { position: relative; display: inline-block; line-height: .74; }

/* The perched dragon stands on the cap line of the last letter. */
.perch {
  --u: 1em;
  left: auto;
  right: -.06em;
  top: auto;
  bottom: .6em;
  height: .92em;
  translate: 0 0;
}
.perch--start { left: .02em; right: auto; }
.perch::before { bottom: -3%; }

/* ── Packs ───────────────────────────────────────────────────────────────── */

.packs {
  padding: clamp(80px, 10vw, 150px) var(--gut) clamp(80px, 9vw, 130px);
  background: linear-gradient(180deg, #fff, var(--floor));
}
.packs__copy { max-width: 1500px; margin: 0 auto; }
.packs__copy p { margin: 0; color: var(--ink-2); max-width: 40ch; }

.packs__row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(14px, 5vw, 90px);
  margin: clamp(48px, 7vw, 96px) auto 0;
}
.pack {
  --r: 0deg;
  position: relative;
  width: clamp(104px, 21vw, 290px);
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}
.pack:nth-child(1) { --r: -5deg; }
.pack:nth-child(3) { --r: 5deg; }
.pack img {
  width: 100%;
  height: auto;
  margin-bottom: 22px;
  transform: rotate(var(--r));
  transform-origin: 50% 100%;
  filter: drop-shadow(0 26px 22px rgba(11, 19, 34, .16)) drop-shadow(0 2px 3px rgba(11, 19, 34, .12));
  transition: transform .55s var(--ease), filter .55s var(--ease);
  user-select: none;
  -webkit-user-drag: none;
}
.pack:hover img,
.pack:focus-visible img { transform: translateY(-18px) rotate(0deg) scale(1.03); filter: drop-shadow(0 46px 30px rgba(11, 19, 34, .14)) drop-shadow(0 2px 3px rgba(11, 19, 34, .1)); }
.pack:active img { transform: translateY(-10px) scale(.98); }
.pack__name { font-family: var(--display); font-size: clamp(15px, 1.4vw, 19px); font-weight: var(--display-weight); font-synthesis: none; text-transform: uppercase; letter-spacing: .04em; }
.pack__sub { font-size: 13px; color: var(--ink-2); }

/* ── End ─────────────────────────────────────────────────────────────────── */

.end {
  position: relative;
  padding: clamp(100px, 12vw, 180px) var(--gut) 28px;
  background: linear-gradient(180deg, var(--floor), #fff 40%, #fff 70%, var(--floor));
  overflow: hidden;
}
.end__cta {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-family: var(--display);
  font-size: clamp(22px, 2.6vw, 38px);
  font-weight: var(--display-weight);
  font-synthesis: none;
  letter-spacing: -.01em;
  text-decoration: none;
  background: linear-gradient(var(--cyan), var(--cyan)) 0 100% / 100% 4px no-repeat;
  padding-bottom: 6px;
  transition: background-size .4s var(--ease), color .3s;
}
.end__cta svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease); }
.end__cta:hover { color: var(--cyan-deep); background-size: 100% 100%; background-image: linear-gradient(rgba(22, 182, 230, .12), rgba(22, 182, 230, .12)); }
.end__cta:hover svg { transform: translateX(6px); }

.end__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: clamp(70px, 9vw, 130px);
  padding-top: 22px;
  border-top: 1.5px solid var(--ink);
  font-size: 13px;
  color: var(--ink-2);
}
.end__meta nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.end__meta a { color: var(--ink); font-weight: 650; text-decoration: none; }
.end__meta a:hover { color: var(--cyan-deep); }
.end__meta p { margin: 0; }

/* ── Pack opening ────────────────────────────────────────────────────────── */

.open {
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  overflow: hidden;
}
.open::backdrop { background: transparent; }
.open[open] { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; } }

.open__stage {
  position: absolute;
  inset: 0 0 110px;
  display: grid;
  place-items: center;
  perspective: 1400px;
}
.open__pack { position: absolute; height: min(64svh, 620px); aspect-ratio: var(--ar); }
.open__pack img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 40px 40px rgba(11, 19, 34, .2));
}
.open__pack .top { clip-path: inset(0 0 87% 0); }
.open__pack .body { clip-path: inset(13% 0 0 0); }

.hand {
  --w: clamp(96px, min(16.5vw, 40svh * .8), 250px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 26px);
  max-width: 96vw;
}
.ocard { position: relative; width: var(--w); aspect-ratio: 4 / 5; perspective: 900px; }
.ocard__in {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(180deg);
  transition: transform .8s cubic-bezier(.3, 1.35, .45, 1);
}
.ocard.is-up .ocard__in { transform: rotateY(0deg); }
.ocard__face,
.ocard__back {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 1px 2px rgba(11, 19, 34, .12), 0 18px 34px -14px rgba(11, 19, 34, .35);
}
.ocard__face img { display: block; width: 100%; height: 100%; }
.ocard__face::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: calc(var(--foil, 0) * .7);
  mix-blend-mode: color-dodge;
  background: linear-gradient(115deg, transparent 30%, hsl(185 95% 65%) 42%, hsl(280 90% 72%) 50%, hsl(40 95% 65%) 58%, transparent 70%) -100% 0 / 250% 100% no-repeat;
}
.ocard.is-up .ocard__face::after { animation: sheen 1.8s .5s var(--ease) both; }
@keyframes sheen { to { background-position: 200% 0; } }
.ocard__back {
  transform: rotateY(180deg);
  background:
    var(--logo) center / 80% auto no-repeat,
    repeating-radial-gradient(circle at 50% 50%, transparent 0 7px, rgba(22, 182, 230, .16) 7px 8px),
    #fff;
}
.ocard__back::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px rgba(22, 182, 230, .45);
}
.ocard__label {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 14px);
  text-align: center;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c);
  opacity: 0;
  transition: opacity .4s .35s;
}
.ocard.is-up .ocard__label { opacity: 1; }
.ocard--burst::before {
  content: "";
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--c) 70%, transparent), transparent);
  opacity: 0;
  pointer-events: none;
}
.ocard--burst.is-up::before { animation: burst 1.4s .25s var(--ease) both; }
@keyframes burst {
  0% { opacity: 0; transform: scale(.4); }
  30% { opacity: 1; }
  100% { opacity: .35; transform: scale(1.1); }
}

.open__ctrl {
  position: absolute;
  left: 0; right: 0; bottom: max(28px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity .4s;
}
.open.is-done .open__ctrl { opacity: 1; }

/* ── Narrow screens ──────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero__foot { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 14px; }
  .hero__tag { max-width: 24ch; }
  .hero__btn, .hero__help { justify-self: center; }
  .hero__help { text-align: center; }

  .print { grid-template-columns: 1fr; justify-items: center; text-align: center; min-height: 0; }
  .print__copy, .print__copy p { margin-inline: auto; }
  .print__word { place-items: center; font-size: 22vw; }
  .print__ctrl { justify-self: center; justify-items: center; }
  .tiers { grid-template-columns: repeat(2, auto); justify-content: center; gap: 0 22px; }
  .tiers button { flex-direction: column-reverse; gap: 8px; font-size: 14px; }
}

@media (max-width: 560px) {
  .hand { --w: 27vw; row-gap: 46px; }
  .ocard__label { font-size: 10px; letter-spacing: .02em; top: calc(100% + 10px); }
  .packs__row { gap: 3vw; }
  .pack { width: 28vw; }
}

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