:root {
  --bg0: #0b0f14;
  --bg1: #121821;
  --bg2: #182231;
  --line: #2a3648;
  --text: #e8eef7;
  --muted: #8b9bb0;
  --accent: #c9a227;
  --accent-soft: rgba(201, 162, 39, 0.14);
  --ok: #3ecf8e;
  --bad: #ef5b67;
  --warn: #f0a33a;
  --blue: #4aa3ff;
  --radius: 10px;
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: #0b0f14;
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100%;
}
body.page-home {
  background:
    linear-gradient(180deg, #0b0f14 0%, #0e141c 40%, #0b0f14 100%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; }
.site { width: 100%; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  border-bottom: 1px solid rgba(42, 54, 72, 0.8);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.85rem 0;
}
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 15, 20, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(8, 11, 16, 0.72), rgba(8, 11, 16, 0));
  padding: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
}
.brand:hover { text-decoration: none; opacity: 0.92; }
.brand span { color: var(--accent); }
.brand .pro { color: var(--accent); font-weight: 550; margin-left: 0.08em; }
.brand-logo {
  display: block;
  height: 1.55rem;
  width: auto;
  background: transparent;
}
.nav-actions { display: flex; gap: 0.6rem; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary {
  background: linear-gradient(180deg, #d6b03a, #b8901d);
  color: #1a1405;
  border-color: transparent;
  font-weight: 600;
}
.btn-ghost { background: transparent; }
.btn-on-dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

/* Full-bleed home hero */
.hero-stage {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.06);
  animation: heroDrift 28s ease-in-out infinite alternate;
}
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(8, 11, 16, 0.35) 0%, rgba(8, 11, 16, 0.55) 45%, rgba(8, 11, 16, 0.92) 100%),
    linear-gradient(90deg, rgba(8, 11, 16, 0.72) 0%, rgba(8, 11, 16, 0.25) 55%, transparent 100%);
  pointer-events: none;
}
.hero-copy {
  position: relative;
  z-index: 2;
  padding: 3.5rem 0 2rem;
  max-width: 640px;
  display: grid;
  gap: 0.85rem;
}
.hero-copy h1,
.hero-brand {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: clamp(2.8rem, 7vw, 4.4rem);
  line-height: 1.02;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero-brand span,
.hero-brand .pro { color: var(--accent); }
.hero-brand .pro {
  font-weight: 500;
  margin-left: 0.08em;
  font-size: 0.72em;
}
.hero-tag {
  margin: 0;
  color: rgba(232, 238, 247, 0.88);
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  line-height: 1.45;
  max-width: 28rem;
  font-weight: 450;
}
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }

@keyframes heroDrift {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.85s ease, transform 0.85s ease;
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
.hero-copy.reveal { transition-delay: 0.12s; }

.risk-banner {
  margin: 0.25rem 0 0.5rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(240, 163, 58, 0.35);
  border-left: 3px solid var(--warn);
  background: rgba(240, 163, 58, 0.07);
  border-radius: 2px 8px 8px 2px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}
.risk-banner strong { color: var(--warn); }

.section { padding: 3.25rem 0 1.25rem; scroll-margin-top: 5rem; }
#performance, #approach, #risk, #engage { scroll-margin-top: 5rem; }
.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin: 0 0 0.45rem;
}
.section .lead { color: var(--muted); margin: 0 0 1.4rem; max-width: 40rem; line-height: 1.55; }

.prose p { color: var(--muted); line-height: 1.6; max-width: 46rem; }
.prose h3,
.prose-stack h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
  color: var(--text);
}
.prose-stack {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.prose-stack > div {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.prose-stack p { margin: 0; color: var(--muted); line-height: 1.6; }

.split-section {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
}
.split-media {
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
  min-height: 420px;
  border: 1px solid rgba(42, 54, 72, 0.7);
}
.split-media img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  display: block;
  transition: transform 1.2s ease;
}
.split-media:hover img { transform: scale(1.03); }

.engagement-section { padding-bottom: 2rem; }
.engagement-panel {
  padding: 2.25rem 0 0.5rem;
  border-top: 1px solid var(--line);
}
.engagement-copy { max-width: 36rem; }
.rate-line {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0.4rem 0 0.85rem;
  color: var(--text);
}
.rate-line strong { color: var(--accent); }

.risk-visual {
  position: relative;
  margin: 2rem 0 2.5rem;
  padding: 0;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--line);
  min-height: 420px;
}
.risk-visual-media {
  position: absolute;
  inset: 0;
}
.risk-visual-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.75) brightness(0.55);
}
.risk-visual-body {
  position: relative;
  z-index: 1;
  padding: 2rem 1.6rem;
  background: linear-gradient(90deg, rgba(8, 11, 16, 0.92) 0%, rgba(8, 11, 16, 0.78) 55%, rgba(8, 11, 16, 0.45) 100%);
  max-width: 42rem;
}
.risk-visual-body .lead,
.risk-visual-body p { color: rgba(232, 238, 247, 0.78); }
.risk-list {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: rgba(232, 238, 247, 0.78);
  line-height: 1.55;
}
.risk-list li { margin: 0.65rem 0; }
.risk-list strong { color: #fff; font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.card {
  background: linear-gradient(180deg, rgba(24, 34, 49, 0.95), rgba(18, 24, 33, 0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
}
.card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-top: 1rem;
}
.metrics.metrics-2 { grid-template-columns: repeat(2, 1fr); }
.metrics.metrics-3 { grid-template-columns: repeat(3, 1fr); }
.metrics.metrics-1 { grid-template-columns: 1fr; }
.metric {
  background: rgba(11, 15, 20, 0.55);
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
}
.metric .k { display: block; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.metric .v { font-family: var(--font-mono); font-size: 0.95rem; margin-top: 0.15rem; }
.metric .v.pos { color: var(--ok); }
.metric .v.neg { color: var(--bad); }
.muted-inline { color: var(--muted); font-size: 0.85em; font-weight: 400; }
.trades-wrap { margin-top: 1rem; }
.trades-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}
.trades-empty {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.trades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.trades-table th,
.trades-table td {
  text-align: left;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.trades-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
}
.trades-table td.pos { color: var(--ok); }
.trades-table td.neg { color: var(--bad); }
.trades-table td:last-child,
.trades-table th:last-child { text-align: right; }

.pricing {
  margin: 1.25rem 0 1.5rem;
  padding: 1.5rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: var(--accent-soft);
}
.pricing h2 { margin-top: 0; font-family: var(--font-display); font-size: 1.25rem; }
.pricing .rate {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0.4rem 0;
}
.pricing .rate strong { color: var(--accent); }

.pwa-install {
  position: sticky;
  top: 3.6rem;
  z-index: 45;
  background: rgba(12, 16, 22, 0.96);
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
  backdrop-filter: blur(10px);
}
.pwa-install[hidden] { display: none !important; }
.pwa-install-inner {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.7rem 0;
  display: flex;
  gap: 0.85rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.pwa-install-inner strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
}
.pwa-install-inner span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.15rem;
}
.pwa-install-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }

.footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 48rem;
}

/* Legacy compact hero used on non-home pages if needed */
.hero {
  padding: 4.5rem 0 2rem;
  display: grid;
  gap: 0.85rem;
  max-width: 720px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.08;
  margin: 0;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 38rem;
}
.prose-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  margin-top: 0.5rem;
}
.prose-grid > div {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.risk-block {
  margin: 1.5rem 0 2rem;
  padding: 1.4rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 24, 33, 0.7);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
}
.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 0.35rem;
}
.auth-card .sub { color: var(--muted); margin: 0 0 1.2rem; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 0.75rem 0 0.3rem; }
input, textarea, select {
  width: 100%;
  background: var(--bg0);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
.form-actions { margin-top: 1.1rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.msg { margin-top: 0.85rem; font-size: 0.92rem; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--bad); }

.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.switcher {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 0.2rem;
}
.chip {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  white-space: nowrap;
  cursor: pointer;
  font: inherit;
}
.chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.banner {
  margin: 0.9rem 0;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  background: rgba(240, 163, 58, 0.12);
  border: 1px solid rgba(240, 163, 58, 0.35);
  color: var(--warn);
  display: none;
}
.banner.show { display: block; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.kpi {
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
}
.kpi .k { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi .v { font-family: var(--font-mono); font-size: 1.15rem; margin-top: 0.25rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; background: var(--bg2); }
tr:last-child td { border-bottom: none; }
.mono { font-family: var(--font-mono); }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.muted { color: var(--muted); }
.admin-grid { display: grid; gap: 1.25rem; margin: 1.25rem 0 2rem; }
.admin-grid h2 { margin: 0 0 0.6rem; font-family: var(--font-display); font-size: 1.25rem; }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.row-actions .btn {
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  white-space: nowrap;
}
.row-actions .btn-edit {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.row-actions .btn-danger {
  border-color: rgba(239, 91, 103, 0.55);
  color: var(--bad);
}
.inline-form {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: end;
}
.inline-form .full { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .prose-grid { grid-template-columns: 1fr; }
  .split-section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .split-media,
  .split-media img { min-height: 280px; }
  .risk-visual-body {
    max-width: none;
    background: linear-gradient(180deg, rgba(8, 11, 16, 0.92) 0%, rgba(8, 11, 16, 0.82) 100%);
  }
}
@media (max-width: 640px) {
  .metrics { grid-template-columns: 1fr; }
  .metrics.metrics-2 { grid-template-columns: 1fr; }
  .metrics.metrics-3 { grid-template-columns: 1fr; }
  .hero { padding-top: 2.5rem; }
  .hero-stage { min-height: 78vh; }
  .hero-copy { padding: 4.5rem 0 1.5rem; }
  .nav-actions .btn-ghost[href="#approach"],
  .nav-actions .btn-ghost[href="#risk"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-media img { animation: none; transform: scale(1.04); }
  .reveal { opacity: 1; transform: none; transition: none; }
}
