:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #52616f;
  --line: #d9e2e7;
  --surface: #ffffff;
  --surface-soft: #f5f8f6;
  --teal: #008f8c;
  --green: #4f9d69;
  --coral: #e85d4f;
  --gold: #c58a00;
  --shadow: 0 24px 70px rgba(23, 32, 42, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  min-height: 4.25rem;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(217, 226, 231, 0.9);
  backdrop-filter: blur(18px);
}

.site-header-inner {
  width: min(72rem, calc(100% - 4rem));
  min-height: 4.25rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.75rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: 2px solid var(--ink);
  background: #ffe8a3;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
}

.nav-links {
  gap: 1.4rem;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--teal);
}

.nav-links a.active {
  color: var(--ink);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.7rem);
  left: 50%;
  display: none;
  min-width: 11rem;
  padding: 0.55rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--ink);
  transform: translateX(-50%);
}

.dropdown-menu a {
  display: block;
  padding: 0.45rem 0.65rem;
  color: var(--muted);
  white-space: nowrap;
}

.dropdown-menu a:hover {
  color: var(--teal);
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.is-open .dropdown-menu {
  display: block;
}

.hero {
  position: relative;
  min-height: 88vh;
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: 9rem 4rem 7rem;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.9) 45%, rgba(255, 255, 255, 0.72) 100%),
    #edf7f5;
}

#tensor-canvas,
.hero-shade {
  position: absolute;
  inset: 0;
}

#tensor-canvas {
  width: 100%;
  height: 100%;
}

.hero-shade {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 68%, #ffffff 100%),
    linear-gradient(110deg, rgba(0, 143, 140, 0.08) 0%, rgba(255, 255, 255, 0) 58%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 45rem;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.9rem;
  color: var(--teal);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1rem;
  font-size: 4.6rem;
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 1rem;
  font-size: 2rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.22rem;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.78rem 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--ink);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.button.primary {
  background: var(--coral);
  color: #ffffff;
}

.button.secondary {
  background: #ffffff;
}

.content-section {
  width: min(72rem, calc(100% - 4rem));
  margin: 0 auto;
  padding: 6rem 0;
}

.first-section {
  padding-top: 6.5rem;
}

.split,
.format {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(20rem, 1.1fr);
  gap: 3rem;
  align-items: start;
}

.format,
#synthetic.split {
  grid-template-columns: 1fr;
}

.content-section p {
  color: var(--muted);
}

.section-heading {
  margin-bottom: 2rem;
}

.command-panel {
  display: grid;
  gap: 1rem;
}

.command-row,
.script-panel,
.format-notes article,
.resource-card {
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--ink);
}

.command-row {
  display: grid;
  gap: 0.8rem;
  padding: 1.25rem;
}

.command-label {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  color: var(--teal);
  font-weight: 850;
  text-decoration: none;
}

.text-link:hover {
  color: var(--coral);
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  overflow-wrap: anywhere;
  color: #132f2f;
  font-size: 0.92rem;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.resource-card {
  min-height: 13rem;
  padding: 1.5rem;
}

.resource-card-link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.resource-card-link .text-link {
  align-self: flex-start;
  margin-top: auto;
}

.resource-card-link:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.resource-card:nth-child(4n + 1) {
  border-top: 8px solid var(--teal);
}

.resource-card:nth-child(4n + 2) {
  border-top: 8px solid var(--green);
}

.resource-card:nth-child(4n + 3) {
  border-top: 8px solid var(--coral);
}

.resource-card:nth-child(4n) {
  border-top: 8px solid var(--gold);
}

.resource-card h3 {
  margin: 0 0 0.8rem;
  font-size: 1.35rem;
  line-height: 1.2;
}

.synthetic-categories {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

.synthetic-categories .resource-card {
  min-height: 12rem;
}

.synthetic-detail-page {
  grid-template-columns: 1fr;
}

.script-panel {
  display: grid;
  gap: 1px;
  overflow: hidden;
  background: var(--ink);
}

.script-panel div {
  min-height: 6.2rem;
  padding: 1.2rem;
  background: #ffffff;
}

.script-panel p {
  margin-bottom: 0;
  color: var(--ink);
  font-weight: 750;
}

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

.format-stack {
  grid-column: 1 / -1;
  display: grid;
  gap: 1.25rem;
}

.format-mode-section {
  display: grid;
  gap: 1.25rem;
  scroll-margin-top: 5.5rem;
}

.format-mode-section + .format-mode-section {
  margin-top: 2rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}

.format-mode-heading {
  max-width: 48rem;
}

#metadata-json-file .format-mode-heading,
#reference-io .format-mode-heading {
  max-width: none;
}

.format-mode-heading h3 {
  margin: 0 0 0.65rem;
  font-size: 1.55rem;
  line-height: 1.2;
}

.format-group {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(20rem, 1.2fr);
  gap: 1.5rem;
  align-items: start;
}

.format-group-heading h3 {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  line-height: 1.2;
}

.format-group-heading p:last-child {
  margin-bottom: 0;
}

.format-notes {
  display: grid;
  gap: 1rem;
}

.format-notes article {
  min-height: 7rem;
  padding: 1.2rem;
}

.format-notes p {
  margin-bottom: 0;
}

.bundle-layout-group .format-notes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bundle-layout-group .format-notes article {
  min-height: 8rem;
}

.bundle-layout-group .format-notes p,
.bundle-layout-group .format-notes code {
  overflow-wrap: anywhere;
}

.format-example {
  grid-column: 1 / -1;
  margin: 0;
  overflow-x: auto;
  padding: 1.4rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #182525;
  box-shadow: 6px 6px 0 var(--ink);
}

.format-example code {
  color: #e9fff9;
}

.example-block {
  display: grid;
  gap: 0.55rem;
}

.example-caption {
  margin: 0;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 900;
}

.example-block .format-example {
  grid-column: auto;
}

.tensor-example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.bundle-example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.bundle-example-grid .format-example {
  grid-column: auto;
}

.tensor-example-grid .format-example {
  grid-column: auto;
}

.metadata-information-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.metadata-information-grid .format-example {
  grid-column: auto;
}

.metadata-json-example {
  overflow-x: visible;
  white-space: pre-wrap;
}

.metadata-json-example code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.metadata-section {
  grid-template-columns: 1fr;
}

.metadata-section .format-group-heading {
  max-width: 48rem;
}

.attribute-table-wrap {
  overflow-x: auto;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--ink);
}

.attribute-table {
  width: 100%;
  min-width: 46rem;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.attribute-table th,
.attribute-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.attribute-table th {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.attribute-table td {
  color: var(--muted);
}

.attribute-table th:first-child,
.attribute-table td:first-child {
  white-space: nowrap;
}

.attribute-table th:nth-child(2),
.attribute-table td:nth-child(2),
.attribute-table th:nth-child(3),
.attribute-table td:nth-child(3) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.attribute-table tr:last-child td {
  border-bottom: 0;
}

.related-grid .resource-card {
  min-height: 9.5rem;
  display: flex;
  flex-direction: column;
}

.related-grid .text-link {
  margin-top: auto;
}

.survey-note {
  margin: 2.75rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.contributor-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contributor-list li {
  font-size: 1.05rem;
  color: var(--ink);
}

.tensor-pair-section {
  margin-top: 2.5rem;
}

.reference-section {
  margin-top: 2.5rem;
}

.cite-section {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}

.cite-section .reference-section {
  margin-top: 0;
}

.reference-section pre {
  margin: 0.5rem 0 0;
  padding: 1.2rem 1.4rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

.tensor-pair-layout-section {
  margin-top: 1.5rem;
}

.tensor-pair-layout-section h4 {
  margin: 0 0 0.8rem;
  color: var(--ink);
  font-size: 1.05rem;
}

.einsum-line {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.tensor-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
  font-family: monospace;
}

.tensor-pair-table-wrap {
  overflow-x: auto;
}

.tensor-pair-table {
  width: 100%;
  min-width: 48rem;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.tensor-pair-table th,
.tensor-pair-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.tensor-pair-table th {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tensor-pair-table td:first-child {
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.tensor-pair-table code {
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer a {
  color: var(--teal);
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 860px) {
  .site-header {
    position: absolute;
  }

  .site-header-inner {
    width: calc(100% - 2.5rem);
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem 0;
  }

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.55rem 0.9rem;
    font-size: 0.82rem;
  }

  .dropdown-menu {
    left: 0;
    transform: none;
  }

  .hero {
    min-height: 44rem;
    padding: 10rem 1.25rem 6rem;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 1.65rem;
  }

  .hero-copy {
    font-size: 1.05rem;
  }

  .content-section {
    width: calc(100% - 2.5rem);
  }

  .split,
  .format,
  .format-group,
  .bundle-layout-group .format-notes,
  .bundle-example-grid,
  .tensor-example-grid,
  .metadata-information-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .content-section {
    padding: 4rem 0;
  }

  .first-section {
    padding-top: 4rem;
  }

  .site-footer {
    flex-direction: column;
    padding: 2rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button {
    transition: none;
  }
}
