/* Cyopsys portal — dark brand theme.
 * Brand DNA from the original Salient build: accent #3452ff, gradient
 * #062d62→#107fa8, dark surfaces #1f1f1f/#313233. On dark backgrounds the
 * raw accent fails AAA for text, so text roles use lightened tints; the
 * raw accent carries buttons with large bold text only.
 * Contrast pairs verified ≥7:1 (WCAG 2.1 AAA) by tests/test_cyportal.py.
 */
:root {
  --bg: #0b1220;
  --bg-soft: #131c30;
  --bg-card: #182441;
  --line: #2b3a5c;
  --fg: #f2f5fb;
  --muted: #b9c4dc;
  --accent: #3452ff;
  --accent-ink: #ffffff;
  --accent-text: #9db9ff;
  --cyan-text: #7fd4ea;
  --chip-bg: #1a2745;
  --chip-fg: #cbd7ef;
  --footer-bg: #0e1526;
  --footer-fg: #c3cde3;
  --footer-muted: #97a5c4;
  --focus: #a8c2ff;
  --radius: 14px;
  --maxw: 68rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

a { color: var(--accent-text); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--bg-card);
  color: var(--fg);
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 18, 32, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}
.brand-mark { width: 2rem; height: 2rem; }
.brand-name { letter-spacing: 0.02em; }

.nav-toggle {
  display: none;
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 0.3rem 0.1rem;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a[aria-current="true"] { color: var(--accent-text); }

.nav-cta {
  background: var(--accent);
  color: var(--accent-ink) !important;
  padding: 0.5rem 1.05rem !important;
  border-radius: 999px;
  font-size: 1.1875rem;
  line-height: 1.2;
  font-weight: 700;
}

/* Sections */
main { display: block; }
main[aria-busy="true"]::after {
  content: "Loading…";
  display: block;
  padding: 4rem 1.25rem;
  text-align: center;
  color: var(--muted);
}

section { padding: 4.5rem 1.25rem; }

.section-head,
.hero-inner,
.value-grid,
.cta-inner,
.noscript {
  max-width: var(--maxw);
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 0.7rem;
}

.section-sub {
  color: var(--muted);
  max-width: 46rem;
  margin: 0;
  font-size: 1.08rem;
}

/* Hero */
.hero {
  padding-top: 5.5rem;
  padding-bottom: 4.5rem;
  background:
    radial-gradient(52rem 26rem at 82% -6%, rgba(52, 82, 255, 0.22), transparent 62%),
    radial-gradient(40rem 22rem at 8% 4%, rgba(16, 127, 168, 0.2), transparent 60%);
}

.eyebrow {
  color: var(--cyan-text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  margin: 0 0 0.8rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 1rem;
  max-width: 56rem;
  background: linear-gradient(100deg, var(--accent-text), var(--cyan-text));
  -webkit-background-clip: text;
  background-clip: text;
  color: #b9cdf7;
  -webkit-text-fill-color: #b9cdf7;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 44rem;
  margin: 0 0 1.6rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0 0 1.9rem;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.2;
  border-radius: 999px;
  padding: 0.8rem 1.6rem;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.1875rem;
}
.btn-primary:hover { background: #2b46e0; }

.btn-ghost {
  background: transparent;
  color: var(--accent-text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent-text); }

.btn-invert {
  background: var(--fg);
  color: #0d1526;
  font-size: 1.1875rem;
}
.btn-invert:hover { background: #ffffff; }

.btn-block { display: block; text-align: center; }

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  max-width: 56rem;
}

.chip {
  background: var(--chip-bg);
  color: var(--chip-fg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
}

/* Value */
.value { border-top: 1px solid var(--line); }

.value-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}

.value-body { color: var(--muted); font-size: 1.08rem; margin: 0; }

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.check-item { display: flex; gap: 0.6rem; align-items: baseline; font-weight: 600; }

.check-mark { color: var(--cyan-text); font-weight: 700; }

/* Features */
.features { background: var(--bg-soft); border-block: 1px solid var(--line); }

.cards {
  max-width: var(--maxw);
  margin: 2.4rem auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card-icon {
  display: inline-flex;
  width: 2.8rem;
  height: 2.8rem;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(52, 82, 255, 0.18);
  color: var(--accent-text);
  margin-bottom: 0.9rem;
}
.card-icon svg { width: 1.6rem; height: 1.6rem; }

.card-title { margin: 0 0 0.45rem; font-size: 1.18rem; }
.card-body { margin: 0; color: var(--muted); }

/* Pricing */
.tiers {
  max-width: var(--maxw);
  margin: 2.4rem auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
  align-items: stretch;
}

.tier {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.7rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.tier-featured {
  border: 2px solid var(--accent);
  box-shadow: 0 12px 40px rgba(52, 82, 255, 0.22);
}

.tier-badge {
  position: absolute;
  top: -0.85rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.1875rem;
  line-height: 1;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
}

.tier-name { margin: 0.2rem 0 0.4rem; font-size: 1.3rem; }

.tier-price {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  margin: 0 0 0.3rem;
  color: var(--accent-text);
  background: linear-gradient(100deg, var(--accent-text), var(--cyan-text));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: #a9cdf3;
}

.tier-per { font-size: 1.05rem; font-weight: 600; color: var(--muted); }

.tier-tagline {
  color: var(--muted);
  margin: 0 0 1.1rem;
  font-weight: 600;
  min-height: 2.6em;
}

.tier-features {
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  flex: 1;
  align-content: start;
}

.tier-feature {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  color: var(--chip-fg);
}

.tier .btn { margin-top: auto; }

.pricing-note {
  max-width: var(--maxw);
  margin: 1.4rem auto 0;
  color: var(--muted);
  text-align: center;
}

/* CTA band */
.cta-band {
  background:
    radial-gradient(40rem 20rem at 18% 10%, rgba(52, 82, 255, 0.28), transparent 60%),
    radial-gradient(34rem 18rem at 85% 90%, rgba(16, 127, 168, 0.26), transparent 62%);
  text-align: center;
}

.cta-body {
  color: var(--muted);
  max-width: 42rem;
  margin: 0 auto 1.6rem;
}

/* FAQ */
.faq { background: var(--bg-soft); border-top: 1px solid var(--line); }

.faq-list {
  max-width: 46rem;
  margin: 1.8rem auto 0;
  display: grid;
  gap: 0.8rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.2rem 1.1rem;
}

.faq-q {
  padding: 0.85rem 0;
  font-weight: 700;
  cursor: pointer;
}

.faq-a { color: var(--muted); margin: 0 0 1rem; }

/* Footer */
.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--line);
  padding: 3rem 1.25rem 2rem;
  color: var(--footer-fg);
}

.footer-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 0.85fr);
  gap: 2.2rem;
}

.footer-brand { font-size: 1.2rem; font-weight: 800; margin: 0 0 0.2rem; }
.footer-tagline {
  color: var(--footer-muted);
  margin: 0 0 0.9rem;
  font-weight: 600;
}
.footer-about-body {
  color: var(--footer-fg);
  margin: 0;
  max-width: 26rem;
}

.footer-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--footer-muted);
  margin: 0 0 0.8rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-link { color: var(--footer-fg); text-decoration: none; }
.footer-link:hover { color: #ffffff; text-decoration: underline; }

.footer-legal {
  max-width: var(--maxw);
  margin: 2.2rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--footer-muted);
  font-size: 0.92rem;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* Error + noscript */
.error {
  max-width: var(--maxw);
  margin: 3rem auto;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.noscript { padding-block: 4rem; }

/* Responsive */
@media (max-width: 60rem) {
  .cards, .tiers { grid-template-columns: 1fr; max-width: 34rem; }
  .value-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .nav-toggle { display: inline-block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    padding: 0.8rem 1.25rem 1.1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 0.55rem 0.2rem; }
  .nav-cta { display: inline-block; text-align: center; margin-top: 0.4rem; }
}

@media (max-width: 34rem) {
  section { padding-inline: 1.1rem; }
  .footer-grid { grid-template-columns: 1fr; }
}
