/* GEMINIUM whitepaper — document layout layered on the tokens in styles.css.
   Only the whitepaper page loads this file. */

/* The page wears the site masthead, so the anchor offset stays the default
   from styles.css. */

/* ---------------------------------------------------------
   Export action (inside the cover's meta row)
   --------------------------------------------------------- */

.wp-print {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--cobalt);
  cursor: pointer;
  border-bottom: 1px solid rgba(31, 61, 168, 0.32);
  transition: border-color 0.14s ease, color 0.14s ease;
}
.wp-print:hover {
  color: #162e88;
  border-bottom-color: currentColor;
}

/* ---------------------------------------------------------
   Cover
   --------------------------------------------------------- */

/* The document block is narrower than the site's page grid: a rail plus a
   74-character measure, centred like a printed report. */
.wp-cover {
  max-width: 1120px;
  margin-inline: auto;
  padding: clamp(38px, 6.4vw, 88px) var(--gutter) clamp(24px, 3.6vw, 44px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  column-gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.wp-cover-copy { min-width: 0; }
/* Same treatment as the homepage .eyebrow: mono label in body ink, with the
   cobalt spark mark carrying the accent. */
.wp-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  font: 500 13.5px/1.5 var(--mono);
  letter-spacing: 0.06em;
  color: var(--body);
}
.wp-cover h1 {
  margin-top: 20px;
  font-size: clamp(32px, 5.4vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.022em;
  font-weight: 700;
  /* Same ink gradient as the homepage hero: navy -> cobalt -> sky -> gold,
     painted through the glyphs. Plain sRGB first as a fallback. */
  background-image: linear-gradient(96deg, #101a3d 0%, #1f3da8 42%, #2a56c6 60%, #c9a25b 88%, #e3c78a 100%);
  background-image: linear-gradient(in oklab 96deg, #101a3d 0%, #1f3da8 42%, #2a56c6 60%, #c9a25b 88%, #e3c78a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #141f45;
}
.wp-cover h1 em {
  font-family: var(--latin);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.wp-latin {
  margin-top: 14px;
  font: italic 400 clamp(15px, 1.8vw, 21px)/1.5 var(--latin);
  color: var(--muted);
}
.wp-abstract {
  max-width: 62ch;
  margin-top: 26px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--body);
}

.wp-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  margin-top: clamp(28px, 4vw, 44px);
  border-block: 1px solid var(--rule);
}
.wp-meta > div {
  padding: 16px 20px 15px 0;
  border-left: 1px solid var(--rule-soft);
  padding-left: 20px;
}
.wp-meta > div:first-child {
  border-left: 0;
  padding-left: 0;
}
.wp-meta dt {
  font: 500 13px/1.4 var(--mono);
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.wp-meta dd {
  margin-top: 8px;
  font: 600 18px/1.35 var(--mono);
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ---------------------------------------------------------
   Cover element card (reuses .mint-card-3d from styles.css)
   --------------------------------------------------------- */

.wp-card-stage {
  --wp-card-scale: 1.5;
  position: relative;
  justify-self: center;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: 22px;
}

.wp-card-stage::before {
  content: "";
  position: absolute;
  inset: 2% 0 16%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(61, 106, 232, 0.26), transparent 64%),
    radial-gradient(circle at 50% 62%, rgba(56, 189, 248, 0.18), transparent 72%);
  filter: blur(26px);
  pointer-events: none;
  z-index: 0;
}

.wp-card-stage .mint-card-3d {
  position: relative;
  z-index: 1;
  cursor: default;
  touch-action: auto;
  /* Reserve the footprint of the scaled card so the caption stays put. */
  margin:
    calc((var(--wp-card-scale) - 1) * 287px / 2)
    calc((var(--wp-card-scale) - 1) * 184px / 2)
    calc((var(--wp-card-scale) - 1) * 287px / 2 + 10px);
  animation: wpCardSpin 26s linear infinite;
}

@keyframes wpCardSpin {
  0%   { transform: scale(var(--wp-card-scale)) translateY(0)    rotateX(-7deg) rotateY(0deg); }
  25%  { transform: scale(var(--wp-card-scale)) translateY(-9px) rotateX(-7deg) rotateY(90deg); }
  50%  { transform: scale(var(--wp-card-scale)) translateY(0)    rotateX(-7deg) rotateY(180deg); }
  75%  { transform: scale(var(--wp-card-scale)) translateY(-9px) rotateX(-7deg) rotateY(270deg); }
  100% { transform: scale(var(--wp-card-scale)) translateY(0)    rotateX(-7deg) rotateY(360deg); }
}

.wp-card-caption {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  font: 500 11.5px/1.6 var(--mono);
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .wp-card-stage .mint-card-3d {
    animation: none;
    transform: scale(var(--wp-card-scale)) rotateX(-7deg) rotateY(-24deg);
  }
  .wp-card-stage .mc-holo { animation: none; }
}

/* ---------------------------------------------------------
   Shell: sticky rail + document column
   --------------------------------------------------------- */

.wp-shell {
  max-width: 1120px;
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(56px, 7vw, 104px);
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  gap: clamp(26px, 4vw, 68px);
  align-items: start;
}

.wp-rail {
  position: sticky;
  top: 92px;
}
.wp-rail p {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 500 13.5px/1.5 var(--mono);
  letter-spacing: 0.06em;
  color: var(--body);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.wp-rail ol { margin-top: 10px; }
.wp-rail a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 9px 9px 0;
  color: var(--body);
  font: 500 15.5px/1.5 var(--sans);
  letter-spacing: 0.01em;
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.wp-rail a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.6); }
.wp-rail a.is-current {
  color: var(--cobalt);
  font-weight: 600;
  border-left-color: var(--cobalt);
  background: rgba(255, 255, 255, 0.78);
}
.wp-rail a span {
  flex: none;
  min-width: 16px;
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
}
.wp-rail a.is-current span { color: var(--cobalt); opacity: 0.78; }

.wp-toc-inline { display: none; }

.wp-doc { max-width: 74ch; }

/* ---------------------------------------------------------
   Sections
   --------------------------------------------------------- */

.wp-sec {
  padding-top: clamp(34px, 4.6vw, 58px);
  margin-top: clamp(34px, 4.6vw, 58px);
  border-top: 1px solid var(--rule);
}
.wp-sec:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}
.wp-sec > h2 {
  display: flex;
  align-items: baseline;
  gap: 13px;
  font-size: clamp(21px, 2.6vw, 29px);
  line-height: 1.25;
  letter-spacing: -0.012em;
  font-weight: 700;
}
.wp-sec > h2 .n {
  font: 500 12.5px/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--cobalt);
  flex: none;
}
.wp-deck {
  margin-top: 12px;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--muted);
}
.wp-doc h3 {
  margin-top: 34px;
  font-size: 16.5px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}
.wp-doc h3 .n {
  font: 500 11.5px/1 var(--mono);
  color: var(--muted);
  margin-right: 8px;
  letter-spacing: 0.06em;
}
.wp-doc h4 {
  margin-top: 26px;
  font-size: 14.5px;
  color: var(--ink);
}
.wp-doc p {
  margin-top: 14px;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--body);
}
.wp-doc ul, .wp-doc ol {
  margin-top: 14px;
  padding-left: 2px;
}
.wp-doc ul { list-style: none; }
.wp-doc ul > li {
  position: relative;
  padding-left: 20px;
  margin-top: 9px;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--body);
}
.wp-doc ul > li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--cobalt);
  border-radius: 50%;
  opacity: 0.55;
}
.wp-doc ol { list-style: none; counter-reset: wp-ol; }
.wp-doc ol > li {
  position: relative;
  padding-left: 30px;
  margin-top: 9px;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--body);
  counter-increment: wp-ol;
}
.wp-doc ol > li::before {
  content: counter(wp-ol, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.12em;
  font: 500 11.5px/1.7 var(--mono);
  color: var(--cobalt);
  opacity: 0.75;
}
.wp-doc strong { color: var(--ink); font-weight: 600; }
.wp-doc em { font-style: normal; color: var(--ink); font-weight: 600; }
.wp-doc a {
  color: var(--cobalt);
  text-decoration: underline;
  text-decoration-color: rgba(31, 61, 168, 0.32);
  text-underline-offset: 3px;
}
.wp-doc a:hover { text-decoration-color: currentColor; }
.wp-doc code {
  font: 500 0.9em/1 var(--mono);
  padding: 1.5px 5px;
  border: 1px solid var(--rule-soft);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.66);
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Blocks: stats, bars, tables, callouts
   --------------------------------------------------------- */

.wp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
  gap: 1px;
  margin-top: 22px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  border-radius: 16px;
  overflow: hidden;
}
.wp-stats > div {
  padding: 15px 17px 14px;
  background: rgba(255, 255, 255, 0.62);
}
.wp-stats b {
  display: block;
  font: 600 clamp(21px, 2.4vw, 26px)/1.1 var(--mono);
  color: var(--ink);
  letter-spacing: -0.02em;
}
.wp-stats b i {
  font-style: normal;
  font-size: 0.55em;
  color: var(--muted);
  margin-left: 4px;
}
.wp-stats span {
  display: block;
  margin-top: 7px;
  font: 500 11.5px/1.5 var(--mono);
  letter-spacing: 0.05em;
  color: var(--muted);
}

.wp-bar {
  display: flex;
  height: 44px;
  margin-top: 18px;
  border: 1px solid var(--rule-soft);
  border-radius: 12px;
  overflow: hidden;
}
.wp-bar > span {
  display: grid;
  place-items: center;
  font: 500 12px/1 var(--mono);
  color: #fff;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.wp-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 12px;
  font: 500 12.5px/1.6 var(--mono);
  color: var(--muted);
}
.wp-bar-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 7px;
}

.wp-table-wrap { margin-top: 20px; overflow-x: auto; }
.wp-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 14px;
}
.wp-table.is-narrow { max-width: 460px; min-width: 300px; }
.wp-table th, .wp-table td {
  text-align: left;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
  line-height: 1.65;
}
.wp-table thead th {
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-color: var(--rule);
  white-space: nowrap;
}
.wp-table td:first-child { color: var(--ink); font-weight: 500; }
.wp-table .num {
  font-family: var(--mono);
  text-align: right;
  white-space: nowrap;
}
.wp-table .num:last-child, .wp-table th.num:last-child { padding-right: 0; }
.wp-table caption {
  caption-side: bottom;
  text-align: left;
  padding-top: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.wp-call {
  margin-top: 22px;
  padding: 15px 18px;
  border-left: 3px solid var(--reason);
  border-radius: 0 12px 12px 0;
  background: rgba(255, 255, 255, 0.56);
}
.wp-call.is-cobalt { border-left-color: var(--cobalt); }
.wp-call.is-plain { border-left-color: var(--rule); }
.wp-call > .wp-call-label {
  display: block;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.08em;
  color: var(--reason);
  text-transform: uppercase;
}
.wp-call.is-cobalt > .wp-call-label { color: var(--cobalt); }
.wp-call.is-plain > .wp-call-label { color: var(--muted); }
.wp-call p { margin-top: 7px; font-size: 14.5px; line-height: 1.8; }
.wp-call p:first-of-type { margin-top: 8px; }

.wp-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 22px;
}
.wp-flow > div {
  padding: 14px 15px;
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}
.wp-flow span {
  font: 500 10.5px/1.4 var(--mono);
  letter-spacing: 0.08em;
  color: var(--cobalt);
}
.wp-flow h4 { margin-top: 8px; }
.wp-flow p {
  margin-top: 7px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--muted);
}

.wp-foot-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 1080px) {
  .wp-cover { grid-template-columns: minmax(0, 1fr); }
  .wp-card-stage {
    justify-self: center;
    margin-top: clamp(18px, 4vw, 34px);
  }
  /* Without the rail the document is the only column: match the shell to the
     reading measure so the inline contents box and the text line up instead of
     leaving the trailing whitespace on one side. */
  .wp-shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: calc(74ch + 2 * var(--gutter));
  }
  .wp-rail { display: none; }
  .wp-toc-inline {
    display: block;
    margin-bottom: clamp(26px, 4vw, 40px);
    border: 1px solid var(--rule-soft);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.5);
  }
  .wp-toc-inline > summary {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    padding: 14px 16px;
    font: 500 13.5px/1.5 var(--mono);
    letter-spacing: 0.06em;
    color: var(--body);
    list-style: none;
  }
  .wp-toc-inline > summary::-webkit-details-marker { display: none; }
  .wp-toc-inline > summary::after {
    content: "+";
    margin-left: auto;
    color: var(--cobalt);
    font-size: 16px;
    line-height: 1;
  }
  .wp-toc-inline[open] > summary::after { content: "−"; }
  .wp-toc-inline ol { padding: 0 16px 14px; }
  /* The contents list must not inherit the document's numbered-list styling. */
  .wp-toc-inline ol > li {
    padding-left: 0;
    margin-top: 0;
    counter-increment: none;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
  }
  .wp-toc-inline ol > li::before { content: none; }
  .wp-toc-inline a {
    display: block;
    padding: 9px 0;
    border-top: 1px solid var(--rule-soft);
    font-size: 15px;
    color: var(--body);
    text-decoration: none;
  }
  .wp-toc-inline a:hover { color: var(--cobalt); }
  .wp-toc-inline a span { font: 500 12px/1 var(--mono); margin-right: 9px; color: var(--muted); }
}

@media (max-width: 640px) {
  .wp-card-stage { --wp-card-scale: 1.16; }
  /* Printing is a desktop / PDF action; the meta row keeps the three facts. */
  .wp-meta > .is-export { display: none; }
  .wp-meta > div {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--rule-soft);
  }
  .wp-meta > div:first-child { border-top: 0; }
  .wp-doc p, .wp-doc ul > li, .wp-doc ol > li { font-size: 15px; }
  /* These tables are two or three columns wide: let them fill the phone
     measure instead of forcing a sideways scroll inside the page. */
  .wp-table, .wp-table.is-narrow { min-width: 0; }
  .wp-table th, .wp-table td { padding-right: 10px; }
  .wp-table .num { white-space: normal; }
}

/* ---------------------------------------------------------
   Print / PDF
   --------------------------------------------------------- */

@media print {
  .masthead, .wp-rail, .wp-toc-inline, .site-foot .foot-top, .skip { display: none !important; }
  html, body {
    background: #fff !important;
    background-image: none !important;
    font-size: 11pt;
  }
  .wp-cover { padding: 0 0 18pt; grid-template-columns: minmax(0, 1fr); }
  /* Gradient text depends on a painted background; the PDF export must keep
     solid ink so the title never prints blank. */
  .wp-cover h1 {
    background-image: none !important;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: currentColor;
    color: #14203a;
  }
  .wp-card-stage, .wp-meta > .is-export { display: none; }
  .wp-shell {
    display: block;
    max-width: none;
    padding: 0;
  }
  .wp-doc { max-width: none; }
  .wp-sec {
    break-inside: auto;
    page-break-inside: auto;
    margin-top: 22pt;
    padding-top: 16pt;
  }
  .wp-sec > h2 { break-after: avoid; }
  .wp-doc h3, .wp-doc h4 { break-after: avoid; }
  .wp-table-wrap, .wp-stats, .wp-bar, .wp-call, .wp-flow { break-inside: avoid; }
  .wp-doc a { text-decoration: none; }
  .wp-stats > div { background: #fff; }
  .wp-call { background: #fff; }
  .wp-flow > div { background: #fff; }
  @page { margin: 17mm 15mm; }
}
