/* ============================================================
   Qervan Exchange — premium digital-asset venue
   Palette: deep navy + gold hairline + cool cyan data accent
   Type: Playfair Display (display serif) / Inter (body)
   ============================================================ */

:root {
  --navy-950: #050c14;
  --navy-900: #071019;
  --navy-850: #0a1628;
  --navy-800: #0d1c31;
  --navy-700: #122a45;
  --navy-600: #17324f;

  --gold: #c8a34a;
  --gold-bright: #e4c481;
  --gold-dim: #9c7f34;
  --gold-line: rgba(200, 163, 74, 0.30);
  --gold-line-soft: rgba(200, 163, 74, 0.16);

  --cyan: #5ad1e6;
  --cyan-dim: rgba(90, 209, 230, 0.18);

  --ink: #efece3;
  --body: #d9d5cb;
  --body-soft: #c2cbd7;
  --mute: #9fadbd;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --shell: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 0.84, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  position: relative;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.74;
  font-weight: 400;
  color: var(--body);
  background-color: var(--navy-900);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layered midnight radial depth — never a flat fill */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 720px at 12% -8%, rgba(30, 68, 110, 0.55), transparent 62%),
    radial-gradient(900px 640px at 90% 2%, rgba(18, 54, 90, 0.50), transparent 58%),
    radial-gradient(1300px 900px at 48% 110%, rgba(23, 54, 88, 0.42), transparent 62%),
    linear-gradient(178deg, #071019 0%, #0a1628 44%, #08131f 100%);
}

/* Grain overlay — inline SVG feTurbulence element, barely visible */
.grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.045;
  mix-blend-mode: overlay;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 5vw, 3rem);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  background: var(--gold);
  color: var(--navy-950);
  font-weight: 600;
  padding: 0.7rem 1.15rem;
  border-radius: 3px;
  text-decoration: none;
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 1rem; }

a { color: var(--gold-bright); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------- skip / header ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(180deg, rgba(7, 16, 25, 0.96), rgba(7, 16, 25, 0.80));
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--gold-line-soft);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 0.85rem clamp(1.15rem, 5vw, 3rem);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--serif);
  font-size: 1.18rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}
.mark__glyph {
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 700;
  font-family: var(--sans);
  letter-spacing: 0;
}
.mark em { font-style: italic; color: var(--gold); }
.mark:hover em, .mark:focus-visible em { color: var(--gold-bright); }

.topbar__nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.35rem, 2vw, 1.4rem);
  align-items: center;
}
.topbar__nav a {
  color: var(--body-soft);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.55rem 0.2rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.topbar__nav a:hover, .topbar__nav a:focus-visible {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}
.topbar__nav a[aria-current="true"] { color: var(--gold-bright); border-bottom-color: var(--gold-line); }

@media (max-width: 720px) {
  .topbar__nav { display: none; }
}

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--gold-line-soft);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: end;
}

.eyebrow {
  margin: 0 0 1.4rem;
  font-size: 0.74rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.eyebrow::after {
  content: "";
  height: 1px;
  flex: 1;
  max-width: 130px;
  background: var(--gold-line);
}

h1 {
  margin: 0 0 1.6rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 6.6vw, 5.1rem);
  line-height: 1.03;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  max-width: 16ch;
}
h1 em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}

.hero__lede {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1.02rem, 1.5vw, 1.16rem);
  color: var(--body-soft);
}

.hero__figure {
  border-left: 1px solid var(--gold-line);
  padding: 0.3rem 0 0.3rem clamp(1.1rem, 3vw, 2.2rem);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.9rem;
}
.hero__figure-num {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 8vw, 5.6rem);
  line-height: 0.92;
  color: var(--gold);
  letter-spacing: -0.02em;
  display: block;
}
.hero__figure-rule {
  height: 1px;
  width: 100%;
  background: var(--gold-line);
}
.hero__figure-cap {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--mute);
  max-width: 30ch;
}

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; align-items: start; }
  .hero__figure {
    border-left: 0;
    border-top: 1px solid var(--gold-line);
    padding: 1.6rem 0 0;
  }
  .hero__figure-cap { max-width: none; }
}

/* hero media band */
.hero__media {
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 4vw, 3.2rem);
  align-items: center;
}
.hero__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  border: 1px solid var(--gold-line);
  filter: saturate(0.82) contrast(1.04) brightness(0.94);
}
.hero__media figcaption {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--mute);
  border-left: 1px solid var(--gold-line);
  padding-left: 1rem;
}
.hero__media-note {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.1vw, 1.5rem);
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 1.1rem;
}
.hero__media-note b { color: var(--gold); font-weight: 500; }

@media (max-width: 880px) {
  .hero__media { grid-template-columns: 1fr; }
  .hero__media img { aspect-ratio: 16 / 11; }
}

/* ---------------- chapter strip ---------------- */

.chapters {
  border-bottom: 1px solid var(--gold-line-soft);
  background: linear-gradient(180deg, rgba(10, 22, 40, 0.55), transparent);
}
.chapters ol {
  list-style: none;
  margin: 0;
  padding: 0.55rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem clamp(1rem, 3vw, 2.4rem);
  counter-reset: ch;
}
.chapters li { counter-increment: ch; }
.chapters a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 0;
  text-decoration: none;
  color: var(--body-soft);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.35s var(--ease);
}
.chapters a::before {
  content: "0" counter(ch);
  font-family: var(--serif);
  font-size: 0.86rem;
  color: var(--gold-dim);
  letter-spacing: 0;
  transition: color 0.35s var(--ease);
}
.chapters a:hover, .chapters a:focus-visible { color: var(--gold-bright); }
.chapters a:hover::before, .chapters a:focus-visible::before { color: var(--gold-bright); }

/* ---------------- content bands ---------------- */

.band {
  position: relative;
  z-index: 1;
  padding: clamp(3rem, 8vw, 6rem) 0;
  border-bottom: 1px solid var(--gold-line-soft);
}
.band--light {
  background:
    radial-gradient(900px 520px at 85% 10%, rgba(46, 92, 140, 0.30), transparent 60%),
    linear-gradient(158deg, #122a45 0%, #0e2038 58%, #0c1d32 100%);
  border-top: 1px solid var(--gold-line);
  border-bottom: 1px solid var(--gold-line);
}
.band--inset { background: linear-gradient(180deg, rgba(13, 28, 49, 0.5), rgba(7, 16, 25, 0)); }

.kicker {
  margin: 0 0 1.1rem;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}

h2 {
  margin: 0 0 1.3rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.75rem, 3.6vw, 2.7rem);
  line-height: 1.14;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
h3 {
  margin: 2.4rem 0 0.85rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.18rem, 2.1vw, 1.5rem);
  line-height: 1.3;
  color: var(--gold-bright);
  letter-spacing: -0.005em;
}
h4 {
  margin: 1.6rem 0 0.5rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--body-soft);
}

.prose { max-width: 74ch; }
.prose p { margin: 0 0 1.15rem; }
.prose p a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose p a:hover, .prose p a:focus-visible { color: var(--cyan); }

.lede {
  font-size: clamp(1.05rem, 1.8vw, 1.24rem);
  line-height: 1.66;
  color: var(--ink);
}
.lede::first-letter {
  font-family: var(--serif);
  font-size: 3.1em;
  line-height: 0.82;
  float: left;
  padding: 0.06em 0.12em 0 0;
  color: var(--gold);
}

.prose ul, .prose ol { margin: 0 0 1.3rem; padding-left: 1.15rem; }
.prose li { margin-bottom: 0.55rem; }
.prose ul li::marker { color: var(--gold); }
.prose ol li::marker { color: var(--gold); font-family: var(--serif); }

/* ---------------- offset editorial ledger ---------------- */

.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--gold-line);
}
.ledger__item {
  display: grid;
  grid-template-columns: minmax(4rem, 8.5rem) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 3.4rem);
  padding: clamp(1.7rem, 4vw, 2.9rem) 0;
  border-bottom: 1px solid var(--gold-line-soft);
  transition: border-color 0.5s var(--ease);
}
.ledger__item:hover { border-bottom-color: var(--gold-line); }
.ledger__num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.3rem, 4.6vw, 3.5rem);
  line-height: 0.9;
  color: rgba(200, 163, 74, 0.20);
  letter-spacing: -0.02em;
}
@supports ((-webkit-text-stroke: 1px black)) {
  .ledger__num {
    color: transparent;
    -webkit-text-stroke: 1px var(--gold);
  }
}
.ledger__title {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.3vw, 1.66rem);
  line-height: 1.25;
  color: var(--ink);
}
.ledger__text p { margin: 0 0 0.8rem; }
.ledger__text p:last-child { margin-bottom: 0; }
.ledger__tag {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  padding: 0.22rem 0.55rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 620px) {
  .ledger__item { grid-template-columns: 1fr; gap: 0.8rem; }
  .ledger__num { font-size: 2rem; }
}

/* ---------------- figures ---------------- */

.figure {
  margin: clamp(1.8rem, 4vw, 2.8rem) 0;
}
.figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--gold-line);
  filter: saturate(0.8) contrast(1.05) brightness(0.94);
}
.figure figcaption {
  margin-top: 0.95rem;
  padding-left: 1rem;
  border-left: 1px solid var(--gold-line);
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--mute);
}
.figure--wide { margin-inline: calc(-1 * clamp(0px, 4vw, 3rem)); }
.figure--wide img { aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------------- tables ---------------- */

.table-wrap {
  margin: 1.7rem 0 2rem;
  overflow-x: auto;
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(11, 25, 44, 0.6), rgba(7, 16, 25, 0.35));
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 0.94rem;
}
caption {
  caption-side: top;
  text-align: left;
  padding: 0.9rem 1.1rem 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}
th, td {
  text-align: left;
  padding: 0.85rem 1.1rem;
  vertical-align: top;
  border-bottom: 1px solid var(--gold-line-soft);
}
thead th {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
  font-weight: 600;
  background: rgba(200, 163, 74, 0.05);
  border-bottom: 1px solid var(--gold-line);
}
tbody tr:last-child td { border-bottom: 0; }
tbody th { color: var(--ink); font-weight: 600; }
td { color: var(--body-soft); }
td strong { color: var(--ink); }
.table--does td:first-child { color: var(--body); }

/* ---------------- callout ---------------- */

.callout {
  margin: 1.8rem 0;
  padding: 1.25rem 1.4rem 1.25rem 1.55rem;
  border-left: 2px solid var(--gold);
  background: linear-gradient(90deg, rgba(200, 163, 74, 0.07), rgba(200, 163, 74, 0));
}
.callout__label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.55rem;
}
.callout p { margin: 0; color: var(--body); }
.callout p + p { margin-top: 0.7rem; }
.callout strong { color: var(--ink); }

.callout--cyan {
  border-left-color: var(--cyan);
  background: linear-gradient(90deg, rgba(90, 209, 230, 0.07), rgba(90, 209, 230, 0));
}
.callout--cyan .callout__label { color: var(--cyan); }

/* ---------------- two-column split ---------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 3.2rem);
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.stat-row {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--gold-line-soft);
  border: 1px solid var(--gold-line-soft);
}
.stat-row li {
  background: rgba(7, 16, 25, 0.45);
  padding: 1rem 1.15rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: baseline;
}
.stat-row dt, .stat-row .k { color: var(--mute); font-size: 0.86rem; }
.stat-row dd, .stat-row .v {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--gold);
}

/* ---------------- FAQ ---------------- */

.faq { border-top: 1px solid var(--gold-line); }
.faq details { border-bottom: 1px solid var(--gold-line-soft); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  min-height: 44px;
  padding: 1.25rem 0;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.9vw, 1.24rem);
  font-weight: 500;
  color: var(--ink);
  transition: color 0.35s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  border-right: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
  transform: rotate(45deg);
  transition: transform 0.45s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover, .faq summary:focus-visible { color: var(--gold-bright); }
.faq__body { padding: 0 0 1.5rem; max-width: 72ch; }
.faq__body p { margin: 0; color: var(--body-soft); }

/* ---------------- related ---------------- */

.related {
  margin-top: 1.6rem;
  display: grid;
  gap: 1px;
  background: var(--gold-line-soft);
  border: 1px solid var(--gold-line-soft);
}
.related a {
  display: block;
  padding: 1.15rem 1.3rem;
  background: linear-gradient(180deg, rgba(11, 25, 44, 0.55), rgba(7, 16, 25, 0.35));
  text-decoration: none;
  min-height: 44px;
  transition: background 0.45s var(--ease);
}
.related a:hover, .related a:focus-visible {
  background: linear-gradient(180deg, rgba(200, 163, 74, 0.09), rgba(200, 163, 74, 0.02));
}
.related__kicker {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}
.related__title { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.06rem; line-height: 1.4; }

/* ---------------- footer ---------------- */

.foot {
  position: relative;
  z-index: 1;
  padding: clamp(2.8rem, 7vw, 4.5rem) 0 2.5rem;
  border-top: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(5, 12, 20, 0.4), rgba(5, 12, 20, 0.9));
}
.foot__brand {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--ink);
}
.foot__brand em { font-style: italic; color: var(--gold); }
.foot__blurb { margin: 0 0 2.4rem; max-width: 54ch; color: var(--mute); font-size: 0.92rem; }
.foot__net-title {
  margin: 0 0 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}
.linknet {
  list-style: none;
  margin: 0 0 2.6rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0 2rem;
  border-top: 1px solid var(--gold-line-soft);
}
.linknet li { border-bottom: 1px solid var(--gold-line-soft); }
.linknet a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 44px;
  padding: 0.75rem 0;
  text-decoration: none;
  color: var(--body-soft);
  font-size: 0.9rem;
  transition: color 0.35s var(--ease), padding-left 0.35s var(--ease);
}
.linknet a:hover, .linknet a:focus-visible { color: var(--gold-bright); padding-left: 0.35rem; }
.linknet a span {
  font-family: var(--serif);
  font-size: 0.82rem;
  color: var(--gold-dim);
  flex: none;
}
.linknet a[aria-current="page"] { color: var(--gold-bright); }

.foot__legal {
  border-top: 1px solid var(--gold-line-soft);
  padding-top: 1.5rem;
  display: grid;
  gap: 0.9rem;
  max-width: 84ch;
}
.foot__legal p { margin: 0; font-size: 0.8rem; line-height: 1.7; color: var(--mute); }
.foot__legal .aside { color: var(--gold-dim); }

/* ---------------- reveal ---------------- */

.js .reveal { opacity: 0; transform: translateY(20px); }
.reveal {
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
