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

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: #3EA9F0;
  color: #10233d;
  font-family: Sora, "Segoe UI", sans-serif;
  min-height: 100%;
}

body { min-height: 100dvh; position: relative; }

img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }

/* CSS sky sits behind the canvas as a fallback / base */
.sky-css {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 45% at 78% 6%, #fff3b0 0%, rgba(255,243,176,0) 55%),
    linear-gradient(180deg, #2c90e4 0%, #57b8f7 42%, #a6ddff 78%, #e8f6ff 100%);
}
body.webgl .sun-css { opacity: 0; }

.sun-css {
  position: absolute;
  top: 3%;
  right: 7%;
  width: min(30vw, 240px);
  height: min(30vw, 240px);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fffcec 0%, #ffe56a 42%, #ffc24a 68%, rgba(255,194,74,0) 70%);
  box-shadow: 0 0 90px 36px rgba(255, 220, 110, 0.5);
}

#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
}

/* STORY */
.story {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}

.chap {
  width: min(920px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 22px 16px 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 10px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}
.chap.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
#chap-hero { position: relative; }
#chap-hero.is-on { transition-delay: 0s; }

.kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1a3a63;
  text-shadow: 0 1px 0 rgba(255,255,255,0.35);
}
.kicker span {
  display: inline-block;
  background: #10233d;
  color: #f4e9c8;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: 2px;
  margin-right: 4px;
}

.hero-title {
  margin: 0;
  font-family: "Paytone One", Sora, sans-serif;
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.02em;
  color: #10233d;
  text-shadow: 0 3px 0 rgba(255,255,255,0.35), 0 18px 40px rgba(16, 50, 110, 0.18);
}
.hero-title .line {
  display: block;
  font-size: clamp(34px, 11vw, 86px);
}
.hero-title .can-word {
  font-size: clamp(72px, 22vw, 168px);
  letter-spacing: 0.02em;
  color: #c41222;
  -webkit-text-stroke: 0;
  text-shadow:
    0 4px 0 #7a0a14,
    0 18px 50px rgba(160, 20, 30, 0.25);
}

.lead, .blurb, .narrative {
  margin: 0;
  max-width: 36rem;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
  color: #123055;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}
.narrative a, .post-view {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #1a3a63;
  opacity: 0.75;
  animation: hintBob 2.2s ease-in-out infinite;
  text-align: center;
  pointer-events: none;
}
.scroll-hint::after {
  content: "";
  display: block;
  width: 1px;
  height: 22px;
  margin: 8px auto 0;
  background: linear-gradient(#1a3a63, transparent);
}
@keyframes hintBob {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(6px); opacity: 1; }
}

#chap-crack, #chap-end { justify-content: flex-end; padding-bottom: 36px; }
#chap-crack h2, #chap-end h2, #chap-post h2 {
  margin: 0;
  font-family: "Paytone One", Sora, sans-serif;
  font-size: clamp(36px, 9vw, 72px);
  line-height: 0.92;
  color: #10233d;
  text-shadow: 0 3px 0 rgba(255,255,255,0.35);
}

#chap-post {
  justify-content: center;
  align-items: center;
  text-align: left;
  gap: 18px;
}

/* VLAD POST CARD — avatar-free, custom, not a widget */
.post-card {
  display: block;
  width: min(560px, 100%);
  text-decoration: none;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(16,35,61,0.08);
  border-radius: 28px;
  padding: 22px 24px 18px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9),
    0 24px 60px rgba(16, 40, 80, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: rotate(-1.1deg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.post-card:hover { transform: rotate(0deg) translateY(-3px); box-shadow: 0 28px 70px rgba(16,40,80,0.28); }
.post-top { margin-bottom: 14px; }
.post-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0b1419;
}
.post-meta {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #536471;
}
.post-text {
  margin: 0;
  font-family: "Paytone One", Sora, sans-serif;
  font-size: clamp(32px, 7vw, 48px);
  line-height: 1.05;
  color: #0b1419;
  letter-spacing: -0.02em;
}
.post-view {
  margin: 16px 0 0;
  font-size: 13px;
  color: #1a3a63;
}
.narrative { text-align: center; max-width: 32rem; background: rgba(255,255,255,0.72); padding: 12px 16px; border-radius: 16px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.chart-bay {
  width: min(560px, 100%);
  background: rgba(16, 35, 61, 0.78);
  color: #eaf4ff;
  border-radius: 16px;
  padding: 10px;
  border: 2px solid rgba(255,255,255,0.2);
}
.chart-label {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.7;
}
.chart-frame { width: 100%; height: 260px; border-radius: 10px; overflow: hidden; background: #0b1220; }
.chart-frame iframe { width: 100%; height: 100%; border: 0; }

.disclaimer {
  margin: 8px 0 0;
  max-width: 36rem;
  font-size: 11px;
  line-height: 1.5;
  color: #1a3a63;
  opacity: 0.88;
}

/* DOCK — enamel campaign pins */
.dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 8;
  width: min(720px, calc(100% - 16px));
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.dock .enamel { pointer-events: auto; }

.enamel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 54px;
  padding: 6px 4px 7px;
  border-radius: 16px;
  border: 2px solid #3a2a12;
  box-shadow:
    0 3px 0 #2a1c0c,
    inset 0 1px 0 rgba(255,255,255,0.7);
  overflow: hidden;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.enamel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.5) 48%, transparent 62%);
  transform: translateX(-120%);
  pointer-events: none;
}
.enamel:hover { filter: brightness(1.05); transform: translateY(-2px); }
.enamel:hover::after { animation: shine 0.7s ease; }
.enamel:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #2a1c0c, inset 0 3px 6px rgba(0,0,0,0.2);
}
.enamel.buy { background: linear-gradient(180deg, #ffe08a 0%, #f0b430 100%); }
.enamel.copy { background: linear-gradient(180deg, #e8eef8 0%, #c5d0e4 100%); }
.enamel.chart { background: linear-gradient(180deg, #c8ecff 0%, #7ec8f0 100%); }
.enamel.x { background: linear-gradient(180deg, #fff 0%, #d9dee8 100%); }
.enamel.tg { background: linear-gradient(180deg, #d9ecff 0%, #8eb8e8 100%); }
.e-k {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #6a4a18;
  line-height: 1;
}
.e-l {
  font-family: "Paytone One", Sora, sans-serif;
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #10233d;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes shine { to { transform: translateX(120%); } }

/* TOAST */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(16px);
  z-index: 30;
  min-width: 140px;
  max-width: calc(100% - 24px);
  background: #10233d;
  color: #f4e9c8;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid #f4e9c8;
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* LOADER */
#loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(180deg, #2f96e8 0%, #7ec8f8 100%);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}
#loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-can {
  width: min(160px, 42vw);
  height: auto;
  filter: drop-shadow(0 16px 24px rgba(16,40,90,0.35));
  animation: loaderRise 1.1s cubic-bezier(.2,.8,.2,1) both;
}
.loader-brand {
  margin: 0;
  font-family: "Paytone One", Sora, sans-serif;
  font-size: clamp(18px, 5vw, 26px);
  letter-spacing: 0.06em;
  color: #10233d;
  text-align: center;
}
.loader-log {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1a3a63;
}
@keyframes loaderRise {
  from { opacity: 0; transform: translateY(40px) rotate(-8deg) scale(0.9); }
  to { opacity: 1; transform: translateY(0) rotate(-4deg) scale(1); }
}

@media (min-width: 800px) {
  .chap { padding: 36px 24px 40px; }
  .e-l { font-size: 13px; }
  .enamel { min-height: 60px; border-radius: 18px; }
  .dock { width: min(760px, calc(100% - 32px)); gap: 8px; }
  #chap-hero { padding-top: 48px; }
  .lead { font-size: 17px; }
}

@media (max-width: 420px) {
  .chap { padding: 14px 12px 16px; }
  .hero-title .line { font-size: clamp(30px, 10.5vw, 48px); }
  .hero-title .can-word { font-size: clamp(64px, 20vw, 96px); }
  .e-l { font-size: 10px; }
  .enamel.x .e-l { font-size: 12px; }
  .enamel.x .e-l { /* shorter label set in HTML via media? keep readable */ }
  .enamel { min-height: 50px; padding: 5px 2px 6px; border-radius: 14px; }
  .post-card { padding: 18px 16px 14px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .chap { opacity: 1; transform: none; }
  .loader-can { animation: none; }
  #loader { transition: opacity 0.2s linear; }
}

.x-short { display: none; }
@media (max-width: 420px) {
  .x-full { display: none; }
  .x-short { display: inline; }
}
