/*
 * qbmap atlas skin
 *
 * A public research atlas, not an admin dashboard: warm paper, editorial type,
 * visible provenance and a restrained two-school colour system.
 */

.atlas-page {
  --ground: #f2efe7;
  --surface: #fbfaf6;
  --surface-2: #ebe7dc;
  --surface-3: #dfd9ca;
  --line: rgba(29, 30, 27, .14);
  --line-strong: rgba(29, 30, 27, .28);
  --ink: #171815;
  --ink-2: #55574f;
  --ink-3: #707268;
  --thu: #6f2879;
  --thu-bg: rgba(111, 40, 121, .08);
  --pku: #9d2634;
  --pku-bg: rgba(157, 38, 52, .08);
  --focus-ring: rgba(111, 40, 121, .34);
  --sel-bg: rgba(111, 40, 121, .13);
  --atlas-serif: "Iowan Old Style", "Baskerville", "Songti SC", "STSong", serif;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --shell-max: 1240px;
  --shell-pad: clamp(20px, 4vw, 52px);
  color-scheme: light;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 3%, rgba(157, 38, 52, .055), transparent 25rem),
    radial-gradient(circle at 13% 24%, rgba(111, 40, 121, .05), transparent 24rem),
    var(--ground);
  color: var(--ink);
  font-family: var(--sans);
}

.atlas-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E");
}

.atlas-page .shell { width: 100%; }

.atlas-page .topbar {
  position: relative;
  background: rgba(242, 239, 231, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.atlas-page .topbar-in {
  min-height: 70px;
  justify-content: space-between;
  gap: 32px;
}

.atlas-page .brand {
  align-items: center;
  gap: 10px;
}

.atlas-page .brand-mark {
  position: relative;
  width: 27px;
  height: 13px;
  gap: 0;
}

.atlas-page .brand-mark::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 6px;
  height: 1px;
  background: var(--ink);
  opacity: .35;
}

.atlas-page .brand-mark i {
  position: absolute;
  top: 2px;
  z-index: 1;
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 4px var(--ground);
}

.atlas-page .brand-mark i:first-child { left: 0; }
.atlas-page .brand-mark i:last-child { right: 0; }
.atlas-page .brand-name {
  font-family: var(--atlas-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.035em;
}
.atlas-page .brand-sub {
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
  font-size: 11px;
  letter-spacing: .11em;
}

.atlas-page .nav {
  flex: 0 1 auto;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.atlas-page .nav a {
  position: relative;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 13px;
  letter-spacing: .02em;
}

.atlas-page .nav a:hover {
  background: rgba(23, 24, 21, .055);
  color: var(--ink);
}

.atlas-page .nav .nav-primary {
  margin-left: 10px;
  padding-inline: 17px;
  background: var(--ink);
  color: var(--surface);
}

.atlas-page .nav .nav-primary:hover {
  background: var(--thu);
  color: #fff;
}

/* Home hero ------------------------------------------------------------ */

.atlas-hero {
  position: relative;
  overflow: clip;
  border-bottom: 1px solid var(--line);
}

.atlas-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: clamp(54px, 8vw, 112px);
  align-items: center;
  min-height: 640px;
  padding-top: clamp(70px, 9vw, 122px);
  padding-bottom: clamp(54px, 7vw, 92px);
}

.atlas-hero-copy { position: relative; z-index: 5; }

.atlas-eyebrow,
.section-kicker,
.map-caption,
.lane-no,
.ledger-label {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.atlas-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  color: var(--ink-2);
}

.atlas-eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--ink);
}

.atlas-hero h1 {
  max-width: 8.4em;
  font-family: var(--atlas-serif);
  font-size: clamp(52px, 5.6vw, 76px);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.055em;
}

.atlas-hero h1 span { color: var(--thu); }

.atlas-deck {
  max-width: 590px;
  margin: 30px 0 34px;
  color: var(--ink-2);
  font-family: var(--atlas-serif);
  font-size: clamp(17px, 1.45vw, 21px);
  line-height: 1.72;
}

.atlas-search {
  position: relative;
  width: min(680px, 100%);
}

.atlas-search-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 70px;
  padding: 0 122px 0 54px;
  background: var(--surface);
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(23, 24, 21, .09);
  transition: transform .18s ease, box-shadow .18s ease;
}

.atlas-search:focus-within .atlas-search-shell {
  transform: translate(-2px, -2px);
  box-shadow: 11px 11px 0 rgba(111, 40, 121, .13);
}

.atlas-search-icon {
  position: absolute;
  left: 21px;
  width: 21px;
  height: 21px;
  color: var(--ink);
}

.atlas-page .atlas-search .input {
  min-height: 68px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--atlas-serif);
  font-size: clamp(17px, 1.6vw, 21px);
}

.atlas-page .atlas-search .input:focus-visible { outline: 0; }

.atlas-search-status {
  position: absolute;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.atlas-search-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-bg);
}

.atlas-page .atlas-search .drop {
  top: calc(100% + 14px);
  padding: 8px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 12px 14px 0 rgba(23, 24, 21, .1);
}

.atlas-page .atlas-search .drop-item {
  padding: 12px 13px;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
}

.atlas-page .atlas-search .drop-item:last-child { border-bottom: 0; }

.atlas-page .atlas-search .drop-item:hover,
.atlas-page .atlas-search .drop-item[aria-selected="true"] {
  background: var(--surface-2);
}

.atlas-search-hint {
  display: flex;
  gap: 10px;
  margin: 15px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.65;
}

.atlas-search-hint::before {
  content: "↳";
  color: var(--thu);
}

/* Network illustration ------------------------------------------------- */

.atlas-map {
  position: relative;
  min-height: 470px;
  isolation: isolate;
}

.atlas-map::before,
.atlas-map::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.atlas-map::before {
  inset: 28px 14px 18px 32px;
  border: 1px solid var(--line);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .52;
}

.atlas-map::after {
  width: 210px;
  height: 210px;
  right: 2px;
  bottom: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  opacity: .38;
}

.atlas-map svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.map-edge {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.2;
  stroke-dasharray: 5 6;
  vector-effect: non-scaling-stroke;
  animation: atlasDash 18s linear infinite;
}

.map-edge.strong {
  stroke: var(--ink);
  stroke-dasharray: none;
  opacity: .42;
}

.map-node { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; }
.map-node.thu { fill: var(--thu); stroke: var(--thu); }
.map-node.pku { fill: var(--pku); stroke: var(--pku); }
.map-ring { fill: none; stroke: var(--line-strong); stroke-width: 1; }

.map-label {
  position: absolute;
  z-index: 3;
  min-width: 124px;
  padding: 9px 11px;
  background: rgba(251, 250, 246, .9);
  border-top: 1px solid var(--ink);
  box-shadow: 0 8px 22px rgba(23, 24, 21, .06);
}

.map-label strong {
  display: block;
  font-family: var(--atlas-serif);
  font-size: 17px;
}

.map-label span {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
}

.map-label.thu { left: 3%; top: 20%; border-color: var(--thu); }
.map-label.pku { right: 0; top: 51%; border-color: var(--pku); }
.map-label.relation { left: 23%; bottom: 4%; }

.map-caption {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 14px;
  color: var(--ink-3);
}

.map-axis {
  position: absolute;
  z-index: 3;
  top: 36px;
  bottom: 18px;
  left: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 8px;
}

/* Release ledger ------------------------------------------------------- */

.atlas-ledger {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  border-top: 1px solid var(--line);
}

.atlas-page #kpis.atlas-ledger { grid-template-columns: repeat(3, 1fr) auto; }

.atlas-ledger .kpi {
  position: relative;
  min-height: 106px;
  padding: 24px 28px;
  border-right: 1px solid var(--line);
  background: rgba(251, 250, 246, .45);
}

.atlas-ledger .kpi-v {
  font-family: var(--atlas-serif);
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 600;
}

.atlas-ledger .kpi-k {
  display: block;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: .05em;
}

.ledger-stamp {
  display: grid;
  place-items: center;
  min-width: 190px;
  padding: 18px 24px;
}

.ledger-stamp a {
  text-decoration: none;
  text-align: center;
}

.ledger-stamp strong {
  display: block;
  font-family: var(--atlas-serif);
  font-size: 15px;
}

.ledger-stamp span {
  display: block;
  margin-top: 4px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
}

/* Journey index -------------------------------------------------------- */

.atlas-section {
  padding-top: clamp(82px, 10vw, 136px);
  padding-bottom: clamp(82px, 10vw, 136px);
}

.atlas-section-head {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) minmax(260px, .46fr);
  gap: 28px;
  align-items: end;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--ink);
}

.section-kicker { color: var(--thu); align-self: start; }

.atlas-section h2 {
  max-width: 12em;
  font-family: var(--atlas-serif);
  font-size: clamp(38px, 4.6vw, 62px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.045em;
}

.section-deck {
  margin: 0;
  color: var(--ink-2);
  font-family: var(--atlas-serif);
  font-size: 16px;
  line-height: 1.75;
}

.journey-lanes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--ink);
}

.journey-lane {
  min-width: 0;
  padding: 34px 30px 28px;
  border-right: 1px solid var(--line-strong);
}

.journey-lane:first-child { padding-left: 0; }
.journey-lane:last-child { padding-right: 0; border-right: 0; }

.lane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.lane-head h3 {
  font-family: var(--atlas-serif);
  font-size: 24px;
  font-weight: 600;
}

.lane-no { color: var(--ink-3); }

.journey-list { display: grid; }

.journey-link {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.journey-index {
  padding-top: 2px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
}

.journey-copy strong {
  display: block;
  font-family: var(--atlas-serif);
  font-size: 17px;
  font-weight: 600;
}

.journey-copy span {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.55;
}

.journey-arrow {
  opacity: 0;
  transform: translateX(-7px);
  color: var(--thu);
  transition: opacity .16s ease, transform .16s ease;
}

.journey-link:hover .journey-arrow,
.journey-link:focus-visible .journey-arrow {
  opacity: 1;
  transform: none;
}

.journey-link:hover .journey-copy strong { color: var(--thu); }

/* Method panel --------------------------------------------------------- */

.method-wrap { padding-bottom: clamp(88px, 10vw, 142px); }

.method-panel {
  position: relative;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: clamp(44px, 7vw, 90px);
  overflow: hidden;
  padding: clamp(38px, 5.5vw, 72px);
  background: var(--ink);
  color: #f3efe5;
}

.method-panel::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -160px;
  top: -170px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255, 255, 255, .025), 0 0 0 110px rgba(255, 255, 255, .02);
}

.method-panel .section-kicker { color: #d5a7da; }

.method-panel h2 {
  margin-top: 20px;
  font-family: var(--atlas-serif);
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 600;
  line-height: 1.05;
}

.method-copy {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  align-content: start;
}

.method-copy p {
  margin: 0;
  color: rgba(243, 239, 229, .72);
  font-size: 13px;
  line-height: 1.75;
}

.method-copy strong {
  display: block;
  margin-bottom: 8px;
  color: #fff;
  font-family: var(--atlas-serif);
  font-size: 18px;
}

.method-link {
  grid-column: 1 / -1;
  width: fit-content;
  margin-top: 8px;
  color: #fff;
  font-size: 12px;
  text-decoration-color: rgba(255, 255, 255, .45);
}

.atlas-page .foot {
  margin: 0;
  padding: 30px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
}

.atlas-footer-in {
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

.atlas-footer-in p { max-width: 800px; margin: 0; }

/* Profile surface ------------------------------------------------------ */

.atlas-page.profile-page .topbar { position: sticky; }
.atlas-page.profile-page .profile-main { padding-top: clamp(46px, 6vw, 78px); }

.atlas-page.profile-page .profile-head {
  position: relative;
  padding: clamp(34px, 5vw, 62px);
  border: 1px solid var(--ink);
  background: var(--surface);
  box-shadow: 12px 12px 0 rgba(23, 24, 21, .075);
}

.atlas-page.profile-page .profile-head::before {
  content: "PUBLIC PROFILE";
  position: absolute;
  top: 18px;
  right: 22px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .16em;
}

.atlas-page.profile-page .profile-title h1 {
  font-family: var(--atlas-serif);
  font-size: clamp(48px, 7vw, 86px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.045em;
}

.atlas-page.profile-page .profile-en {
  margin-top: 12px;
  font-family: var(--atlas-serif);
  font-size: 22px;
}

.atlas-page.profile-page .btn {
  border-color: var(--ink);
  border-radius: 0;
  background: transparent;
  text-decoration: none;
}

.atlas-page.profile-page .btn:hover { background: var(--ink); color: #fff; }

.atlas-page.profile-page .profile-kpis {
  margin-top: 38px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
}

.atlas-page.profile-page .profile-kpis .kpi { background: var(--surface); }
.atlas-page.profile-page .profile-kpis .kpi-v { font-family: var(--atlas-serif); font-size: 28px; }
.atlas-page.profile-page .profile-grid { gap: 22px; margin-top: 22px; }
.atlas-page.profile-page .profile-card { border-color: var(--line-strong); border-radius: 0; background: rgba(251, 250, 246, .74); }
.atlas-page.profile-page .profile-note { border-radius: 0; }
.atlas-page.profile-page .profile-search .input { border-radius: 999px; background: var(--surface); }
.atlas-page.profile-page .profile-search .drop { border-radius: 0; }

/* Motion --------------------------------------------------------------- */

@keyframes atlasReveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes atlasDash { to { stroke-dashoffset: -110; } }

.atlas-hero-copy > * {
  opacity: 0;
  animation: atlasReveal .65s cubic-bezier(.2, .8, .2, 1) forwards;
}
.atlas-hero-copy > :nth-child(2) { animation-delay: .08s; }
.atlas-hero-copy > :nth-child(3) { animation-delay: .16s; }
.atlas-hero-copy > :nth-child(4) { animation-delay: .24s; }
.atlas-map { opacity: 0; animation: atlasReveal .8s .2s cubic-bezier(.2, .8, .2, 1) forwards; }

@media (max-width: 960px) {
  .atlas-hero-grid { grid-template-columns: 1fr; min-height: auto; }
  .atlas-map { min-height: 390px; max-width: 620px; width: 100%; }
  .atlas-ledger,
  .atlas-page #kpis.atlas-ledger { grid-template-columns: repeat(3, 1fr); }
  .ledger-stamp { grid-column: 1 / -1; min-height: 76px; border-top: 1px solid var(--line); }
  .atlas-section-head { grid-template-columns: 60px 1fr; }
  .section-deck { grid-column: 2; }
  .journey-lanes { grid-template-columns: 1fr; }
  .journey-lane,
  .journey-lane:first-child,
  .journey-lane:last-child { padding: 28px 0; border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .journey-lane:last-child { border-bottom: 0; }
}

@media (max-width: 720px) {
  .atlas-page .topbar-in { min-height: 60px; flex-wrap: nowrap; padding-top: 0; padding-bottom: 0; }
  .atlas-page .brand-sub { display: none; }
  .atlas-page .nav { order: initial; flex-basis: auto; width: auto; }
  .atlas-page .nav a:not(.nav-primary) { display: none; }
  .atlas-page .nav .nav-primary { min-height: 38px; margin-left: 0; padding: 7px 14px; }
  .atlas-page .atlas-search .drop-item {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 10px;
  }
  .atlas-page .atlas-search .school { grid-row: 1 / 3; align-self: center; white-space: nowrap; }
  .atlas-page .atlas-search .drop-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .atlas-page .atlas-search .drop-name em { display: block; margin-left: 0; }
  .atlas-page .atlas-search .drop-meta {
    grid-column: 2;
    min-width: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .atlas-hero-grid { gap: 42px; padding-top: 64px; padding-bottom: 52px; }
  .atlas-hero h1 { font-size: clamp(48px, 15vw, 66px); }
  .atlas-deck { margin-block: 24px 28px; font-size: 17px; }
  .atlas-search-shell { min-height: 62px; padding: 0 22px 0 49px; box-shadow: 6px 6px 0 rgba(23, 24, 21, .09); }
  .atlas-search-status { display: none; }
  .atlas-page .atlas-search .input { min-height: 60px; font-size: 17px; }
  .atlas-map { min-height: 310px; margin-inline: -4px; }
  .map-label { min-width: 106px; padding: 7px 9px; }
  .map-label strong { font-size: 14px; }
  .atlas-ledger,
  .atlas-page #kpis.atlas-ledger { grid-template-columns: 1fr; }
  .atlas-ledger .kpi { min-height: 84px; padding: 18px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .atlas-ledger .kpi-v { font-size: 27px; }
  .ledger-stamp { grid-column: auto; }
  .atlas-section-head { grid-template-columns: 1fr; gap: 18px; }
  .section-deck { grid-column: auto; }
  .atlas-section h2 { font-size: 42px; }
  .method-panel { grid-template-columns: 1fr; }
  .method-copy { grid-template-columns: 1fr; }
  .method-link { grid-column: auto; }
  .atlas-footer-in { flex-direction: column; }
  .atlas-page.profile-page .profile-search { display: none; }
  .atlas-page.profile-page .profile-head { padding-top: 56px; }
  .atlas-page.profile-page .profile-kpis .kpi:last-child { grid-column: 1 / -1; }
}

@media (max-width: 460px) {
  .atlas-page .shell { padding-inline: 18px; }
  .atlas-hero h1 { font-size: 48px; }
  .atlas-map { min-height: 278px; }
  .map-label.relation { left: 11%; }
  .atlas-section { padding-block: 76px; }
  .atlas-section h2 { font-size: 38px; }
  .journey-copy strong { font-size: 16px; }
  .atlas-page.profile-page .profile-kpis { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-hero-copy > *, .atlas-map { opacity: 1; animation: none; }
  .map-edge { animation: none; }
}
