:root {
  --ink: #090807;
  --ink-2: #12100d;
  --ink-3: #1a1712;
  --gold: #c9a227;
  --gold-soft: #e8c86a;
  --gold-deep: #8a6a12;
  --cream: #f4edd8;
  --mute: #a89f8c;
  --line: rgba(201, 162, 39, 0.28);
  --font: "Sora", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --wrap: min(1140px, calc(100% - 2.4rem));
}

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

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

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

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--gold-soft);
  text-decoration: none;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

/* Atmosphere */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 45% at 20% 10%, rgba(201, 162, 39, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 20%, rgba(180, 70, 30, 0.1), transparent 50%),
    radial-gradient(ellipse 45% 35% at 70% 85%, rgba(50, 120, 100, 0.08), transparent 55%),
    linear-gradient(165deg, #0c0a08 0%, #070605 50%, #0d0b08 100%);
}

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

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  backdrop-filter: blur(18px);
  background: rgba(9, 8, 7, 0.78);
  border-bottom: 1px solid rgba(201, 162, 39, 0.14);
}

.topbar-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--cream);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.logo img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(201, 162, 39, 0.4));
}

.menu {
  display: flex;
  gap: 1.15rem;
  margin-inline: auto;
  font-size: 0.8rem;
  font-weight: 500;
}

.menu a {
  color: var(--mute);
  transition: color 0.2s;
}

.menu a:hover,
.menu a.active {
  color: var(--gold-soft);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.chip,
.ghost-btn,
.seal-btn,
.copy-btn,
.burger {
  font-family: inherit;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.22s ease;
}

.chip,
.ghost-btn {
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--gold-soft);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
}

.chip:hover,
.ghost-btn:hover {
  background: rgba(201, 162, 39, 0.1);
  border-color: var(--gold);
}

.seal-btn {
  padding: 0.72rem 1.3rem;
  border-radius: 999px;
  background:
    linear-gradient(145deg, #f0d57a, #c9a227 45%, #8a6a12);
  color: #1a1406;
  font-weight: 700;
  font-size: 0.84rem;
  box-shadow:
    0 8px 28px rgba(201, 162, 39, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.seal-btn:hover {
  transform: translateY(-2px);
  color: #1a1406;
  box-shadow: 0 12px 34px rgba(201, 162, 39, 0.45);
}

.burger {
  display: none;
  background: none;
  color: var(--gold);
  font-size: 1.4rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 3rem 0 4rem;
}

.hero-mark {
  position: absolute;
  inset-inline-end: -4%;
  top: 42%;
  transform: translateY(-50%);
  font-family: var(--display);
  font-size: clamp(18rem, 42vw, 34rem);
  font-weight: 900;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(201, 162, 39, 0.12);
  pointer-events: none;
  user-select: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201, 162, 39, 0.06);
  animation: rise 0.8s ease both;
}

.hero-text h1 {
  font-family: var(--display);
  font-size: clamp(4rem, 11vw, 7.2rem);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #fff8e7 10%, var(--gold-soft) 50%, var(--gold) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rise 0.9s ease 0.08s both;
}

.motto {
  margin-top: 1.1rem;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  font-style: italic;
  font-weight: 500;
  color: var(--gold-soft);
  animation: rise 0.9s ease 0.16s both;
}

.lede {
  margin-top: 1.35rem;
  max-width: 34rem;
  color: var(--mute);
  font-size: 1.02rem;
  animation: rise 0.9s ease 0.24s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  animation: rise 0.9s ease 0.34s both;
}

.hero-relic {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
}

.halo {
  position: absolute;
  width: min(520px, 86%);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, 0.28);
  animation: spinSlow 28s linear infinite;
}

.halo::before,
.halo::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 16px var(--gold);
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
}

.halo-2 {
  width: min(420px, 72%);
  border-style: dashed;
  animation-direction: reverse;
  animation-duration: 18s;
  opacity: 0.7;
}

.relic-coin {
  width: min(460px, 88%);
  height: auto;
  position: relative;
  z-index: 2;
  filter:
    drop-shadow(0 30px 50px rgba(0, 0, 0, 0.65))
    drop-shadow(0 0 40px rgba(201, 162, 39, 0.28));
  animation: floatCoin 6s ease-in-out infinite;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatCoin {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

/* Marquee */
.marquee {
  overflow: hidden;
  border-block: 1px solid rgba(201, 162, 39, 0.18);
  background: rgba(18, 16, 13, 0.85);
  padding: 0.95rem 0;
}

.marquee-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  white-space: nowrap;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  animation: marquee 28s linear infinite;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

html[dir="rtl"] .marquee-track {
  animation-name: marqueeRtl;
}

@keyframes marqueeRtl {
  to { transform: translateX(50%); }
}

/* Ledger */
.ledger {
  padding: 2.5rem 0 1rem;
}

.ledger-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.ledger-grid article {
  padding: 1.4rem 1rem;
  border: 1px solid rgba(201, 162, 39, 0.16);
  background: linear-gradient(160deg, rgba(32, 28, 22, 0.7), rgba(12, 10, 8, 0.9));
  position: relative;
  overflow: hidden;
}

.ledger-grid article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-soft), transparent);
}

.ledger-grid b {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--gold-soft);
  line-height: 1.1;
}

.ledger-grid span {
  display: block;
  margin-top: 0.45rem;
  color: var(--mute);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Chapters */
.chapter {
  padding: 4.8rem 0;
}

.chapter-dark {
  background: linear-gradient(180deg, rgba(18, 16, 13, 0.75), rgba(9, 8, 7, 0.3));
  border-block: 1px solid rgba(201, 162, 39, 0.1);
}

.chapter-head {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 2.4rem;
  max-width: 42rem;
}

.chapter-no {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
  opacity: 0.7;
}

.chapter-head h2 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.chapter-head p {
  color: var(--mute);
}

.note {
  margin-top: 1rem;
  color: var(--mute);
  font-size: 0.85rem;
}

/* Video frame */
.frame-seal {
  position: relative;
  padding: 0.7rem;
  background:
    linear-gradient(135deg, rgba(201, 162, 39, 0.35), rgba(201, 162, 39, 0.05) 40%, rgba(201, 162, 39, 0.25));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

.frame-seal video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
  object-fit: cover;
}

/* Ribbons */
.ribbons {
  display: grid;
  gap: 1.25rem;
}

.ribbon {
  padding: 1.5rem 1.4rem 1.25rem;
  border: 1px solid rgba(201, 162, 39, 0.18);
  background: linear-gradient(120deg, rgba(28, 24, 18, 0.9), rgba(10, 9, 7, 0.95));
}

.ribbon-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.55rem;
}

.ribbon-top h3 {
  font-family: var(--display);
  font-size: 1.35rem;
}

.ribbon-top strong {
  color: var(--gold-soft);
  font-size: 0.95rem;
  white-space: nowrap;
}

.ribbon > p {
  color: var(--mute);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.ribbon-fill {
  height: 4px;
  background: rgba(201, 162, 39, 0.12);
  overflow: hidden;
}

.ribbon-fill i {
  display: block;
  height: 100%;
  width: calc(var(--p) * 1%);
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible .ribbon-fill i {
  transform: scaleX(1);
}

html[dir="rtl"] .ribbon-fill i {
  transform-origin: right;
}

/* Feature path */
.path {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 1.25rem;
}

.path::before {
  content: "";
  position: absolute;
  inset: 1.1rem 8% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.45), transparent);
  pointer-events: none;
}

.path article {
  position: relative;
  padding-top: 2.4rem;
}

.path .node {
  position: absolute;
  top: 0.55rem;
  inset-inline-start: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(201, 162, 39, 0.15), 0 0 18px rgba(201, 162, 39, 0.45);
}

.path h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  margin-bottom: 0.45rem;
}

.path p {
  color: var(--mute);
  font-size: 0.92rem;
}

/* Duo panels */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.duo-panel {
  padding: 1.75rem;
  border: 1px solid rgba(201, 162, 39, 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(201, 162, 39, 0.12), transparent 45%),
    linear-gradient(160deg, #1c1812, #0c0a08);
}

.badge {
  display: inline-block;
  margin-bottom: 0.9rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.duo-panel h3 {
  font-family: var(--display);
  font-size: 1.45rem;
  margin-bottom: 0.7rem;
}

.duo-panel p {
  color: var(--mute);
  margin-bottom: 1.25rem;
}

/* Certificate */
.certificate {
  border: 1px solid rgba(201, 162, 39, 0.28);
  background:
    linear-gradient(145deg, rgba(36, 30, 20, 0.55), rgba(10, 9, 7, 0.95));
  padding: 1.6rem;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.08), 0 24px 60px rgba(0, 0, 0, 0.4);
}

.cert-stamp {
  display: inline-flex;
  margin-bottom: 1.25rem;
  padding: 0.4rem 0.8rem;
  border: 1px dashed rgba(90, 200, 170, 0.5);
  color: #7dceb8;
  font-size: 0.82rem;
  font-weight: 600;
}

.cert-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.95rem 0;
  border-top: 1px solid rgba(201, 162, 39, 0.14);
}

.cert-row span {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}

.cert-row code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.84rem;
  color: var(--gold-soft);
  word-break: break-all;
}

/* Constellation */
.constellation {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.constellation a {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.35rem 1.1rem;
  border: 1px solid rgba(201, 162, 39, 0.16);
  background: rgba(18, 16, 13, 0.65);
  color: var(--cream);
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.constellation a:hover {
  border-color: rgba(201, 162, 39, 0.5);
  background: rgba(32, 28, 20, 0.9);
  transform: translateY(-3px);
}

.constellation strong {
  font-family: var(--display);
  font-size: 1.2rem;
}

.constellation span {
  color: var(--mute);
  font-size: 0.86rem;
}

/* Ritual */
.ritual {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  counter-reset: ritual;
}

.ritual li {
  counter-increment: ritual;
  padding: 1.5rem 1.1rem;
  border: 1px solid rgba(201, 162, 39, 0.18);
  background: linear-gradient(160deg, #1a1712, #0c0a08);
  position: relative;
}

.ritual li::before {
  content: counter(ritual, decimal-leading-zero);
  display: block;
  margin-bottom: 0.85rem;
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--gold);
}

.ritual h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.ritual p {
  color: var(--mute);
  font-size: 0.88rem;
}

.center-cta {
  margin-top: 2rem;
  text-align: center;
}

/* Footer */
.foot {
  padding: 3.5rem 0 2.5rem;
  border-top: 1px solid rgba(201, 162, 39, 0.16);
  text-align: center;
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.foot-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.foot-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 1.3rem;
}

.foot-brand em {
  font-style: normal;
  color: var(--gold);
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}

.foot-motto {
  font-family: var(--display);
  font-style: italic;
  color: var(--mute);
  margin-bottom: 1.25rem;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
  font-size: 0.88rem;
}

.disclaimer {
  margin: 2rem auto 0;
  max-width: 40rem;
  color: #6a6458;
  font-size: 0.74rem;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.85s ease, transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* RTL */
html[dir="rtl"] body {
  font-family: "Sora", "Segoe UI", Tahoma, sans-serif;
}

html[dir="rtl"] .motto,
html[dir="rtl"] .foot-motto {
  font-style: normal;
}

html[dir="rtl"] .ledger-grid article::before {
  inset: 0 0 0 auto;
}

html[dir="rtl"] .hero-mark {
  inset-inline-end: auto;
  inset-inline-start: -4%;
}

/* Mobile */
@media (max-width: 960px) {
  .menu {
    display: none;
  }

  .burger {
    display: block;
    margin-inline-start: auto;
    order: 2;
  }

  .top-actions {
    order: 3;
  }

  .logo {
    order: 1;
  }

  .topbar-inner.open .menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: #14110d;
    padding: 1rem 1.25rem 1.3rem;
    border-bottom: 1px solid var(--line);
    gap: 0.85rem;
  }

  .top-actions .seal-btn {
    padding: 0.55rem 0.85rem;
    font-size: 0.75rem;
  }

  .hero {
    min-height: auto;
    padding-top: 1.5rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-relic {
    order: -1;
    min-height: 300px;
  }

  .relic-coin {
    width: min(300px, 78vw);
  }

  .lede {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-mark {
    opacity: 0.35;
    font-size: 40vw;
    inset-inline-end: 50%;
    transform: translate(50%, -50%);
  }

  .ledger-grid,
  .path,
  .duo,
  .constellation,
  .ritual {
    grid-template-columns: 1fr;
  }

  .path::before {
    display: none;
  }

  .cert-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .cert-row .chip {
    justify-self: start;
  }

  .ribbon-top {
    flex-direction: column;
    align-items: flex-start;
  }

  html, body {
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }
}

@media (max-width: 560px) {
  .ledger-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eyebrow,
  .hero-text h1,
  .motto,
  .lede,
  .hero-actions,
  .relic-coin,
  .halo,
  .marquee-track,
  .reveal,
  .ribbon-fill i {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
