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

/* Design tokens and document defaults */

:root {
  color-scheme: dark;
  --nvidia-green: #76b900;
  --ink: #f5f5f5;
  --ink-soft: #bfbfbf;
  --page: #121212;
  --surface: #191919;
  --surface-raised: #202020;
  --surface-hover: #252525;
  --line: #353535;
  --line-strong: #656565;
  --tile-line: #4d692e;
  --status-green: #76b900;
  --status-green-bg: #1e310d;
  --status-light-orange: #f2b866;
  --status-light-orange-bg: #382a18;
  --status-orange: #f29f3d;
  --status-orange-bg: #3d2710;
  --status-dark-orange: #dc7929;
  --status-dark-orange-bg: #3a1f0e;
  --status-red: #ee6666;
  --status-red-bg: #3b1717;
  --shell: clamp(74rem, 90vw, 120rem);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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);
}

/* Shared site header */

.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;
}

.product-link {
  text-decoration: none;
}

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

.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;
}

.header-links {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 1.25rem;
}

.header-link-compact {
  display: none;
}

/* Shared typography and buttons */

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

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.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%);
}

.button-tertiary {
  gap: 0.35rem;
  padding-inline: 0.5rem;
  color: #dedede;
}

.button-tertiary:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 0.22rem;
}
/* Metadata shared by catalog cards and detail pages */

.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;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0 0 0.75rem;
  list-style: none;
}

.tag {
  padding: 0.18rem 0.45rem;
  border: 1px solid #4a4a4a;
  border-radius: 999px;
  color: #c9c9c9;
  font-size: 0.7rem;
  line-height: 1.3;
}

.tag-collection {
  border-color: var(--tile-line);
  color: var(--nvidia-green);
}
/* Shared site footer */

.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 > p {
  max-width: 42rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.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;
}

/* Responsive shared shell */

@media (max-width: 50rem) {
  .header-link-wide {
    display: none;
  }

  .header-link-compact {
    display: inline;
  }
}

@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;
  }

  .brand-divider,
  .product-name {
    display: none;
  }

  .repository-link {
    min-height: 2.5rem;
    font-size: 0.75rem;
  }
}

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