/* ==========================================================================
   Helix Design System & Shared Stylesheet
   Modern, crisp, high-contrast, typographic elegance for fintech & compliance
   ========================================================================== */

:root {
  --primary-emerald: #059669;
  --primary-emerald-dark: #047857;
  --primary-emerald-light: #ecfdf5;
  --zinc-50: #fafafa;
  --zinc-100: #f4f4f5;
  --zinc-200: #e4e4e7;
  --zinc-300: #d4d4d8;
  --zinc-400: #a1a1aa;
  --zinc-500: #71717a;
  --zinc-600: #52525b;
  --zinc-700: #3f3f46;
  --zinc-800: #27272a;
  --zinc-900: #18181b;
  --zinc-950: #09090b;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #ffffff;
  color: #09090b;
  -webkit-font-smoothing: antialiased;
}

.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Custom Navigation Switcher */
.edition-pill {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.edition-pill.active {
  background-color: #09090b;
  color: #ffffff;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.2);
}
.edition-pill:not(.active):hover {
  background-color: #f4f4f5;
  color: #09090b;
}

/* Interactive Tabs */
.tab-active {
  background-color: #ffffff;
  color: #09090b !important;
  font-weight: 600;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.tab-active svg {
  color: #059669 !important;
}
.tab-inactive {
  background-color: transparent;
  color: #52525b !important;
  font-weight: 500;
}
.tab-inactive:hover {
  color: #09090b !important;
}
.tab-inactive svg {
  color: #71717a !important;
}

/* Card Shadows and Borders */
.clean-border {
  border: 1px solid #e4e4e7;
}
.clean-shadow {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.02);
}
.card-shadow {
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 12px -3px rgba(0, 0, 0, 0.03);
}
.card-shadow-lg {
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.08), 0 8px 16px -6px rgba(0, 0, 0, 0.04);
}

/* Modal Backdrop */
.modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-color: rgba(9, 9, 11, 0.65);
}

/* Code Diff Line Highlighting */
.diff-added {
  background-color: rgba(6, 78, 59, 0.35);
  color: #34d399;
}
.diff-removed {
  background-color: rgba(136, 19, 55, 0.35);
  color: #fb7185;
}

/* Smooth Transitions */
.transition-smooth {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Pulse animation helper */
@keyframes subtle-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.02); }
}
.animate-subtle {
  animation: subtle-pulse 3s infinite ease-in-out;
}

/* ==========================================================================
   Consolidated experience: developers + chief security officers
   ========================================================================== */

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

.hx-page section[id],
.hx-page [id="top"] {
  scroll-margin-top: 8.5rem;
}

html[data-audience="dev"] .hx-cso,
html[data-audience="dev"] .hx-cmp { display: none !important; }
html[data-audience="cso"] .hx-dev,
html[data-audience="cso"] .hx-cmp { display: none !important; }
html[data-audience="cmp"] .hx-dev,
html[data-audience="cmp"] .hx-cso { display: none !important; }

h1 .hx-dev,
h1 .hx-cso,
h1 .hx-cmp {
  display: block;
}

.hx-page a.sr-only:focus {
  position: absolute;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.5rem 0.75rem;
  clip: auto;
  overflow: visible;
  white-space: normal;
  z-index: 80;
  background: #fff;
  border-radius: 0.5rem;
}

.hx-hero {
  background-color: #09090b;
  background-image:
    radial-gradient(ellipse 70% 55% at 0% 0%, rgba(5, 150, 105, 0.22), transparent 55%),
    radial-gradient(ellipse 40% 40% at 100% 10%, rgba(16, 185, 129, 0.08), transparent 50%),
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, auto, 72px 72px, 72px 72px;
  color: #fafafa;
}

.hx-switch {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
}

.hx-switch.is-full {
  display: flex;
  width: 100%;
}

.hx-switch.is-full button {
  flex: 1 1 auto;
  text-align: center;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  font-size: 0.75rem;
}

@media (min-width: 640px) {
  .hx-switch.is-full button {
    font-size: 0.8125rem;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
}

.hx-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #52525b;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.hx-switch-on-dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.hx-switch-on-dark button { color: #d4d4d8; }

html[data-audience="dev"] .hx-switch [data-set-audience="dev"],
html[data-audience="cso"] .hx-switch [data-set-audience="cso"],
html[data-audience="cmp"] .hx-switch [data-set-audience="cmp"] {
  background: #ffffff;
  color: #09090b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.hx-switch button:focus-visible,
.hx-chips button:focus-visible,
.hx-page a:focus-visible,
.hx-page button:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
}

.hx-console {
  background: #0c0c0f;
  border: 1px solid #3f3f46;
  border-radius: 18px;
  box-shadow: 0 30px 70px -36px rgba(0, 0, 0, 0.85);
}

.hx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hx-chips button {
  appearance: none;
  border: 1px solid transparent;
  background: #18181b;
  color: #d4d4d8;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.hx-chips button[aria-pressed="true"] {
  background: #059669;
  color: #ffffff;
}

.hx-diff {
  overflow-x: auto;
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 10px 0;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

.hx-line {
  display: flex;
  gap: 10px;
  padding: 0 12px;
  white-space: pre;
  min-width: max-content;
}

.hx-mark {
  width: 12px;
  flex: none;
  color: #71717a;
}

.hx-line-file { color: #a1a1aa; padding-bottom: 6px; }
.hx-line-ctx { color: #e4e4e7; }
.hx-line-add { background: rgba(6, 78, 59, 0.55); color: #d1fae5; }
.hx-line-del { background: rgba(136, 19, 55, 0.45); color: #ffe4e6; }

.hx-seat {
  border: 1px solid #e4e4e7;
  border-radius: 16px;
  background: #ffffff;
  padding: 1.25rem 1.35rem 1.35rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

html[data-audience="dev"] .seat-dev,
html[data-audience="cso"] .seat-cso,
html[data-audience="cmp"] .seat-cmp {
  border-color: #059669;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

.seat-label-yours { display: none; }
.seat-label-same { display: block; }

html[data-audience="dev"] .seat-dev .seat-label-yours,
html[data-audience="cso"] .seat-cso .seat-label-yours,
html[data-audience="cmp"] .seat-cmp .seat-label-yours { display: block; }

html[data-audience="dev"] .seat-dev .seat-label-same,
html[data-audience="cso"] .seat-cso .seat-label-same,
html[data-audience="cmp"] .seat-cmp .seat-label-same { display: none; }

@media (max-width: 1023px) {
  html[data-audience="dev"] .seat-dev,
  html[data-audience="cso"] .seat-cso,
  html[data-audience="cmp"] .seat-cmp { order: -1; }
}

.hx-faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 1rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: #09090b;
}

.hx-faq summary::-webkit-details-marker { display: none; }

.hx-faq summary::after {
  content: "+";
  color: #71717a;
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1;
}

.hx-faq[open] summary::after { content: "–"; }

.hx-faq p {
  padding-bottom: 1rem;
  color: #52525b;
  font-size: 0.875rem;
  line-height: 1.6;
}

.hx-code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  background: #09090b;
  color: #e4e4e7;
  border-radius: 12px;
  padding: 12px 14px;
  overflow-x: auto;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hx-seat,
  .hx-switch button { transition: none; }
}

.cto {
  background: #0c0e13;
  color: #f4f6f8;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.cto-banner {
  background: #3dd68c;
  color: #042016;
}

.cto-header {
  background: rgba(12, 14, 19, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cto-logo {
  display: inline-flex;
  align-items: baseline;
  color: #fff;
  font-family: "Inter Tight", Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
}

.cto-logo-dot {
  width: 5px;
  height: 5px;
  margin-left: 3px;
  border-radius: 50%;
  background: #3dd68c;
  flex-shrink: 0;
}

.cto-hero {
  background-color: #0c0e13;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
}

.cto-amber { color: #3dd68c; }

.cto-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #3dd68c;
  color: #042016;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.7rem 1.15rem;
  transition: background 0.15s ease;
}

.cto-btn:hover { background: #6ee7b0; }

.cto-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f4f6f8;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.7rem 1.15rem;
  background: transparent;
}

.cto-btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }

.cto-card {
  background: #141820;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  min-width: 0;
}

.cto-card .grid > * { min-width: 0; }

.cto-chip {
  appearance: none;
  border: 1px solid transparent;
  background: #1c212b;
  color: #c5ccd6;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.cto-chip[aria-pressed="true"] {
  background: #3dd68c;
  color: #042016;
}

.cto-diff {
  overflow-x: auto;
  max-width: 100%;
  background: #0b0d12;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 0;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
}

.cto-line { display: flex; gap: 10px; padding: 0 12px; white-space: pre; min-width: max-content; }
.cto-mark { width: 12px; flex: none; color: #6b7280; }
.cto-line-file { color: #9aa3b2; padding-bottom: 6px; }
.cto-line-ctx { color: #e7ebf0; }
.cto-line-add { background: rgba(16, 90, 62, 0.55); color: #d1fae5; }
.cto-line-del { background: rgba(127, 29, 29, 0.45); color: #ffe4e6; }

.cto-finding {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #10141b;
  border-radius: 12px;
  padding: 12px 14px;
}

.cto-tag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
}

.cto-tag-nogo { background: #3f1218; color: #fda4af; }
.cto-tag-unproven { background: #0c2a1c; color: #3dd68c; }
.cto-tag-pass { background: rgba(61, 214, 140, 0.12); color: #3dd68c; }

.cto-faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  font-weight: 600;
}

.cto-faq summary::-webkit-details-marker { display: none; }
.cto-faq summary::after { content: "+"; color: #9aa3b2; font-weight: 500; }
.cto-faq[open] summary::after { content: "–"; }
.cto-faq p { padding-bottom: 1rem; color: #b7c0cc; font-size: 0.925rem; line-height: 1.6; }

.cto input, .cto select {
  width: 100%;
  background: #0c0e13;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f4f6f8;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 0.875rem;
}

.cto input:focus, .cto select:focus {
  outline: 2px solid #3dd68c;
  outline-offset: 1px;
}

.cto a:focus-visible, .cto button:focus-visible, .cto summary:focus-visible {
  outline: 2px solid #3dd68c;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cto-btn { transition: none; }
}
