/* ─────────────────────────────────────────────
   $CHEBU — chebucoin.xyz
   Vintage Soviet picture book aesthetic
   ───────────────────────────────────────────── */

:root {
  --bg-cream: #f4ead0;
  --bg-cream-deep: #e8d9b1;
  --paper-fade: rgba(244, 234, 208, 0.55);
  --ink-brown: #3a2818;
  --ink-medium: #5a3a1f;
  --ink-light: #8a6940;
  --accent-blue: #0098EA;
  --accent-blue-dark: #0078ba;
  --orange: #d97a3c;
  --shadow-soft: 0 6px 28px rgba(58, 40, 24, 0.18);
  --shadow-soft-sm: 0 2px 12px rgba(58, 40, 24, 0.12);
  --max-width: 1100px;
  --radius: 10px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Lora', Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-brown);
  background: var(--bg-cream) url('bg_texture.jpg') repeat;
  background-size: 384px 384px;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Subtle wash so the texture doesn't shout under text */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(244,234,208,0.30) 0%, rgba(244,234,208,0.10) 100%);
  pointer-events: none;
  z-index: 0;
}

main, section, footer, .divider { position: relative; z-index: 1; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-blue); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-blue-dark); }

h1, h2, h3 {
  font-family: 'Lora', Georgia, serif;
  color: var(--ink-brown);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.6rem, 7vw, 4.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin-bottom: 1.25rem; }

p { margin-bottom: 1rem; }

em { font-style: italic; color: var(--ink-medium); }

.chapter-mark {
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-light);
  letter-spacing: 0.12em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

/* ─── HERO ──────────────────────────────────── */

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center left;
  z-index: -1;
}

.hero-overlay {
  margin-left: auto;
  padding: 4rem var(--gutter);
  width: min(46%, 540px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-card {
  background: var(--paper-fade);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  padding: 2.25rem 2rem;
  border-radius: var(--radius);
  border: 1px solid rgba(58, 40, 24, 0.12);
  box-shadow: var(--shadow-soft-sm);
}

.ticker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--accent-blue);
  margin-bottom: 0.75rem;
}

.tagline {
  font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  margin: 1.25rem 0 1.75rem;
  color: var(--ink-medium);
  line-height: 1.5;
}

.cta-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease;
  text-align: center;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 2px 0 var(--accent-blue-dark);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--accent-blue-dark); color: #fff; }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--accent-blue-dark); }

.btn-secondary {
  background: rgba(58, 40, 24, 0.06);
  color: var(--ink-brown);
  border-color: rgba(58, 40, 24, 0.25);
}
.btn-secondary:hover { background: rgba(58, 40, 24, 0.12); color: var(--ink-brown); }

/* ─── LORE SECTIONS ─────────────────────────── */

.lore {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) var(--gutter);
}

.lore-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.lore-right .lore-image { order: 2; }
.lore-right .lore-text { order: 1; text-align: right; }

.lore-text p { font-size: clamp(1.05rem, 1.6vw, 1.15rem); }

/* ─── DIVIDER ───────────────────────────────── */

.divider {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.divider img {
  width: 100%;
  opacity: 0.9;
  mix-blend-mode: multiply;
}

/* ─── NUMBERS ───────────────────────────────── */

.numbers {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--gutter);
  text-align: center;
}

.contract {
  background: rgba(58, 40, 24, 0.05);
  border: 1px solid rgba(58, 40, 24, 0.18);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem 1.25rem;
  margin: 1.75rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  max-width: 660px;
}

.contract .label {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-light);
}

.contract .ca {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  word-break: break-all;
  color: var(--ink-brown);
  line-height: 1.4;
}

.copy-btn {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 0.45rem 1.1rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color .2s ease;
  letter-spacing: 0.05em;
}
.copy-btn:hover { background: var(--accent-blue-dark); }

.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin: 2rem 0;
}

.stats li {
  background: rgba(58, 40, 24, 0.04);
  border: 1px solid rgba(58, 40, 24, 0.10);
  border-radius: var(--radius);
  padding: 1.1rem 0.75rem;
  text-align: center;
}

.stats .label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-light);
  margin-bottom: 0.45rem;
}

.stats .value {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-brown);
}

.chart-wrap {
  margin-top: 2.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft-sm);
  background: #fff;
  border: 1px solid rgba(58, 40, 24, 0.12);
}
.chart-wrap iframe {
  width: 100%;
  height: 600px;
  border: 0;
  display: block;
}

.link-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.75rem;
}

.link-pill {
  background: rgba(58, 40, 24, 0.04);
  border: 1px solid rgba(58, 40, 24, 0.18);
  color: var(--ink-medium);
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.link-pill:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

/* ─── UNIVERSE ──────────────────────────────── */

.universe {
  max-width: var(--max-width);
  margin: 2rem auto 4rem;
  padding: clamp(2rem, 4vw, 3rem) var(--gutter);
  text-align: center;
}
.universe img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  margin: 1.75rem auto 1.75rem;
}
.universe .caption {
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--ink-medium);
  line-height: 1.7;
}

/* ─── COMMUNITY ─────────────────────────────── */

.community {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--gutter);
  text-align: center;
}
.community h2 { margin-bottom: 0.75rem; }
.community .caption {
  font-style: italic;
  color: var(--ink-light);
  margin-bottom: 2rem;
}
.community-row {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-community {
  background: var(--ink-brown);
  color: var(--bg-cream);
  padding: 1.05rem 2.4rem;
  font-size: 1.05rem;
  border: 1px solid var(--ink-brown);
}
.btn-community:hover {
  background: var(--ink-medium);
  color: var(--bg-cream);
  transform: translateY(-1px);
}

/* ─── FOOTER ────────────────────────────────── */

footer {
  text-align: center;
  padding: 4rem var(--gutter) 5rem;
  border-top: 1px solid rgba(58, 40, 24, 0.15);
  margin-top: 3rem;
}

.footer-img {
  max-width: 220px;
  margin: 0 auto 1.75rem;
  border-radius: var(--radius);
  opacity: 0.95;
}

.ca-footer {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--ink-light);
  word-break: break-all;
  max-width: 540px;
  margin: 0 auto 0.85rem;
  line-height: 1.5;
}

.disclaimer {
  font-size: 0.88rem;
  color: var(--ink-light);
  font-style: italic;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.copyright {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--ink-light);
  letter-spacing: 0.08em;
  margin-bottom: 0;
}

/* ─── SUBTLE FADE-IN ON SCROLL ──────────────── */

@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .lore, .universe, .numbers, .community {
    animation: fadeUp 0.7s ease-out backwards;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
}

/* ─── RESPONSIVE ────────────────────────────── */

@media (max-width: 768px) {
  body { font-size: 17px; }

  .hero {
    min-height: 78vh;
    align-items: flex-end;
  }
  .hero-img { object-position: center top; }
  .hero-overlay {
    width: 100%;
    margin: 0;
    padding: 1.5rem;
    align-items: stretch;
  }
  .hero-card {
    padding: 1.6rem 1.4rem;
    background: rgba(244, 234, 208, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .cta-row { justify-content: stretch; }
  .cta-row .btn { flex: 1; min-width: 0; padding: 0.85rem 0.5rem; }

  .lore {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .lore-right .lore-image,
  .lore-right .lore-text {
    order: unset;
    text-align: left;
  }

  .chart-wrap iframe { height: 460px; }

  .community-row { flex-direction: column; }
  .btn-community { width: 100%; }
}

@media (max-width: 420px) {
  h1 { font-size: clamp(2.2rem, 10vw, 3rem); }
  .hero-card { padding: 1.4rem 1.2rem; }
}
