/* Degrees of Satoshi — non-Atlas theme layer.
 *
 * This file is intentionally opt-in. Every public page except atlas.html loads
 * it after its existing stylesheets. Keep every rule body-scoped so the Atlas
 * renderer and its shared base stylesheet remain an independent visual system.
 */

@media screen {

:where(
  body.home-atlas,
  body.wallet-page,
  body.community-page,
  body.public-profile-page,
  body.site-document-page,
  body.history-page,
  body.research-page
) {
  --site-space: #070912;
  --site-surface: #0c0e16;
  --site-paper: #eee9df;
  --site-muted: rgb(218 213 203 / 0.62);
  --site-faint: rgb(218 213 203 / 0.4);
  --site-hairline: rgb(232 225 208 / 0.2);
  --site-hairline-soft: rgb(232 225 208 / 0.11);
  --site-gold: #e1b969;
  --site-gold-soft: #cba65d;
  --site-bitcoin: #f7931a;
  --site-route-blue: #6999b0;
  --site-glass: rgb(12 14 22 / 0.76);

  --bg: var(--site-space);
  --panel: var(--site-surface);
  --border: var(--site-hairline);
  --text: var(--site-paper);
  --muted: var(--site-muted);
  --amber: var(--site-gold);
  --violet: var(--site-gold);
  --blue: var(--site-route-blue);
  color-scheme: dark;
}

:where(
  body.home-atlas,
  body.wallet-page,
  body.community-page,
  body.public-profile-page,
  body.site-document-page,
  body.history-page,
  body.research-page
) ::selection {
  color: var(--site-space);
  background: var(--site-gold);
}

:where(
  body.home-atlas,
  body.wallet-page,
  body.community-page,
  body.public-profile-page,
  body.site-document-page
) :is(a, button, input, summary, [tabindex]):focus-visible {
  outline: 1px solid rgb(238 208 145 / 0.72);
  outline-offset: 4px;
}

:where(
  body.home-atlas,
  body.wallet-page,
  body.community-page,
  body.public-profile-page,
  body.site-document-page
) :is(button.primary, .button-link.primary) {
  border-color: #e8c779;
  color: #17130a;
  background: linear-gradient(180deg, #ebcc83, #d9ae5c);
  box-shadow:
    0 15px 40px rgb(0 0 0 / 0.26),
    0 0 25px rgb(225 185 105 / 0.1),
    inset 0 1px rgb(255 250 225 / 0.52);
}

:where(
  body.home-atlas,
  body.wallet-page,
  body.community-page,
  body.public-profile-page,
  body.site-document-page
) :is(button.primary, .button-link.primary):hover {
  border-color: #f3d896;
  filter: brightness(1.05);
}

/* Shared deep-page sky. The homepage supplies its own, more detailed field. */
:where(
  body.wallet-page,
  body.community-page,
  body.public-profile-page,
  body.site-document-page,
  body.research-page
) {
  background-color: var(--site-space);
  background-image:
    radial-gradient(circle at 73% 18%, rgb(225 185 105 / 0.075), transparent 20%),
    radial-gradient(circle at 23% 38%, rgb(105 153 176 / 0.05), transparent 24%),
    linear-gradient(180deg, rgb(7 9 18 / 0.2), rgb(7 9 18 / 0.88)),
    url('/starfield.svg');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: auto, auto, auto, cover;
  background-attachment: fixed;
}

/* Methodology and data notice ------------------------------------------------ */

body.site-document-page .wrap {
  max-width: 1040px;
  padding-top: clamp(24px, 5vw, 58px);
  padding-bottom: 72px;
}

body.site-document-page .methodology {
  position: relative;
  max-width: 82ch;
  overflow: hidden;
  border: 1px solid var(--site-hairline);
  border-radius: 22px;
  color: var(--site-paper);
  background:
    radial-gradient(circle at 88% 0%, rgb(225 185 105 / 0.07), transparent 27%),
    linear-gradient(145deg, rgb(14 16 25 / 0.9), rgb(9 11 19 / 0.82));
  box-shadow: 0 28px 90px rgb(0 0 0 / 0.3), inset 0 1px rgb(255 255 255 / 0.03);
  padding: clamp(25px, 5vw, 58px);
  backdrop-filter: blur(18px) saturate(108%);
}

body.site-document-page .methodology::before {
  position: absolute;
  top: 0;
  right: clamp(30px, 6vw, 72px);
  left: clamp(30px, 6vw, 72px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(225 185 105 / 0.52), transparent);
  content: '';
}

body.site-document-page .methodology-brand {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  color: var(--site-gold-soft);
  font-size: 9px;
  letter-spacing: 0.17em;
}

body.site-document-page .methodology-brand .brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgb(238 233 223 / 0.78);
}

body.site-document-page .methodology-brand .brand-link::before {
  display: inline-grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid rgb(247 147 26 / 0.48);
  border-radius: 50%;
  color: var(--site-bitcoin);
  background: rgb(247 147 26 / 0.055);
  box-shadow: 0 0 18px rgb(247 147 26 / 0.1);
  content: '₿';
  font-family: system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

body.site-document-page .methodology h1 {
  max-width: 17ch;
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--site-paper);
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 500;
  letter-spacing: -0.052em;
  line-height: 1.02;
}

body.site-document-page .methodology-meta {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--site-hairline-soft);
  color: var(--site-faint);
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.07em;
  line-height: 1.65;
  padding-bottom: 22px;
  text-transform: uppercase;
}

body.site-document-page .methodology-meta em { font-style: normal; }

body.site-document-page .methodology h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 48px;
  color: var(--site-gold-soft);
  font-size: 11px;
  letter-spacing: 0.16em;
}

body.site-document-page .methodology h2::before {
  width: 18px;
  height: 1px;
  flex: 0 0 18px;
  background: linear-gradient(90deg, var(--site-gold), transparent);
  content: '';
}

body.site-document-page .methodology :is(p, li) {
  color: rgb(226 222 213 / 0.78);
}

body.site-document-page .methodology > p:first-of-type {
  color: rgb(238 233 223 / 0.9);
  font-size: 18px;
}

body.site-document-page .methodology code {
  color: #dfc27e;
}

body.site-document-page .methodology pre,
body.site-document-page .method-table {
  border: 1px solid var(--site-hairline-soft);
  border-radius: 14px;
  background: rgb(7 9 18 / 0.54);
  box-shadow: inset 0 1px rgb(255 255 255 / 0.02);
}

body.site-document-page .method-table {
  margin-top: 18px;
  margin-bottom: 30px;
}

body.site-document-page .methodology :is(th, td) {
  border-color: var(--site-hairline-soft);
}

body.site-document-page .methodology th {
  color: var(--site-gold-soft);
}

body.site-document-page .foot {
  max-width: 82ch;
  margin-right: auto;
  margin-left: auto;
  padding-top: 25px;
  border-top: 1px solid var(--site-hairline-soft);
  color: var(--site-faint);
}

body.site-document-page .foot a:hover { color: var(--site-gold); }

/* The arrival hero is already canonical; only its secondary application
 * states inherit the same glass treatment after a trace or account action. */
body.home-atlas :is(
  .panel,
  .save-confirmation,
  .private-saves,
  .publication-dialog-shell
) {
  border-color: var(--site-hairline);
  background-color: var(--site-glass);
  box-shadow: 0 20px 64px rgb(0 0 0 / 0.26), inset 0 1px rgb(255 255 255 / 0.025);
  backdrop-filter: blur(18px) saturate(112%);
}

/* Community and public profiles -------------------------------------------- */

:where(body.community-page, body.public-profile-page) .community-nav {
  min-height: 66px;
  border-bottom: 1px solid var(--site-hairline-soft);
}

:where(body.community-page, body.public-profile-page) .community-nav a {
  color: var(--site-muted);
}

:where(body.community-page, body.public-profile-page) .community-nav .community-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgb(238 233 223 / 0.82);
}

:where(body.community-page, body.public-profile-page) .community-brand::before {
  width: 7px;
  height: 7px;
  border: 1px solid var(--site-gold);
  border-radius: 50%;
  background: rgb(225 185 105 / 0.18);
  box-shadow: 0 0 15px rgb(225 185 105 / 0.62);
  content: '';
}

:where(body.community-page, body.public-profile-page) .community-nav > a:last-child {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border: 1px solid var(--site-hairline);
  border-radius: 14px;
  background: var(--site-glass);
  padding-right: 14px;
  padding-left: 14px;
  backdrop-filter: blur(16px) saturate(110%);
}

body.community-page .community-hero {
  padding-top: clamp(64px, 8vw, 92px);
}

body.community-page .community-hero .eyebrow,
body.community-page .community-join .eyebrow,
body.public-profile-page :is(.public-profile-heading, .public-profile-cta) .eyebrow {
  color: var(--site-gold-soft);
}

body.community-page .community-hero h1 {
  color: var(--site-paper);
  font-weight: 500;
}

body.community-page .community-hero h1 em {
  color: #e5c77f;
  font-weight: 300;
}

body.community-page .community-lede { color: var(--site-muted); }

body.community-page .community-orbit span {
  border-color: rgb(105 153 176 / 0.25);
}

body.community-page .community-orbit span:nth-child(1) {
  border-color: rgb(225 185 105 / 0.48);
}

body.community-page .community-orbit span:nth-child(3) {
  border-color: rgb(232 225 208 / 0.16);
}

body.community-page .community-orbit i {
  border: 1px solid #e8c779;
  color: #17130a;
  background: linear-gradient(180deg, #ebcc83, #d9ae5c);
  box-shadow: 0 0 54px rgb(225 185 105 / 0.24);
}

:where(body.community-page, body.public-profile-page) :is(
  .community-proof-note,
  .community-join,
  .community-board,
  .public-profile-card,
  .public-profile-cta,
  .public-profile-error
) {
  border-color: var(--site-hairline);
  background:
    radial-gradient(circle at 12% 0%, rgb(72 78 110 / 0.17), transparent 48%),
    linear-gradient(145deg, rgb(14 16 25 / 0.9), rgb(9 11 19 / 0.84));
  box-shadow: 0 24px 72px rgb(0 0 0 / 0.27), inset 0 1px rgb(255 255 255 / 0.025);
  backdrop-filter: blur(18px) saturate(108%);
}

:where(body.community-page, body.public-profile-page) .community-proof-note {
  border-color: rgb(95 214 165 / 0.3);
}

:where(body.community-page, body.public-profile-page) .community-proof-mark {
  border-color: rgb(95 214 165 / 0.55);
  color: var(--mint);
}

body.community-page .community-table :is(th, td),
body.public-profile-page .public-profile-facts,
body.public-profile-page .public-profile-facts > div {
  border-color: var(--site-hairline-soft);
}

body.community-page .community-rank span {
  border-color: rgb(225 185 105 / 0.56);
  color: var(--site-gold);
}

body.community-page .community-table tr.is-targeted {
  outline-color: rgb(105 153 176 / 0.58);
  background: rgb(105 153 176 / 0.06);
}

body.community-page .community-profile a:hover,
body.community-page .community-empty > span,
body.community-page .community-empty a,
body.public-profile-page :is(.public-profile-board-link, .public-profile-error > span) {
  color: var(--site-gold);
}

body.public-profile-page .public-profile-card-top > strong {
  color: var(--site-gold);
  font-family: Iowan Old Style, Baskerville, Georgia, serif;
  font-weight: 400;
  text-shadow: 0 0 28px rgb(220 171 75 / 0.14);
}

body.public-profile-page .public-profile-facts code { color: #dfc27e; }

:where(body.community-page, body.public-profile-page) .community-foot {
  padding-top: 25px;
  border-top: 1px solid var(--site-hairline-soft);
}

:where(body.community-page, body.public-profile-page) .foot a:hover {
  color: var(--site-gold);
}

/* Address dossiers ---------------------------------------------------------- */

body.wallet-page {
  color: var(--site-paper);
}

body.wallet-page .wallet-story {
  --wallet-space: var(--site-space);
  --wallet-paper: var(--site-paper);
  --wallet-muted-warm: var(--site-muted);
  --wallet-hairline: var(--site-hairline);
  --wallet-gold: var(--site-gold);
  --wallet-gold-soft: var(--site-gold-soft);
  --wallet-bitcoin: var(--site-bitcoin);
  --wallet-route-blue: rgb(105 153 176 / 0.82);
}

body.wallet-page :is(
  .wallet-record-card,
  .wallet-related-card,
  .wallet-caveats,
  .wallet-address-set,
  .wallet-source-ledger
) {
  border-color: var(--site-hairline-soft);
  background-color: rgb(12 14 22 / 0.7);
  box-shadow: inset 0 1px rgb(255 255 255 / 0.018);
}

body.wallet-page .wallet-related-card:hover {
  border-color: rgb(225 185 105 / 0.38);
}

body.wallet-page .wallet-section-head .eyebrow,
body.wallet-page .wallet-facts-section .fact-l,
body.wallet-page .wallet-record-list dt,
body.wallet-page .wallet-source-heading > span {
  color: var(--site-gold-soft);
}

body.wallet-page .foot {
  padding-top: 25px;
  border-top: 1px solid var(--site-hairline-soft);
}

body.wallet-page .foot a:hover { color: var(--site-gold); }

/* History publication and research dossiers -------------------------------- */

body.history-page {
  --history-bg: var(--site-space);
  --history-surface: var(--site-surface);
  --history-rule: var(--site-hairline-soft);
  --history-rule-bright: var(--site-hairline);
  --history-text: var(--site-paper);
  --history-muted: var(--site-muted);
  --history-faint: var(--site-faint);
  --history-amber: var(--site-bitcoin);
  --history-atlas-gold: var(--site-gold);
  --history-atlas-gold-soft: var(--site-gold-soft);
  --history-atlas-blue: var(--site-route-blue);
}

body.history-page .history-topbar {
  min-height: 66px;
  border-color: var(--site-hairline-soft);
  background: rgb(7 9 18 / 0.84);
  box-shadow: 0 14px 42px rgb(0 0 0 / 0.15);
  backdrop-filter: blur(18px) saturate(110%);
}

body.history-page .history-brand::before {
  display: inline-grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid rgb(247 147 26 / 0.48);
  border-radius: 50%;
  background: rgb(247 147 26 / 0.055);
  box-shadow: 0 0 18px rgb(247 147 26 / 0.1);
  font-size: 12px;
}

body.history-page .history-footer {
  border-top-color: var(--site-hairline-soft);
  background: rgb(7 9 18 / 0.72);
}

body.research-page {
  --research-bg: var(--site-space);
  --research-surface: var(--site-surface);
  --research-ink: var(--site-paper);
  --research-muted: var(--site-muted);
  --research-faint: var(--site-faint);
  --research-rule: var(--site-hairline-soft);
  --research-rule-strong: var(--site-hairline);
  --research-amber: var(--site-gold);
  --research-cyan: #79b7b1;
}

body.research-page .research-topbar {
  min-height: 66px;
  border-color: var(--site-hairline-soft);
  background: rgb(7 9 18 / 0.84);
  box-shadow: 0 14px 42px rgb(0 0 0 / 0.15);
  backdrop-filter: blur(18px) saturate(110%);
}

body.research-page .research-brand::before {
  display: inline-grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid rgb(247 147 26 / 0.48);
  border-radius: 50%;
  background: rgb(247 147 26 / 0.055);
  box-shadow: 0 0 18px rgb(247 147 26 / 0.1);
  color: var(--site-bitcoin);
  font-size: 12px;
}

body.research-page :is(
  .verified-record,
  .evidence-artifact,
  .claim-register,
  .research-caveats,
  .research-sources,
  .citation-box,
  .editorial-note,
  .catalog-table,
  .data-dictionary,
  .source-policy,
  .download-ledger
) {
  border-color: var(--site-hairline-soft);
}

body.research-page .research-footer {
  border-top-color: var(--site-hairline-soft);
  background: rgb(7 9 18 / 0.72);
}

@media (max-width: 700px) {
  :where(
    body.wallet-page,
    body.community-page,
    body.public-profile-page,
    body.site-document-page,
    body.research-page
  ) {
    background-attachment: scroll;
    background-size: auto, auto, auto, 150% auto;
  }

  body.site-document-page .wrap {
    padding-top: 14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  body.site-document-page .methodology {
    border-radius: 18px;
    padding: 24px 19px 30px;
  }

  body.site-document-page .methodology h1 {
    font-size: clamp(34px, 11vw, 46px);
  }

  :where(body.community-page, body.public-profile-page) .community-nav > a:last-child {
    min-height: 40px;
    padding-right: 11px;
    padding-left: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(
    body.home-atlas,
    body.wallet-page,
    body.community-page,
    body.public-profile-page,
    body.site-document-page
  ) :is(button.primary, .button-link.primary) {
    transition: none;
  }
}

@media (forced-colors: active) {
  :where(
    body.wallet-page,
    body.community-page,
    body.public-profile-page,
    body.site-document-page,
    body.history-page,
    body.research-page
  ) :is(.methodology, .community-board, .public-profile-card, .wallet-record-card) {
    border-color: CanvasText;
    background: Canvas;
    box-shadow: none;
  }
}

}
