/* ═══════════════════════════════════════════════════════════════════════════
   OpenUSD Web Lab — NVIDIA DLI-Inspired Light Theme
   Colors: NVIDIA Green #76B900, Black #1A1A2E
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  --nv-green:       #76B900;
  --nv-green-hover: #6aa400;
  --nv-green-dark:  #5a9300;
  --nv-green-light: #e8f5d0;
  --nv-green-bg:    rgba(118,185,0,.06);
  --nv-green-glow:  rgba(118,185,0,.12);
  --nv-black:       #1a1a2e;
  --nv-dark:        #2d2d3f;

  --bg-body:        #ffffff;
  --bg-surface:     #f7f7f8;
  --bg-card:        #ffffff;
  --bg-code:        #f4f4f6;
  --bg-topbar:      #1a1a2e;

  --border:         #e5e5ea;
  --border-lt:      #d4d4d8;

  --text:           #1a1a2e;
  --text-sec:       #4a4a5a;
  --text-muted:     #8a8a9a;

  --green:          #76B900;
  --red:            #d32f2f;
  --red-bg:         rgba(211,47,47,.06);
  --orange:         #e67e22;
  --blue:           #2563eb;
  --cyan:           #0891b2;

  --radius:         10px;
  --radius-sm:      8px;
  --radius-xs:      6px;
  --font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:           'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --shadow:         0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --shadow-md:      0 2px 8px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.06);
}

/* ─── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: var(--mono);
  font-size: .85em;
  background: var(--bg-code);
  padding: .15em .4em;
  border-radius: 4px;
  color: var(--nv-green-dark);
}

a { color: var(--nv-green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── Top Bar (NVIDIA-style dark header) ────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-topbar);
  border-bottom: 3px solid var(--nv-green);
}

.topbar-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: .7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.logo {
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  background: var(--nv-green);
  border-radius: var(--radius-xs);
  color: #fff;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #fff;
}

.topbar-sub {
  font-size: .7rem;
  color: rgba(255,255,255,.55);
  line-height: 1.3;
}

.topbar-actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font);
  font-size: .8125rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-xs);
  padding: .5rem 1rem;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--nv-green);
  color: #fff;
}
.btn-primary:hover { background: var(--nv-green-hover); }

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.2);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-color: rgba(255,255,255,.3);
}

.btn-run {
  background: var(--nv-green);
  color: #fff;
  font-size: .875rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius-sm);
}
.btn-run:hover { background: var(--nv-green-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(118,185,0,.2); }
.btn-run:active { transform: translateY(0); }
.btn-run:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-run.running {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  pointer-events: none;
}

/* ─── Hero Banner ───────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #f8fef0 0%, #f0fae0 30%, #fff 70%);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--nv-green);
  color: #fff;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .3rem .75rem;
  border-radius: 20px;
  margin-bottom: .75rem;
}

.hero h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--nv-black);
  margin-bottom: .5rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-sec);
  line-height: 1.6;
  max-width: 640px;
  margin-bottom: 1.25rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.hero-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .3rem .75rem;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-sec);
}

.hero-meta-chip svg { color: var(--nv-green); width: 14px; height: 14px; }

/* ─── Info Cards (Objectives, Why, Prerequisites) ───────────────────────── */
.info-cards {
  display: grid;
  gap: 1rem;
  padding: 1.75rem 0;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.info-card h3 {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--nv-black);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.info-card h3 svg { color: var(--nv-green); flex-shrink: 0; }

.info-card p, .info-card li {
  font-size: .8375rem;
  color: var(--text-sec);
  line-height: 1.7;
}

.info-card ul {
  list-style: none;
  display: grid;
  gap: .35rem;
}

.info-card li::before {
  content: "✓";
  color: var(--nv-green);
  font-weight: 700;
  margin-right: .5rem;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
  margin-top: .75rem;
}

.why-item {
  background: var(--bg-surface);
  border-radius: var(--radius-xs);
  padding: .75rem .875rem;
}

.why-item strong {
  display: block;
  font-size: .8rem;
  color: var(--nv-black);
  margin-bottom: .2rem;
}

.why-item span {
  font-size: .75rem;
  color: var(--text-muted);
}

/* ─── Nav Pills ─────────────────────────────────────────────────────────── */
.nav-pills {
  position: sticky;
  top: 55px;
  z-index: 90;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: .5rem 0;
  overflow-x: auto;
}

.nav-pills-inner {
  display: flex;
  gap: .3rem;
}

.pill {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: .35rem .75rem;
  border-radius: 20px;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.pill:hover { color: var(--text-sec); background: var(--bg-surface); text-decoration: none; }
.pill.active { color: #fff; background: var(--nv-green); }

/* ─── Step Cards ────────────────────────────────────────────────────────── */
main.container { padding-top: 1.5rem; padding-bottom: 4rem; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .3s;
}
.card:hover { box-shadow: var(--shadow-md); }

.card.running {
  border-color: var(--nv-green);
  box-shadow: 0 0 0 1px var(--nv-green), 0 0 20px var(--nv-green-glow);
}
.card.done { border-left: 4px solid var(--nv-green); }
.card.error { border-left: 4px solid var(--red); }

.card-head {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.step-num {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  background: var(--nv-green);
  padding: .3rem .55rem;
  border-radius: var(--radius-xs);
  line-height: 1;
  margin-top: .1rem;
  flex-shrink: 0;
}

.card-head h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .2rem;
  color: var(--nv-black);
}

.card-head p {
  font-size: .8rem;
  color: var(--text-sec);
  line-height: 1.45;
}

.card-head > div { flex: 1; }

.badge {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .25rem .6rem;
  border-radius: 20px;
  flex-shrink: 0;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge.pass { background: var(--nv-green-light); color: var(--nv-green-dark); border-color: rgba(118,185,0,.2); }
.badge.fail { background: var(--red-bg); color: var(--red); border-color: rgba(211,47,47,.2); }
.badge.running-badge { background: var(--nv-green-bg); color: var(--nv-green); border-color: rgba(118,185,0,.2); }

.card-body {
  padding: 1.25rem 1.5rem;
}

.info-box {
  background: var(--nv-green-bg);
  border: 1px solid rgba(118,185,0,.15);
  border-left: 3px solid var(--nv-green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .875rem 1rem;
  font-size: .8125rem;
  color: var(--text-sec);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.info-box strong { color: var(--nv-black); }

/* ─── Config Grid ───────────────────────────────────────────────────────── */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.config-grid label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.config-grid input {
  font-family: var(--mono);
  font-size: .875rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: .5rem .625rem;
  color: var(--text);
  transition: border-color .15s;
  width: 100%;
}
.config-grid input:focus {
  outline: none;
  border-color: var(--nv-green);
  box-shadow: 0 0 0 3px var(--nv-green-glow);
}

/* ─── Output Areas ──────────────────────────────────────────────────────── */
.output-wrap {
  margin-top: 1rem;
  display: none;
}
.output-wrap.visible { display: block; }

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

.output-section h4 {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.output-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .25rem .75rem;
  font-size: .8125rem;
}
.output-kv dt {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.output-kv dd { color: var(--text); font-weight: 500; }

.output-code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.65;
  color: var(--text-sec);
  max-height: 350px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.output-code::-webkit-scrollbar { width: 6px; }
.output-code::-webkit-scrollbar-track { background: transparent; }
.output-code::-webkit-scrollbar-thumb { background: var(--border-lt); border-radius: 3px; }

/* ─── Hierarchy Tree ────────────────────────────────────────────────────── */
.tree-item {
  font-family: var(--mono);
  font-size: .8125rem;
  padding: .2rem 0;
  color: var(--text-sec);
}
.tree-item .tree-name { color: var(--nv-black); font-weight: 600; }
.tree-item .tree-type { color: var(--nv-green-dark); }

/* ─── Results Table ─────────────────────────────────────────────────────── */
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8125rem;
}
.result-table th {
  text-align: left;
  font-weight: 700;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: .5rem .75rem;
  border-bottom: 2px solid var(--border);
}
.result-table td {
  padding: .45rem .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-sec);
}
.result-table tr:last-child td { border-bottom: none; }
.result-table tr:hover td { background: var(--nv-green-bg); }

.status-pass { color: var(--nv-green-dark); font-weight: 700; }
.status-fail { color: var(--red); font-weight: 700; }
.status-ok   { color: var(--nv-green-dark); }
.status-warn { color: var(--orange); }

/* ─── Validation Cards ──────────────────────────────────────────────────── */
.val-group {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .75rem;
  overflow: hidden;
}

.val-group-head {
  padding: .625rem .875rem;
  font-size: .8125rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  background: var(--bg-card);
}

.val-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .35rem .875rem;
  font-size: .75rem;
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.val-row:last-child { border-bottom: none; }
.val-check { color: var(--text-sec); }
.val-msg   { color: var(--text-muted); font-family: var(--mono); font-size: .6875rem; }

/* ─── Variant Cards ─────────────────────────────────────────────────────── */
.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}

.variant-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .875rem;
}

.variant-card h5 {
  font-size: .875rem;
  font-weight: 700;
  margin-bottom: .5rem;
  text-transform: capitalize;
  color: var(--nv-black);
}

.variant-card .vk { color: var(--text-muted); font-size: .75rem; }
.variant-card .vv { color: var(--text); font-family: var(--mono); font-size: .8125rem; }

/* ─── Keyframe Table ────────────────────────────────────────────────────── */
.kf-table { font-family: var(--mono); }
.kf-table td { font-size: .75rem; padding: .3rem .5rem; }

/* ─── Flatten Bar ───────────────────────────────────────────────────────── */
.flatten-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .875rem 1rem;
  margin-top: 1rem;
}

.flatten-bar .fb-label {
  font-size: .7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.flatten-bar .fb-val {
  font-family: var(--mono);
  font-size: .875rem;
  color: var(--text);
  font-weight: 600;
}

/* ─── Error ─────────────────────────────────────────────────────────────── */
.error-box {
  background: var(--red-bg);
  border: 1px solid rgba(211,47,47,.15);
  border-left: 3px solid var(--red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .875rem 1rem;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--red);
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
}

/* ─── Spinner ───────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--nv-green);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── What's Next Card ──────────────────────────────────────────────────── */
.next-card {
  background: linear-gradient(135deg, #f8fef0, #f0fae0);
  border: 1px solid rgba(118,185,0,.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.next-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--nv-black);
  margin-bottom: .5rem;
}

.next-card p {
  font-size: .85rem;
  color: var(--text-sec);
  line-height: 1.7;
}

.next-card ul {
  list-style: none;
  margin-top: .75rem;
}

.next-card li {
  font-size: .8rem;
  color: var(--text-sec);
  padding: .2rem 0;
}

.next-card li::before {
  content: "→";
  color: var(--nv-green);
  font-weight: 700;
  margin-right: .5rem;
}

/* ─── 3D Viewer Modal ──────────────────────────────────────────────────── */
.viewer-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #111;
  flex-direction: column;
}
.viewer-modal.active { display: flex; }

.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 1rem;
  background: var(--nv-black);
  border-bottom: 2px solid var(--nv-green);
  z-index: 1;
  gap: 1rem;
  flex-shrink: 0;
}

.viewer-header-left {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
}
.viewer-header-left svg { color: var(--nv-green); }

.viewer-header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.viewer-playback {
  display: none;
  align-items: center;
  gap: .5rem;
}
.viewer-playback.active { display: flex; }

.viewer-playback input[type="range"] {
  width: 200px;
  accent-color: var(--nv-green);
  height: 4px;
}

.viewer-time {
  font-family: var(--mono);
  font-size: .75rem;
  color: rgba(255,255,255,.5);
  min-width: 70px;
}

.viewer-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
  border-radius: var(--radius-xs);
  padding: .35rem .6rem;
  cursor: pointer;
  font-size: .8rem;
  transition: all .15s;
}
.viewer-btn:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}
.viewer-close { font-size: 1rem; padding: .3rem .55rem; }

.viewer-canvas {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.viewer-canvas canvas { display: block; }

.viewer-loading {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(17,17,17,.9);
  justify-content: center;
  align-items: center;
  color: rgba(255,255,255,.7);
  font-size: .875rem;
  gap: .5rem;
  z-index: 2;
}
.viewer-loading.active { display: flex; }

/* ─── View 3D Button ──────────────────────────────────────────────────── */
.btn-view3d {
  background: linear-gradient(135deg, rgba(118,185,0,.08), rgba(118,185,0,.15));
  border: 1px solid rgba(118,185,0,.25);
  color: var(--nv-green-dark);
  font-family: var(--font);
  font-size: .8125rem;
  font-weight: 600;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  transition: all .15s;
  margin-top: .75rem;
}
.btn-view3d:hover {
  background: linear-gradient(135deg, rgba(118,185,0,.15), rgba(118,185,0,.25));
  border-color: var(--nv-green);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(118,185,0,.15);
}
.btn-view3d:active { transform: translateY(0); }
.btn-view3d svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ─── Footer ────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-topbar);
  padding: 2rem 0;
  text-align: center;
}
.footer p {
  font-size: .75rem;
  color: rgba(255,255,255,.4);
}
.footer a { color: var(--nv-green); }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .topbar-sub { display: none; }
  .topbar-actions { gap: .25rem; }
  .btn { font-size: .75rem; padding: .4rem .7rem; }
  .hero h2 { font-size: 1.4rem; }
  .card-head { flex-wrap: wrap; }
  .config-grid { grid-template-columns: 1fr 1fr; }
  .info-cards { gap: .75rem; }
  .why-grid { grid-template-columns: 1fr; }
}
