/* ==========================================================================
   NEXUS dark theme: glowing ribbons, serif accents, mono labels.
   Loaded after styles.css. Remove the <link> to return to the light theme.
   Fonts: Instrument Serif and JetBrains Mono (SIL Open Font License 1.1).
   ========================================================================== */
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  --navy: #F1F5FB;          /* headings, strong text */
  --navy-2: #FFFFFF;
  --text: #C3CCDA;
  --muted: #8E9AAF;
  --white: #0D1422;         /* card surface */
  --off: #05080E;           /* page */
  --pale: #090E18;          /* alternate band */
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --blue: #7DB8FF;
  --blue-dark: #A8CFFF;
  --intel: #5EA8FF;
  --connect: #3FE0C5;
  --auto: #8E92FF;
  --acc: #7CF2D7;
  --acc-ink: #03130F;
  --ink: #F1F5FB;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

body { background: var(--off); }
::selection { background: rgba(124, 242, 215, .3); color: #fff; }

h1, h2, h3, h4 { color: var(--ink); }
h1 { font-weight: 600; letter-spacing: -.04em; }
h2 { font-weight: 600; letter-spacing: -.035em; }
.it { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }

/* Mono labels with a glowing dot */
.kicker { font-family: var(--mono); font-weight: 400; font-size: .8125rem; color: #B9C3D3; text-transform: lowercase; letter-spacing: .01em;
  display: inline-flex; align-items: center; gap: .55rem; padding: .4rem .75rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(10, 15, 25, .55); justify-self: start; width: max-content; max-width: 100%; }
.kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 10px var(--acc); flex: none; }

/* Buttons */
.btn-primary, .on-dark .btn-primary, .on-dark .form-card .btn-primary { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); box-shadow: 0 0 36px -10px var(--acc); }
.btn-primary:hover, .on-dark .btn-primary:hover, .on-dark .form-card .btn-primary:hover { background: #A2F7E4; color: var(--acc-ink); }
.btn-secondary, .on-dark .btn-secondary { color: var(--ink); border-color: var(--line-strong); background: rgba(10, 15, 25, .45); }
.btn-secondary:hover, .on-dark .btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.skip-link { background: var(--acc); color: var(--acc-ink); }
.skip-link:focus { color: var(--acc-ink); }
:focus-visible { outline-color: var(--acc); }

/* Header */
.site-header { background: rgba(5, 8, 14, .72) !important; border-bottom-color: var(--line) !important; backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); }
.wordmark { color: var(--ink); }
.submenu { background: #0B111D; border-color: var(--line); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8); }
.nav-link { color: var(--text); }

/* Spinning logo */
.wordmark { flex-direction: row !important; align-items: center; gap: .7rem; }
.wordmark-text { display: flex; flex-direction: column; line-height: 1; }
.nx-logo { width: 40px; height: 40px; flex: none; overflow: visible; }
.nx-logo .nx-orbit { transform-origin: 32px 32px; }
.nx-logo .nx-core { transform-origin: 32px 32px; }
@media (prefers-reduced-motion: no-preference) {
  .nx-logo .nx-orbit { animation: nx-spin 24s linear infinite; }
  .nx-logo .nx-core { animation: nx-breathe 4s ease-in-out infinite; }
  .nx-logo .nx-dot { animation: nx-glow 4s ease-in-out infinite; }
  .nx-logo .nx-dot.d2 { animation-delay: -1.33s; }
  .nx-logo .nx-dot.d3 { animation-delay: -2.66s; }
  .wordmark:hover .nx-orbit { animation-duration: 6s; }
}
@keyframes nx-spin { to { transform: rotate(360deg); } }
@keyframes nx-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes nx-glow { 0%, 100% { opacity: .85; } 50% { opacity: 1; filter: drop-shadow(0 0 3px currentColor); } }

/* Sections */
.section-white { background: transparent; }
.section-pale { background: var(--pale); }
.section-navy { background: #070B14; color: var(--text); border-block: 1px solid var(--line); }
.section-navy h2, .section-navy h3, .section-navy h4, .section-navy a:not(.btn) { color: var(--ink); }
.section-navy .process li::before { background: var(--white); color: var(--ink); }
.combo-step strong { color: var(--ink); }

/* Glass cards */
.division-card, .workflow, .mini-case, .related a, .finder, .division-row, .form-card, .ocd-showcase, .oversight, .book-frame, .consent-banner {
  background: rgba(13, 20, 34, .72) !important; border-color: var(--line) !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.division-card:hover, .related a:hover { border-color: var(--line-strong) !important; box-shadow: 0 30px 80px -40px rgba(94, 168, 255, .45); }
.consent-banner { box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .9); }
.process li::before { background: var(--white); border-color: var(--acc); color: var(--acc); }

/* Forms */
.field input, .field select, .field textarea { background: #070C16; color: var(--ink); border-color: var(--line-strong); }
.field input::placeholder, .field textarea::placeholder { color: #66728A; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(124, 242, 215, .18); }
.form-error-summary { background: rgba(240, 68, 56, .12); color: #FFB4AB; border-color: rgba(240, 68, 56, .5); }

/* Hero diagram */
.nexus-svg .core-ring { fill: #0D1422; stroke: rgba(255, 255, 255, .25); }
.nexus-svg .core { fill: #111B2E; }
.nexus-svg .core-text { fill: var(--ink); }
.nexus-svg .node-title { fill: var(--ink); }
.nexus-svg a:hover .node-bg { fill: #131C2E; }
.nexus-stack .core-chip { background: var(--acc); color: var(--acc-ink); }

/* Product frames on dark */
.ui-frame { background: rgba(13, 20, 34, .82) !important; border-color: var(--line) !important; box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .03) !important; backdrop-filter: blur(12px); }
.ui-bar { background: rgba(255, 255, 255, .03); }
.chat-msg.user { background: #172238; color: var(--ink); }
.ui-input span:last-child { background: var(--acc); }
.status.live { background: rgba(63, 224, 197, .14); color: #7CEBD7; }
.status.wait { background: rgba(94, 168, 255, .14); color: #A8CFFF; }
.status.qa { background: rgba(142, 146, 255, .16); color: #C3C5FF; }
.run-step.done .dot { color: #0A0B20; }
.run-step.hold .dot { box-shadow: 0 0 0 4px rgba(142, 146, 255, .2); }
.approve i:first-child { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.ph { color: #FFE9A8; background: rgba(255, 233, 168, .08); border-color: rgba(255, 233, 168, .5); }

/* CTA band and footer */
.cta-band { background: linear-gradient(180deg, rgba(5, 8, 14, 0), #070B14 30%); border-top: 1px solid var(--line); }
.cta-band h2 { color: var(--ink); }
.site-footer { background: #03050A; border-top-color: var(--line); }
.site-footer .wordmark, .site-footer h2, .site-footer a:hover, .footer-bottom button.linklike:hover { color: var(--ink); }

/* Glowing ribbons behind heroes */
.has-ribbons { position: relative; isolation: isolate; overflow: hidden; }
.has-ribbons > .ribbons { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.has-ribbons::after { content: ""; position: absolute; inset: auto 0 0 0; height: 160px; z-index: -1; pointer-events: none; background: linear-gradient(rgba(5, 8, 14, 0), var(--off)); }
.cta-band.has-ribbons::after { display: none; }

/* Keep the interactive demos as light "product shots" */
#ocd, .apc-phone, .book-frame iframe, .book-gate {
  --navy: #172B4D; --navy-2: #1F3760; --text: #243447; --muted: #55667A; --white: #FFFFFF; --off: #F4F6F8; --pale: #EAF1F8;
  --line: #D3DEEA; --line-strong: #B7C7D9; --blue: #2F6B9A; --blue-dark: #24577F; --intel: #2F6B9A; --connect: #2C7A77; --auto: #5658A3; --ink: #172B4D;
  color-scheme: light;
}
#ocd h3, #ocd h4, #ocd h5 { color: var(--navy); }
.book-frame { background: #fff !important; }
.ocd-note { background: rgba(13, 20, 34, .72); border: 1px solid var(--line); }
.ocd-missions .chip { background: rgba(13, 20, 34, .72); color: var(--text); border-color: var(--line-strong); }
.ocd-missions .chip[aria-selected="true"] { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.ocd-missions .chip[aria-selected="true"] .ck { color: #0B5A46; }
.ocd-privacy { background: rgba(13, 20, 34, .72) !important; border-color: var(--line) !important; }
.apd-pattern article, .apc-try li { background: rgba(13, 20, 34, .72); border-color: var(--line); }
.apd-pattern dl div { border-color: var(--line); }
.apd-pattern .tag, .apc-try li .n { background: rgba(142, 146, 255, .16); color: #C3C5FF; }
.apd-pattern em { color: #E7C76A; }
.apc-try li.done { background: rgba(63, 224, 197, .1); border-color: rgba(63, 224, 197, .45); }
.apc-try li.apc-more { background: transparent; }
.nexus-svg .spoke.s1 { stroke: #5EA8FF; } .nexus-svg .spoke.s2 { stroke: #3FE0C5; } .nexus-svg .spoke.s3 { stroke: #8E92FF; }
.nexus-svg .pulse.p1 { fill: #5EA8FF; } .nexus-svg .pulse.p2 { fill: #3FE0C5; } .nexus-svg .pulse.p3 { fill: #8E92FF; }
.hero h1 .it { display: inline !important; color: inherit; }

/* Homepage workflow card */
.flowcard { position: relative; background: rgba(12, 18, 30, .78); border: 1px solid var(--line); border-radius: 22px; padding: 1.1rem 1.25rem 1rem; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 50px 120px -50px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .04); font-size: .9rem; }
.fc-top { display: flex; align-items: center; gap: .8rem; color: var(--muted); padding-bottom: .9rem; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.fc-top > i { width: 1px; height: 14px; background: var(--line-strong); }
.fc-mono, .fc-run, .fc-lbl, .fc-wait, .fc-runs, .fc-node small { font-family: var(--mono); }
.fc-mono { color: #C9D2E0; font-size: .8rem; }
.fc-run { margin-left: auto; color: var(--acc); font-size: .78rem; display: inline-flex; align-items: center; gap: .45rem; }
.fc-run b { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.fc-body { position: relative; height: 300px; margin: .9rem 0 .4rem 46px; }
.fc-tools { position: absolute; left: -46px; top: 16px; display: grid; gap: .5rem; }
.fc-tools span { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); display: grid; place-items: center; }
.fc-tools svg { width: 14px; height: 14px; fill: none; stroke: #9AA6BA; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fc-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fc-wires path { fill: none; stroke: rgba(255, 255, 255, .13); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.fc-wires path.lit { stroke: var(--acc); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .9; filter: drop-shadow(0 0 4px rgba(124, 242, 215, .8)); }
.fc-node { position: absolute; transform: translateY(-50%); width: 26.8%; padding: .7rem .8rem; background: #0A101B; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font-weight: 500; font-size: .88rem; line-height: 1.25; transition: border-color .35s ease, box-shadow .35s ease; }
#fcn1, #fcn2 { width: 28.6%; }
.fc-end { width: 21.4%; }
.fc-node small { display: block; color: var(--muted); font-size: .7rem; font-weight: 400; margin-top: .3rem; }
.fc-node::before, .fc-node::after { content: ""; position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #1B2436; border: 1px solid rgba(255, 255, 255, .25); }
.fc-node::before { left: -4px; } .fc-node::after { right: -4px; }
#fcn0::before, .fc-end::after { display: none; }
.fc-node.on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 0 34px -8px var(--c); }
.fc-lbl { position: absolute; transform: translate(-50%, -50%); font-size: .68rem; color: #9AA6BA; background: #0A101B; border: 1px solid var(--line); border-radius: 5px; padding: .05rem .4rem; }
.fc-pulse { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(124, 242, 215, .35), 0 0 18px 4px var(--acc); opacity: 0; pointer-events: none; }
.fc-wait { position: absolute; right: 0; top: 88%; font-size: .7rem; color: #C3C5FF; border: 1px solid rgba(142, 146, 255, .4); background: rgba(142, 146, 255, .1); border-radius: 999px; padding: .2rem .6rem; opacity: 0; transition: opacity .3s ease; white-space: nowrap; }
.fc-wait.show { opacity: 1; }
.fc-runs { border-top: 1px solid var(--line); padding-top: .85rem; font-size: .76rem; }
.fc-runs p { color: var(--muted); margin-bottom: .45rem; }
.fc-runs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.fc-runs li { display: grid; grid-template-columns: 10px 70px 1fr auto; gap: .5rem; align-items: center; color: #AEB8C9; }
.fc-runs li i { width: 6px; height: 6px; border-radius: 50%; background: #3A4458; }
.fc-runs li:first-child i { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.fc-runs time { color: #6F7B91; }
.fc-runs em { font-style: normal; color: #6F7B91; }
.fc-runs li.new { animation: fc-in .45s ease; }
@keyframes fc-in { from { opacity: 0; transform: translateY(-6px); } }
.fc-cap { margin-top: .7rem; font-size: .72rem; color: #6F7B91; text-align: right; }
@media (max-width: 960px) { .flowcard { margin-top: 1rem; } }
@media (max-width: 560px) {
  .flowcard { padding: .9rem .9rem .8rem; font-size: .8rem; }
  .fc-body { height: 250px; margin-left: 0; }
  .fc-tools, .fc-lbl { display: none; }
  .fc-node { padding: .5rem .55rem; font-size: .72rem; }
  .fc-node small { font-size: .6rem; }
  .fc-top .fc-mono, .fc-top > i { display: none; }
  .fc-runs li { grid-template-columns: 8px 60px 1fr; } .fc-runs em { display: none; }
}
@media (min-width: 961px) { .hero-grid { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); } }
.fc-node { overflow-wrap: anywhere; }

/* System videos */
.vid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1.5rem; }
.vid-card { background: rgba(13, 20, 34, .72); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s ease, box-shadow .2s ease; }
.vid-card:hover { border-color: var(--line-strong); box-shadow: 0 30px 80px -40px rgba(94, 168, 255, .45); }
.vid-thumb { all: unset; box-sizing: border-box; position: relative; display: block; cursor: pointer; aspect-ratio: 16 / 9; background: #070B14; overflow: hidden; }
.vid-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, filter .3s ease; filter: saturate(.95) brightness(.85); }
.vid-thumb:hover img, .vid-thumb:focus-visible img { transform: scale(1.04); filter: none; }
.vid-thumb:focus-visible { outline: 3px solid var(--acc); outline-offset: -3px; }
.vid-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; background: var(--acc); display: grid; place-items: center; box-shadow: 0 0 0 8px rgba(124, 242, 215, .18), 0 0 40px -4px var(--acc); transition: transform .2s ease; }
.vid-thumb:hover .vid-play { transform: scale(1.08); }
.vid-play svg { width: 26px; height: 26px; fill: var(--acc-ink); margin-left: 3px; }
.vid-dur { position: absolute; right: .75rem; bottom: .75rem; font-family: var(--mono); font-size: .75rem; color: #fff; background: rgba(5, 8, 14, .78); padding: .2rem .5rem; border-radius: 6px; }
.vid-info { padding: 1.25rem 1.4rem 1.4rem; display: grid; gap: .6rem; }
.vid-info h3 { font-size: var(--step-1); }
.vid-info p { color: var(--muted); font-size: .9375rem; }
.vid-tags { list-style: none; margin: .2rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.vid-tags li { font-family: var(--mono); font-size: .72rem; color: #B9C3D3; border: 1px solid var(--line); border-radius: 6px; padding: .15rem .5rem; }
.vid-modal { padding: 0; border: 0; background: transparent; width: min(1100px, 94vw); max-width: none; max-height: 92vh; color: var(--text); }
.vid-modal::backdrop { background: rgba(3, 5, 10, .86); backdrop-filter: blur(6px); }
.vid-modal-in { background: #0A101B; border: 1px solid var(--line-strong); border-radius: var(--radius-l); overflow: hidden; }
.vid-modal-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem .75rem .75rem 1.25rem; border-bottom: 1px solid var(--line); }
.vid-modal-bar h2 { font-size: var(--step-1); letter-spacing: -.01em; }
.vid-close { all: unset; cursor: pointer; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line); }
.vid-close:hover { border-color: var(--ink); }
.vid-close:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.vid-close svg { width: 18px; height: 18px; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; fill: none; }
.vid-modal video { display: block; width: 100%; max-height: calc(92vh - 64px); background: #000; }
.btn-watch svg { width: 14px; height: 14px; fill: var(--acc); margin-right: .45rem; }
@media (min-width: 861px) {
  .vid-grid:has(> .vid-card:only-child) { grid-template-columns: 1fr; }
  .vid-card:only-child { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .vid-card:only-child .vid-thumb { height: 100%; }
  .vid-card:only-child .vid-info { align-content: center; padding: 2rem 2.25rem; }
  .vid-card:only-child .vid-info h3 { font-size: var(--step-2); }
}
