/* ==========================================================================
   Qervan Global — institutional trust
   Light bone base, deep pine green primary, copper accent.
   Formal centered measure on a strong vertical axis, seal/badge motifs.
   ========================================================================== */

:root {
  --pine:      #1d3b32;
  --pine-deep: #142b24;
  --bone:      #f6f4ef;
  --bone-warm: #f0ece3;
  --copper:    #a9713f;
  --copper-ink:#8a5a2e;
  --slate:     #5c6660;
  --ink:       #1b2622;
  --hair:      rgba(29, 59, 50, 0.22);
  --hair-soft: rgba(29, 59, 50, 0.11);

  --serif: "Source Serif 4", "Georgia", "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --measure: 46rem;
  --wide: 68rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.03rem;
  line-height: 1.72;
  color: var(--ink);
  background-color: var(--bone);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E"),
    repeating-linear-gradient(to bottom,
      rgba(29, 59, 50, 0.038) 0, rgba(29, 59, 50, 0.038) 1px,
      transparent 1px, transparent 33px);
  background-attachment: fixed, scroll;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------- typography */

h1, h2, h3, .masthead__word, .seal__mono, .foot__brand {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--pine);
  letter-spacing: -0.005em;
}

h1 {
  font-size: clamp(2.05rem, 1.35rem + 3vw, 3.35rem);
  line-height: 1.15;
  font-weight: 700;
  margin: 1.1rem 0 0;
}

h2 {
  font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.05rem);
  line-height: 1.22;
  margin: 0 0 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--copper);
  position: relative;
}

h2::before {
  content: "";
  position: absolute;
  top: -4px; left: 0;
  width: 2.6rem; height: 3px;
  background: var(--copper);
}

h3 {
  font-size: 1.2rem;
  line-height: 1.35;
  margin: 2.2rem 0 0.7rem;
}

p { margin: 0 0 1.15rem; }

a {
  color: var(--pine);
  text-decoration: underline;
  text-decoration-color: var(--copper);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.28s var(--ease), text-decoration-color 0.28s var(--ease);
}
a:hover { color: var(--copper-ink); text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 2px;
}

strong { color: var(--pine); font-weight: 600; }

/* ---------------------------------------------------------------- a11y bits */

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 60;
  padding: 0.7rem 1.1rem;
  background: var(--pine);
  color: var(--bone);
  text-decoration: none;
  font-size: 0.9rem;
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 1rem; outline: 2px solid var(--copper); outline-offset: 2px; }

.measure { width: min(100% - 2.6rem, var(--measure)); margin-inline: auto; }

/* ------------------------------------------------------------------ masthead */

.masthead {
  padding: 1.9rem 0 0;
  background: linear-gradient(180deg, var(--bone-warm), transparent 78%);
}

.rule { height: 0; border-top: 1px solid var(--pine); position: relative; }
.rule--top { border-top-width: 2px; }
.rule--top::after {
  content: ""; display: block; margin-top: 3px;
  border-top: 1px solid var(--hair);
}
.rule--bottom { border-top-width: 2px; margin-top: 1.3rem; }
.rule--bottom::before {
  content: ""; display: block; margin-bottom: 3px;
  border-top: 1px solid var(--hair);
}

.masthead__inner { text-align: center; padding: 1.5rem 0 0; }

.crest { display: inline-block; color: var(--pine); }
.seal { width: 84px; height: 84px; display: block; color: var(--pine); }
.seal__ring {
  font-family: var(--sans);
  font-size: 9.4px;
  font-weight: 600;
  letter-spacing: 0.16em;
  fill: var(--pine);
}
.seal__mono {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.02em;
  fill: var(--copper-ink);
}

.masthead__word {
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  margin: 0.65rem 0 0.15rem;
}
.masthead__word span { color: var(--copper-ink); }

.masthead__tag {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--slate);
}

.masthead__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.5rem;
  margin: 1.1rem 0 0;
  padding: 0;
}
.masthead__nav a {
  font-size: 0.79rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--slate);
  padding: 0.4rem 0.15rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: color 0.28s var(--ease), border-color 0.28s var(--ease);
}
.masthead__nav a:hover { color: var(--pine); border-bottom-color: var(--copper); }

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

.hero { padding: 3rem 0 1.4rem; text-align: center; }

.kicker {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--copper-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}
.kicker::before, .kicker::after {
  content: ""; height: 1px; width: 2.2rem;
  background: var(--copper); opacity: 0.65;
}

.hero__lede {
  font-family: var(--serif);
  font-size: 1.16rem;
  line-height: 1.66;
  color: var(--slate);
  margin: 1.4rem auto 0;
  max-width: 38rem;
}

.hero__media { margin: 2.7rem 0 0; }
.hero__media img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--hair);
  padding: 8px;
  background: var(--bone);
  filter: saturate(0.86) contrast(1.02);
}
figcaption {
  font-size: 0.83rem;
  line-height: 1.55;
  color: var(--slate);
  margin-top: 0.75rem;
  padding-left: 0.95rem;
  border-left: 2px solid var(--copper);
  text-align: left;
}
.hero__media figcaption { max-width: 40rem; margin-inline: auto; }

/* ------------------------------------------------------------------- ledger */

.ledger { padding-bottom: 4rem; }
.article { padding-top: 3rem; }
.article section { margin-bottom: 3.4rem; scroll-margin-top: 2rem; }

.dropcap::first-letter {
  font-family: var(--serif);
  float: left;
  font-size: 3.6rem;
  line-height: 0.82;
  font-weight: 700;
  color: var(--pine);
  margin: 0.1rem 0.6rem 0 0;
  padding-right: 0.12rem;
}

.inline-fig { margin: 2rem 0 1.8rem; }
.inline-fig img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--hair);
  padding: 7px;
  background: var(--bone);
  filter: saturate(0.84);
}

.prose ul, .article ul { padding-left: 1.15rem; margin: 0 0 1.3rem; }
.article ul li { margin-bottom: 0.6rem; padding-left: 0.2rem; }
.article ul li::marker { color: var(--copper); }

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

.callout {
  margin: 2rem 0;
  padding: 1.25rem 1.4rem 1.05rem;
  background: var(--bone-warm);
  border-top: 2px solid var(--copper);
  border-bottom: 1px solid var(--hair);
}
.callout__label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper-ink);
  margin-bottom: 0.5rem;
}
.callout p:last-child { margin-bottom: 0; }

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

.table-scroll { overflow-x: auto; margin: 1.8rem 0; border: 1px solid var(--hair); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; min-width: 34rem; }
caption {
  caption-side: top;
  text-align: left;
  padding: 0.85rem 1rem;
  font-family: var(--serif);
  font-size: 0.92rem;
  font-style: italic;
  color: var(--slate);
  border-bottom: 1px solid var(--hair);
  background: var(--bone-warm);
}
th, td { text-align: left; padding: 0.78rem 1rem; vertical-align: top; }
thead th {
  font-family: var(--sans);
  font-size: 0.71rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--pine);
  border-bottom: 1px solid var(--copper);
  background: rgba(29, 59, 50, 0.045);
}
tbody tr + tr td { border-top: 1px solid var(--hair-soft); }
tbody td:first-child { color: var(--pine); font-weight: 500; }
tbody tr { transition: background-color 0.3s var(--ease); }
tbody tr:hover { background: rgba(169, 113, 63, 0.07); }

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

.faq { border-top: 1px solid var(--hair); }
.faq details { border-bottom: 1px solid var(--hair); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.05rem 2.4rem 1.05rem 0;
  position: relative;
  font-family: var(--serif);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--pine);
  min-height: 44px;
  transition: color 0.28s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.35rem; top: 1.5rem;
  width: 0.62rem; height: 0.62rem;
  border-right: 1.6px solid var(--copper);
  border-bottom: 1.6px solid var(--copper);
  transform: rotate(45deg);
  transition: transform 0.32s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { color: var(--copper-ink); }
.faq summary:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.faq__body { padding: 0 0 1.3rem; }
.faq__body p { margin: 0; color: var(--ink); }

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

.related { display: grid; gap: 0.8rem; margin-top: 1.1rem; }
.related a {
  display: block;
  padding: 0.95rem 1.1rem;
  text-decoration: none;
  border-left: 3px solid var(--copper);
  background: var(--bone-warm);
  transition: background-color 0.3s var(--ease), padding-left 0.3s var(--ease);
}
.related a:hover { background: rgba(169, 113, 63, 0.11); padding-left: 1.35rem; }
.related a:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.related__kicker {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--copper-ink);
}
.related__title { display: block; font-family: var(--serif); color: var(--pine); font-size: 1.02rem; }

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

.foot {
  background: var(--pine);
  color: rgba(246, 244, 239, 0.84);
  padding: 3.2rem 0 2.6rem;
  text-align: center;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}
.foot .measure { width: min(100% - 2.6rem, var(--wide)); }
.seal--foot { width: 62px; height: 62px; color: var(--copper); margin-inline: auto; }
.seal--foot .seal__mono { fill: var(--bone); }

.foot__brand {
  font-size: 1.45rem;
  color: var(--bone);
  margin: 0.7rem 0 0.4rem;
}
.foot__brand span { color: var(--copper); }
.foot__blurb { color: rgba(246, 244, 239, 0.72); max-width: 34rem; margin: 0 auto 2rem; font-size: 0.94rem; }

.foot__net-title {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper);
  border-top: 1px solid rgba(246, 244, 239, 0.2);
  padding-top: 1.5rem;
  margin: 0 0 1rem;
}

.linknet {
  list-style: none;
  margin: 0 auto 2.4rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.15rem 2rem;
  max-width: 56rem;
  text-align: left;
}
.linknet a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0.2rem;
  min-height: 44px;
  color: rgba(246, 244, 239, 0.86);
  text-decoration: none;
  border-bottom: 1px solid rgba(246, 244, 239, 0.13);
  font-size: 0.9rem;
  transition: color 0.28s var(--ease), border-color 0.28s var(--ease);
}
.linknet a span { color: var(--copper); font-size: 0.76rem; letter-spacing: 0.1em; }
.linknet a:hover { color: #fff; border-bottom-color: var(--copper); }
.linknet a:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }

.foot__legal {
  border-top: 1px solid rgba(246, 244, 239, 0.2);
  padding-top: 1.5rem;
  font-size: 0.83rem;
  line-height: 1.7;
  color: rgba(246, 244, 239, 0.62);
  max-width: 46rem;
  margin-inline: auto;
}
.foot__meta { color: rgba(246, 244, 239, 0.68); margin-bottom: 0; }

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

/* reveal is scoped to .js so the page is fully visible with JS disabled */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

.img-fallback {
  display: block;
  font-size: 0.83rem;
  font-style: italic;
  color: var(--copper-ink);
  margin-top: 0.5rem;
}

/* ------------------------------------------------------------------ narrow */

@media (max-width: 720px) {
  body { font-size: 1rem; }
  .masthead__nav { gap: 0.2rem 1rem; }
  .masthead__nav a { font-size: 0.72rem; letter-spacing: 0.08em; }
  .hero { padding-top: 2.2rem; }
  .ledger { padding-bottom: 3rem; }
  .article { padding-top: 2.2rem; }
  .article section { margin-bottom: 2.6rem; }
  .dropcap::first-letter { font-size: 3rem; }
  .foot .measure { width: min(100% - 2rem, var(--wide)); }
  .linknet { grid-template-columns: 1fr; }
}

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