/* arqivanelabs.com reference pages: the home gate's night, a Night Earth masthead, and one custody route. */
:root {
  --space: #07060a;
  --deep: #0e0c14;
  --line: rgb(247 243 255 / 0.12);
  --line-strong: rgb(247 243 255 / 0.22);
  --ink: #f7f3ff;
  --soft: #cdc6dd;
  --muted: #a39bb8;
  --lav: #c4b5fd;
  --violet: #8b47ce;
  --burn: #d9c8ff;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
  accent-color: var(--lav);
  scrollbar-color: #3a3150 var(--space);
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--space); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--space); color: var(--soft); font: 400 17px/1.7 var(--font); font-feature-settings: "cv11", "ss01"; caret-color: var(--lav); }
::selection { background: rgb(196 181 253 / 0.32); color: var(--ink); }
a { color: var(--lav); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: rgb(196 181 253 / 0.45); transition: color 160ms ease, text-decoration-color 160ms ease; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--lav); outline-offset: 3px; border-radius: 3px; }
@media (hover: hover) and (pointer: fine) { a:hover { color: var(--ink); text-decoration-color: var(--ink); } }
code, .mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
strong { color: var(--ink); font-weight: 600; }

/* ---------- Masthead: a slice of the home page's Night Earth ---------- */
.mast { position: relative; isolation: isolate; min-height: clamp(260px, 30vw, 380px); padding: 22px 0 34px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.mast::before { content: ""; position: absolute; inset: 0; z-index: -2; background: url("/assets/masthead-earth.jpg") right 30% / cover no-repeat; }
.mast::after { content: ""; position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(90deg, rgb(7 6 10 / 0.75) 0%, rgb(7 6 10 / 0.4) 38%, rgb(7 6 10 / 0) 62%),
  linear-gradient(180deg, rgb(7 6 10 / 0.6) 0%, rgb(7 6 10 / 0) 34%, rgb(7 6 10 / 0.45) 78%, var(--space) 100%); }
.mast-bar, .mast-title { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: var(--gutter) var(--gutter-r); }
.mast-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; }
.mast-logo { display: block; line-height: 0; }
.mast-logo img { width: 112px; height: auto; }
.mast nav { display: flex; flex-wrap: wrap; gap: 2px 24px; font: 500 14px/1 var(--font); }
.mast nav a { padding: 14px 0; color: rgb(247 243 255 / 0.78); text-decoration: none; position: relative; text-shadow: 0 1px 10px rgb(7 6 10 / 0.95), 0 0 2px rgb(7 6 10 / 0.9); }
.mast nav a[aria-current] { color: var(--ink); }
.mast nav a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; border-radius: 2px; background: var(--lav); }
@media (hover: hover) and (pointer: fine) { .mast nav a:hover { color: var(--ink); } }
.mast-title { padding-top: 40px; }
.mast h1 { margin: 0; max-width: 18ch; color: var(--ink); font: 650 clamp(34px, 5.4vw, 64px)/1.04 var(--font); letter-spacing: -0.032em; text-wrap: balance; }
.mast h1 .batch { display: block; margin-top: 0.3em; color: var(--burn); font: 500 clamp(17px, 2vw, 24px)/1.2 var(--mono); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.mast .sub { margin: 14px 0 0; max-width: 60ch; color: var(--soft); font-size: 18px; line-height: 1.6; text-wrap: pretty; }
.mast .sub .mono { color: var(--burn); }

/* ---------- Page body ---------- */
.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 8px var(--gutter-r) 72px var(--gutter); }
.col { max-width: 68ch; }
.page h2 { margin: 2.4em 0 0.6em; color: var(--ink); font: 620 clamp(22px, 2.4vw, 28px)/1.25 var(--font); letter-spacing: -0.018em; text-wrap: balance; }
.page h2:first-child { margin-top: 0.6em; }
.page h3 { margin: 1.8em 0 0.4em; color: var(--ink); font: 600 18px/1.35 var(--font); }
.page :where(p, li) { max-width: 68ch; text-wrap: pretty; }
.page :where(ul, ol) { padding-left: 1.25em; }
.page :where(li) { margin: 0.35em 0; }
.page li::marker { color: var(--muted); }

/* Tables: hairline ledger, tabular numerals, scroll inside their own box on narrow screens. */
.ledger { margin: 18px 0 8px; overflow-x: auto; border-block: 1px solid var(--line-strong); }
.ledger table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ledger th, .ledger td { padding: 13px 16px 13px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 15px; line-height: 1.5; }
.ledger th { color: var(--muted); font: 500 12px/1.4 var(--font); letter-spacing: 0.06em; text-transform: uppercase; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger td { color: var(--soft); }
.ledger td:first-child { color: var(--ink); font-weight: 550; }
.ledger td.result { color: var(--ink); font-family: var(--mono); font-size: 14px; }
.ledger td.result.word { font-family: var(--font); font-size: 15px; }

/* ---------- The custody route ---------- */
.route { --fill: 1; position: relative; list-style: none; margin: 34px 0 0; padding: 0 0 0 46px; max-width: 880px; }
/* docs.js sets --spine so the line ends at the last stop's node; without it the line runs the route's length. */
.route::before, .route::after { content: ""; position: absolute; left: 13px; top: 10px; bottom: 26px; height: var(--spine, auto); width: 2px; border-radius: 2px; }
.route::before { background: rgb(139 71 206 / 0.32); }
.route::after { background: linear-gradient(180deg, var(--violet), var(--lav)); transform-origin: top; transform: scaleY(var(--fill)); }
.stop { position: relative; padding: 0 0 46px; }
.stop:last-child { padding-bottom: 0; }
.stop::before { content: ""; position: absolute; left: -38px; top: 7px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--violet); background: var(--space); z-index: 1; transition: background-color 400ms var(--ease), border-color 400ms var(--ease), transform 400ms var(--ease); }
.stop::after { content: ""; position: absolute; left: -24px; top: 14px; width: 14px; height: 2px; background: rgb(139 71 206 / 0.6); }
.stop.is-lit::before { border-color: var(--ink); background: var(--lav); transform: scale(1.2); }
.page .stop h2 { margin: 0 0 6px; font-size: clamp(20px, 2.1vw, 24px); }
.stop p { margin: 0.4em 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--deep); color: var(--ink); font: 550 15px/1 var(--font); text-decoration: none; transition: border-color 160ms ease, background-color 160ms ease, transform 140ms var(--ease); }
.btn svg { width: 16px; height: 16px; flex: none; color: var(--lav); transition: transform 200ms var(--ease); }
.btn.primary { border-color: rgb(196 181 253 / 0.55); background: rgb(139 71 206 / 0.22); }
.btn:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .btn:hover { color: var(--ink); border-color: var(--lav); } .btn:hover svg { transform: translateX(3px); } }

/* ---------- Certificates: the batches as stations on one line ---------- */
.stations { position: relative; list-style: none; margin: 30px 0 0; padding: 0 0 0 46px; max-width: 960px; }
.stations::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 30px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, var(--violet), var(--lav)); }
.station { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 8px 20px; min-height: 64px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.station:first-child { border-top: 1px solid var(--line); }
.station::before { content: ""; position: absolute; left: -38px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; border: 2px solid var(--violet); background: var(--space); transition: background-color 200ms ease, border-color 200ms ease; }
.station .name { color: var(--ink); font-weight: 600; font-size: 18px; text-decoration: none; }
.station .name::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.station .batch { color: var(--burn); font: 500 14px/1.4 var(--mono); }
.station .date { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.station .pdf { position: relative; z-index: 1; color: var(--soft); font-size: 14px; }
.station:focus-within::before { border-color: var(--burn); background: var(--lav); }
@media (hover: hover) and (pointer: fine) {
  .station:hover::before { border-color: var(--burn); background: var(--lav); }
  .station:hover .name { color: var(--burn); }
}

/* ---------- Guides index and FAQ ---------- */
.contents { list-style: none; margin: 24px 0 0; padding: 0; max-width: 820px; border-top: 1px solid var(--line); }
.contents li { margin: 0; max-width: none; border-bottom: 1px solid var(--line); }
.contents a { display: grid; gap: 4px; padding: 22px 0; text-decoration: none; }
.contents .t { color: var(--ink); font: 600 20px/1.3 var(--font); letter-spacing: -0.01em; }
.contents .d { color: var(--muted); font-size: 16px; }
@media (hover: hover) and (pointer: fine) { .contents a:hover .t { color: var(--burn); } }
dl.faq { max-width: 68ch; margin: 24px 0 0; border-top: 1px solid var(--line); }
dl.faq dt { padding-top: 22px; color: var(--ink); font: 600 18px/1.4 var(--font); }
dl.faq dd { margin: 6px 0 0; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.note { max-width: 68ch; margin: 28px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line-strong); color: var(--muted); font-size: 15px; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); }
.foot-in { width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px var(--gutter-r) calc(36px + env(safe-area-inset-bottom, 0px)) var(--gutter); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 40px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.foot-in p { margin: 0; max-width: 60ch; }
.foot-in nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot-in nav a { color: var(--soft); text-decoration: none; padding: 6px 0; }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .mast { min-height: 300px; padding-top: 14px; padding-bottom: 26px; }
  .mast::before { background-position: 80% 30%; }
  .mast::after { background:
    linear-gradient(90deg, rgb(7 6 10 / 0.55) 0%, rgb(7 6 10 / 0.2) 100%),
    linear-gradient(180deg, rgb(7 6 10 / 0.35) 0%, rgb(7 6 10 / 0.1) 30%, rgb(7 6 10 / 0.75) 88%, var(--space) 100%); }
  .mast-logo img { width: 92px; }
  .mast nav { gap: 0 18px; font-size: 14px; }
  .mast-title { padding-top: 26px; }
  .mast .sub { font-size: 16px; }
  .route, .stations { padding-left: 34px; }
  .route::before, .route::after, .stations::before { left: 7px; }
  .stop::before, .station::before { left: -32px; }
  .stop::after { left: -18px; width: 10px; }
  .station { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name pdf" "batch date"; padding: 14px 0; }
  .station .name { grid-area: name; }
  .station .batch { grid-area: batch; }
  .station .date { grid-area: date; justify-self: end; }
  .station .pdf { grid-area: pdf; justify-self: end; }
  .ledger th, .ledger td { padding-right: 12px; font-size: 14px; }
  .btn { padding: 0 16px; font-size: 14px; }
  /* Three-column tables become one block per row, each cell labelled. */
  .ledger.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ledger.stack tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .ledger.stack tr:last-child { border-bottom: 0; }
  .ledger.stack td { display: block; padding: 0; border: 0; }
  .ledger.stack td:first-child { margin-bottom: 6px; font-size: 16px; }
  .ledger.stack td[data-label] { margin-top: 6px; }
  .ledger.stack td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font: 500 11px/1.6 var(--font); letter-spacing: 0.06em; text-transform: uppercase; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
