/* NightBuilds Portal — public brand site for nightbuilds.com
   Built entirely on the shared design tokens in _content/NightBuilds.Branding/tokens/theme.css,
   with document-level typography (body font, heading scale, links, focus ring) coming from
   _content/NightBuilds.Branding/css/base.css. This file only adds layout/component rules
   specific to this site — it does not redefine --primary-*, --bg-*, --text-* or --border-*
   token families, and deliberately declares no body font/line-height (base.css owns those;
   see NightBuilds.Branding/SHELL_PLAYBOOK.md Part 4.5). */

* { box-sizing: border-box; }

/* margin: 0 is Bootstrap Reboot's job elsewhere in the platform; this site links no
   Bootstrap, so it carries the one reset line itself (same as NightBuilds.Community). */
body { margin: 0; }

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: var(--text-on-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  text-decoration: none;
  z-index: 1000;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  height: 4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: var(--font-weight-bold);
  font-size: 1.05rem;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--text-primary); }

.main-nav {
  display: flex;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: var(--font-weight-medium);
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition-base);
}
.main-nav a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--primary-color);
}

/* Language dropdown - the shared shell's [code][chevron] cell + options panel, rebuilt
   on the tokens (this site links neither Bootstrap nor site-header.css). Disclosure is
   the shell's own static pattern: a hidden-but-focusable checkbox that must remain a
   SIBLING of the cell and the panel for the ~ selectors to reach them. */
.lang-dropdown {
  position: relative;
  flex: 0 0 auto;
}

/* Clipped, NOT display:none or hidden - either would drop the control from the
   accessibility tree and tab order (shell rule, SiteHeader.razor). */
.lang-dropdown-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.lang-dropdown-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.02em;
  /* --text-secondary, not --text-muted: muted is the same grey in both themes and fails
     AA on light backgrounds (measured 2.37:1) - see NightBuilds.Branding/CLAUDE.md. */
  color: var(--text-secondary);
  transition: var(--transition-base);
}
.lang-dropdown-cell:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.lang-dropdown-toggle:focus-visible ~ .lang-dropdown-cell {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

.lang-dropdown-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-0.1rem);
  transition: var(--transition-base);
}
.lang-dropdown-toggle:checked ~ .lang-dropdown-cell .lang-dropdown-chevron {
  transform: rotate(225deg) translateY(-0.1rem);
}

.lang-dropdown-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 30;
  min-width: 11rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}
.lang-dropdown-toggle:checked ~ .lang-dropdown-panel { display: block; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.88rem;
}
.lang-option:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.lang-option-code {
  flex: 0 0 auto;
  width: 1.9rem;
  font-size: 0.72rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}
.lang-option-label { flex: 1 1 auto; }
.lang-option-check { visibility: hidden; color: var(--text-link); font-weight: var(--font-weight-bold); }
.lang-option.active .lang-option-label { font-weight: var(--font-weight-semibold); }
.lang-option.active .lang-option-check { visibility: visible; }

@media (max-width: 760px) {
  .header-inner { flex-direction: column; align-items: flex-start; height: auto; padding: 0.9rem 0; gap: 0.7rem; }
  .main-nav { gap: 1rem; font-size: 0.85rem; }
  /* The stacked header is left-aligned, so anchor the panel left too or it hangs off-screen. */
  .lang-dropdown-panel { right: auto; left: 0; }
}

/* ===== Hero (home) ===== */
.hero {
  position: relative;
  padding: var(--spacing-3xl) 0 var(--spacing-2xl);
  background-image: radial-gradient(circle at 1px 1px, var(--border-color) 1px, transparent 0);
  background-size: 28px 28px;
  background-position: center top;
  border-bottom: 1px solid var(--border-color);
}

.hero-inner { max-width: 44rem; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-link);
  margin: 0 0 var(--spacing-md);
}
.hero-kicker::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--primary-color);
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 0 0 var(--spacing-md);
  text-wrap: balance;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 0 var(--spacing-xl);
  max-width: 38rem;
}

.hero-actions {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: var(--border-radius);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-base);
}

.btn-primary {
  background: var(--primary-color);
  color: var(--text-on-primary);
}
.btn-primary:hover {
  background: var(--primary-surface-hover);
  color: var(--text-on-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-link);
  border: 1px solid var(--border-color);
}
.btn-ghost:hover {
  border-color: var(--primary-color);
  color: var(--text-link-hover);
}

/* ===== Sections ===== */
.section { padding: var(--spacing-2xl) 0; }

.section-head {
  margin-bottom: var(--spacing-xl);
  max-width: 40rem;
}
.section-head h2 { margin-bottom: var(--spacing-sm); }

/* ===== Page headers (inner pages) ===== */
.page-header {
  padding: var(--spacing-2xl) 0 var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}
.page-header h1 { margin: 0 0 var(--spacing-md); }
.page-header .lede {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 42rem;
  margin: 0;
}

.prose { max-width: 44rem; }
.prose p { color: var(--text-secondary); font-size: 1.02rem; }
/* Legal-page section headings: base.css's h2 scale is oversized for policy sections. */
.prose h2 {
  font-size: var(--font-size-xl);
  margin: var(--spacing-xl) 0 var(--spacing-sm);
}
.prose h2:first-child { margin-top: 0; }

.legal-updated {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: var(--spacing-md) 0 0;
}

/* ===== Cards ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--spacing-lg);
}

.feature-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  transition: var(--transition-base);
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-color);
}
.feature-card h3 {
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
}
.feature-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: 0;
  flex: 1;
}
.feature-card .card-cta {
  margin-top: var(--spacing-md);
  font-size: 0.88rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-link);
  text-decoration: none;
}
.feature-card .card-cta:hover { color: var(--text-link-hover); }

/* Product marks: brand accent chips. Codes (IS/CP/NS/OP) are brand data, not prose. */
.product-mark {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-weight: var(--font-weight-bold);
  font-size: 0.85rem;
  /* Dark ink on the light -500 accents: the readable pairing on every accent, see
     SHELL_PLAYBOOK.md Part 4.6. */
  color: var(--text-on-primary);
  margin-bottom: var(--spacing-md);
}
.product-mark.mark-ids { background: var(--nb-blue-500); }
.product-mark.mark-ns { background: var(--nb-orange-500); }
.product-mark.mark-cpl { background: var(--nb-metal-500); }
/* All four mark surfaces are light accents, so the one dark ink (--text-on-primary)
   is the readable pairing in both modes on all of them. */
.product-mark.mark-ops { background: var(--nb-info); }

/* ===== Pillars (What we do) ===== */
.pillar-list {
  display: grid;
  gap: var(--spacing-xl);
  max-width: 48rem;
}
.pillar {
  display: flex;
  gap: var(--spacing-lg);
  align-items: flex-start;
}
.pillar .product-mark { margin-bottom: 0; }
.pillar h2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin: 0 0 var(--spacing-xs);
}
.pillar p {
  color: var(--text-secondary);
  margin: 0;
}

/* ===== CTA band ===== */
.cta-band {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}
.cta-band-inner {
  text-align: center;
  max-width: 36rem;
}
.cta-band h2 { margin-bottom: var(--spacing-sm); }
.cta-band p {
  color: var(--text-secondary);
  margin: 0 0 var(--spacing-lg);
}

/* ===== Contact form ===== */
.contact-inner { max-width: 36rem; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-field label {
  font-weight: var(--font-weight-semibold);
  font-size: 0.9rem;
}
.form-field input,
.form-field textarea {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.6rem 0.75rem;
  font-size: var(--font-size-base);
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: var(--transition-base);
}
.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--focus-color);
  outline-offset: 1px;
  border-color: var(--primary-color);
}

.field-error {
  color: var(--danger-color);
  font-size: 0.85rem;
}
.field-error:empty { display: none; }

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Alerts: tinted surface + readable ink, both halves declared together (background and
   colour are one decision - SHELL_PLAYBOOK.md Part 1.3). */
.alert {
  padding: 0.9rem 1rem;
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
  font-weight: var(--font-weight-medium);
  border: 1px solid transparent;
}
.alert-success {
  background: color-mix(in srgb, var(--success-color) 14%, var(--bg-primary));
  border-color: color-mix(in srgb, var(--success-color) 40%, var(--bg-primary));
  color: var(--text-primary);
}
.alert-error {
  background: color-mix(in srgb, var(--danger-color) 14%, var(--bg-primary));
  border-color: color-mix(in srgb, var(--danger-color) 40%, var(--bg-primary));
  color: var(--text-primary);
}

.support-note {
  margin-top: var(--spacing-xl);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  padding: var(--spacing-2xl) 0;
  margin-top: var(--spacing-2xl);
}
.footer-inner { text-align: center; }
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.footer-tagline {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 30rem;
  margin: 0 auto var(--spacing-md);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}
.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--text-link); }
.footer-meta { color: var(--text-secondary); font-size: 0.82rem; margin: 0; }
