@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,600;1,9..144,300&family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Skip to content ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--primary, #E63946);
  color: #fff;
  border-radius: 0 0 var(--radius, 10px) var(--radius, 10px);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: top .1s;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid #fff;
  outline-offset: -4px;
}

/* ── Focus styles — keyboard navigation ── */
:focus-visible {
  outline: 2px solid var(--primary, #E63946);
  outline-offset: 2px;
}
.btn--primary:focus-visible,
.btn--accent:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--primary);
}

/* ═══════════════════════════════════════════════════
   DARK PREMIUM — RED ACCENT (default)
═══════════════════════════════════════════════════ */
:root {
  --bg:           #0C0C10;
  --surface:      #131318;
  --surface-alt:  #1A1A22;
  --surface-3:    #22222C;
  --primary:      #E63946;
  --primary-light:#F04450;
  --accent:       #E63946;
  --text:         #F0F0F4;
  --text-muted:   rgba(240,240,244,.55);
  --border:       rgba(255,255,255,.08);
  --border-2:     rgba(255,255,255,.14);
  --success:      #22C55E;
  --success-bg:   rgba(34,197,94,.1);
  --warning:      #F59E0B;
  --warning-bg:   rgba(245,158,11,.12);
  --danger:       #E63946;
  --danger-bg:    rgba(230,57,70,.12);
  --info-bg:      rgba(230,57,70,.08);
  --red-dim:      rgba(230,57,70,.1);
  --radius:       10px;
  --radius-lg:    16px;
  --shadow:       0 2px 14px rgba(0,0,0,.35);
  --shadow-lg:    0 8px 40px rgba(0,0,0,.55);
  --font:         'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-serif:   'Fraunces', Georgia, "Times New Roman", serif;
  --max-w:        1080px;
}

/* Light theme overrides */
:root[data-theme="light"] {
  --bg:           #F4F5F7;
  --surface:      #FFFFFF;
  --surface-alt:  #F0F1F4;
  --surface-3:    #E6E8EC;
  --primary:      #D42F3B;
  --primary-light:#E63946;
  --accent:       #D42F3B;
  --text:         #0F1117;
  --text-muted:   rgba(15,17,23,.55);
  --border:       rgba(0,0,0,.08);
  --border-2:     rgba(0,0,0,.14);
  --success:      #16A34A;
  --success-bg:   rgba(22,163,74,.08);
  --warning:      #B45309;
  --warning-bg:   rgba(180,83,9,.08);
  --danger:       #D42F3B;
  --danger-bg:    rgba(212,47,59,.08);
  --info-bg:      rgba(212,47,59,.06);
  --red-dim:      rgba(212,47,59,.08);
  --shadow:       0 2px 10px rgba(0,0,0,.06);
  --shadow-lg:    0 8px 30px rgba(0,0,0,.10);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font); background: var(--bg);
  color: var(--text); line-height: 1.6; font-size: 16px;
}
a    { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.1rem; }
p  { color: var(--text-muted); }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section   { padding: 72px 0; }
.section--alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font); font-size: .95rem; font-weight: 600;
  padding: 12px 24px; border-radius: var(--radius); border: none;
  cursor: pointer; transition: all .2s; text-decoration: none; line-height: 1;
  white-space: nowrap;
}
.btn--primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 0 0 0 rgba(230,57,70,.3);
}
.btn--primary:hover {
  background: var(--primary-light); transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(230,57,70,.3);
}
.btn--accent  { background: var(--primary); color: #fff; }
.btn--accent:hover  { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(230,57,70,.25); }
.btn--outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-2);
}
.btn--outline:hover { background: var(--surface-alt); border-color: var(--border-2); }
.btn--lg { font-size: 1.05rem; padding: 15px 32px; border-radius: 12px; }
.btn--full { width: 100%; justify-content: center; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--success { background: var(--success); color: #fff; }

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(12,12,16,.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 0;
}
:root[data-theme="light"] .nav {
  background: rgba(244,245,247,.92);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.nav__logo {
  font-family: var(--font-serif); font-size: 1.3rem;
  color: var(--text); font-weight: 600; text-decoration: none; letter-spacing: -.01em;
}
.nav__logo span { color: var(--primary); }

/* Theme toggle (shared nav) */
.nav-theme-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border-2); background: transparent;
  cursor: pointer; color: var(--text-muted); transition: all .15s;
  flex-shrink: 0;
}
.nav-theme-btn:hover { background: var(--surface-alt); color: var(--text); }
.nav-theme-btn svg, .nav-theme-btn i { width: 16px; height: 16px; }

/* ── Hero (assessment, etc.) ── */
.hero { padding: 88px 0 72px; text-align: center; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary); background: var(--info-bg);
  border: 1px solid rgba(230,57,70,.2);
  padding: 6px 14px; border-radius: 100px; margin-bottom: 20px;
}
.hero h1 { max-width: 700px; margin: 0 auto 20px; }
.hero h1 em { font-style: italic; color: var(--primary); }
.hero__sub { font-size: 1.1rem; max-width: 560px; margin: 0 auto 36px; }
.hero__cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero__proof { margin-top: 40px; font-size: .82rem; color: var(--text-muted); }

/* ── Features grid ── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-top: 48px; }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.feature:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.feature__icon { font-size: 2rem; margin-bottom: 12px; color: var(--primary); }
.feature h3 { color: var(--text); margin-bottom: 6px; }

/* ── Section header ── */
.section-header { text-align: center; }
.section-header h2 { margin-bottom: 10px; }
.section-header p  { max-width: 520px; margin: 0 auto; }
.section-eyebrow {
  display: inline-block; font-size: .68rem; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 10px;
}

/* ── Disclaimer banner ── */
.disclaimer {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  font-size: .78rem; color: var(--text-muted); line-height: 1.5; margin-top: 24px;
}
.disclaimer strong { color: var(--text); }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border); padding: 26px 0;
  font-size: .8rem; color: var(--text-muted); background: var(--bg);
}
.footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer a { color: var(--text-muted); text-decoration: underline; }
.footer__disclaimer { max-width: 600px; font-size: .72rem; line-height: 1.5; }

/* Premium footer styles live in /footer.css — loaded separately so they work
   on pages that don't link styles.css (privacy, terms, 404, index's inline-CSS). */

/* ══ ASSESSMENT WIZARD ══ */
.wizard-page { min-height: 100vh; display: flex; flex-direction: column; }
.wizard-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; }

.progress-bar { background: var(--border); height: 4px; border-radius: 99px; margin-bottom: 36px; }
.progress-bar__fill { background: var(--primary); height: 100%; border-radius: 99px; transition: width .4s ease; }

.wizard-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 44px; box-shadow: var(--shadow);
  max-width: 620px; margin: 0 auto; width: 100%;
}
.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-step__eyebrow {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--primary); margin-bottom: 8px;
}
.wizard-step h2 { font-size: 1.4rem; margin-bottom: 6px; }
.wizard-step .lead { font-size: .92rem; margin-bottom: 28px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.field select, .field input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: .92rem; font-family: var(--font);
  background: var(--surface-alt); color: var(--text); outline: none; transition: border .15s;
}
.field select:focus, .field input:focus { border-color: var(--primary); background: var(--surface-3, var(--surface-alt)); box-shadow: 0 0 0 3px rgba(230,57,70,.15); outline: none; }
.field select option { background: var(--surface); }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}

/* Radio-style options */
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all .15s; font-size: .9rem; color: var(--text);
  background: var(--surface);
}
.radio-opt:hover { border-color: var(--primary-light); background: var(--surface-alt); }
.radio-opt.selected { border-color: var(--primary); background: var(--info-bg); font-weight: 600; }
.radio-opt:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.radio-opt__dot {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border);
  flex-shrink: 0; position: relative;
}
.radio-opt.selected .radio-opt__dot { border-color: var(--primary); }
.radio-opt.selected .radio-opt__dot::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
}

.wizard-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.wizard-nav__back { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: .85rem; font-family: var(--font); }
.wizard-nav__back:hover { color: var(--text); }

.error-msg { color: var(--danger); font-size: .82rem; margin-top: 8px; padding: 10px 14px; background: var(--danger-bg); border-radius: var(--radius); }

/* ── Loading / spinner ── */
.spinner { text-align: center; padding: 60px 20px; }
.spinner__ring {
  width: 44px; height: 44px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══ SCORE REVEAL ══ */
.score-page { min-height: 100vh; }
.score-wrap { max-width: 640px; margin: 0 auto; padding: 60px 24px; text-align: center; }

.score-circle { position: relative; width: 200px; height: 200px; margin: 0 auto 28px; }
.score-circle svg { transform: rotate(-90deg); }
.score-circle__track { fill: none; stroke: var(--border); stroke-width: 10; }
.score-circle__fill  { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.5s ease; }
.score-circle__label {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-serif); font-size: 3rem; font-weight: bold; color: var(--text);
}
.score-circle__sub { font-size: .8rem; color: var(--text-muted); margin-top: -8px; }

.score-color-red    { stroke: var(--danger); }
.score-color-orange { stroke: var(--warning); }
.score-color-yellow { stroke: #D4A900; }
.score-color-green  { stroke: var(--success); }

/* Top gaps preview */
.gap-preview { text-align: left; margin: 28px 0; }
.gap-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius); margin-bottom: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.gap-item--critical { background: var(--danger-bg); border-color: rgba(230,57,70,.2); }
.gap-item--high     { background: var(--warning-bg); border-color: rgba(245,158,11,.2); }
.gap-item--medium   { background: var(--surface-alt); }
.gap-item--low      { background: var(--surface); }
.gap-item__sev {
  font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em;
  padding: 2px 8px; border-radius: 4px; flex-shrink: 0; margin-top: 2px;
}
.gap-item__sev--critical { background: var(--danger); color: #fff; }
.gap-item__sev--high     { background: var(--warning); color: #fff; }
.gap-item__sev--medium   { background: var(--primary-light); color: #fff; }
.gap-item__sev--low      { background: var(--text-muted); color: #fff; }
.gap-item__text { font-size: .9rem; color: var(--text); font-weight: 500; }

.blur-overlay { position: relative; overflow: hidden; max-height: 200px; }
.blur-overlay::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 120px;
  background: linear-gradient(transparent, var(--bg));
}

.upgrade-card {
  background: var(--surface); border: 2px solid var(--primary);
  border-radius: var(--radius-lg); padding: 32px; margin-top: 28px; box-shadow: var(--shadow-lg);
}
.upgrade-card h3 { color: var(--primary); margin-bottom: 8px; }
.upgrade-card__price { font-family: var(--font-serif); font-size: 2.5rem; color: var(--primary); font-weight: bold; margin: 12px 0 4px; }
.upgrade-card__sub { font-size: .82rem; color: var(--text-muted); margin-bottom: 20px; }

/* ══ DASHBOARD (legacy) ══ */
.dash-page { min-height: 100vh; }
.dash-wrap { max-width: 860px; margin: 0 auto; padding: 40px 24px; }
.dash-header { display: flex; align-items: center; gap: 32px; margin-bottom: 36px; flex-wrap: wrap; }
.dash-score { flex-shrink: 0; }
.dash-score .score-circle { width: 130px; height: 130px; margin: 0; }
.dash-score .score-circle__label { font-size: 2rem; }
.dash-meta h1 { font-size: 1.6rem; margin-bottom: 4px; }
.dash-progress { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 24px; }
.dash-progress__bar { background: var(--border); height: 8px; border-radius: 99px; margin-top: 10px; }
.dash-progress__fill { height: 100%; border-radius: 99px; transition: width .5s; }
.dash-progress__fill--low { background: var(--danger); }
.dash-progress__fill--mid { background: var(--warning); }
.dash-progress__fill--good { background: #D4A900; }
.dash-progress__fill--great { background: var(--success); }

.checklist { display: flex; flex-direction: column; gap: 10px; }
.checklist-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: all .2s; cursor: pointer;
}
.checklist-item:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.checklist-item--done { opacity: .6; }
.checklist-item--done .checklist-item__label { text-decoration: line-through; }
.checklist-item__check {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border);
  flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.checklist-item--done .checklist-item__check { background: var(--success); border-color: var(--success); color: #fff; font-size: .75rem; }
.checklist-item__body { flex: 1; min-width: 0; }
.checklist-item__label { font-weight: 600; font-size: .95rem; color: var(--text); margin-bottom: 3px; }
.checklist-item__desc  { font-size: .82rem; color: var(--text-muted); line-height: 1.4; }
.checklist-item__meta  { display: flex; gap: 16px; margin-top: 6px; font-size: .75rem; color: var(--text-muted); }
.checklist-item__sev {
  font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  padding: 2px 7px; border-radius: 4px; flex-shrink: 0; margin-top: 3px;
}
.sev--critical { background: var(--danger); color: #fff; }
.sev--high     { background: var(--warning); color: #fff; }
.sev--medium   { background: var(--primary-light); color: #fff; }
.sev--low      { background: var(--text-muted); color: #fff; }
.checklist-item__guide { margin-top: 2px; }
.checklist-item__guide .btn { font-size: .8rem; padding: 6px 14px; }

/* ── Guide panel ── */
.guide-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; margin-top: 28px;
  box-shadow: var(--shadow-lg);
}
.guide-panel h2 { font-size: 1.3rem; margin-bottom: 16px; }
.guide-panel__content { font-size: .92rem; line-height: 1.8; white-space: pre-wrap; color: var(--text); }
.guide-panel__close { margin-top: 20px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  /* Minimum 44px touch targets on mobile */
  .btn { min-height: 44px; }
  .nav-theme-btn { width: 40px; height: 40px; }
  .radio-opt { min-height: 44px; }
}

@media (max-width: 600px) {
  .wizard-card { padding: 24px 18px; }
  .dash-header { flex-direction: column; text-align: center; }
  .dash-score .score-circle { margin: 0 auto; }
  .checklist-item { padding: 14px; }
  .upgrade-card { padding: 24px 18px; }

  /* Score circle — 200px is too large for small phones */
  .score-wrap .score-circle { width: 160px; height: 160px; }
  .score-wrap .score-circle svg { width: 160px; height: 160px; }
  .score-wrap .score-circle__label { font-size: 2.2rem; }

  /* Reduce hero/section vertical padding */
  .hero { padding: 56px 0 40px; }
  .section { padding: 56px 0; }

  /* Features grid single column */
  .features { grid-template-columns: 1fr; }

  /* Wizard nav — wrap buttons on narrow screens */
  .wizard-nav { flex-wrap: wrap; gap: 12px; }

  /* Footer stacks vertically */
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 375px) {
  /* Tighter container padding for very small phones */
  .container { padding: 0 16px; }

  /* Slightly smaller large buttons */
  .btn--lg { padding: 13px 20px; }
}

/* ══ ENTRANCE ANIMATIONS ══
   Only active when IntersectionObserver initializes .js-animate on <html>.
   Gracefully degrades: without JS everything stays fully visible.
   ═══════════════════════════════════════════════════════════════════ */

/* Single element fade-up */
.js-animate [data-animate] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s cubic-bezier(.4,0,.2,1),
              transform 0.55s cubic-bezier(.4,0,.2,1);
}
.js-animate [data-animate="fade"] { transform: none; }
.js-animate [data-animate].is-visible {
  opacity: 1;
  transform: none;
}

/* Staggered children — add data-stagger to a grid/list parent */
.js-animate [data-stagger] > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s cubic-bezier(.4,0,.2,1),
              transform 0.5s cubic-bezier(.4,0,.2,1);
}
.js-animate [data-stagger].is-visible > *              { opacity: 1; transform: none; }
.js-animate [data-stagger].is-visible > *:nth-child(2) { transition-delay: .08s; }
.js-animate [data-stagger].is-visible > *:nth-child(3) { transition-delay: .16s; }
.js-animate [data-stagger].is-visible > *:nth-child(4) { transition-delay: .24s; }
.js-animate [data-stagger].is-visible > *:nth-child(5) { transition-delay: .32s; }
.js-animate [data-stagger].is-visible > *:nth-child(6) { transition-delay: .40s; }
.js-animate [data-stagger].is-visible > *:nth-child(7) { transition-delay: .48s; }
.js-animate [data-stagger].is-visible > *:nth-child(8) { transition-delay: .56s; }

/* Honour reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .js-animate [data-animate],
  .js-animate [data-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
