/* ==========================================================
   RIBBIT :: ink-wash frog on old paper, in the spirit of
   Ito Jakuchu. parchment + sepia ink + one vermillion seal.
   ========================================================== */

:root {
  --paper: #efe1c7;
  --paper-deep: #e4d2ae;
  --ink: #3d342a;
  --ink-soft: #6e604e;
  --band: #5f615c;
  --seal: #b03a2e;
  --script: "Pacifico", cursive;
  --serif: "EB Garamond", Georgia, serif;
  --mono: "Courier Prime", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* elements that animate FROM hidden must land visible when motion is off */
  .hero-text > *, .rv, .panel { opacity: 1 !important; transform: none !important; }
}

body {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 252, 240, .5), rgba(0,0,0,0) 55%),
    radial-gradient(140% 100% at 50% 110%, rgba(95, 97, 92, .18), rgba(0,0,0,0) 50%),
    var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: var(--seal); color: var(--paper); }

.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 60; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono { font-family: var(--mono); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 26px;
  padding: 14px 26px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--ink);
}
.nav-logo {
  font-family: var(--script); font-size: 26px; color: var(--ink); text-decoration: none;
  line-height: 1;
}
.nav-links { display: flex; gap: 20px; flex: 1; }
.nav-links a {
  color: var(--ink-soft); text-decoration: none; font-size: 16px; font-style: italic;
  border-bottom: 1px solid transparent; transition: color .2s, border-color .2s;
}
.nav-links a:hover { color: var(--ink); border-color: var(--ink); }

.ca-pill {
  font-family: var(--mono); font-size: 12px;
  background: var(--ink); color: var(--paper);
  border: 0; padding: 8px 14px; cursor: pointer;
  border-radius: 2px;
  max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ca-pill:hover { background: var(--seal); }

/* ---------- hero ---------- */
.hero { padding: 96px 0 0; text-align: center; }
.hero-text > * { opacity: 0; transform: translateY(12px); animation: rise .8s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-ticker { animation-delay: .05s; }
.hero-tag { animation-delay: .18s; }
.hero-sub { animation-delay: .32s; }
.hero-actions { animation-delay: .46s; }
.ca-bar { animation-delay: .58s; }
.plaque { animation-delay: .72s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.hero-frame {
  border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  background: var(--paper-deep);
}
.hero-banner { width: 100%; max-width: 1200px; display: block; margin: 0 auto; }

/* ribbit ticker strip */
.ticker {
  background: var(--band); color: #d8d4c6;
  border-bottom: 2px solid var(--ink);
  overflow: hidden; white-space: nowrap;
  font-family: var(--mono); font-size: 13px; letter-spacing: .12em;
  padding: 7px 0;
}
.ticker-track { display: inline-flex; animation: tick 40s linear infinite; }
.ticker-track span { padding-right: 0; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.hero-text { padding: 44px 24px 80px; max-width: 760px; margin: 0 auto; }
.hero-ticker {
  font-family: var(--script);
  font-size: clamp(56px, 11vw, 110px);
  font-weight: 400; line-height: 1.15;
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--paper-deep);
}
.hero-tag {
  font-style: italic; font-size: clamp(20px, 3vw, 26px); color: var(--ink-soft);
  margin-top: 2px;
}
.hero-sub { margin: 22px auto 0; max-width: 34em; }
.kanji-inline { font-size: .95em; color: var(--seal); }

.hero-actions { margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  font-family: var(--mono); font-size: 14px; text-transform: lowercase;
  color: var(--ink); background: transparent;
  border: 2px solid var(--ink); border-radius: 2px;
  padding: 12px 24px; text-decoration: none;
  transition: transform .15s ease, background .2s, color .2s;
}
.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn-seal { background: var(--seal); border-color: var(--seal); color: #f6ead2; }
.btn-seal:hover { background: #93291e; border-color: #93291e; color: #f6ead2; }

.ca-bar {
  margin: 26px auto 0; display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center;
  border: 2px dashed var(--ink-soft); border-radius: 2px;
  padding: 10px 16px; font-size: 14px;
  max-width: 92vw;
}
.ca-bar .mono { word-break: break-all; }
.ca-label {
  font-family: var(--mono); font-weight: 700; color: var(--seal); font-size: 13px;
}
.copy-btn {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  background: var(--ink); color: var(--paper); border: 0; border-radius: 2px;
  padding: 5px 10px; cursor: pointer;
}
.copy-btn:hover { background: var(--seal); }

/* plaque: the vitals */
.plaque {
  margin: 34px auto 0; max-width: 640px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 2px solid var(--ink); border-radius: 2px;
  background: var(--paper-deep);
  box-shadow: 3px 3px 0 rgba(61,52,42,.25);
}
.plaque-item {
  padding: 12px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.plaque-item + .plaque-item { border-left: 2px solid var(--ink); }
.plaque-k { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--seal); }
.plaque-v { font-size: 15px; color: var(--ink); }
@media (max-width: 640px) {
  .plaque { grid-template-columns: repeat(2, 1fr); }
  .plaque-item:nth-child(3) { border-left: 0; }
  .plaque-item:nth-child(n+3) { border-top: 2px solid var(--ink); }
}

/* generic scroll reveal */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.rv.seen { opacity: 1; transform: translateY(0); }

/* ---------- sections ---------- */
.section-kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--seal); margin-bottom: 10px;
}
.section-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 5vw, 46px); line-height: 1.15;
}

/* ---------- lore ---------- */
.lore {
  position: relative; overflow: hidden;
  border-top: 2px solid var(--ink);
  background: var(--paper-deep);
  padding: 84px 24px;
}
.kanji-watermark {
  position: absolute; right: -30px; top: 50%; transform: translateY(-50%);
  font-size: clamp(280px, 40vw, 520px); line-height: 1;
  color: rgba(61, 52, 42, .06); pointer-events: none; user-select: none;
}
.lore-inner { max-width: 880px; margin: 0 auto; position: relative; }
.lore-cols { margin-top: 26px; display: grid; gap: 18px; max-width: 44em; }
.lore-cols p { color: var(--ink); }
.lore-seal-line { position: relative; }
.seal {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; margin-left: 14px; vertical-align: middle;
  background: var(--seal); color: #f6ead2;
  font-size: 24px; border-radius: 4px;
  transform: rotate(-6deg);
  box-shadow: 0 2px 0 rgba(61,52,42,.35);
}

/* ---------- comic ---------- */
.comic {
  border-top: 2px solid var(--ink);
  padding: 84px 24px;
  text-align: center;
}
.comic-sub { font-style: italic; color: var(--ink-soft); margin-top: 8px; }
.comic-grid {
  margin: 44px auto 0; max-width: 1200px;
  display: grid; gap: 18px;
  grid-template-columns: repeat(4, 1fr);
}
.panel {
  background: #f7efdc;
  border: 2px solid var(--ink); border-radius: 2px;
  padding: 6px;
  box-shadow: 3px 3px 0 rgba(61,52,42,.25);
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.panel.seen { opacity: 1; transform: translateY(0); }
.panel img { width: 100%; display: block; }
.panel { cursor: zoom-in; }
.panel:hover { transform: translateY(-3px) !important; }
.comic-note { margin-top: 30px; font-size: 15px; color: var(--ink-soft); }
.comic-note a { color: var(--seal); }

@media (max-width: 1000px) { .comic-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .comic-grid { grid-template-columns: 1fr; max-width: 420px; } }

/* ---------- how to buy ---------- */
.buy {
  border-top: 2px solid var(--ink);
  background: var(--paper-deep);
  padding: 84px 24px 96px;
  text-align: center;
}
.buy-grid {
  margin: 44px auto 0; max-width: 1080px;
  display: grid; gap: 18px;
  grid-template-columns: repeat(4, 1fr);
  text-align: left;
}
@media (max-width: 1100px) { .buy-grid { grid-template-columns: repeat(2, 1fr); max-width: 640px; } }
@media (max-width: 560px) { .buy-grid { grid-template-columns: 1fr; max-width: 420px; } }
.buy-card {
  background: var(--paper);
  border: 2px solid var(--ink); border-radius: 2px;
  padding: 24px 22px;
  box-shadow: 3px 3px 0 rgba(61,52,42,.25);
}
.buy-num {
  font-size: 30px; color: var(--seal); display: block; margin-bottom: 8px;
}
.buy-card h3 { font-weight: 500; font-size: 22px; margin-bottom: 6px; }
.buy-card p { font-size: 16px; color: var(--ink-soft); }

/* ---------- footer ---------- */
.footer {
  border-top: 2px solid var(--ink);
  background: var(--band);
  color: #e9e4d5;
  padding: 56px 24px 64px;
  text-align: center;
}
.footer-ca {
  display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center;
  font-size: 14px;
}
.footer-ca .mono { word-break: break-all; color: #f3eddb; }
.footer-ca .ca-label { color: #f0c8a0; }
.footer-socials { margin-top: 18px; display: flex; gap: 22px; justify-content: center; }
.footer-socials a {
  color: #e9e4d5; font-family: var(--mono); font-size: 14px; text-decoration: none;
  border-bottom: 1px solid rgba(233,228,213,.5);
}
.footer-socials a:hover { color: #fff; border-color: #fff; }
.footer-line { margin-top: 26px; font-style: italic; }
.footer-fine { margin: 10px auto 0; max-width: 44em; font-size: 13.5px; opacity: .7; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(43, 37, 29, .88);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-height: 86vh; max-width: min(680px, 78vw);
  border: 3px solid var(--paper); border-radius: 2px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  background: var(--paper);
}
.lb-close {
  position: absolute; top: 18px; right: 22px;
  font-size: 34px; line-height: 1; color: var(--paper);
  background: transparent; border: 0; cursor: pointer;
}
.lb-nav {
  font-size: 26px; color: var(--paper);
  background: transparent; border: 2px solid var(--paper); border-radius: 2px;
  width: 48px; height: 48px; cursor: pointer; flex: 0 0 auto;
  transition: background .2s;
}
.lb-nav:hover { background: var(--seal); border-color: var(--seal); }
@media (max-width: 560px) { .lb-nav { display: none; } .lightbox img { max-width: 92vw; } }

/* ---------- hop to top ---------- */
.hop-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 70;
  font-family: var(--mono); font-size: 13px;
  background: var(--ink); color: var(--paper);
  border: 0; border-radius: 2px; padding: 10px 14px; cursor: pointer;
  box-shadow: 3px 3px 0 rgba(61,52,42,.3);
  transition: background .2s, transform .15s;
}
.hop-top:hover { background: var(--seal); transform: translateY(-3px); }
.hop-top[hidden] { display: none; }

@media (max-width: 640px) {
  .nav { gap: 14px; padding: 12px 16px; }
  .nav-links { display: none; }
  .nav-logo { margin-right: auto; }
  .hop-top span { display: none; }
}
