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

html {
  min-width: 320px;
  background: var(--atlas-bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--atlas-bg);
  color: var(--atlas-text);
  font: 400 var(--atlas-type-supporting)/1.65 var(--atlas-font-body);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--atlas-z-base);
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.026) 1px, transparent 1px);
  background-size: 80px 80px;
}

a { color: inherit; }
button, input { font: inherit; }

.cv-global-header {
  background: color-mix(in srgb, var(--atlas-bg) 94%, transparent);
}

.cv-brand-cluster { min-width: 0; }

.cv-wordmark {
  min-height: var(--atlas-touch-min);
  display: inline-flex;
  align-items: center;
  color: var(--atlas-text);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-decoration: none;
  white-space: nowrap;
}

.cv-wordmark span { color: var(--atlas-accent); }

.estate-status {
  min-height: var(--atlas-touch-min);
  color: var(--atlas-text-dim);
  text-decoration: none;
}

.estate-status:hover,
.estate-status:focus-visible {
  border-color: var(--atlas-border-hi);
  color: var(--atlas-text);
}

.estate-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--atlas-unknown);
}

.estate-status[data-state="operational"] .estate-status-dot {
  background: var(--atlas-operational);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--atlas-operational) 14%, transparent);
}

.estate-status[data-state="degraded"] .estate-status-dot,
.estate-status[data-state="checking"] .estate-status-dot {
  background: var(--atlas-degraded);
  box-shadow: 0 0 0 3px var(--atlas-accent-dim);
}

.estate-status[data-state="unavailable"] .estate-status-dot {
  background: var(--atlas-unavailable);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--atlas-unavailable) 14%, transparent);
}

.cv-search-trigger {
  min-height: var(--atlas-touch-min);
  display: inline-flex;
  align-items: center;
  gap: var(--atlas-space-2);
  border: 1px solid var(--atlas-border);
  border-radius: var(--atlas-radius-sm);
  padding: 0 var(--atlas-space-3);
  background: transparent;
  color: var(--atlas-text-dim);
  cursor: pointer;
  font-size: var(--atlas-type-meta);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cv-search-trigger:hover,
.cv-search-trigger:focus-visible {
  border-color: var(--atlas-border-hi);
  color: var(--atlas-text);
}

.cv-search-trigger svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.cv-search-trigger kbd {
  color: var(--atlas-text-faint);
  font: inherit;
  font-size: var(--atlas-type-tiny);
}

.cv-product-strip {
  position: relative;
  z-index: 1;
  min-height: 50px;
  border-bottom: 0;
}

.cv-product-identity {
  display: flex;
  align-items: center;
  gap: var(--atlas-space-3);
}

.cv-product-identity > strong {
  color: var(--atlas-text);
  font-size: var(--atlas-type-supporting);
  font-weight: 500;
  letter-spacing: .1em;
}

.cv-document-state {
  display: inline-flex;
  align-items: center;
  gap: var(--atlas-space-2);
  color: var(--atlas-text-faint);
  font-size: var(--atlas-type-meta);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.cv-document-state > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--atlas-accent);
  box-shadow: 0 0 0 3px var(--atlas-accent-dim);
}

.cv-document-state[data-state="active"] > span {
  background: var(--atlas-operational);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--atlas-operational) 14%, transparent);
}

.cv-shell {
  position: relative;
  z-index: 1;
  width: min(var(--atlas-content), calc(100% - 48px));
  min-height: calc(100vh - 106px);
  margin: 0 auto;
  padding: var(--atlas-space-7) 0 var(--atlas-space-8);
}

.document-gate {
  scroll-margin-top: calc(56px + var(--atlas-space-3));
  min-height: min(680px, calc(100vh - 154px));
  padding: clamp(var(--atlas-space-5), 4vw, var(--atlas-space-7));
  overflow: hidden;
  background:
    radial-gradient(70% 120% at 90% 44%, var(--atlas-accent-dim), transparent 64%),
    linear-gradient(145deg, color-mix(in srgb, var(--atlas-bg-2) 72%, transparent), var(--atlas-bg-1));
}

.gate-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
  align-items: center;
  gap: clamp(var(--atlas-space-6), 6vw, var(--atlas-space-9));
}

.gate-introduction { min-width: 0; }

.terminal-line {
  margin: 0 0 var(--atlas-space-6);
  color: var(--atlas-text-faint);
  font-size: var(--atlas-type-meta);
  overflow-wrap: anywhere;
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -.15em;
  background: var(--atlas-accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--atlas-accent) 48%, transparent);
  animation: cv-caret-blink 1.05s steps(2, start) infinite;
}

.gate-role {
  max-width: 720px;
  margin: var(--atlas-space-4) 0 0;
  color: var(--atlas-text);
  font-size: var(--atlas-type-supporting);
  letter-spacing: .06em;
  line-height: 1.7;
  text-transform: uppercase;
}

.gate-copy {
  margin-top: var(--atlas-space-5);
  font-size: var(--atlas-type-body);
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--atlas-space-3);
  margin-top: var(--atlas-space-6);
}

.gate-actions .atlas-button,
.viewer-actions .atlas-button {
  min-height: var(--atlas-touch-min);
}

.gate-actions svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.document-dossier {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--atlas-accent) 32%, var(--atlas-border));
  border-radius: var(--atlas-radius-lg);
  padding: var(--atlas-space-5);
  background: color-mix(in srgb, var(--atlas-bg) 82%, transparent);
  box-shadow: inset 0 0 52px rgba(0,0,0,.38);
}

.document-sheet {
  position: relative;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--atlas-border-hi);
  border-radius: var(--atlas-radius-sm);
  padding: var(--atlas-space-5);
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    var(--atlas-bg-1);
  background-size: 32px 32px;
}

.document-sheet::before {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 58px;
  height: 58px;
  border-bottom: 1px solid var(--atlas-border-hi);
  border-left: 1px solid var(--atlas-border-hi);
  background: linear-gradient(135deg, var(--atlas-bg-1) 49%, var(--atlas-bg-2) 50%);
}

.document-sheet-index {
  color: var(--atlas-text-faint);
  font-size: var(--atlas-type-meta);
  letter-spacing: .12em;
}

.document-sheet strong {
  margin-top: auto;
  color: var(--atlas-accent);
  font: 400 clamp(4rem, 8vw, 6.5rem)/.9 var(--atlas-font-display);
  text-shadow: 0 0 30px var(--atlas-accent-dim);
}

.document-sheet-rule {
  width: 100%;
  height: 1px;
  margin: var(--atlas-space-5) 0 var(--atlas-space-4);
  background: var(--atlas-border-hi);
}

.document-sheet-line {
  width: 70%;
  height: 6px;
  margin-top: var(--atlas-space-2);
  background: var(--atlas-border-hi);
}

.document-sheet-line--long { width: 88%; }
.document-sheet-line--short { width: 48%; }

.document-sheet-mark {
  margin-top: auto;
  color: var(--atlas-text-faint);
  font-size: var(--atlas-type-meta);
  letter-spacing: .12em;
}

.document-dossier-copy {
  display: grid;
  gap: var(--atlas-space-2);
  margin-top: var(--atlas-space-4);
}

.document-dossier-copy p {
  margin: 0;
  color: var(--atlas-accent);
  font-size: var(--atlas-type-meta);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.document-dossier-copy strong {
  color: var(--atlas-text);
  font-size: var(--atlas-type-supporting);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.document-dossier-copy > span {
  color: var(--atlas-text-dim);
  font-size: var(--atlas-type-meta);
  line-height: 1.6;
}

.document-meta {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: var(--atlas-space-7) 0 0;
  border: 1px solid var(--atlas-border);
  border-radius: var(--atlas-radius-sm);
  overflow: hidden;
}

.document-meta div {
  min-width: 0;
  padding: var(--atlas-card-compact);
  border-right: 1px solid var(--atlas-border);
  background: color-mix(in srgb, var(--atlas-bg-2) 70%, transparent);
}

.document-meta div:last-child { border-right: 0; }

.document-meta dt {
  color: var(--atlas-text-faint);
  font-size: var(--atlas-type-meta);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.document-meta dd {
  margin: var(--atlas-space-2) 0 0;
  color: var(--atlas-text-dim);
  font-size: var(--atlas-type-supporting);
  overflow-wrap: anywhere;
}

.noscript-note {
  margin: var(--atlas-space-4) 0 0;
  color: var(--atlas-text-dim);
}

.noscript-note a { color: var(--atlas-accent); }

.viewer {
  scroll-margin-top: calc(56px + var(--atlas-space-3));
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: var(--atlas-bg-1);
  box-shadow: var(--atlas-shadow-floating);
  animation: cv-viewer-reveal var(--atlas-motion-reveal) var(--atlas-easing-standard) both;
}

.viewer[hidden] { display: none; }

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--atlas-space-5);
  padding: var(--atlas-space-5);
  border-bottom: 1px solid var(--atlas-border);
  background: var(--atlas-bg-1);
}

.viewer-bar .atlas-page-intro__eyebrow {
  margin-bottom: var(--atlas-space-2);
}

.viewer-bar h2 {
  max-width: 760px;
  margin: 0;
  color: var(--atlas-text);
  font: 400 clamp(1.45rem, 3vw, 2.25rem)/1.05 var(--atlas-font-display);
  overflow-wrap: anywhere;
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--atlas-space-2);
}

.viewer-frame {
  min-height: 70vh;
  background: var(--atlas-bg-2);
}

.viewer-frame object {
  display: block;
  width: 100%;
  height: calc(100vh - 230px);
  min-height: 620px;
  border: 0;
}

.viewer-fallback {
  min-height: 420px;
  display: grid;
  place-items: center;
  gap: var(--atlas-space-4);
  padding: var(--atlas-space-6);
  text-align: center;
}

.viewer-fallback p { color: var(--atlas-text-dim); }

.cv-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--atlas-space-4);
}

.cv-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: var(--atlas-space-5);
}

.cv-footer a {
  min-width: var(--atlas-touch-min);
  min-height: var(--atlas-touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: var(--atlas-space-2);
  color: var(--atlas-text-dim);
  text-decoration: none;
}

.cv-footer a:hover,
.cv-footer a:focus-visible { color: var(--atlas-accent); }

.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;
}

.atlas-search-root {
  position: fixed;
  inset: 0;
  z-index: var(--atlas-z-dialog);
  display: grid;
  place-items: start center;
  padding: min(12vh, 7rem) var(--atlas-space-4) var(--atlas-space-4);
}

.atlas-search-root[hidden] { display: none; }

.atlas-search-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(4,4,8,.82);
  backdrop-filter: blur(8px);
  cursor: default;
}

.atlas-search-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(720px, 78vh);
  overflow: auto;
  border: 1px solid var(--atlas-border-hi);
  border-radius: var(--atlas-radius-lg);
  padding: var(--atlas-space-5);
  background: var(--atlas-bg-1);
  box-shadow: var(--atlas-shadow-floating);
}

.atlas-search-heading {
  margin: 0 0 var(--atlas-space-3);
  color: var(--atlas-accent);
  font-size: var(--atlas-type-meta);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.atlas-search-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--atlas-border-hi);
  border-radius: var(--atlas-radius-sm);
  padding: var(--atlas-space-3) var(--atlas-space-4);
  background: var(--atlas-bg-2);
  color: var(--atlas-text);
}

.atlas-search-status {
  min-height: 1.5rem;
  margin: var(--atlas-space-3) 0;
  color: var(--atlas-text-dim);
  font-size: var(--atlas-type-meta);
}

.atlas-search-results {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--atlas-border);
}

.atlas-search-result { background: var(--atlas-bg); }

.atlas-search-result-main {
  display: grid;
  gap: var(--atlas-space-2);
  min-height: var(--atlas-touch-min);
  padding: var(--atlas-space-4);
  color: var(--atlas-text-dim);
  text-decoration: none;
}

.atlas-search-result-main:hover,
.atlas-search-result-main:focus-visible {
  background: var(--atlas-bg-2);
  color: var(--atlas-text);
}

.atlas-search-result-main strong {
  color: var(--atlas-text);
  font-size: var(--atlas-type-supporting);
  overflow-wrap: anywhere;
}

.atlas-search-result-main span {
  font-size: var(--atlas-type-supporting);
  line-height: 1.65;
}

.atlas-search-close {
  min-height: var(--atlas-touch-min);
  margin-top: var(--atlas-space-4);
}

body.atlas-search-open { overflow: hidden; }

@keyframes cv-caret-blink { 50% { opacity: 0; } }

@keyframes cv-viewer-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1023px) {
  .gate-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, .72fr);
    gap: var(--atlas-space-6);
  }

  .document-sheet { min-height: 280px; }
}

@media (max-width: 900px) {
  .gate-layout { grid-template-columns: minmax(0, 1fr); }
  .document-dossier {
    display: grid;
    grid-template-columns: minmax(180px, .7fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--atlas-space-5);
  }
  .document-sheet { min-height: 230px; }
  .document-dossier-copy { margin-top: 0; }
}

@media (max-width: 767px) {
  .cv-global-header .atlas-global-header__actions { display: flex; }
  .cv-search-trigger {
    min-width: var(--atlas-touch-min);
    justify-content: center;
    padding-inline: var(--atlas-space-2);
  }
  .cv-search-trigger span,
  .cv-search-trigger kbd { display: none; }
  .cv-product-strip { padding-inline: var(--atlas-space-4); }
  .cv-shell {
    width: min(100% - 24px, var(--atlas-content));
    padding: var(--atlas-space-5) 0 var(--atlas-space-7);
  }
  .document-gate {
    min-height: 0;
    padding: var(--atlas-card-standard);
  }
  .document-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-meta div:nth-child(2) { border-right: 0; }
  .document-meta div:nth-child(-n+2) { border-bottom: 1px solid var(--atlas-border); }
  .viewer-bar {
    align-items: flex-start;
    flex-direction: column;
  }
  .viewer-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .viewer-frame object {
    height: calc(100vh - 250px);
    min-height: 520px;
  }
  .cv-footer { margin-top: var(--atlas-space-7); }
}

@media (max-width: 520px) {
  .cv-document-state {
    width: var(--atlas-touch-min);
    justify-content: center;
    font-size: 0;
  }
  .document-dossier {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--atlas-space-4);
  }
  .document-sheet { min-height: 250px; }
  .document-meta { grid-template-columns: minmax(0, 1fr); }
  .document-meta div {
    border-right: 0;
    border-bottom: 1px solid var(--atlas-border);
  }
  .document-meta div:last-child { border-bottom: 0; }
  .gate-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .gate-actions .atlas-button { width: 100%; }
}

@media (max-width: 420px) {
  .estate-status-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .estate-status {
    width: var(--atlas-touch-min);
    min-height: var(--atlas-touch-min);
    justify-content: center;
    padding: 0;
  }
  .cv-shell { width: min(100% - 16px, var(--atlas-content)); }
  .document-gate { padding: var(--atlas-card-compact); }
  .gate-role { font-size: var(--atlas-type-meta); }
  .gate-copy { font-size: var(--atlas-type-supporting); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; opacity: .72; }
  .viewer { animation: none; }
}
