/* ── Fonts (self-hosted, latin + latin-ext) ─────────────────────────────── */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-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: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-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: "Rubik Mono One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/rubik-mono-one-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: "Rubik Mono One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/rubik-mono-one-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;
}

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --bg: #f4efe4;
  --ink: #1b1a17;
  --muted: #8a8375;
  --pink: #d2427a;
  --yellow: #f2c14e;
  --card-face: #f6f1e6;
  --display: "Rubik Mono One", ui-monospace, monospace;
  --body: "Manrope", system-ui, -apple-system, sans-serif;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--pink); }
h1, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.display { font-family: var(--display); font-weight: 400; }

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-x: clip;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { color: var(--pink); border-color: var(--pink); }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.is-disabled, .btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.is-disabled:hover, .btn:disabled:hover { color: var(--ink); border-color: var(--ink); transform: none; }
.btn.is-copied, .btn.is-copied:hover { color: #fff; background: var(--pink); border-color: var(--pink); }
.btn:focus-visible, .ca:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
.btn-sm { padding: 8px 12px; font-size: 11px; }
.btn.is-busy { opacity: .7; pointer-events: none; }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 56px;
}
.brand { font-family: var(--display); font-size: 22px; white-space: nowrap; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-link { padding: 11px 8px; font-size: 13px; font-weight: 800; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 600px;
  gap: 40px;
  align-items: center;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 60px 56px;
}
.hero-copy { display: flex; flex-direction: column; gap: 28px; }
.word {
  font-family: var(--display);
  font-weight: 400;
  font-size: 180px;
  line-height: .85;
  letter-spacing: -.02em;
}
.tagline { font-size: 32px; line-height: 1.15; font-weight: 800; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 12px; font-weight: 700; color: var(--muted); }
.meta-link { color: var(--ink); }

/* ── Card fan ────────────────────────────────────────────────────────────── */
.fan-wrap {
  --s: 1;
  width: calc(600px * var(--s));
  height: calc(520px * var(--s));
  max-width: 100%;
}
.fan {
  position: relative;
  width: 600px;
  height: 520px;
  transform: scale(var(--s));
  transform-origin: top left;
}
.slot { position: absolute; transform-origin: bottom center; }
.slot-1 { left: 0;     top: 70px; transform: rotate(-14deg); }
.slot-2 { left: 250px; top: 70px; transform: rotate(12deg); }
.slot-3 { left: 125px; top: 40px; }
.tilt { width: 300px; height: 420px; perspective: 900px; }
.tilt-inner { transition: transform .15s ease-out; transform-style: preserve-3d; }

.card {
  position: relative;
  width: 300px;
  height: 420px;
  padding: 10px;
  border-radius: 16px;
  overflow: hidden;
  color: var(--ink);
  box-shadow: 0 18px 40px -18px rgba(27, 26, 23, .45), 0 2px 0 rgba(255, 255, 255, .5) inset;
}
.card-yellow { background: var(--yellow); }
.card-gold   { background: linear-gradient(135deg, #b8862b, #ffe08a 40%, #c99a3a 60%, #fff2c2 85%, #b8862b); }
.card-holo   { background: linear-gradient(120deg, #f2a7c9, #ffe7a3, #7fe0bf, #a9c3ff, #f2a7c9); }

.card-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px 8px;
  border-radius: 9px;
  border: 1px solid rgba(27, 26, 23, .15);
  background: var(--card-face);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-title { display: flex; align-items: baseline; gap: 6px; }
.card-title .display { font-size: 22px; line-height: 1; }
.tag { font-size: 9px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.tag.dark { color: var(--ink); letter-spacing: .1em; }
.card-lvl { display: flex; align-items: baseline; gap: 3px; }
.card-lvl .lvl { font-size: 16px; line-height: 1; color: var(--pink); }

.card-art {
  position: relative;
  flex: 1;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: #fff;
}
.card-art img {
  position: absolute;
  left: -9%;
  top: -14%;
  width: 118%;
  height: auto;
  display: block;
}
.sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: .35;
  background-image: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .9) 48%, transparent 62%);
  background-size: 300% 300%;
  animation: holo 5s linear infinite;
}
@keyframes holo {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.card-name { display: flex; justify-content: space-between; align-items: baseline; padding-top: 4px; }
.card-name .display { font-size: 14px; }
.card-name .tag { letter-spacing: .1em; }
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 5px;
  border-top: 1px solid rgba(27, 26, 23, .2);
  font-size: 7.5px;
  font-weight: 700;
  color: var(--muted);
}
.card-foot .num { display: flex; align-items: center; gap: 4px; }
.diamond { display: inline-block; width: 7px; height: 7px; background: var(--ink); transform: rotate(45deg); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.foot {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 56px 32px;
}
.pills { display: flex; flex-wrap: wrap; gap: 12px; }
.pills .btn { padding: 12px 20px; }
.fine {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(27, 26, 23, .15);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.ca { padding: 0; font-weight: 600; color: var(--muted); }
.ca:not(:disabled):hover, .ca.is-copied { color: var(--pink); }
.ca:disabled { cursor: default; }

/* ── Meme bank ───────────────────────────────────────────────────────────── */
.bank {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 56px 48px;
}
.bank-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-top: 32px;
  border-top: 1px solid rgba(27, 26, 23, .15);
}
.bank-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -.01em;
}
.bank-sub { margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.bank-sub a { color: var(--ink); font-weight: 800; }
.bank-sub a:hover { color: var(--pink); }
.bank-count { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.bank-empty {
  padding: 40px 16px;
  text-align: center;
  border: 2px dashed rgba(27, 26, 23, .25);
  border-radius: 16px;
  font-weight: 700;
  color: var(--muted);
}

.meme {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(27, 26, 23, .15);
  background: var(--card-face);
  transition: transform .2s ease, box-shadow .2s ease;
}
.meme:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(27, 26, 23, .45); }
.meme-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.meme-head .tag { flex-shrink: 0; white-space: nowrap; }
.meme-title { min-width: 0; font-size: 12px; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meme-art {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  cursor: zoom-in;
}
.meme-art img, .meme-art video { display: block; width: 100%; height: 100%; object-fit: contain; }
.meme-art:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
.meme-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(27, 26, 23, .2);
}
.meme-kind { font-size: 9px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }

/* Lightbox: the meme opens as a yellow card */
.lightbox {
  width: auto;
  max-width: min(92vw, 880px);
  padding: 0;
  border: 0;
  background: transparent;
}
.lightbox::backdrop { background: rgba(27, 26, 23, .72); }
.lightbox-card { width: auto; height: auto; max-width: 100%; }
.lightbox-inner { height: auto; }
.lightbox-art {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: #fff;
}
.lightbox-art img, .lightbox-art video { display: block; width: auto; height: auto; max-width: 100%; max-height: 70vh; }
.lightbox-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.lightbox-close:hover { color: var(--pink); border-color: var(--pink); }
.lightbox-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid rgba(27, 26, 23, .2);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
/* The rotated cards overhang the 600px fan box: the visual extent is
   -97px … 634px, i.e. 731px wide. Below 1100px the wrapper is sized to that
   extent and the fan is shifted right so nothing hangs off the viewport. */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; gap: 0; }
  .fan-wrap { --s: .8; width: calc(731px * var(--s)); }
  .fan { margin-left: calc(97px * var(--s)); }
  .word { font-size: 120px; }
  .nav, .foot, .bank { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 640px) {
  .hero { padding: 32px 24px; }
  .fan-wrap { --s: .44; margin: 8px auto 0; }
  .word { font-size: 88px; }
  .nav { flex-wrap: wrap; padding: 16px 20px; }
  .brand { font-size: 15px; }
  .nav .btn { padding: 9px 12px; font-size: 12px; }
  .foot { padding-left: 20px; padding-right: 20px; }
  .bank { padding: 0 20px 40px; }
  .bank-title { font-size: 32px; }
  .bank-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .meme { padding: 7px 8px 6px; }
}
/* Fit the fan to the viewport exactly where calc() can divide lengths. */
@supports (transform: scale(calc(1px / 1px))) {
  @media (max-width: 1100px) {
    .fan-wrap { --s: min(.8, calc((100vw - 48px) / 731px)); }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sheen { animation: none; }
  .tilt-inner, .btn, .meme { transition: none; }
}
