/* ============================================================
   GOBLINHOOD — $GHOOD · one-page landing
   ============================================================ */

:root {
  --bg: #0a0d05;
  --lime: #cfec28;
  --lime-soft: #e6ff5c;
  --gold: #eac244;
  --ink: #0d1107;
  --text: #f0f4da;
  --dim: #9aa877;
  --mono: "Space Mono", monospace;
  --display: "Titan One", "Rubik", sans-serif;
  --body: "Rubik", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

img { max-width: 100%; height: auto; }

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

/* ---------------- Atmosphere ---------------- */

.glow {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 42% at 50% 58%, rgba(207, 236, 40, .17), transparent 65%),
    radial-gradient(ellipse 80% 55% at 50% 115%, rgba(207, 236, 40, .12), transparent 60%);
  pointer-events: none;
  animation: breathe 7s ease-in-out infinite;
  z-index: 0;
}

@keyframes breathe {
  0%, 100% { opacity: .85; }
  50% { opacity: 1.15; }
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .5;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(255, 255, 255, .012) 2px 3px),
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(0, 0, 0, .02) 2px 3px);
}

/* drifting embers */

.dust { position: fixed; inset: 0; pointer-events: none; z-index: 1; }

.dust i {
  position: absolute;
  bottom: -12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  opacity: 0;
  animation: drift 11s linear infinite;
}

.dust i:nth-child(1)  { left: 6%;  animation-delay: 0s;    scale: .7; }
.dust i:nth-child(2)  { left: 15%; animation-delay: 2.8s;  scale: 1.1; }
.dust i:nth-child(3)  { left: 24%; animation-delay: 6.4s;  scale: .5; }
.dust i:nth-child(4)  { left: 33%; animation-delay: 1.6s;  scale: .9; }
.dust i:nth-child(5)  { left: 41%; animation-delay: 8.2s;  scale: .6; }
.dust i:nth-child(6)  { left: 52%; animation-delay: 4.4s;  scale: 1; }
.dust i:nth-child(7)  { left: 60%; animation-delay: 9.6s;  scale: .8; }
.dust i:nth-child(8)  { left: 69%; animation-delay: .9s;   scale: .55; }
.dust i:nth-child(9)  { left: 77%; animation-delay: 5.5s;  scale: 1.15; }
.dust i:nth-child(10) { left: 85%; animation-delay: 3.2s;  scale: .65; }
.dust i:nth-child(11) { left: 92%; animation-delay: 7.3s;  scale: .9; }
.dust i:nth-child(12) { left: 97%; animation-delay: 10.2s; scale: .5; }

@keyframes drift {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  8% { opacity: .75; }
  60% { opacity: .45; transform: translateY(-58vh) translateX(-14px); }
  100% { transform: translateY(-104vh) translateX(12px); opacity: 0; }
}

/* ---------------- Topbar ---------------- */

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: .05em;
}

.brand em { color: var(--lime); font-style: normal; }

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
}

.brand:hover img { transform: rotate(360deg) scale(1.12); }

.top-links { display: flex; gap: .6rem; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(207, 236, 40, .45);
  transition: transform .15s, background .15s, border-color .15s;
}

.icon-btn svg { width: 17px; height: 17px; fill: var(--lime); }

.icon-btn:hover {
  background: rgba(207, 236, 40, .14);
  border-color: var(--lime);
  transform: translateY(-2px) rotate(-6deg);
}

/* ---------------- Stage ---------------- */

.stage {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 1.25rem 4rem;
  gap: .35rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid rgba(207, 236, 40, .3);
  border-radius: 999px;
  padding: .42rem 1.05rem;
  margin-bottom: .9rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.title {
  font-family: var(--display);
  font-size: clamp(3.4rem, 11.5vw, 8rem);
  line-height: .92;
  letter-spacing: .015em;
  color: var(--text);
  text-shadow: 0 6px 0 rgba(0, 0, 0, .55), 0 0 70px rgba(207, 236, 40, .3);
}

.title span {
  background: linear-gradient(115deg, var(--lime) 25%, var(--gold) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  font-family: var(--display);
  font-size: clamp(.95rem, 2.6vw, 1.35rem);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--lime);
  margin-top: .5rem;
}

.tagline b { color: var(--gold); }

/* ---------------- Goblin ---------------- */

.goblin-wrap {
  position: relative;
  margin: 1.1rem 0 .9rem;
  display: grid;
  place-items: center;
}

.watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  font-size: clamp(5rem, 22vw, 15rem);
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(207, 236, 40, .13);
  letter-spacing: .04em;
  white-space: nowrap;
  user-select: none;
  animation: breathe 7s ease-in-out infinite;
}

.goblin {
  position: relative;
  height: clamp(230px, 34vh, 340px);
  width: auto;
  cursor: pointer;
  filter: drop-shadow(0 18px 32px rgba(0, 0, 0, .55));
  animation: levitate 5.5s ease-in-out infinite;
  transition: transform .3s ease;
  z-index: 2;
}

.goblin:hover { transform: scale(1.04) rotate(-2deg); }

@keyframes levitate {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -16px; }
}

.shadow {
  position: absolute;
  bottom: -14px;
  width: 130px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(207, 236, 40, .3), transparent 70%);
  animation: shadow-pulse 5.5s ease-in-out infinite;
}

@keyframes shadow-pulse {
  0%, 100% { transform: scaleX(1); opacity: .9; }
  50% { transform: scaleX(.72); opacity: .5; }
}

/* ---------------- CA capsule ---------------- */

.ca-capsule {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  background: rgba(207, 236, 40, .06);
  border: 1px dashed rgba(207, 236, 40, .5);
  border-radius: 12px;
  padding: .68rem 1.05rem;
  color: var(--dim);
  font-family: var(--mono);
  font-size: .92rem;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
  max-width: 92vw;
}

.ca-capsule:hover {
  border-color: var(--lime);
  background: rgba(207, 236, 40, .12);
  transform: translateY(-2px);
}

.ca-tag {
  background: var(--lime);
  color: var(--ink);
  font-weight: 700;
  font-family: var(--body);
  border-radius: 6px;
  padding: .08rem .5rem;
  font-size: .78rem;
}

.ca-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ca-capsule svg { width: 15px; height: 15px; fill: var(--lime); flex-shrink: 0; }

/* ---------------- Links ---------------- */

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .8rem;
  margin-top: 1.15rem;
}

.btn {
  font-family: var(--display);
  font-size: 1.02rem;
  letter-spacing: .04em;
  text-decoration: none;
  padding: .78rem 1.7rem;
  border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}

.btn-solid {
  background: var(--lime);
  color: var(--ink);
  box-shadow: 0 0 26px rgba(207, 236, 40, .35);
}

.btn-solid:hover {
  background: var(--lime-soft);
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 0 44px rgba(207, 236, 40, .55);
}

.btn-line {
  color: var(--lime);
  border: 1.5px solid rgba(207, 236, 40, .55);
}

.btn-line:hover {
  background: rgba(207, 236, 40, .12);
  border-color: var(--lime);
  transform: translateY(-3px) rotate(1deg);
}

.footnote {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--dim);
  opacity: .8;
  margin-top: 1.5rem;
}

/* ---------------- Ticker ---------------- */

.ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--lime);
  padding: .52rem 0;
  overflow: hidden;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .45);
}

.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker 28s linear infinite;
  font-family: var(--display);
  font-size: .95rem;
  color: var(--ink);
  letter-spacing: .08em;
}

@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------------- Toast ---------------- */

#toast {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: var(--lime);
  color: var(--ink);
  font-weight: 700;
  padding: .8rem 1.5rem;
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5), 0 0 30px rgba(207, 236, 40, .3);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), visibility .35s;
  visibility: hidden;
  z-index: 200;
  white-space: nowrap;
  max-width: 92vw;
  text-overflow: ellipsis;
  overflow: hidden;
}

#toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }

/* ---------------- Coin burst ---------------- */

.burst-coin {
  position: fixed;
  width: 42px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 150;
  animation: coin-fall 1.4s ease-in forwards;
}

@keyframes coin-fall {
  0% { transform: translateY(0) rotate(0deg) scale(.6); opacity: 1; }
  100% { transform: translateY(55vh) rotate(360deg) scale(1); opacity: 0; }
}

/* ---------------- Entrance ---------------- */

.rise { opacity: 0; translate: 0 26px; animation: rise .8s cubic-bezier(.22, .9, .36, 1) forwards; }

.r1 { animation-delay: .05s; }
.r2 { animation-delay: .16s; }
.r3 { animation-delay: .28s; }
.r4 { animation-delay: .4s; }
.r5 { animation-delay: .55s; }
.r6 { animation-delay: .68s; }
.r7 { animation-delay: .82s; }

@keyframes rise { to { opacity: 1; translate: 0 0; } }

/* ---------------- Responsive ---------------- */

@media (max-width: 540px) {
  .goblin { height: clamp(200px, 30vh, 280px); }

  .btn { font-size: .92rem; padding: .7rem 1.35rem; }

  .links { gap: .6rem; }

  .ca-capsule { font-size: .8rem; }
}

@media (max-height: 720px) {
  .goblin { height: clamp(180px, 28vh, 260px); }

  .stage { gap: .2rem; }

  .footnote { margin-top: 1rem; }
}

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .rise { opacity: 1; translate: 0 0; }
}
