:root {
  color-scheme: light dark;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --ink: #111827;
  --text: #334155;
  --muted: #64748b;
  --line: #d9e2ea;
  --brand: #c1121f;
  --brand-2: #8f111d;
  --navy: #102033;
  --teal: #0f766e;
  --blue: #1d4ed8;
  --gold: #b7791f;
  --green: #15803d;
  --danger: #b91c1c;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --container: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1118;
    --surface: #121a24;
    --surface-2: #172231;
    --ink: #f8fafc;
    --text: #cbd5e1;
    --muted: #94a3b8;
    --line: #253449;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; }

.skip-link {
  position: fixed;
  top: -64px;
  left: 16px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--brand);
  color: #fff;
  border-radius: 0 0 6px 6px;
}
.skip-link:focus { top: 0; }

.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand-name { display: block; color: var(--ink); font-weight: 800; font-size: 17px; }
.brand-meta { display: block; color: var(--muted); font-size: 12px; }

.nav-toggle { display: none; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav a {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  padding: 9px 10px;
  border-radius: 6px;
}
.site-nav a[aria-current="page"],
.site-nav a:hover {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-weight: 750;
  cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); color: #fff; }
.btn-secondary { background: var(--navy); color: #fff; }
.btn-secondary:hover { background: #1b3554; color: #fff; }
.btn-outline { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }

.hero {
  position: relative;
  min-height: 690px;
  display: flex;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  background: var(--navy);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(8, 17, 29, 0.9), rgba(8, 17, 29, 0.68) 42%, rgba(8, 17, 29, 0.08)), var(--hero-image);
  background-size: cover;
  background-position: center;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 96px;
  background: linear-gradient(180deg, transparent, var(--bg));
  z-index: -1;
}
.hero-content {
  max-width: 720px;
  color: #fff;
  padding: 72px 0 112px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}
.hero h1,
.page-hero h1 {
  margin: 16px 0 18px;
  color: inherit;
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1.05;
  font-weight: 760;
}
.hero p { max-width: 650px; font-size: 19px; color: #e6edf5; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-proof {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  margin-top: -64px;
  position: relative;
  z-index: 2;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.proof-item { background: var(--surface); padding: 20px; }
.proof-value { display: block; color: var(--ink); font-size: 24px; font-weight: 850; }
.proof-label { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.section { padding: 76px 0; }
.section-tight { padding: 48px 0; }
.section-band { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 780px; margin-bottom: 28px; }
.section-head h2,
.page-section h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.14;
}
.section-head p { margin: 0; color: var(--muted); font-size: 17px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}
.card h3 { margin: 0 0 8px; color: var(--ink); font-size: 19px; }
.card p { margin: 0; color: var(--muted); }
.card .icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  margin-bottom: 14px;
  font-weight: 900;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.metric {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.metric strong { display: block; color: var(--ink); font-size: 30px; line-height: 1.1; }
.metric span { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }

.page-hero {
  padding: 76px 0 44px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow { color: var(--brand); }
.page-hero h1 { color: var(--ink); max-width: 860px; }
.page-hero p { max-width: 820px; color: var(--muted); font-size: 18px; }
.breadcrumb {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumb a { color: var(--muted); }

.feature-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 42px;
  align-items: center;
}
.feature-media {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.feature-media img { width: 100%; height: 420px; object-fit: cover; }

.list-check {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.list-check li {
  position: relative;
  padding-left: 28px;
}
.list-check li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--green);
  font-weight: 900;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--ink); font-size: 13px; text-transform: uppercase; }
td { color: var(--text); }

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
}
.faq details + details { margin-top: 12px; }
.faq summary { color: var(--ink); font-weight: 800; cursor: pointer; }
.faq p { margin: 10px 0 0; color: var(--muted); }

.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field label { display: block; color: var(--ink); font-weight: 750; margin-bottom: 6px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
  padding: 12px 13px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--brand) 18%, transparent);
  border-color: var(--brand);
}

.site-footer {
  background: var(--navy);
  color: #d7e0ea;
  padding: 56px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 0.8fr;
  gap: 28px;
}
.footer-grid h2,
.footer-grid h3 { color: #fff; margin-top: 0; }
.footer-grid a { display: block; color: #d7e0ea; margin: 7px 0; }
.footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.14);
  color: #aab7c5;
  font-size: 13px;
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: var(--bg);
}
.portal-sidebar {
  background: var(--navy);
  color: #dbe7f2;
  padding: 24px 18px;
}
.portal-sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 7px;
  color: #dbe7f2;
  margin: 4px 0;
}
.portal-sidebar a[aria-current="page"],
.portal-sidebar a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.portal-main { padding: 28px; }
.portal-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--navy);
}
.login-panel {
  width: min(100%, 440px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.login-panel img { width: 52px; margin-bottom: 12px; }
.alert {
  padding: 12px 14px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}
.alert-danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); color: var(--danger); }

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
  }
  .site-nav {
    position: fixed;
    inset: 72px 16px auto 16px;
    display: none;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    justify-content: flex-start;
  }
  .site-nav.open { display: grid; grid-template-columns: 1fr; }
  .site-nav a { width: 100%; }
  .hero { min-height: 620px; }
  .hero h1, .page-hero h1 { font-size: 42px; }
  .hero-proof, .metric-row, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2, .feature-split, .footer-grid { grid-template-columns: 1fr; }
  .portal-shell { grid-template-columns: 1fr; }
  .portal-sidebar { position: static; }
}

@media (max-width: 620px) {
  .container { width: min(100% - 24px, var(--container)); }
  .header-inner { min-height: 64px; }
  .brand { min-width: 0; }
  .brand-name { font-size: 15px; }
  .brand-meta { display: none; }
  .hero { min-height: 560px; }
  .hero-content { padding: 58px 0 88px; }
  .hero h1, .page-hero h1 { font-size: 34px; }
  .hero p, .page-hero p { font-size: 16px; }
  .hero-proof, .metric-row, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 54px 0; }
  .section-head h2, .page-section h2 { font-size: 30px; }
  .form-row { grid-template-columns: 1fr; }
  .portal-main { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
