/* Atlas Research Guides v2: one interactive path through Start, Run, Outputs and Today. */

body[data-atlas-research-guide] {
  --guide-cyan: var(--docs-v3-cyan, #42d9e8);
  --guide-green: var(--docs-v3-green, #26d39a);
  --guide-gold: var(--docs-v3-gold, #f0c75e);
  --guide-line: var(--docs-v3-line, rgba(97, 220, 235, .24));
  --guide-panel: var(--docs-v3-panel, #071b2a);
  --guide-panel-strong: var(--docs-v3-panel-strong, #0a2435);
  --guide-text: var(--docs-v3-text, #f3fbff);
  --guide-muted: var(--docs-v3-muted, #9db5c5);
}

body[data-atlas-research-guide] .docs-hero {
  grid-template-areas:
    "copy console"
    "facts facts";
  grid-template-columns: minmax(0, 1.02fr) minmax(430px, .98fr) !important;
  align-items: stretch !important;
}

.atlas-guide-copy {
  grid-area: copy;
  min-width: 0;
  align-self: center;
}

.atlas-guide-console {
  --guide-progress: .25;
  grid-area: console;
  position: relative;
  min-width: 0;
  min-height: 456px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--guide-line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(66, 217, 232, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 217, 232, .045) 1px, transparent 1px),
    linear-gradient(145deg, color-mix(in srgb, var(--guide-cyan) 8%, transparent), transparent 58%),
    var(--guide-panel);
  background-size: 24px 24px, 24px 24px, auto, auto;
  box-shadow: 0 28px 72px rgba(0, 0, 0, .22);
  isolation: isolate;
}

.atlas-guide-console::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  z-index: 2;
  height: 3px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--guide-cyan), var(--guide-green), var(--guide-gold));
  transform: scaleX(var(--guide-progress));
  transform-origin: left;
  transition: transform 280ms cubic-bezier(.16, 1, .3, 1);
}

.atlas-guide-console__head,
.atlas-guide-console__foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.atlas-guide-console__head {
  min-height: 44px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--guide-line);
}

.atlas-guide-console__foot {
  min-height: 44px;
  padding-top: 12px;
  border-top: 1px solid var(--guide-line);
}

.atlas-guide-console__head span,
.atlas-guide-console__head strong,
.atlas-guide-console__foot span,
.atlas-guide-console__foot strong {
  font: 900 .64rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

.atlas-guide-console__head span,
.atlas-guide-console__foot span { color: var(--guide-muted); }
.atlas-guide-console__head strong { color: var(--guide-cyan); text-align: right; }
.atlas-guide-console__foot strong { color: var(--guide-green); text-align: right; }

.atlas-guide-console__body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.atlas-guide-rail {
  position: relative;
  display: grid;
  align-content: center;
  gap: 7px;
}

.atlas-guide-rail::before {
  content: "";
  position: absolute;
  top: 14%;
  bottom: 14%;
  left: 20px;
  width: 1px;
  background: linear-gradient(var(--guide-cyan), var(--guide-green), var(--guide-gold));
}

.atlas-guide-node {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--guide-line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--guide-panel-strong) 93%, transparent);
  color: var(--guide-text);
  text-align: left;
  cursor: pointer;
  transition: transform 100ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.atlas-guide-node::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle 120px at var(--guide-pulse-x, 50%) var(--guide-pulse-y, 50%), color-mix(in srgb, var(--guide-cyan) 24%, transparent), transparent 74%);
  opacity: 0;
  transform: scale(.86);
  transition: opacity 180ms ease, transform 240ms cubic-bezier(.16, 1, .3, 1);
}

.atlas-guide-node[data-guide-pulse="true"]::after { opacity: 1; transform: scale(1); }

.atlas-guide-node > span {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--guide-line);
  border-radius: 50%;
  color: var(--guide-cyan);
  font: 900 .57rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.atlas-guide-node > strong {
  position: relative;
  z-index: 1;
  color: var(--guide-text);
  font: 850 .67rem/1.2 Inter, Arial, sans-serif;
  letter-spacing: 0;
}

.atlas-guide-node:active { transform: scale(.975); }
.atlas-guide-node:focus-visible { outline: 2px solid var(--guide-cyan); outline-offset: 2px; }
.atlas-guide-node[data-guide-active="true"] {
  border-color: var(--guide-cyan);
  background: color-mix(in srgb, var(--guide-cyan) 12%, var(--guide-panel-strong));
  box-shadow: inset 3px 0 var(--guide-cyan);
}
.atlas-guide-node[data-guide-complete="true"] > span { border-color: var(--guide-green); color: var(--guide-green); }

.atlas-guide-focus {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--guide-line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--guide-panel-strong) 91%, transparent);
}

.atlas-guide-focus::before,
.atlas-guide-focus::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 210px;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--guide-cyan) 35%, transparent);
  border-radius: 50%;
  transform: rotateX(62deg) rotateZ(20deg);
}

.atlas-guide-focus::after {
  right: -26px;
  bottom: -104px;
  width: 250px;
  border-color: color-mix(in srgb, var(--guide-gold) 28%, transparent);
  transform: rotateX(68deg) rotateZ(-36deg);
}

.atlas-guide-focus > * { position: relative; z-index: 1; }

.atlas-guide-focus__index {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--guide-line);
  border-radius: 50%;
  color: var(--guide-cyan);
  font: 900 .82rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.atlas-guide-focus__content {
  align-self: center;
  max-width: 520px;
}

.atlas-guide-focus__eyebrow {
  margin: 0;
  color: var(--guide-cyan);
  font: 900 .62rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.atlas-guide-focus h2 {
  margin: 11px 0 8px;
  color: var(--guide-text);
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  line-height: 1;
  letter-spacing: 0;
}

.atlas-guide-focus__copy {
  margin: 0;
  color: var(--guide-muted);
  font-size: .86rem;
  line-height: 1.58;
}

.atlas-guide-focus__result {
  align-self: end;
  margin: 18px 0 0;
  color: var(--guide-green);
  font: 900 .61rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.atlas-guide-chapters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 16px 0 0;
  overflow: hidden;
  border: 1px solid var(--guide-line);
  border-radius: 8px;
  background: var(--guide-line);
}

.atlas-guide-chapters a {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 13px;
  background: var(--guide-panel);
  color: var(--guide-muted);
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}

.atlas-guide-chapters a span,
.atlas-guide-chapters a strong { letter-spacing: 0; }
.atlas-guide-chapters a span { color: var(--guide-cyan); font: 900 .56rem/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.atlas-guide-chapters a strong { font-size: .76rem; }
.atlas-guide-chapters a[aria-current="page"] { background: color-mix(in srgb, var(--guide-cyan) 12%, var(--guide-panel)); color: var(--guide-text); box-shadow: inset 0 -3px var(--guide-cyan); }
.atlas-guide-chapters a:focus-visible { outline: 2px solid var(--guide-cyan); outline-offset: -3px; }

body[data-atlas-research-guide] .hero-strip { grid-area: facts; }

body[data-atlas-research-guide] .docs-brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

body[data-atlas-research-guide] .docs-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

body[data-atlas-research-guide] .docs-section {
  position: relative;
  padding-top: 38px !important;
}

body[data-atlas-research-guide] .docs-section h2::before {
  content: "RESEARCH LOOP";
  display: block;
  margin-bottom: 8px;
  color: var(--guide-cyan);
  font: 900 .61rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
}

body[data-guide-route="outputs"] .docs-section h2::before { content: "ARTIFACT CONTRACT"; }
body[data-guide-route="today"] .docs-section h2::before { content: "DAILY REVIEW"; }

body[data-atlas-research-guide] .doc-card {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  border-color: var(--guide-line) !important;
  border-radius: 8px !important;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--guide-cyan) 8%, transparent), transparent 58%),
    var(--guide-panel) !important;
  box-shadow: none !important;
}

body[data-atlas-research-guide] .doc-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 180px at var(--guide-pulse-x, 50%) var(--guide-pulse-y, 50%), color-mix(in srgb, var(--guide-cyan) 22%, transparent), transparent 72%);
  opacity: 0;
  transform: scale(.84);
  transition: opacity 180ms ease, transform 260ms cubic-bezier(.16, 1, .3, 1);
}

body[data-atlas-research-guide] .doc-card[data-guide-pulse="true"]::after { opacity: 1; transform: scale(1); }
body[data-atlas-research-guide] .doc-card > * { position: relative; z-index: 1; }
body[data-atlas-research-guide] .doc-card span { color: var(--guide-cyan) !important; letter-spacing: 0 !important; }
body[data-atlas-research-guide] .doc-card h3 { color: var(--guide-text) !important; }
body[data-atlas-research-guide] .doc-card p { color: var(--guide-muted) !important; }

body[data-atlas-research-guide] .callout {
  border: 1px solid var(--guide-line);
  border-left: 3px solid var(--guide-gold);
  border-radius: 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--guide-gold) 8%, transparent), transparent 48%), var(--guide-panel);
  color: var(--guide-muted);
}

body[data-atlas-research-guide] .table-wrap {
  border-color: var(--guide-line);
  border-radius: 8px;
  background: var(--guide-panel);
}

@media (max-width: 900px) {
  body[data-atlas-research-guide] .docs-hero {
    grid-template-areas: "copy" "console" "facts";
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 620px) {
  body[data-atlas-research-guide] .docs-hero { gap: 20px; }
  body[data-atlas-research-guide] .docs-hero h1 { font-size: 2.32rem !important; }
  body[data-atlas-research-guide] .lede { font-size: .94rem !important; }
  .atlas-guide-console { min-height: 412px; padding: 13px; }
  .atlas-guide-console__body { grid-template-columns: minmax(0, 1fr); }
  .atlas-guide-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-content: stretch;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--guide-line);
    border-radius: 7px;
    background: var(--guide-line);
  }
  .atlas-guide-rail::before { display: none; }
  .atlas-guide-node {
    min-height: 62px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 4px;
    padding: 7px 4px;
    border: 0;
    border-radius: 0;
    text-align: center;
  }
  .atlas-guide-node > span { width: 24px; height: 24px; }
  .atlas-guide-node > strong { font-size: .57rem; }
  .atlas-guide-node[data-guide-active="true"] { box-shadow: inset 0 -3px var(--guide-cyan); }
  .atlas-guide-focus { min-height: 220px; padding: 15px; }
  .atlas-guide-focus::before,
  .atlas-guide-focus::after { opacity: .68; }
  .atlas-guide-focus__index { width: 42px; height: 42px; }
  .atlas-guide-focus h2 { font-size: 1.7rem; }
  .atlas-guide-focus__copy { max-width: 88%; font-size: .82rem; }
  .atlas-guide-chapters {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  .atlas-guide-chapters a { flex: 0 0 150px; scroll-snap-align: start; }
  body[data-atlas-research-guide] .docs-card-grid {
    display: flex !important;
    gap: 9px !important;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  body[data-atlas-research-guide] .doc-card {
    flex: 0 0 min(82vw, 300px);
    scroll-snap-align: start;
  }
  body[data-atlas-research-guide] .table-wrap table,
  body[data-atlas-research-guide] .table-wrap tbody,
  body[data-atlas-research-guide] .table-wrap tr,
  body[data-atlas-research-guide] .table-wrap td { display: block; width: 100%; box-sizing: border-box; }
  body[data-atlas-research-guide] .table-wrap thead { display: none; }
  body[data-atlas-research-guide] .table-wrap tr { padding: 13px 14px; border-bottom: 1px solid var(--guide-line); }
  body[data-atlas-research-guide] .table-wrap tr:last-child { border-bottom: 0; }
  body[data-atlas-research-guide] .table-wrap td { min-height: 44px; padding: 5px 0 !important; border: 0 !important; color: var(--guide-muted); }
  body[data-atlas-research-guide] .table-wrap td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: var(--guide-cyan);
    font: 900 .58rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
    text-transform: uppercase;
  }
}

@media (min-width: 1800px) {
  body[data-atlas-research-guide] .docs-shell {
    width: min(2320px, calc(100% - var(--atlas-uhd-gutter, 128px))) !important;
    max-width: 2320px !important;
  }
  body[data-atlas-research-guide] .docs-hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(720px, .92fr) !important;
    gap: 96px;
  }
  .atlas-guide-console { min-height: 570px; }
  .atlas-guide-console__body { grid-template-columns: 210px minmax(0, 1fr); }
  .atlas-guide-node { min-height: 84px; }
  .atlas-guide-focus { padding: 28px; }
  .atlas-guide-focus__copy { font-size: 1rem; }
  body[data-atlas-research-guide] .docs-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-guide-console::after,
  .atlas-guide-node,
  .atlas-guide-node::after,
  .atlas-guide-chapters a,
  body[data-atlas-research-guide] .doc-card::after { transition: none !important; }
}
