:root {
  --navy: #071127;
  --navy-2: #0e1b34;
  --blue: #183d6f;
  --red: #d71910;
  --yellow: #dfbd09;
  --paper: #f4f3ee;
  --paper-2: #ecebe5;
  --white: #fff;
  --text: #172033;
  --muted: #69707c;
  --line: rgba(7,17,39,.16);
  --mono: "IBM Plex Mono", monospace;
  --sans: "IBM Plex Sans", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--paper);
}

a { text-decoration: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244,243,238,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-grid {
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  color: var(--navy);
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
}

.brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand strong {
  font-size: .95rem;
}

.brand span {
  margin-top: .3rem;
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.main-nav {
  display: flex;
  gap: 1.3rem;
}

.main-nav a,
.header-action {
  font-size: .76rem;
  color: var(--navy);
}

.header-action {
  font-family: var(--mono);
}

.knowledge-hero {
  border-bottom: 1px solid var(--line);
}

.hero-main {
  min-height: 650px;
  padding: 5rem 5rem 5rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.hero-code,
.section-code,
.search-label,
.index-title,
.topic-id,
.data-type,
.project-repository .repo-top,
.research-id,
.research-main > span {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--blue);
}

.hero-main h1 {
  max-width: 1050px;
  margin: 2rem 0;
  font-size: clamp(4rem, 7vw, 7.5rem);
  line-height: .95;
  letter-spacing: -.055em;
  font-weight: 500;
  color: var(--navy);
}

.hero-main p {
  max-width: 720px;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin-top: 2rem;
}

.hero-actions a {
  color: var(--navy);
  font-size: .8rem;
  font-weight: 600;
  border-bottom: 1px solid var(--navy);
  padding-bottom: .25rem;
}

.hero-index {
  min-height: 650px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--navy);
  color: #fff;
}

.index-title {
  padding: 0 2rem 1.5rem;
  color: var(--yellow);
}

.hero-index a {
  display: grid;
  grid-template-columns: 42px 1fr;
  padding: 1.25rem 2rem;
  color: rgba(255,255,255,.8);
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .9rem;
}

.hero-index a:last-child {
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.hero-index a span {
  font-family: var(--mono);
  font-size: .66rem;
  color: rgba(255,255,255,.38);
}

.hero-index a:hover {
  background: rgba(255,255,255,.05);
  color: #fff;
}

.quick-search {
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.search-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: center;
  gap: 2rem;
}

.search-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid var(--line);
}

.search-input-wrap input {
  width: 100%;
  border: 0;
  padding: 1rem 1.2rem;
  font-family: var(--mono);
  font-size: .8rem;
  background: transparent;
  outline: 0;
}

.search-input-wrap button {
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 1.6rem;
  background: var(--navy);
  color: #fff;
  font-family: var(--mono);
  font-size: .72rem;
}

.knowledge-overview {
  border-bottom: 1px solid var(--line);
}

.overview-grid > div {
  min-height: 340px;
  padding: 4rem 2rem;
  border-right: 1px solid var(--line);
}

.overview-grid > div:last-child {
  border-right: 0;
}

.overview-label span {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
}

.overview-copy h2,
.section-head h2,
.data-intro h2,
.system-map h2,
.contact-grid h2 {
  margin: 0;
  font-size: clamp(2.5rem, 4.7vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 500;
  color: var(--navy);
}

.overview-note p,
.section-head p,
.data-intro p,
.contact-detail p {
  margin: 0;
  font-size: .95rem;
  line-height: 1.8;
  color: var(--muted);
}

.services-library,
.topic-library,
.project-repository,
.insight-research {
  padding: 7rem 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr 380px;
  align-items: end;
  gap: 3rem;
  margin-bottom: 4rem;
}

.section-code {
  margin-bottom: 1rem;
}

.library-table {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 100px 1.2fr 1.6fr 1.1fr 40px;
  gap: 1.5rem;
  align-items: center;
}

.table-head {
  padding: .9rem 1rem;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.table-row {
  padding: 1.45rem 1rem;
  color: var(--text);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.35);
}

.table-row:hover {
  background: var(--white);
}

.table-row > span:first-child,
.table-row > span:nth-child(4) {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--muted);
}

.table-row strong {
  font-size: 1rem;
  color: var(--navy);
}

.table-row > span:nth-child(3) {
  font-size: .82rem;
  line-height: 1.55;
  color: var(--muted);
}

.topic-library {
  background: var(--white);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.topic-card {
  min-height: 260px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  color: var(--navy);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.topic-card:hover {
  background: var(--paper);
}

.topic-card h3 {
  margin: 2.2rem 0 .7rem;
  font-size: 2rem;
  font-weight: 500;
}

.topic-card p {
  margin: 0;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--muted);
}

.topic-meta {
  margin-top: auto;
  padding-top: 2rem;
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--muted);
}

.data-section {
  background: var(--navy);
  color: #fff;
}

.data-intro {
  padding: 6rem 4rem;
  border-right: 1px solid rgba(255,255,255,.1);
}

.section-code.light {
  color: var(--yellow);
}

.data-intro h2 {
  color: #fff;
}

.data-intro p {
  margin-top: 2rem;
  color: rgba(255,255,255,.55);
}

.data-list article {
  min-height: 200px;
  padding: 2.2rem 3rem;
  display: grid;
  grid-template-columns: 1fr 170px;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.data-list article:last-child {
  border-bottom: 0;
}

.data-type {
  color: var(--yellow);
}

.data-list h3 {
  margin: .75rem 0;
  font-size: 1.7rem;
  font-weight: 500;
}

.data-list p {
  margin: 0;
  font-family: var(--mono);
  font-size: .7rem;
  color: rgba(255,255,255,.45);
}

.data-side {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  align-items: flex-end;
}

.data-side span {
  font-family: var(--mono);
  font-size: .68rem;
  color: rgba(255,255,255,.45);
}

.data-side a {
  color: #fff;
  font-size: .78rem;
}

.repository-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.repo-card {
  min-height: 300px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.28);
}

.repo-top,
.repo-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.repo-top {
  color: var(--muted);
}

.repo-card h3 {
  margin: 3.5rem 0 .8rem;
  font-size: 1.55rem;
  font-weight: 500;
  color: var(--navy);
}

.repo-card p {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--muted);
}

.repo-bottom {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: .72rem;
}

.repo-bottom a {
  color: var(--navy);
}

.insight-research {
  background: var(--white);
}

.research-list {
  border-top: 1px solid var(--line);
}

.research-list article {
  display: grid;
  grid-template-columns: 100px 1fr 140px 70px;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}

.research-main h3 {
  margin: .55rem 0;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--navy);
}

.research-main p {
  margin: 0;
  font-size: .82rem;
  color: var(--muted);
}

.research-meta {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--muted);
}

.research-list article > a {
  color: var(--navy);
  font-size: .78rem;
}

.system-map {
  padding: 2rem 0;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.map-shell {
  padding: 4rem;
  background: var(--navy);
  color: #fff;
}

.map-shell h2 {
  color: #fff;
}

.map-flow {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(7, auto);
  gap: 1rem;
  align-items: center;
  justify-content: start;
}

.map-flow span {
  padding: .9rem 1.1rem;
  border: 1px solid rgba(255,255,255,.16);
  font-family: var(--mono);
  font-size: .7rem;
}

.map-flow b {
  color: var(--yellow);
  font-weight: 400;
}

.contact-section {
  padding: 7rem 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 4rem;
  align-items: end;
}

.contact-detail a {
  display: inline-block;
  margin-top: 2rem;
  color: var(--navy);
  font-size: .8rem;
  font-weight: 600;
  border-bottom: 1px solid var(--navy);
}

.site-footer {
  padding: 3rem 0;
  background: #050b17;
  color: rgba(255,255,255,.55);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 2rem;
  font-family: var(--mono);
  font-size: .64rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.footer-brand img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 50%;
}

.footer-brand div {
  display: flex;
  flex-direction: column;
}

.footer-brand strong {
  color: #fff;
  font-family: var(--sans);
  font-size: .84rem;
}

.footer-brand span {
  margin-top: .25rem;
}

@media (max-width: 1199.98px) {
  .topic-grid,
  .repository-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 991.98px) {
  .header-grid {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .hero-main,
  .hero-index {
    min-height: auto;
  }

  .hero-main {
    padding: 5rem 0;
    border-right: 0;
  }

  .hero-index {
    padding: 3rem 0;
  }

  .search-shell,
  .section-head,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .overview-grid > div {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .table-head {
    display: none;
  }

  .table-row {
    grid-template-columns: 90px 1fr 40px;
  }

  .table-row > span:nth-child(3),
  .table-row > span:nth-child(4) {
    grid-column: 2;
  }

  .table-row > span:last-child {
    grid-column: 3;
    grid-row: 1 / span 3;
  }

  .data-intro {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.1);
  }

  .research-list article {
    grid-template-columns: 85px 1fr 60px;
  }

  .research-meta {
    grid-column: 2;
  }

  .research-list article > a {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .map-flow {
    grid-template-columns: 1fr;
  }

  .map-flow b {
    transform: rotate(90deg);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .hero-main h1 {
    font-size: 3.4rem;
  }

  .topic-grid,
  .repository-grid {
    grid-template-columns: 1fr;
  }

  .data-intro {
    padding: 4rem 1.5rem;
  }

  .data-list article {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
  }

  .data-side {
    margin-top: 1.5rem;
    align-items: flex-start;
  }

  .table-row {
    grid-template-columns: 70px 1fr 28px;
    gap: 1rem;
  }

  .table-row strong {
    font-size: .92rem;
  }

  .research-list article {
    grid-template-columns: 1fr 42px;
  }

  .research-id,
  .research-meta {
    grid-column: 1;
  }

  .research-main {
    grid-column: 1;
  }

  .research-list article > a {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .map-shell {
    padding: 3rem 1.5rem;
  }
}
