/*
 * SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

:root {
  color-scheme: dark;
  --nvidia-green: #76b900;
  --ink: #f5f5f5;
  --ink-soft: #bfbfbf;
  --page: #121212;
  --line: #353535;
  --tile-line: #4d692e;
  --shell: 74rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

:focus-visible {
  outline: 3px solid var(--nvidia-green);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--page);
}

.shell {
  width: min(calc(100% - 3rem), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  transform: translateY(-180%);
  border-radius: 0.3rem;
  background: var(--nvidia-green);
  color: #111111;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  background: var(--page);
  color: var(--ink);
}

.masthead {
  display: flex;
  min-height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.5rem;
  border-bottom: 3px solid var(--nvidia-green);
}

.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
}

.nvidia-brand {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
}

.nvidia-brand img {
  width: 5.8rem;
  height: auto;
  filter: brightness(0) invert(1);
}

.brand-divider {
  width: 1px;
  height: 1.4rem;
  background: var(--nvidia-green);
}

.product-name {
  overflow: hidden;
  color: #dedede;
  font-size: 0.82rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repository-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.25rem;
  color: #dedede;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
}

.repository-link:hover {
  color: #ffffff;
}

.hero {
  overflow: hidden;
  background: var(--page);
  color: var(--ink);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(19rem, 0.95fr);
  gap: 2.875rem;
  align-items: end;
  padding-block: 4rem 2.5rem;
}

.eyebrow {
  margin: 0 0 1.25rem;
  color: #c7c7c7;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 19.5rem;
  margin-bottom: 1.25rem;
  font-size: clamp(2.1rem, 7vw, 4.1rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.hero-summary {
  max-width: 35rem;
  margin: 0;
  color: #c7c7c7;
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.625rem;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

.button-primary {
  gap: 0.25rem;
  border-color: var(--nvidia-green);
  background: var(--nvidia-green);
  color: #111111;
}

.button-primary:hover {
  border-color: #8acb1b;
  background: #8acb1b;
}

.button-secondary {
  border-color: #e2e2e2;
  background: transparent;
  color: var(--ink);
}

.button-secondary:hover {
  border-color: #ffffff;
  background: rgb(255 255 255 / 5%);
}

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

.category-tile {
  display: flex;
  min-width: 0;
  min-height: 7.25rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  border: 1px solid var(--tile-line);
  color: var(--ink);
  text-decoration: none;
}

.category-tile:hover {
  border-color: var(--nvidia-green);
  background: rgb(118 185 0 / 4%);
}

.category-name {
  font-size: 0.94rem;
  font-weight: 400;
}

.category-count {
  color: var(--nvidia-green);
  font-size: 0.84rem;
  font-weight: 500;
}

.catalog {
  padding-block: 2.125rem 3rem;
  background: var(--page);
}

.catalog-group {
  padding: 0;
  background: var(--page);
  scroll-margin-top: 1.5rem;
}

.group-layout {
  display: grid;
  gap: 0;
  padding-block: 1.75rem;
  border-top: 1px solid var(--line);
}

.catalog-group:target .group-layout {
  border-top-color: var(--nvidia-green);
}

.group-heading {
  max-width: 70rem;
}

.group-heading h2 {
  margin-bottom: 0.35rem;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.group-heading > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem 1.375rem;
  margin-top: 0.5rem;
}

.example-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding-block: 1rem;
  background: transparent;
  scroll-margin-top: 1.5rem;
}

.example-card:target {
  outline: 3px solid var(--nvidia-green);
  outline-offset: 0.35rem;
}

.provenance {
  align-self: flex-start;
  margin: 0 0 0.65rem;
  color: var(--nvidia-green);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.example-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.18rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.outcome {
  margin: 0 0 0.65rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.example-card dl {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
}

.example-card dl.fit {
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.example-card dl div {
  display: block;
}

.example-card dt,
.example-card dd {
  display: inline;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}

.example-card dt {
  font-weight: 500;
}

.example-card dt::after {
  content: ": ";
  white-space: pre;
}

.example-card dd {
  margin: 0;
}

.example-card .fit dt,
.example-card .fit dd {
  color: var(--nvidia-green);
  font-weight: 500;
}

.example-card code {
  padding: 0.05rem 0.2rem;
  border-radius: 0.15rem;
  background: #252525;
  color: #f1f1f1;
  font-size: 0.88em;
}

.example-card abbr {
  text-decoration-color: #8c8c8c;
  text-underline-offset: 0.14em;
}

.guide-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  align-self: flex-start;
  margin-top: auto;
  color: var(--nvidia-green);
  font-size: 0.84rem;
  font-weight: 500;
}

.guide-link::after {
  margin-left: 0.25rem;
  content: "↗";
}

.site-footer {
  background: var(--page);
  color: var(--ink);
}

.footer-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding-block: 1.5rem 2.125rem;
  border-top: 1px solid var(--line);
}

.footer-layout > div > p:last-child {
  max-width: 42rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.7rem 1rem;
}

.footer-links a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  color: var(--nvidia-green);
  font-size: 0.8rem;
  font-weight: 500;
}

@media (max-width: 45rem) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-block: 2.875rem 2.5rem;
  }

  .hero-copy {
    max-width: 50rem;
  }

  h1 {
    max-width: 13ch;
  }

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

@media (max-width: 29.375rem) {
  .shell {
    width: min(calc(100% - 2rem), var(--shell));
  }

  .masthead {
    gap: 0.75rem;
  }

  .nvidia-brand img {
    width: 5.2rem;
  }

  .product-name {
    font-size: 0.75rem;
  }

  .repository-link {
    display: none;
  }

  h1 {
    font-size: clamp(2.1rem, 11vw, 3rem);
  }

  .hero-actions {
    display: grid;
  }

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

  .category-tile {
    min-height: 6rem;
  }
}

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