/* Chinese Inu — Lantern Festival Night Market */
:root {
  --red-deep: #1a0508;
  --red-dark: #3d0a12;
  --red-mid: #8b1525;
  --red-bright: #c41e3a;
  --red-glow: #ff2d4a;
  --gold: #f0c14b;
  --gold-bright: #ffe08a;
  --gold-dim: #b8860b;
  --ink: #0d0204;
  --cream: #fff5e6;
  --paper: #faf0e0;
  --stall-wood: #2a1210;
  --lantern-glow: rgba(255, 180, 60, 0.55);
  --font-display: "ZCOOL XiaoWei", "Noto Serif SC", Georgia, serif;
  --font-body: "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  --max: 1120px;
  --nav-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color .2s, opacity .2s; }
a:hover { color: var(--gold-bright); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* —— Sticky hanging lanterns —— */
.lantern-rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 100;
  pointer-events: none;
  display: flex;
  justify-content: space-around;
  padding: 0 4vw;
  background: linear-gradient(180deg, rgba(26,5,8,.92) 0%, transparent 100%);
}

.lantern {
  width: 28px;
  height: 40px;
  position: relative;
  animation: sway 3.5s ease-in-out infinite;
  transform-origin: top center;
}
.lantern:nth-child(odd) { animation-delay: -.8s; }
.lantern:nth-child(3n) { animation-delay: -1.6s; width: 22px; height: 32px; }
.lantern:nth-child(4n) { animation-delay: -2.4s; }

.lantern::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 1px;
  height: 12px;
  background: var(--gold-dim);
  transform: translateX(-50%);
}
.lantern .bulb {
  width: 100%;
  height: 70%;
  background: radial-gradient(ellipse at 40% 30%, #ff6b4a, var(--red-bright) 50%, var(--red-dark));
  border-radius: 40% 40% 45% 45%;
  box-shadow: 0 0 18px var(--lantern-glow), 0 0 40px rgba(196,30,58,.35);
  position: relative;
}
.lantern .bulb::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 10px;
  background: var(--gold);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 8px rgba(255,200,80,.5);
}
.lantern .tassel {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 14px;
  background: linear-gradient(var(--gold), transparent);
}

@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

/* —— Nav —— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  background: rgba(13, 2, 4, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(240, 193, 75, 0.18);
  margin-top: 8px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: .02em;
}
.nav-brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  aspect-ratio: 1;
}
.nav-brand .ticker {
  color: var(--gold);
  font-size: .85rem;
  font-family: var(--font-body);
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}
.nav-links a {
  color: var(--cream);
  font-size: .9rem;
  font-weight: 500;
  opacity: .9;
}
.nav-links a:hover { color: var(--gold); opacity: 1; }

.nav-x {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  border: 1px solid rgba(240,193,75,.45);
  border-radius: 999px;
  color: var(--gold) !important;
  font-weight: 600 !important;
  font-size: .85rem !important;
}
.nav-x:hover {
  background: rgba(240,193,75,.12);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: calc(var(--nav-h) + 8px);
    right: 0;
    left: 0;
    flex-direction: column;
    padding: 1.25rem;
    background: rgba(13,2,4,.96);
    border-bottom: 1px solid rgba(240,193,75,.2);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform .3s, opacity .3s;
    gap: 1rem;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

/* —— Envelope rain —— */
.envelope-rain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.envelope {
  position: absolute;
  top: -60px;
  width: 28px;
  height: 36px;
  background: linear-gradient(145deg, var(--red-bright), var(--red-dark));
  border-radius: 3px;
  opacity: .55;
  animation: fall linear infinite;
  box-shadow: 0 0 8px rgba(196,30,58,.4);
}
.envelope::before {
  content: "福";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--gold);
  font-family: var(--font-display);
}
@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); opacity: .6; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: min(92vh, 900px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--red-deep);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  aspect-ratio: 16 / 9;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(13,2,4,.88) 0%, rgba(13,2,4,.55) 42%, rgba(13,2,4,.25) 70%, transparent 100%),
    linear-gradient(180deg, rgba(13,2,4,.35) 0%, transparent 30%, rgba(13,2,4,.7) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: inherit;
  display: flex;
  align-items: center;
}

.hero-content {
  position: relative;
  z-index: 3;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 4rem clamp(1.25rem, 4vw, 2.5rem);
  max-width: 560px;
  margin-left: clamp(1rem, 8vw, 6rem);
}

.hero-character {
  position: absolute;
  right: clamp(0.5rem, 4vw, 3rem);
  bottom: 0;
  top: auto;
  z-index: 2;
  width: min(48vw, 560px);
  max-width: 52%;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.hero-character picture,
.hero-character img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(82vh, 760px);
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 28px rgba(196, 30, 58, 0.25));
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 78%, transparent 100%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .85rem;
  background: rgba(196,30,58,.35);
  border: 1px solid rgba(240,193,75,.4);
  border-radius: 999px;
  font-size: .8rem;
  color: var(--gold-bright);
  margin-bottom: 1.25rem;
  letter-spacing: .04em;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  line-height: 1.1;
  color: var(--cream);
  text-shadow: 0 2px 24px rgba(0,0,0,.6), 0 0 40px rgba(196,30,58,.3);
  margin-bottom: .35rem;
}
.hero h1 .gold { color: var(--gold); }

.hero-ticker {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: var(--gold);
  font-weight: 700;
  letter-spacing: .08em;
  margin-bottom: 1rem;
}

.hero-tagline {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: rgba(255,245,230,.9);
  margin-bottom: 1.75rem;
  max-width: 42ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .75rem 1.35rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  transition: transform .15s, box-shadow .2s, background .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-bright), var(--red-mid));
  color: var(--cream);
  box-shadow: 0 4px 20px rgba(196,30,58,.45), inset 0 1px 0 rgba(255,255,255,.15);
  border: 1px solid rgba(240,193,75,.3);
}
.btn-primary:hover:not(:disabled):not(.is-disabled) {
  box-shadow: 0 6px 28px rgba(196,30,58,.6);
  background: linear-gradient(135deg, var(--red-glow), var(--red-bright));
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(240,193,75,.35);
}
.btn-gold:hover:not(:disabled):not(.is-disabled) {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(240,193,75,.5);
  color: var(--gold);
}
.btn-ghost:hover:not(:disabled):not(.is-disabled) {
  background: rgba(240,193,75,.1);
}

.hero-social {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .9rem;
}
.hero-social a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--cream);
  opacity: .85;
}
.hero-social a:hover { opacity: 1; color: var(--gold); }

/* —— Market street sections —— */
.market {
  position: relative;
  padding: 4rem 0 2rem;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(196,30,58,.18), transparent 50%),
    radial-gradient(ellipse at 80% 40%, rgba(240,193,75,.08), transparent 45%),
    linear-gradient(180deg, var(--ink) 0%, var(--red-deep) 40%, var(--ink) 100%);
}

.market::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(180deg, rgba(13,2,4,.9), transparent);
  pointer-events: none;
}

.section {
  width: min(100%, var(--max));
  margin: 0 auto 3.5rem;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

.stall {
  background: linear-gradient(165deg, rgba(61,10,18,.75), rgba(26,5,8,.9));
  border: 2px solid rgba(240,193,75,.28);
  border-radius: 16px;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  position: relative;
  box-shadow:
    0 0 0 1px rgba(139,21,37,.4),
    0 20px 50px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.stall::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(70%, 280px);
  height: 28px;
  background: linear-gradient(90deg, transparent, var(--red-bright) 15%, var(--red-mid) 50%, var(--red-bright) 85%, transparent);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 -4px 20px rgba(196,30,58,.4);
  clip-path: polygon(0 100%, 5% 0, 95% 0, 100% 100%);
}

.stall-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  color: var(--gold);
  text-align: center;
  margin-bottom: .35rem;
  letter-spacing: .03em;
}
.stall-sub {
  text-align: center;
  color: rgba(255,245,230,.65);
  font-size: .9rem;
  margin-bottom: 1.75rem;
}

/* —— Lucky pouch CA —— */
.pouch {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.pouch-box {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(240,193,75,.2), transparent 60%),
    linear-gradient(180deg, #4a1018, #1a0508);
  border: 2px solid var(--gold);
  border-radius: 20px;
  padding: 1.75rem 1.5rem;
  position: relative;
  box-shadow: 0 0 40px rgba(240,193,75,.15), inset 0 0 30px rgba(196,30,58,.2);
}
.pouch-box::before,
.pouch-box::after {
  content: "🪙";
  position: absolute;
  top: -12px;
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}
.pouch-box::before { left: 18%; }
.pouch-box::after { right: 18%; }

.pouch-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--gold);
  margin-bottom: .75rem;
  font-weight: 700;
}

.ca-display {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: clamp(.85rem, 2.5vw, 1.05rem);
  color: var(--cream);
  word-break: break-all;
  padding: .85rem 1rem;
  background: rgba(0,0,0,.35);
  border-radius: 10px;
  border: 1px dashed rgba(240,193,75,.35);
  margin-bottom: 1rem;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ca-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
}

.trade-links {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  margin-top: 1.25rem;
}

/* —— About —— */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2rem;
  align-items: center;
}
@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; }
}

.about-portrait {
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid rgba(240,193,75,.45);
  box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 0 30px rgba(196,30,58,.2);
  max-width: 360px;
  margin: 0 auto;
}
.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text p {
  margin-bottom: 1rem;
  color: rgba(255,245,230,.88);
  font-size: 1.05rem;
}
.about-text .bio {
  font-size: 1.15rem;
  color: var(--gold-bright);
  font-family: var(--font-display);
  line-height: 1.5;
}

/* —— Fortune cookie How to Buy —— */
.fortune-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (max-width: 720px) {
  .fortune-row { grid-template-columns: 1fr; }
}

.cookie {
  background: linear-gradient(160deg, #3a1808, #1a0a06);
  border: 1.5px solid rgba(240,193,75,.4);
  border-radius: 50% 50% 48% 48% / 55% 55% 40% 40%;
  padding: 2rem 1.25rem 1.75rem;
  text-align: center;
  position: relative;
  transition: transform .25s, box-shadow .25s;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.cookie:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(240,193,75,.2);
}
.cookie-num {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: var(--red-bright);
  color: var(--gold);
  border-radius: 50%;
  font-weight: 700;
  font-family: var(--font-display);
  margin-bottom: .75rem;
  border: 2px solid var(--gold);
}
.cookie h3 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.15rem;
  margin-bottom: .5rem;
}
.cookie p {
  font-size: .9rem;
  color: rgba(255,245,230,.75);
  line-height: 1.5;
}
.cookie .slip {
  margin-top: .85rem;
  padding: .5rem .75rem;
  background: var(--paper);
  color: var(--red-dark);
  font-size: .78rem;
  font-weight: 600;
  border-radius: 4px;
  display: inline-block;
  font-family: var(--font-display);
}

/* —— Gallery —— */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.gallery-item {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid rgba(240,193,75,.25);
  position: relative;
  background: var(--stall-wood);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: .5rem .75rem;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  font-size: .75rem;
  color: var(--gold-bright);
  opacity: 0;
  transition: opacity .25s;
}
.gallery-item:hover figcaption { opacity: 1; }

/* —— Community —— */
.join-banner {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 1.5rem;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(240,193,75,.35);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  background: rgba(0,0,0,.25);
}
.join-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.community-cta {
  text-align: center;
  padding: 1rem 0;
}
.community-cta p {
  margin-bottom: 1.25rem;
  color: rgba(255,245,230,.8);
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}

/* —— Footer —— */
.site-footer {
  background: #080103;
  border-top: 2px solid rgba(240,193,75,.25);
  padding: 2.5rem clamp(1.25rem, 4vw, 2rem) 2rem;
  text-align: center;
}
.footer-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
}
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}
.footer-brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  aspect-ratio: 1;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  font-size: .9rem;
}
.footer-disclaimer {
  max-width: 52ch;
  margin: 0 auto 1rem;
  font-size: .85rem;
  color: rgba(255,245,230,.55);
  line-height: 1.55;
  padding: .85rem 1rem;
  border: 1px solid rgba(240,193,75,.2);
  border-radius: 8px;
  background: rgba(61,10,18,.3);
}
.footer-copy {
  font-size: .75rem;
  color: rgba(255,245,230,.35);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--red-mid);
  color: var(--gold-bright);
  padding: .65rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--gold);
  font-size: .9rem;
  font-weight: 600;
  z-index: 200;
  transition: transform .3s;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .hero {
    min-height: auto;
  }
  .hero-inner {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0;
  }
  .hero-content {
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    padding-bottom: 1rem;
  }
  .hero-character {
    position: relative;
    right: auto;
    width: min(78%, 380px);
    max-width: 380px;
    margin: 0 auto;
    justify-content: center;
  }
  .hero-character img {
    max-height: min(46vh, 360px);
    object-position: center bottom;
  }
}

@media (max-width: 500px) {
  .lantern-rail .lantern:nth-child(n+7) { display: none; }
  .hero-content { margin-left: auto; margin-right: auto; max-width: 100%; }
  .hero-character { width: min(88%, 300px); max-width: 300px; }
  .hero-character img { max-height: min(38vh, 280px); }
}
