/* Cinematic dark skin. Loaded after terminal.css so these rules win. */

html {
  scroll-behavior: smooth;
}

html.dark,
html.dark body {
  background-color: #07080a !important;
  background-image:
    radial-gradient(ellipse 55% 42% at 0% -10%, rgba(30, 64, 175, 0.38), transparent 58%),
    radial-gradient(ellipse 42% 36% at 100% 0%, rgba(8, 145, 178, 0.2), transparent 52%) !important;
  color: #ffffff !important;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif !important;
}

html.dark h1 {
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.04em !important;
  line-height: 0.95 !important;
  color: #ffffff !important;
}

.noir-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 40 !important;
  padding: 14px 16px 0 !important;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
}

.noir-pill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 8px 8px 8px 16px;
  background: rgba(24, 24, 27, 0.62) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 999px !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 0 50px -12px rgba(255, 255, 255, 0.08) !important;
}

.noir-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.noir-brand .brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px !important;
  background: #22d3ee !important;
  color: #07080a !important;
  font-size: 14px;
  font-weight: 700;
}

.noir-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
}

.noir-links a {
  color: #a1a1aa !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.noir-links a:hover,
.noir-links a:focus-visible {
  color: #ffffff !important;
}

.noir-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 999px !important;
  background: #22d3ee !important;
  color: #07080a !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(34, 211, 238, 0.45) !important;
  box-shadow: 0 0 24px -6px rgba(34, 211, 238, 0.7) !important;
}

.noir-cta:hover,
.noir-cta:focus-visible {
  background: #67e8f9 !important;
  color: #07080a !important;
}

.noir-tools {
  width: min(1080px, 100%);
  margin: 10px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.noir-hero {
  width: min(1080px, calc(100% - 32px));
  margin: 36px auto 20px;
  padding: 36px 8px 8px;
}

.noir-tools .hidden {
  display: inline !important;
}

html.dark .noir-hero h1,
html.dark .noir-hero h1 span {
  max-width: 16ch;
  font-size: clamp(44px, 7vw, 84px) !important;
  background-image: linear-gradient(180deg, #ffffff 30%, #67e8f9 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
}

.noir-hero h1 span {
  display: inline-block;
  animation: noir-rise 700ms ease both;
}

.noir-hero h1 span:nth-child(2) {
  animation-delay: 80ms;
}

.noir-hero p {
  max-width: 42rem;
  margin-top: 18px;
  color: #a1a1aa !important;
  font-size: 18px;
  line-height: 1.5;
}

.noir-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.noir-pills button {
  padding: 8px 14px !important;
  border-radius: 999px !important;
  background: rgba(24, 24, 27, 0.6) !important;
  color: #e4e4e7 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  cursor: pointer;
}

.noir-pills button:hover,
.noir-pills button:focus-visible {
  border-color: rgba(34, 211, 238, 0.5) !important;
  color: #67e8f9 !important;
  box-shadow: 0 0 30px -5px rgba(6, 182, 212, 0.15) !important;
}

html.dark .glass-panel,
html.dark aside > div,
html.dark .engine-panel,
html.dark .fintech-lead-card,
html.dark .solution-card,
html.dark .modal-card,
html.dark #faq-section,
html.dark #seo-authority-directory .luxury-glass {
  background-color: rgba(24, 24, 27, 0.6) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 50px -12px rgba(255, 255, 255, 0.08) !important;
}

html.dark .engine-panel {
  transition: border-color 300ms ease, box-shadow 300ms ease;
}

html.dark .engine-panel:hover {
  border-color: rgba(6, 182, 212, 0.5) !important;
  box-shadow: 0 0 30px -5px rgba(6, 182, 212, 0.15) !important;
}

html.dark .engine-panel h2,
html.dark .engine-panel h3,
html.dark #knowledge-base h2,
html.dark #knowledge-base h3,
html.dark #faq-section h3,
html.dark footer h3 {
  color: #ffffff !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
}

html.dark .result-display-card {
  background: rgba(9, 9, 11, 0.72) !important;
  border: 1px solid rgba(34, 211, 238, 0.3) !important;
  border-bottom: 1px solid rgba(34, 211, 238, 0.3) !important;
  border-radius: 16px !important;
  box-shadow: 0 0 40px -12px rgba(34, 211, 238, 0.35) !important;
}

html.dark .output-value,
html.dark [class*="text-emerald"],
html.dark [class*="text-teal"],
html.dark [class*="text-cyan"] {
  color: #22d3ee !important;
}

html.dark .text-rose-400,
html.dark [class*="text-rose"] {
  color: #fb7185 !important;
}

html.dark input,
html.dark select,
html.dark textarea {
  background-color: rgba(9, 9, 11, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  color: #ffffff !important;
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: rgba(34, 211, 238, 0.7) !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15) !important;
}

html.dark input[type="range"] {
  accent-color: #22d3ee;
  height: 4px;
  background: rgba(255, 255, 255, 0.12) !important;
  border: none !important;
}

html.dark input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #22d3ee;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.8);
}

html.dark .tab-btn.active,
html.dark .ws-chip.active,
html.dark .toggle-btn.active,
html.dark .category-chip.active,
html.dark .preset-chip.active,
html.dark .mortgage-term-btn.active,
html.dark button.active {
  color: #67e8f9 !important;
  border: 1px solid rgba(34, 211, 238, 0.45) !important;
  border-bottom: 1px solid rgba(34, 211, 238, 0.45) !important;
  background-color: rgba(8, 145, 178, 0.12) !important;
  border-radius: 12px !important;
  box-shadow: 0 0 18px -8px rgba(34, 211, 238, 0.8) !important;
}

html.dark .tab-btn:hover,
html.dark button:hover {
  color: #ffffff !important;
}

html.dark #faq-section details {
  background: rgba(9, 9, 11, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
}

html.dark #faq-section details[open] {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 24px -10px rgba(34, 211, 238, 0.45);
}

html.dark #faq-section summary {
  cursor: pointer;
  font-weight: 700;
  color: #ffffff;
  list-style: none;
}

html.dark #faq-section summary::-webkit-details-marker {
  display: none;
}

html.dark #faq-section details p {
  margin-top: 10px;
  color: #a1a1aa !important;
  font-size: 14px;
  line-height: 1.55;
}

html.dark footer {
  background: #07080a !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark footer a:hover {
  color: #67e8f9 !important;
}

.noir-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #a1a1aa !important;
}

.noir-status i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22d3ee;
  box-shadow: 0 0 10px #22d3ee;
}

#mortgage-chart-principal {
  background: #22d3ee !important;
}

@keyframes noir-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

html.in-frame .noir-hero,
html.in-frame .noir-pill,
html.calculator-landing .noir-hero,
html.calculator-landing #workspace-intro {
  display: none !important;
}

html.calculator-landing #calculators {
  padding-top: 8px;
}

html.calculator-landing .engine-panel {
  scroll-margin-top: 12px;
}

@media (max-width: 1023px) {
  html.calculator-landing #calculators {
    display: flex;
    flex-direction: column;
  }

  html.calculator-landing #engine-stage {
    order: 1;
  }

  html.calculator-landing #calculators > aside {
    order: 2;
  }
}

@media (max-width: 720px) {
  .noir-pill {
    border-radius: 22px !important;
    padding: 12px;
  }

  .noir-links {
    width: 100%;
  }

  .noir-cta {
    margin-left: auto;
  }
}

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

  .noir-hero h1 span {
    animation: none;
  }
}

@media print {
  .noir-header,
  .noir-hero,
  .noir-tools {
    display: none !important;
  }
}
