:root {
  color-scheme: dark;
  --bg: #0f1117;
  --surface: #1a1d27;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --border: #2a2d3a;
  --fixed: #3b82f6;
  --hedged: #f59e0b;
  --exposed: #ef4444;
  --positive: #10b981;
  --brief: #8b5cf6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", sans-serif;
}

/* ============================================================
   SITE NAVIGATION
   ============================================================ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 23, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  height: 54px;
  gap: 2.5rem;
}

.nav-logo {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo-img {
  height: 24px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  flex: 1;
}

.nav-links a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-cta {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: var(--fixed);
  border-radius: 0.4rem;
  padding: 0.4rem 0.85rem;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.nav-cta:hover {
  opacity: 0.85;
}

/* ============================================================
   SITE SHELL (shared max-width container)
   ============================================================ */

.site-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================================
   HERO
   ============================================================ */

.site-hero {
  padding: 5.5rem 0 4.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fixed);
  margin: 0 0 1.25rem;
}

.hero-headline {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 1.25rem;
  max-width: 820px;
}

.hero-sub {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 600px;
  margin: 0 0 2rem;
}

.hero-description {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 0 0 2rem;
}

.hero-logo-img {
  height: 60px;
  width: auto;
  flex-shrink: 0;
}

.hero-actions {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

.hero-cta-primary {
  background: var(--fixed);
  color: #fff;
  text-decoration: none;
  border-radius: 0.4rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: opacity 0.15s;
}

.hero-cta-primary:hover {
  opacity: 0.85;
}

.hero-cta-secondary {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}

.hero-cta-secondary:hover {
  color: var(--ink);
}

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

.hero-meta span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ============================================================
   PROBLEM SECTION
   ============================================================ */

.site-problem {
  padding: 4rem 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.section-headline {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.5rem;
}

.section-sub {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 2rem;
  max-width: 520px;
}

.problem-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.problem-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.problem-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.problem-card p {
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}

/* ============================================================
   CONTENT SECTIONS (platform / intelligence / portfolio)
   ============================================================ */

.site-section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  margin-bottom: 1.5rem;
}

/* Platform grid — metrics full-width, scenario + ladder 1:2 */

.platform-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-areas:
    "metrics  metrics  metrics  metrics  metrics  metrics"
    "scenario scenario ladder   ladder   ladder   ladder";
  gap: 0.9rem;
}

/* Intelligence grid — position + market brief 50/50 */

.intelligence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

/* ============================================================
   PANELS
   ============================================================ */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.panel--metrics  { grid-area: metrics; }
.panel--scenario { grid-area: scenario; }
.panel--ladder   { grid-area: ladder; }

.panel-title {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ============================================================
   METRIC CARDS
   ============================================================ */

.metric-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.metric-unit {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ============================================================
   SCENARIO SLIDER
   ============================================================ */

.slider-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.slider-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.slider-value {
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sofr-slider {
  width: 100%;
  accent-color: var(--ink);
  cursor: pointer;
}

.scenario-delta {
  font-size: 0.8rem;
  color: var(--muted);
}

.scenario-cashflow-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.scenario-cashflow-value {
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   MATURITY LADDER
   ============================================================ */

.ladder-canvas {
  min-height: 220px;
  width: 100%;
  position: relative;
}

.ladder-canvas svg {
  display: block;
}

.ladder-legend {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.legend-item::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-item--fixed::before   { background: var(--fixed); }
.legend-item--hedged::before  { background: var(--hedged); }
.legend-item--exposed::before { background: var(--exposed); }

/* ============================================================
   CHART TOOLTIP
   ============================================================ */

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  color: var(--ink);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  opacity: 0;
  transition: opacity 0.1s;
}

.chart-tooltip.visible {
  opacity: 1;
}

/* ============================================================
   PORTFOLIO MAP
   ============================================================ */

.portfolio-map {
  height: 380px;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  overflow: hidden;
}

.mapboxgl-map {
  border-radius: 0.75rem;
}

.map-legend {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

/* Map popup */

.map-popup .mapboxgl-popup-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.map-popup .mapboxgl-popup-tip {
  border-top-color: var(--border);
}

.map-popup-inner {
  padding: 0.5rem 0.75rem;
}

.map-popup-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.map-popup-market {
  font-size: 0.72rem;
  color: var(--muted);
}

.map-popup-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* ============================================================
   BRIEF PANELS
   ============================================================ */

.panel--position-brief,
.panel--market-brief {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 280px;
}

.brief-meta {
  font-size: 0.72rem;
  color: var(--muted);
  min-height: 1rem;
}

.brief-output {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ink);
}

.brief-output h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1rem 0 0.35rem;
}

.brief-output h3:first-child {
  margin-top: 0;
}

.brief-output p {
  margin: 0 0 0.5rem;
}

.brief-output ul {
  list-style-type: disc;
  margin: 0 0 0.5rem;
  padding-left: 1.25rem;
}

.brief-output li {
  margin-bottom: 0.3rem;
}

.brief-btn {
  align-self: flex-start;
  background: var(--brief);
  color: #fff;
  border: none;
  border-radius: 0.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.brief-btn:hover:not(:disabled) {
  opacity: 0.85;
}

.brief-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.brief-btn--completed {
  /* Keep same visual appearance as regular button */
  background: var(--brief);
  color: #fff;
  cursor: default;
}

.brief-btn--completed:hover {
  opacity: 1;  /* No hover effect since it's now a title */
}

.brief-error {
  color: var(--exposed);
  font-size: 0.8rem;
}

/* Thinking indicator */

.brief-thinking {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

.brief-thinking-dots {
  display: inline-flex;
  gap: 0.25rem;
}

.brief-thinking-dots span {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  animation: brief-dot-pulse 1.4s ease-in-out infinite;
}

.brief-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.brief-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes brief-dot-pulse {
  0%, 80%, 100% { opacity: 0.2; }
  40%           { opacity: 1;   }
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */

.site-about {
  padding: 4.5rem 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.about-inner {
  max-width: 640px;
}

.about-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.5rem 0 0.2rem;
}

.about-background {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.about-body {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.about-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fixed);
  text-decoration: none;
}

.about-cta:hover {
  text-decoration: underline;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  padding: 1.5rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--ink);
}

/* ============================================================
   PLACEHOLDER
   ============================================================ */

.placeholder-text {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}

/* ============================================================
   CONTACT MODAL
   ============================================================ */

.contact-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.contact-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.contact-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.contact-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.contact-modal-close:hover {
  color: var(--ink);
}

.contact-modal-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.contact-modal-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
}

.form-group input,
.form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.6rem 0.75rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--fixed);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.contact-submit {
  background: var(--fixed);
  color: white;
  border: none;
  border-radius: 0.4rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: opacity 0.15s;
}

.contact-submit:hover {
  opacity: 0.9;
}

/* Success message */
.contact-success {
  text-align: center;
  padding: 2rem 1rem;
}

.success-icon {
  font-size: 3rem;
  color: var(--positive);
  margin-bottom: 1rem;
}

.success-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

.success-text {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 2rem;
  line-height: 1.5;
}
