/* DRYCE — public static canvas. Tokens mirror packages/web/src/dryce-atmosphere.css :root (UI_DIRECTIVE §2.1). */

@font-face {
  font-family: "CashMarket-BoldRounded";
  src: url("/fonts/CashMarket-BoldRounded.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Wordmark SVG — web/dryce-logo.svg (aperture + core strokes) */
  --dryce-mark-aperture: #f4b528;
  --dryce-mark-core: #298d66;
  --dryce-chamber: #1b1b2f;
  --dryce-recess: #0d0d14;
  --dryce-joint: #2a2a3d;
  --dryce-surface: #141420;
  --color-signal: #f6c667;
  --color-signal-dim: #c9a855;
  --color-text: #faf9f6;
  --color-muted: #8888a0;
  --color-spectral: #4a6fa5;
  --color-success: #7db980;

  /* Legacy aliases — existing static HTML + guides */
  --canvas: var(--dryce-recess);
  --saffron: var(--color-signal);
  --viridian: var(--color-success);
  --cobalt: var(--color-spectral);
  --text: var(--color-text);
  --text-dim: var(--color-muted);
  --muted: var(--color-muted);
  --dryce-leading-body: 1.6;
  --dryce-tracking-body: -0.01em;
  --dryce-leading-readable: 1.65;
  --dryce-measure: 40rem;
  --dryce-pad-inline: 1.5rem;
  --dryce-pad-block-start: 3rem;
  --dryce-pad-block-end: 5rem;
  --dryce-dim-inset-top: inset 0 1px 0
    color-mix(in srgb, var(--color-text) 9%, transparent);
  --dryce-dim-edge: 0 0 0 1px
    color-mix(in srgb, var(--dryce-joint) 55%, transparent);
  --dryce-dim-chassis: 0 10px 36px
    color-mix(in srgb, var(--dryce-recess) 52%, transparent);
  --dryce-dim-type-face:
    0 1px 0 color-mix(in srgb, var(--color-text) 10%, transparent),
    0 2px 14px color-mix(in srgb, var(--dryce-recess) 55%, transparent);
  --dryce-dim-type-gold:
    0 1px 0 color-mix(in srgb, var(--color-signal) 32%, transparent),
    0 2px 12px color-mix(in srgb, var(--dryce-recess) 50%, transparent);
}

@media (prefers-contrast: more) {
  :root {
    --color-text: #ffffff;
    --color-muted: #c4c4d4;
    --text-dim: var(--color-muted);
    --muted: var(--color-muted);
    --dryce-dim-type-face: none;
    --dryce-dim-type-gold: none;
  }
}

* {
  box-sizing: border-box;
}

/* Visually hidden; exposed to screen readers / focus APIs */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — static apex + legal pages (hub/guide use higher-specificity rules) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus,
.skip-link:focus-visible {
  position: fixed;
  left: max(1rem, env(safe-area-inset-left));
  top: max(1rem, env(safe-area-inset-top));
  z-index: 10000;
  width: auto;
  height: auto;
  clip: auto;
  overflow: visible;
  padding: 0.75rem 1.25rem;
  margin: 0;
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--dryce-surface) 55%, var(--dryce-chamber)) 0%,
    color-mix(in srgb, var(--dryce-chamber) 40%, transparent) 100%
  );
  color: var(--text);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 2px solid
    color-mix(in srgb, var(--color-signal) 55%, var(--dryce-joint));
  border-radius: 6px;
  box-shadow:
    var(--dryce-dim-inset-top),
    0 8px 28px color-mix(in srgb, var(--dryce-recess) 45%, transparent);
}

body:not(.rg-guide):not(.rg-hub) main#main-content {
  scroll-margin-top: 1rem;
}

body:not(.rg-guide) footer[role='contentinfo'] {
  max-width: var(--dryce-measure);
  margin: 0 auto;
  padding: 0 var(--dryce-pad-inline) var(--dryce-pad-block-end);
}

body:not(.rg-guide) footer[role='contentinfo'] a {
  border-bottom-color: color-mix(in srgb, var(--color-signal) 28%, transparent);
}

html {
  min-height: 100%;
  background-color: var(--dryce-recess);
  /* Discrete Nave-class washes — toned subset of `.dryce-atmosphere` (density ~1) */
  background-image:
    radial-gradient(
      ellipse 128% 88% at 50% -10%,
      rgba(246, 198, 103, 0.085) 0%,
      transparent 56%
    ),
    radial-gradient(
      ellipse 72% 58% at 76% 38%,
      rgba(201, 168, 85, 0.052) 0%,
      transparent 54%
    ),
    radial-gradient(
      circle at 22% 44%,
      rgba(250, 249, 246, 0.038) 0%,
      transparent 44%
    ),
    radial-gradient(
      ellipse 110% 52% at 50% 108%,
      rgba(13, 13, 20, 0.42) 0%,
      transparent 45%
    ),
    radial-gradient(
      ellipse 95% 38% at 50% 102%,
      rgba(74, 111, 165, 0.065) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 70% 45% at 90% 8%,
      rgba(196, 178, 224, 0.045) 0%,
      transparent 55%
    ),
    radial-gradient(
      circle at 8% 85%,
      rgba(110, 196, 196, 0.04) 0%,
      transparent 42%
    );
  background-attachment: fixed;
}

@media (prefers-reduced-motion: reduce) {
  html {
    background-attachment: scroll;
  }
}

body {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family:
    "CashMarket-BoldRounded",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 16px;
  line-height: var(--dryce-leading-body, 1.6);
  letter-spacing: var(--dryce-tracking-body, -0.01em);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Pulls page column into chamber — whisper rim only (full-document <main>, not guide article landmarks) */
body:not(.rg-guide) main {
  position: relative;
  isolation: isolate;
  max-width: var(--dryce-measure);
  margin: 0 auto;
  padding: var(--dryce-pad-block-start) var(--dryce-pad-inline)
    var(--dryce-pad-block-end);
  border-radius: 4px;
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--dryce-chamber) 26%, transparent) 0%,
    transparent 58%
  );
  box-shadow:
    var(--dryce-dim-inset-top),
    0 0 0 1px color-mix(in srgb, var(--dryce-joint) 42%, transparent),
    var(--dryce-dim-chassis);
}

body.rg-guide main#main-content {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  scroll-margin-top: 1rem;
}

h1 {
  font-size: clamp(1.625rem, 4vw, 1.75rem);
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
  text-shadow: var(--dryce-dim-type-face);
}

h2 {
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  line-height: 1.35;
  text-transform: none;
  color: var(--saffron);
  margin: 2rem 0 0.75rem;
  text-wrap: balance;
  text-shadow: var(--dryce-dim-type-gold);
}

p {
  margin: 0 0 1rem;
}

h3 {
  font-size: 1rem;
  line-height: 1.35;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
  text-shadow: var(--dryce-dim-type-face);
}

p,
li {
  color: var(--text);
}

p.lede {
  color: var(--saffron);
  font-style: italic;
  font-size: 1.125rem;
  line-height: var(--dryce-leading-readable, 1.65);
  margin: 0 0 1.5rem;
  text-wrap: pretty;
}

p.footnote {
  margin-top: 3rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-dim);
}

a {
  color: var(--saffron);
  text-decoration: none;
  border-bottom: 1px solid
    color-mix(in srgb, var(--color-signal) 35%, transparent);
}

a:hover {
  border-bottom-color: var(--saffron);
}

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

@media (forced-colors: active) {
  a:focus-visible {
    outline-color: CanvasText;
  }
}

/** Main column links — same rim language as the app (excludes resource-guide gold CTA pages). */
body:not(.rg-guide) main a {
  border-bottom: 1px solid
    color-mix(in srgb, var(--color-signal) 42%, transparent);
  padding: 0.1em 0.32em 0.12em;
  border-radius: 4px;
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--dryce-surface) 52%, transparent) 0%,
    color-mix(in srgb, var(--dryce-chamber) 38%, transparent) 48%,
    color-mix(in srgb, var(--dryce-recess) 35%, transparent) 100%
  );
  box-shadow:
    var(--dryce-dim-inset-top),
    0 1px 0 color-mix(in srgb, var(--color-text) 5%, transparent),
    var(--dryce-dim-chassis);
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

body:not(.rg-guide) main a:hover {
  color: var(--text);
  border-bottom-color: color-mix(in srgb, var(--color-signal) 65%, transparent);
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--dryce-surface) 62%, transparent) 0%,
    color-mix(in srgb, var(--dryce-chamber) 48%, transparent) 100%
  );
  box-shadow:
    var(--dryce-dim-inset-top),
    0 2px 12px color-mix(in srgb, var(--dryce-recess) 48%, transparent);
}

.dryce-site-brand a {
  background: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border-bottom: none !important;
}

.dryce-site-brand a:hover {
  border-bottom: none !important;
}

nav {
  margin: 1.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}

ul {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.5rem;
}

hr {
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--dryce-joint) 72%, transparent);
  margin: 2.5rem 0;
}

code {
  background: color-mix(in srgb, var(--dryce-surface) 85%, transparent);
  padding: 0.125rem 0.35rem;
  border-radius: 3px;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.diamond {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--saffron);
  transform: rotate(45deg);
  margin-right: 6px;
}

.updated {
  color: var(--text-dim);
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* Platform brand — Resources & shared static pages */
.dryce-site-brand {
  margin: 0 0 2rem;
}

.dryce-site-brand a {
  display: inline-block;
  border-bottom: none;
}

.dryce-site-brand a:hover {
  opacity: 0.88;
}

.dryce-site-brand img {
  display: block;
  height: 34px;
  width: auto;
}

.dryce-copyright-block {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid color-mix(in srgb, var(--dryce-joint) 72%, transparent);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.dryce-copyright-block strong {
  color: var(--text);
  font-weight: 600;
}
