:root {
  --paper: #f7f3ec;
  --paper-2: #fbf8f2;
  --ink: #15262b;
  --ink-soft: #3c4f54;
  --teal: #126e82;
  --teal-deep: #0e5566;
  --clay: #b5662e;
  --line: rgba(21, 38, 43, .14);
  --line-soft: rgba(21, 38, 43, .08);
  --shadow: 0 1px 2px rgba(21, 38, 43, .04), 0 12px 32px -12px rgba(21, 38, 43, .16);
  --sans: "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --heading: Montserrat, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.55 var(--sans);
}

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 {
  font-family: var(--heading);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.22;
}

a { color: var(--teal-deep); text-underline-offset: .18em; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 2;
  padding: .5rem .75rem;
  background: var(--paper-2);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.atlas-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px 64px;
}

.brand-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 70px;
  border-bottom: 1px solid var(--line);
}

.brand { color: var(--ink); font: 600 1.04rem var(--heading); text-decoration: none; }
.brand span { color: var(--teal-deep); }
.site-links, .portfolio-footer {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  font: .75rem/1.35 var(--mono);
}
.site-links a { text-decoration: none; }
.site-links a:hover, .site-links a[aria-current="page"] { text-decoration: underline; }
.portfolio-footer {
  margin-top: 2.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.atlas-masthead { padding: 42px 0 34px; }
.eyebrow,
.atlas-section-label {
  display: flex;
  align-items: center;
  gap: .625rem;
  color: var(--teal-deep);
  font: 500 .75rem/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--teal);
}
.atlas-masthead h1 {
  margin-top: .5rem;
  font-size: clamp(2.5rem, 6vw, 4rem);
}
.atlas-masthead > p:last-child {
  max-width: 64ch;
  margin-top: .625rem;
  color: var(--ink-soft);
  font-size: 1.075rem;
}

.atlas-workspace {
  display: grid;
  grid-template-columns: minmax(220px, .34fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 2.75rem);
  align-items: start;
}
.index-panel {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: calc(100vh - 36px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
}
.index-header { padding: 17px 16px 10px; border-bottom: 1px solid var(--line-soft); }
.index-header h2 { margin-bottom: .75rem; font-size: 1rem; }
.search-label { display: block; margin-bottom: .25rem; font-size: .875rem; }
#atlas-search {
  width: 100%;
  min-height: 44px;
  padding: .35rem .625rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--paper);
}
#atlas-search::placeholder { color: var(--ink-soft); }
#atlas-index-summary {
  min-height: 1.4em;
  margin-top: .55rem;
  color: var(--ink-soft);
  font: .75rem/1.4 var(--mono);
}
.index-scroll {
  min-height: 0;
  max-height: 530px;
  padding: .5rem 1rem .875rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.theme-group + .theme-group { margin-top: 1rem; }
.theme-group > h3,
.theme-group > h4 {
  margin: .45rem 0 .25rem;
  color: var(--ink-soft);
  font: 500 .75rem/1.4 var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.theme-group > ul { margin: 0; padding: 0; list-style: none; }
.project-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 37px;
  padding: .375rem .5rem;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink);
  font-size: .94rem;
  line-height: 1.35;
  text-decoration: none;
}
.project-link:hover,
.project-link[aria-current="true"],
.project-link[aria-current="page"] {
  border-color: var(--line);
  color: var(--teal-deep);
  background: var(--paper);
}
.project-link[aria-current] { font-weight: 600; }
.project-status, .featured-label {
  color: var(--teal-deep);
  font: .72rem/1.4 var(--mono);
}

.atlas-main { min-width: 0; }
.workspace-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  min-height: 54px;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
}
.project-navigation, .view-switch {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.project-navigation { gap: .75rem; }
.text-action {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: .25rem 0;
  border: 0;
  color: var(--teal-deep);
  background: transparent;
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: .22em;
}
.text-action:disabled { opacity: .55; cursor: default; }
.view-switch {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-2);
}
.view-switch button {
  min-height: 34px;
  padding: .25rem .68rem;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink-soft);
  background: transparent;
  font: 500 .78rem/1.45 var(--mono);
}
.view-switch button:hover { color: var(--teal-deep); }
.view-switch button[aria-pressed="true"] {
  color: var(--paper-2);
  background: var(--teal-deep);
}

.atlas-overview,
.project-panel,
.project-view { padding-top: 22px; }
.atlas-overview > h2,
.project-view > h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
}
.overview-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .88rem;
}
.overview-card {
  display: flex;
  flex-direction: column;
  padding: clamp(.875rem, 2vw, 1.2rem);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.overview-card h3 { font-size: 1rem; }
.overview-card p {
  flex: 1;
  margin: .625rem 0 .9rem;
  color: var(--ink-soft);
  font-size: .94rem;
}
.overview-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .15rem .5rem;
  padding-top: .55rem;
  border-top: 1px solid var(--line);
}
.overview-path a,
.overview-cases a { padding: .23rem 0; font-size: .93rem; font-weight: 600; }
.overview-path span,
.overview-cases a span { color: var(--teal); }
.overview-cases {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.overview-cases h3 { font-size: 1rem; }
.overview-cases ul {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  margin: .75rem 0 0;
  padding: 0;
  list-style: none;
}

.project-panel { padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.project-heading,
.project-panel > h2 { margin: .25rem 0 .6rem; font-size: clamp(1.65rem, 4vw, 2.55rem); }
.project-description {
  max-width: 66ch;
  margin-bottom: .8rem;
  font-size: clamp(1.04rem, 2vw, 1.18rem);
  font-weight: 500;
}
.project-details, .project-dates { max-width: 72ch; color: var(--ink-soft); }
.project-details { margin: .8rem 0; }
.project-details p + p { margin-top: .6rem; }
.project-details h3 { margin-bottom: .4rem; font-size: 1rem; }
.project-dates, .project-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .25rem .75rem;
  font: .75rem/1.5 var(--mono);
}

.project-evidence,
.project-features {
  margin-top: 1.35rem;
}
.project-evidence > h3,
.project-features > h3 {
  margin-bottom: .65rem;
  font-size: 1rem;
}
.project-surface-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: .65rem;
}
.project-surface {
  padding: .8rem .95rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--teal);
  border-radius: 5px;
  background: var(--paper-2);
  overflow-wrap: anywhere;
}
.project-surface h4 {
  margin: .3rem 0;
  font-size: .95rem;
}
.project-surface h4 a:hover { color: var(--ink); }
.project-surface p {
  color: var(--ink-soft);
  font-size: .9rem;
}
.project-surface .surface-kind {
  color: var(--teal-deep);
  font: 500 .73rem/1.4 var(--mono);
}

.feature-card {
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-2);
  overflow-wrap: anywhere;
}
.feature-card + .feature-card { margin-top: .65rem; }
.feature-card h4 { font-size: .95rem; }
.feature-card > p {
  max-width: 68ch;
  margin-top: .4rem;
  color: var(--ink-soft);
  font-size: .92rem;
}
.feature-mockup { margin: .75rem 0 0; }
.feature-mockup figcaption {
  margin-top: .5rem;
  color: var(--ink-soft);
  font-size: .84rem;
}
.mockup-frame {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  overflow: hidden;
}
.mockup-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .2rem .75rem;
  padding: .55rem .8rem;
  color: var(--paper-2);
  background: var(--ink);
}
.mockup-title { font: 600 .86rem/1.4 var(--heading); }
.mockup-label { font: .73rem/1.4 var(--mono); }
.mockup-columns,
.mockup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(5.6rem, 26%);
  align-items: start;
  gap: .55rem;
  padding: .5rem .8rem;
}
.mockup-columns {
  color: var(--ink-soft);
  font: 500 .73rem/1.4 var(--mono);
}
.mockup-row {
  border-top: 1px solid var(--line);
  font-size: .875rem;
  line-height: 1.4;
}
.mockup-item small {
  display: block;
  margin-top: .12rem;
  color: var(--ink-soft);
  font-size: .82rem;
}
.mockup-status {
  justify-self: start;
  padding: .2rem .35rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--teal-deep);
  background: var(--paper-2);
  font: 500 .74rem/1.35 var(--mono);
}

.graph {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  padding: .88rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
}
.graph-column {
  min-width: 0;
  padding: .15rem 0;
}
.graph-column:empty { display: none; }
.graph-label {
  display: block;
  margin-bottom: .5rem;
  color: var(--ink-soft);
  font: 500 .74rem/1.4 var(--mono);
}
.graph-edge { padding: 0 0 .6rem; }
.graph-node {
  position: relative;
  display: block;
  padding: .45rem .55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
a.graph-node:hover { border-color: var(--teal); }
.graph-node.is-selected {
  border-color: var(--ink);
  color: var(--paper-2);
  background: var(--ink);
}
.graph-edge-label {
  display: block;
  margin-top: .3rem;
  color: var(--ink-soft);
  font: .72rem/1.45 var(--mono);
}
.graph-edge[data-certainty="tentative"] .graph-node,
.graph-edge[data-kind="intended"] .graph-node { border-style: dashed; }
.graph-edge[data-kind="removed"] .graph-node { border-left: 3px solid var(--clay); }
.graph-edge[data-kind="editorial"] .graph-node { border-style: dotted; }
.graph .empty-state { padding: .25rem 0; }

@media (min-width: 561px) {
  .graph:has(> .graph-column:empty) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .graph-edge:not([data-kind="editorial"]) .graph-node::before,
  .graph-edge:not([data-kind="editorial"]) .graph-node::after {
    position: absolute;
    top: 50%;
    content: "";
    pointer-events: none;
  }
  .graph-edge:not([data-kind="editorial"]) .graph-node::before {
    width: 1rem;
    border-top: 1px solid var(--teal);
  }
  .graph-edge:not([data-kind="editorial"]) .graph-node::after {
    width: 0;
    height: 0;
    border-block: 3px solid transparent;
    border-left: 4px solid var(--teal);
    transform: translateY(-50%);
  }
  .graph-column:first-child .graph-node::before { left: 100%; }
  .graph-column:first-child .graph-node::after { left: calc(100% + .88rem); }
  .graph-column:last-child .graph-node::before { right: 100%; }
  .graph-column:last-child .graph-node::after { right: calc(100% + .04rem); }
  .graph-edge[data-certainty="tentative"] .graph-node::before { border-top-style: dashed; }
  .graph-edge[data-kind="removed"] .graph-node::before { border-top-color: var(--clay); }
  .graph-edge[data-kind="removed"] .graph-node::after { border-left-color: var(--clay); }
}

.relationship-section h3 { margin-bottom: .7rem; font-size: 1rem; }
.relationship-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin: .7rem 0 0;
  padding: 0;
  list-style: none;
}
.relationship-card {
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper-2);
  overflow-wrap: anywhere;
}
.relationship-card[data-certainty="tentative"],
.relationship-card[data-kind="intended"] { border-style: dashed; }
.relationship-card[data-kind="removed"] { border-left: 3px solid var(--clay); }
.relationship-card[data-kind="editorial"] { border-style: dotted; }
.relationship-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .18rem .5rem;
  margin-bottom: .35rem;
  color: var(--ink-soft);
  font: .72rem/1.4 var(--mono);
}
.relationship-status { color: var(--teal-deep); font-weight: 500; }
.relationship-card h4 { font-size: .94rem; }
.relationship-description { margin-top: .45rem; color: var(--ink-soft); font-size: .92rem; }

.timeline {
  display: grid;
  gap: 1rem;
  padding: .95rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
}
.timeline .theme-group { margin: 0; }
.timeline-note { color: var(--ink-soft); font-size: .9rem; }
.timeline-scale,
.timeline-row {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(0, 1fr);
  gap: .75rem;
  align-items: center;
}
.timeline-scale {
  color: var(--ink-soft);
  font: .72rem/1.4 var(--mono);
}
.timeline-scale > div { position: relative; min-height: 1.4em; }
.timeline-scale > div > span { position: absolute; left: var(--timeline-start); }
.timeline-row {
  min-height: 43px;
  padding: .25rem 0;
  border-top: 1px solid var(--line-soft);
  text-decoration: none;
}
.timeline-label { line-height: 1.25; }
.timeline-label small { display: block; }
.timeline-label > span + span,
.timeline-label small { color: var(--ink-soft); font: .7rem/1.4 var(--mono); }
.timeline-row:hover .timeline-label,
.timeline-row[aria-current="true"] .timeline-label { text-decoration: underline; }
.timeline-track {
  position: relative;
  height: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
}
.timeline-bar {
  position: absolute;
  top: 50%;
  left: var(--timeline-start);
  width: var(--timeline-width);
  min-width: 3px;
  height: 6px;
  border-radius: 4px;
  background: var(--teal);
  transform: translateY(-50%);
}

.empty-state { padding: .65rem 0; color: var(--ink-soft); font-size: .94rem; }

@media (max-width: 900px) {
  .overview-paths { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .atlas-shell { padding-bottom: 42px; }
  .brand-bar { min-height: 59px; }
  .atlas-masthead { padding: 28px 0 22px; }
  .atlas-masthead > p:last-child { font-size: 1rem; }
  .atlas-workspace { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .index-panel { position: static; max-height: none; }
  .index-header { padding: 13px 14px 9px; }
  .index-header h2 { margin-bottom: .55rem; }
  .index-scroll { max-height: 190px; padding: .25rem .875rem .6rem; }
  .project-link { min-height: 43px; }
  .workspace-toolbar { padding-bottom: .55rem; }
  .view-switch button { min-height: 41px; }
}

@media (max-width: 560px) {
  .project-surface,
  .feature-card { padding: .75rem; }
  .mockup-toolbar,
  .mockup-columns,
  .mockup-row { padding-inline: .6rem; }
  .graph,
  .relationship-list { grid-template-columns: minmax(0, 1fr); }
  .graph { gap: .6rem; }
  .graph-column:not(:empty) ~ .graph-column:not(:empty) {
    padding: .6rem 0 0;
    border: 0;
    border-top: 1px solid var(--line-soft);
  }
  .timeline-scale,
  .timeline-row { grid-template-columns: minmax(116px, .95fr) minmax(0, 1fr); gap: .4rem; }
  .timeline { padding: .65rem; }
  .timeline-label { font-size: .88rem; }
  .overview-cases ul { gap: .4rem .95rem; }
}
