/* $wick, wickmeme.com
   Estetica: marcador preto sobre papel. Nada de gradientes, nada de glow.
   Tudo o que e desenhado passa pelo filtro #sharpie para o traco tremer. */

:root {
  --ink: #14110f;
  --paper: #fbfaf7;
  --green: #1fbf4b;
  --red: #e33b33;
  --marker: "Permanent Marker", "Comic Sans MS", cursive;
  --hand: "Courier Prime", "Courier New", monospace;
  --intro-total: 2500ms;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

/* O cursor e ele. Verde por defeito, vermelho no que se pode clicar. */
body {
  cursor: url("assets/cursor.svg") 13 2, auto;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--hand);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

/* Grao de papel. Ruido em SVG, sem imagem externa. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
}

.svg-defs { position: absolute; width: 0; height: 0; }

body.intro-open { overflow: hidden; }

a { color: inherit; }

/* ---------------- intro ---------------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--paper);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.intro-inner {
  width: min(92vw, 760px);
  display: grid;
  place-items: center;
  position: relative;
}

.intro-stage { width: 100%; max-width: 620px; max-height: 60vh; height: auto; overflow: visible; }

.i-base {
  transform-origin: 320px 430px;
  animation: base-draw 320ms ease-out both;
}

.i-body {
  transform-origin: 300px 430px;
  animation:
    body-pop 220ms ease-out 300ms both,
    god-candle 800ms cubic-bezier(.16,1.02,.3,1) 520ms both;
}

.i-wick-top {
  transform-origin: 300px 96px;
  animation: wick-shoot 420ms cubic-bezier(.2,.9,.25,1) 1000ms both;
}

.i-wick-bot {
  transform-origin: 300px 426px;
  animation: wick-shoot 300ms ease-out 1180ms both;
}

.i-impact { animation: impact 520ms ease-out 1300ms both; transform-origin: 310px 30px; }

.i-face { animation: face-in 260ms ease-out 1460ms both; }

.intro-logo {
  font-family: var(--marker);
  font-size: clamp(2.6rem, 9vw, 5rem);
  margin: -10px 0 0;
  letter-spacing: .01em;
  clip-path: inset(0 100% 0 0);
  animation: write 760ms steps(18, end) 980ms both;
}

.intro-skip {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  font-size: 13px;
  opacity: 0;
  animation: fade-in 400ms ease-out 1900ms both;
}

.intro.is-done { animation: lift 460ms cubic-bezier(.6,0,.9,.4) both; }

@keyframes base-draw { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes body-pop  { from { transform: scaleY(0); } to { transform: scaleY(.07); } }
@keyframes god-candle {
  0%   { transform: scaleY(.07); }
  72%  { transform: scaleY(1.05); }
  86%  { transform: scaleY(.97); }
  100% { transform: scaleY(1); }
}
@keyframes wick-shoot { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes impact {
  0%   { transform: scale(.35); opacity: 0; }
  35%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes face-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes write { to { clip-path: inset(0 0 0 0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: .55; } }
@keyframes lift { to { transform: translateY(-102%); } }

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 70px 20px 90px;
  overflow: hidden;
}

.hero-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .13;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  text-align: center;
  max-width: 900px;
}

.hero-title {
  font-family: var(--marker);
  font-size: clamp(4rem, 17vw, 11rem);
  line-height: .85;
  margin: 0 0 -14px;
  transform: rotate(-2deg);
}

.hero-mascot { width: clamp(150px, 30vw, 250px); margin: 6px 0 18px; }

.mascot { width: 100%; height: auto; display: block; overflow: visible; }
.mascot .m-body { fill: var(--green); }
.mascot.is-red .m-body { fill: var(--red); }

.hero-bio { margin: 0 0 6px; font-size: clamp(15px, 2.1vw, 19px); max-width: 30em; }
.hero-bio b { font-weight: 700; }

.hero-chain {
  font-family: var(--marker);
  font-size: 15px;
  margin: 2px 0 22px;
  transform: rotate(1.2deg);
  color: var(--green);
  border-bottom: 3px solid var(--green);
  padding-bottom: 2px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 22px; }

/* botoes: retangulos desenhados, ligeiramente tortos */
.btn {
  font-family: var(--marker);
  font-size: 20px;
  text-decoration: none;
  padding: 12px 30px;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 16px 9px 18px 7px;
  cursor: pointer;
  display: inline-block;
  transform: rotate(-1deg);
  transition: transform 120ms ease, background 120ms ease;
}
.btn:hover { transform: rotate(1deg) translateY(-3px); }
.btn:active { transform: rotate(0deg) translateY(1px); }
.btn-buy { background: var(--green); }
.btn-buy.is-soon { background: var(--paper); }
.btn-ghost { transform: rotate(1.4deg); }
.btn-react { font-size: 26px; padding: 14px 54px; background: var(--paper); }

.ca-bar {
  font-family: var(--hand);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: 12px 8px 14px 6px;
  cursor: pointer;
  font-size: 14px;
  max-width: 100%;
  transform: rotate(.6deg);
}
.ca-bar.is-soon { cursor: default; opacity: .75; }
.ca-label { font-family: var(--marker); font-size: 15px; }
.ca-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-copy { font-family: var(--marker); font-size: 14px; border-bottom: 2px solid var(--ink); }

.scroll-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--marker);
  font-size: 14px;
  text-align: center;
  line-height: 1.2;
  opacity: .5;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 7px); } }

/* ---------------- seccoes ---------------- */

.sec-title {
  font-family: var(--marker);
  font-size: clamp(2.2rem, 7vw, 4rem);
  margin: 0;
  transform: rotate(-1.4deg);
}
.sec-sub { margin: 4px 0 0; opacity: .7; }

.react {
  border-top: 4px solid var(--ink);
  padding: 54px 20px 62px;
  display: grid;
  justify-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

.react-stage {
  position: relative;
  width: min(210px, 52vw);
  margin: 22px 0 20px;
}
.react-stage.is-shaking { animation: shake 340ms ease-in-out; }
@keyframes shake {
  10%, 90% { transform: translateX(-4px) rotate(-.8deg); }
  30%, 70% { transform: translateX(6px) rotate(1deg); }
  50%      { transform: translateX(-7px) rotate(-1.2deg); }
}

.react-mascot { cursor: pointer; }
.react-mascot .mascot { width: 100%; }

.react-flyers { position: absolute; inset: -40px -60px; pointer-events: none; overflow: visible; }

.flyer {
  position: absolute;
  bottom: 18%;
  font-family: var(--marker);
  font-size: clamp(18px, 4vw, 26px);
  white-space: nowrap;
  animation: fly 1.15s cubic-bezier(.2,.7,.4,1) forwards;
}
.flyer.is-up { color: var(--green); }
.flyer.is-down { color: var(--red); }
@keyframes fly {
  0%   { transform: translate(0,0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--drift, 0), -210px) rotate(var(--spin, 8deg)); opacity: 0; }
}

.score {
  display: flex;
  gap: 34px;
  margin-top: 26px;
  border: 4px solid var(--ink);
  border-radius: 18px 10px 20px 8px;
  padding: 14px 30px;
  background: var(--paper);
  transform: rotate(-.8deg);
}
.score-cell { display: grid; }
.score-n { font-family: var(--marker); font-size: clamp(2rem, 6vw, 2.8rem); line-height: 1; }
.score-k { font-size: 13px; opacity: .7; letter-spacing: .08em; }
.score-zero { color: var(--red); }

.react-note { min-height: 1.6em; margin: 18px 0 0; font-size: 16px; }

/* ---------------- how to buy ---------------- */

.buy {
  border-top: 4px solid var(--ink);
  padding: 60px 20px 70px;
  display: grid;
  justify-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 34px 0 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  max-width: 900px;
  width: 100%;
}

.card {
  border: 4px solid var(--ink);
  background: var(--paper);
  border-radius: 18px 10px 20px 8px;
  padding: 22px 18px 20px;
  position: relative;
}
.step:nth-child(1) { transform: rotate(-1.6deg); }
.step:nth-child(2) { transform: rotate(.9deg); }
.step:nth-child(3) { transform: rotate(-.6deg); }

.step-n {
  position: absolute;
  top: -20px;
  left: -14px;
  font-family: var(--marker);
  font-size: 30px;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
}
.step-art { width: 100%; max-width: 130px; height: auto; margin-bottom: 8px; }
.step p { margin: 0; }
.mono { font-size: 14px; opacity: .7; }

/* ---------------- footer ---------------- */

.foot {
  border-top: 4px solid var(--ink);
  padding: 34px 20px 0;
  text-align: center;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

/* Faixa de velas a fechar a pagina. Arte, nao dados. */
.foot-candles {
  display: block;
  width: 100%;
  height: clamp(120px, 22vw, 230px);
  margin-top: 26px;
}
.foot-links { display: flex; gap: 26px; justify-content: center; font-family: var(--marker); font-size: 20px; }
.foot-links a { text-decoration: none; border-bottom: 3px solid var(--ink); }
.foot-links a:hover { border-bottom-style: dashed; }

/* ---------------- responsivo ---------------- */

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; max-width: 380px; }
  .btn { min-height: 50px; display: inline-flex; align-items: center; }
  .score { gap: 22px; padding: 12px 20px; }
  .hero { padding-top: 46px; }
  .ca-bar { font-size: 12.5px; gap: 8px; }
  .intro-stage { width: 118%; }
}

/* ---------------- movimento reduzido ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro { display: none; }
  .scroll-hint { animation: none; }
  .react-stage.is-shaking { animation: none; }
  .flyer { animation-duration: .01ms; }
  .btn { transition: none; }
}

/* ---------------- pfp lab ---------------- */

.pfp {
  border-top: 4px solid var(--ink);
  padding: 54px 20px 64px;
  display: grid;
  justify-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

.pfp-wrap {
  display: grid;
  grid-template-columns: minmax(0, 512px) minmax(240px, 320px);
  gap: 26px;
  align-items: start;
  margin-top: 30px;
  max-width: 900px;
  width: 100%;
}

.pfp-stage { display: grid; justify-items: center; }

#pfp-canvas {
  width: 100%;
  max-width: 512px;
  aspect-ratio: 1;
  border: 4px solid var(--ink);
  border-radius: 18px 10px 20px 8px;
  background: var(--paper);
  touch-action: none;
  cursor: grab;
}
#pfp-canvas:active { cursor: grabbing; }

.pfp-hint { font-size: 13px; opacity: .6; margin: 10px 0 0; }

.pfp-side { display: grid; gap: 18px; text-align: left; }

.pfp-group {
  border: 4px solid var(--ink);
  border-radius: 16px 9px 18px 7px;
  padding: 14px;
  background: var(--paper);
  display: grid;
  gap: 10px;
}
.pfp-group:nth-child(2) { transform: rotate(.5deg); }

.pfp-label {
  font-family: var(--marker);
  font-size: 17px;
}

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 34px;
  height: 34px;
  border: 3px solid var(--ink);
  border-radius: 10px 7px 12px 6px;
  cursor: pointer;
  padding: 0;
}

.stickers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sticker-btn {
  border: 3px solid var(--ink);
  border-radius: 10px 7px 12px 6px;
  background: var(--paper);
  cursor: pointer;
  padding: 6px;
  height: 58px;
  display: grid;
  place-items: center;
  transition: transform 100ms ease;
}
.sticker-btn:hover { transform: rotate(-3deg) scale(1.06); }
.sticker-btn img { max-width: 100%; max-height: 42px; display: block; }

.slider { display: grid; gap: 4px; font-size: 13px; }
.slider input { width: 100%; accent-color: var(--green); }

.btn-small {
  font-family: var(--marker);
  font-size: 15px;
  padding: 8px 16px;
  border: 3px solid var(--ink);
  border-radius: 12px 8px 14px 6px;
  background: var(--paper);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: inline-block;
  transform: none;
}
.btn-small:hover { transform: rotate(-1deg); }

.pfp-actions { display: grid; gap: 10px; }
.pfp-actions .btn-buy { text-align: center; }

/* ---------------- memes ---------------- */

.memes {
  border-top: 4px solid var(--ink);
  padding: 54px 20px 64px;
  display: grid;
  justify-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

.meme-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
  max-width: 980px;
  width: 100%;
}

.meme {
  padding: 10px 10px 8px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  font: inherit;
  color: inherit;
  transition: transform 120ms ease;
}
.meme:nth-child(odd) { transform: rotate(-1deg); }
.meme:nth-child(even) { transform: rotate(.8deg); }
.meme:hover { transform: rotate(0deg) translateY(-4px); }
.meme img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border: 3px solid var(--ink); }
.meme-title { font-family: var(--marker); font-size: 15px; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 17, 15, .82);
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 24px;
  grid-auto-rows: min-content;
  align-content: center;
}
.lightbox-inner { margin: 0; display: grid; justify-items: center; gap: 10px; }
.lightbox img {
  max-width: min(88vw, 720px);
  max-height: 70vh;
  border: 4px solid var(--paper);
  background: var(--paper);
  display: block;
}
.lightbox figcaption { font-family: var(--marker); font-size: 20px; color: var(--paper); }
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  font-family: var(--marker);
  font-size: 18px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 12px 8px 14px 6px;
  padding: 6px 16px;
  cursor: pointer;
}
.lightbox .btn-small { background: var(--paper); }

@media (max-width: 860px) {
  .pfp-wrap { grid-template-columns: 1fr; max-width: 520px; }
  .pfp-side { text-align: center; }
  .pfp-label { text-align: left; }
}

/* ---------------- cursor ---------------- */

a, button, summary,
.btn, .btn-small, .ca-bar, .meme, .sticker-btn, .swatch,
.lightbox-close, #pfp-canvas {
  cursor: url("assets/cursor-click.svg") 13 2, pointer;
}

input[type="range"] { cursor: url("assets/cursor-click.svg") 13 2, ew-resize; }
#pfp-canvas:active { cursor: url("assets/cursor-click.svg") 13 2, grabbing; }
.ca-bar.is-soon { cursor: url("assets/cursor.svg") 13 2, default; }
