/* ═══════════════════════════════════════════
   ONJA — abyssal editorial
   ═══════════════════════════════════════════ */

:root {
  --ink: #0a0a0a;
  --ink-2: #0f0f0f;
  --ink-3: #181818;
  --bone: #ececec;
  --bone-dim: rgba(236, 236, 236, 0.55);
  --bone-faint: rgba(236, 236, 236, 0.28);
  --line: rgba(236, 236, 236, 0.14);
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.12);

  --font-display: "Clash Display", sans-serif;
  --font-body: "Satoshi", sans-serif;
  --font-mono: "Fragment Mono", monospace;

  --pad: clamp(1.25rem, 4vw, 4rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }
html.lenis { height: auto; scroll-behavior: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.mono {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dim { color: var(--bone-dim); }
.accent { color: var(--accent); }
.outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--bone);
}

/* ═══════════ GRAIN ═══════════ */
.grain {
  position: fixed; inset: -100%;
  pointer-events: none; z-index: 200;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%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");
  animation: grain 7s steps(8) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(3%, -6%); }
  50% { transform: translate(-5%, 4%); }
  75% { transform: translate(6%, 7%); }
}

/* ═══════════ CURSOR ═══════════ */
.cursor {
  position: fixed; top: 0; left: 0;
  width: 14px; height: 14px;
  border: 1px solid var(--bone);
  border-radius: 50%;
  pointer-events: none; z-index: 300;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out),
              background 0.25s, border-color 0.25s, opacity 0.3s;
  opacity: 0;
  mix-blend-mode: difference;
}
.cursor.is-visible { opacity: 1; }
.cursor.is-hover {
  width: 44px; height: 44px;
  background: rgba(234, 227, 210, 0.12);
  border-color: transparent;
}
@media (pointer: coarse) { .cursor { display: none; } }

/* ═══════════ LOADER ═══════════ */
.loader {
  position: fixed; inset: 0; z-index: 400;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.loader__inner {
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  overflow: hidden;
}
.loader__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: 0.06em;
  animation: loaderPulse 1.2s ease-in-out infinite alternate;
}
.loader__count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.2em;
}
@keyframes loaderPulse { from { opacity: 0.35; } to { opacity: 1; } }

/* ═══════════ NAV ═══════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--pad);
  mix-blend-mode: normal;
  background: linear-gradient(to bottom, rgba(10,10,10,0.85), transparent);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}
.nav__logo sup { font-size: 0.55em; color: var(--accent); }
.nav__links { display: flex; gap: 2.25rem; }
.nav__links a {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-dim);
  transition: color 0.25s;
  position: relative;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.nav__links a:hover { color: var(--bone); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  transition: border-color 0.3s, background 0.3s;
}
.nav__cta:hover { border-color: var(--accent); background: var(--accent-soft); }
.nav__cta-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.45); }
  60% { box-shadow: 0 0 0 7px rgba(255,255,255,0); }
}
@media (max-width: 720px) {
  .nav__links { display: none; }
}

/* ═══════════ HERO ═══════════ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: var(--pad);
  overflow: hidden;
}
.hero__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.hero__veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(10,10,10,0.55), transparent 60%),
    linear-gradient(to bottom, rgba(10,10,10,0.4), transparent 30%, transparent 70%, var(--ink));
  pointer-events: none;
}
.hero__meta {
  position: absolute; top: 5.5rem;
  display: flex; flex-direction: column; gap: 0.3rem;
  z-index: 2;
}
.hero__meta--tl { left: var(--pad); }
.hero__meta--tr { right: var(--pad); text-align: right; }
.hero__title {
  position: relative; z-index: 2;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(5.5rem, 24vw, 21rem);
  line-height: 0.86;
  letter-spacing: 0.01em;
  user-select: none;
}
.hero__line { display: block; overflow: hidden; }
.hero__char {
  display: inline-block;
  transform: translateY(110%);
}
.hero__char--ghost {
  color: transparent;
  -webkit-text-stroke: clamp(1.5px, 0.3vw, 3px) var(--bone);
}
.hero__tag {
  position: relative; z-index: 2;
  margin-top: 2rem;
  max-width: 34rem;
  text-align: center;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  color: var(--bone-dim);
  opacity: 0;
  text-shadow: 0 1px 10px rgba(10, 10, 10, 0.95), 0 0 28px rgba(10, 10, 10, 0.85);
}
.hero__tag em {
  font-style: italic;
  font-weight: 500;
  color: var(--bone);
}
.hero__bottom {
  position: absolute; bottom: 1.75rem; left: var(--pad); right: var(--pad);
  display: flex; align-items: flex-end; justify-content: space-between;
  z-index: 2;
  opacity: 0;
}
.hero__scroll { display: inline-flex; align-items: center; gap: 0.8rem; }
.hero__scroll-ring {
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid; place-items: center;
}
.hero__scroll-arrow {
  display: inline-block;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob {
  0%,100% { transform: translateY(-2px); }
  50% { transform: translateY(3px); }
}
.hero__mint { display: flex; flex-direction: column; gap: 0.3rem; text-align: right; }
@media (max-width: 720px) {
  .hero__meta--tr { display: none; }
  .hero__mint { display: none; }
  .hero__bottom { justify-content: center; }
}

/* ═══════════ MARQUEE ═══════════ */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 0.85rem 0;
  background: var(--ink-2);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}
.marquee__chunk {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1rem, 2.4vw, 1.6rem);
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding-right: 0.5rem;
}
.marquee__chunk i {
  font-style: normal;
  color: var(--accent);
  padding: 0 0.7rem;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ═══════════ SECTION HEAD ═══════════ */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.8rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.section-head__no { color: var(--accent); }
.section-head__label { color: var(--bone-dim); }

/* ═══════════ MANIFESTO ═══════════ */
.manifesto {
  padding: clamp(5rem, 12vw, 10rem) var(--pad);
  max-width: 1500px; margin: 0 auto;
}
.manifesto__text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 4.4vw, 3.6rem);
  line-height: 1.18;
  max-width: 22ch;
}
.manifesto__text .w {
  display: inline-block;
  opacity: 0.13;
  transition: opacity 0.4s;
}
.manifesto__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: clamp(3.5rem, 8vw, 6rem);
  margin-left: auto;
  max-width: 60rem;
}
.manifesto__col { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.manifesto__col p { margin-top: 0.7rem; color: var(--bone-dim); font-size: 0.95rem; }
@media (max-width: 720px) {
  .manifesto__cols { grid-template-columns: 1fr; }
}

/* ═══════════ COLLECTION ═══════════ */
.collection {
  padding: clamp(5rem, 12vw, 10rem) var(--pad);
  max-width: 1500px; margin: 0 auto;
}
.collection__title, .passage__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}
.collection__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.8rem, 1.6vw, 1.4rem);
}
.card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--ink-2);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  transition: border-color 0.35s, transform 0.5s var(--ease-out);
}
.card:nth-child(even) { transform: translateY(clamp(1rem, 3vw, 2.5rem)); }
.card:hover { border-color: var(--bone-faint); }
.card canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transition: transform 0.7s var(--ease-out);
}
.card:hover canvas { transform: scale(1.06); }
.card__meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 0.9rem;
  background: linear-gradient(to top, rgba(10,10,10,0.92), transparent);
}
.card__meta .name { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.collection__note { margin-top: clamp(2.5rem, 5vw, 3.5rem); text-align: center; }
@media (max-width: 980px) {
  .collection__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .collection__grid { grid-template-columns: 1fr; }
  .card:nth-child(even) { transform: none; }
}

/* ═══════════ PASSAGE ═══════════ */
.passage {
  padding: clamp(5rem, 12vw, 10rem) var(--pad);
  max-width: 1100px; margin: 0 auto;
}
.passage__sub {
  color: var(--bone-dim);
  max-width: 32rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

/* progress */
.progress {
  display: flex; align-items: center; gap: 1.5rem;
  margin-bottom: 2rem;
}
.progress__label { white-space: nowrap; }
.progress__label span { color: var(--accent); }
.progress__bar {
  flex: 1;
  display: flex; gap: 6px;
}
.progress__seg {
  flex: 1; height: 4px;
  background: var(--ink-3);
  position: relative;
  overflow: hidden;
}
.progress__seg::after {
  content: ""; position: absolute; inset: 0;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.6s var(--ease-out);
}
.progress__seg.is-done::after { transform: scaleX(1); }

/* quests */
.quests { display: flex; flex-direction: column; }
.quest {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.4rem, 3vw, 2rem) 0;
  border-top: 1px solid var(--line);
  transition: opacity 0.4s;
}
.quest:last-child { border-bottom: 1px solid var(--line); }
.quest__index { color: var(--accent); }
.quest__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.1;
}
.quest__desc { color: var(--bone-dim); font-size: 0.95rem; margin-top: 0.25rem; }
.quest__btn {
  position: relative;
  border: 1px solid var(--bone-faint);
  border-radius: 999px;
  padding: 0.85rem 1.7rem;
  font-weight: 500;
  font-size: 0.95rem;
  min-width: 12rem;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}
.quest__btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.quest__btn-verifying, .quest__btn-done {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.quest__btn-verifying i {
  font-style: normal;
  animation: dots 1.2s infinite;
}
.quest__btn-verifying i:nth-child(2) { animation-delay: 0.2s; }
.quest__btn-verifying i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dots { 0%,100% { opacity: 0.2; } 50% { opacity: 1; } }

.quest.is-verifying .quest__btn { pointer-events: none; border-color: var(--bone-faint); }
.quest.is-verifying .quest__btn-label { opacity: 0; }
.quest.is-verifying .quest__btn-verifying { opacity: 1; }

.quest.is-done .quest__btn {
  pointer-events: none;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink);
}
.quest.is-done .quest__btn-label,
.quest.is-done .quest__btn-verifying { opacity: 0; }
.quest.is-done .quest__btn-done { opacity: 1; font-weight: 700; }
.quest.is-done .quest__name { color: var(--bone-dim); }

@media (max-width: 640px) {
  .quest { grid-template-columns: auto 1fr; }
  .quest__btn { grid-column: 1 / -1; width: 100%; }
}

/* ═══════════ ANCHOR (WALLET) ═══════════ */
.anchor {
  position: relative;
  margin-top: clamp(3rem, 7vw, 5rem);
  border: 1px solid var(--line);
  background: var(--ink-2);
  padding: clamp(1.75rem, 5vw, 3.5rem);
  overflow: hidden;
}
.anchor__lock {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.8rem;
  background: rgba(10, 10, 10, 0.72);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  text-align: center;
  padding: 1rem;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}
.anchor__lock-icon { font-size: 1.6rem; }
.anchor.is-unlocked .anchor__lock { opacity: 0; visibility: hidden; }

.anchor__label { display: block; color: var(--accent); margin-bottom: 1.1rem; }
.anchor__row { display: flex; gap: 0.8rem; }
.anchor__row + .anchor__row { margin-top: 0.8rem; }
.anchor__input {
  flex: 1;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--bone);
  padding: 1rem 1.2rem;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  border-radius: 0;
  min-width: 0;
  transition: border-color 0.3s;
  text-transform: none;
}
.anchor__input:focus { outline: none; border-color: var(--bone-faint); }
.anchor__input.is-invalid { border-color: var(--accent); }
.anchor__input::placeholder { color: var(--bone-faint); }
.anchor__submit {
  background: var(--bone);
  color: var(--ink);
  font-weight: 700;
  padding: 1rem 1.9rem;
  white-space: nowrap;
  transition: background 0.3s, transform 0.2s;
}
.anchor__submit:hover { background: var(--accent); }
.anchor__submit:active { transform: scale(0.97); }
.anchor__submit:disabled { opacity: 0.55; cursor: progress; pointer-events: none; }
.anchor__error {
  color: var(--accent);
  margin-top: 0.75rem;
  min-height: 1.1em;
}
.anchor__hint { margin-top: 0.35rem; }
@media (max-width: 640px) {
  .anchor__row { flex-direction: column; }
}

/* ticket / confirmation */
.ticket { display: none; }
.anchor.is-confirmed .anchor__form { display: none; }
.anchor.is-confirmed .ticket { display: block; }
.ticket__inner { position: relative; }
.ticket__stamp {
  position: absolute; top: 0; right: 0;
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 0.5rem 1rem;
  transform: rotate(8deg);
  font-weight: 700;
  letter-spacing: 0.2em;
}
.ticket__eyebrow { color: var(--accent); }
.ticket__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1;
  margin: 1rem 0 2rem;
}
.ticket__rows { border-top: 1px solid var(--line); }
.ticket__row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
.ticket__row span:last-child { text-align: right; word-break: break-all; }
#ticketWallet, #ticketHandle { text-transform: none; }
.ticket__note { margin-top: 1.5rem; color: var(--bone-dim); font-size: 0.95rem; }
.ticket__reset {
  margin-top: 1.25rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.ticket__reset:hover { color: var(--bone); }

/* ═══════════ FAQ ═══════════ */
.faq {
  padding: clamp(5rem, 12vw, 9rem) var(--pad);
  max-width: 1100px; margin: 0 auto;
}
.faq__item {
  border-bottom: 1px solid var(--line);
}
.faq__item summary {
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem;
  cursor: pointer;
  padding: 1.4rem 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  transition: color 0.3s;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--accent); }
.faq__plus {
  font-weight: 500;
  color: var(--accent);
  transition: transform 0.35s var(--ease-out);
}
.faq__item[open] .faq__plus { transform: rotate(45deg); }
.faq__item p {
  color: var(--bone-dim);
  padding-bottom: 1.5rem;
  max-width: 44rem;
}

/* ═══════════ FOOTER ═══════════ */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(2.5rem, 6vw, 4rem) var(--pad) 1.5rem;
  overflow: hidden;
}
.footer__big {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(5rem, 22vw, 19rem);
  line-height: 0.8;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 1px var(--bone-faint);
  user-select: none;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  transition: -webkit-text-stroke-color 0.5s;
}
.footer__big:hover { -webkit-text-stroke-color: var(--accent); }
.footer__row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}
.footer__links { display: flex; gap: 1.75rem; }
.footer__links a { transition: color 0.25s; }
.footer__links a:hover { color: var(--accent); }
@media (max-width: 640px) {
  .footer__row { justify-content: center; text-align: center; }
}

/* ═══════════ REVEALS ═══════════ */
[data-reveal] { opacity: 0; transform: translateY(40px); }
.no-js [data-reveal], .reduced [data-reveal] { opacity: 1; transform: none; }

/* ═══════════ REDUCED MOTION ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
