/* Cova Life website styles.
 *
 * Colours come from the app's palette (theme.config.js in the Cova app repo):
 * gold #C9A84C, Midnight Blue in dark mode, Star Dust with a Steel Teal header
 * in light mode. Every colour is a token below; the rules only use tokens.
 * Dark is the default, as in the app; assets/js/theme.js sets
 * <html data-theme="light"> when the visitor switches.
 */
:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --panel: #161b22;
  --panel-on-alt: #1c2128;
  --text: #e6edf3;
  --body: #c9d1d9;
  --muted: #7d8590;
  --line: #30363d;
  --accent: #c9a84c;
  --accent-hover: #e2c97a;
  --on-accent: #0d1117;
  --accent-text: #c9a84c;
  --accent-heading: #c9a84c;
  --accent-soft: rgba(201, 168, 76, 0.1);
  --accent-line: rgba(201, 168, 76, 0.35);
  --glow: rgba(201, 168, 76, 0.1);
  --ring-track: #30363d;
  --ghost-line: rgba(230, 237, 243, 0.35);
  --input-bg: #0d1117;
  --shadow: rgba(0, 0, 0, 0.3);
  --header-bg: #1c2128;
  --header-text: #e6edf3;
  --header-muted: rgba(230, 237, 243, 0.7);
  --header-line: rgba(230, 237, 243, 0.14);
  --max: 1180px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

:root[data-theme="light"] {
  --bg: #fffaf8;
  --bg-alt: #f9f3f1;
  --panel: #ffffff;
  --panel-on-alt: #ffffff;
  --text: #232323;
  --body: #4a5568;
  --muted: #757575;
  --line: #d6d3ba;
  --accent-hover: #a8882e;
  --on-accent: #232323;
  /* Gold is too faint on off-white for small text: links use Steel Teal and
     large headings the darker gold. */
  --accent-text: #285c70;
  --accent-heading: #a8882e;
  --accent-soft: rgba(201, 168, 76, 0.12);
  --accent-line: rgba(168, 136, 46, 0.4);
  --glow: rgba(201, 168, 76, 0.16);
  --ring-track: #eae8d8;
  --ghost-line: rgba(35, 35, 35, 0.3);
  --input-bg: #ffffff;
  --shadow: rgba(35, 35, 35, 0.08);
  --header-bg: #285c70;
  --header-text: #ffffff;
  --header-muted: rgba(255, 255, 255, 0.8);
  --header-line: rgba(255, 255, 255, 0.25);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; }
.container { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; }
.narrow { max-width: 800px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 20; background: var(--accent); color: var(--on-accent); border-radius: 8px; padding: 10px 14px; }
.skip-link:focus { top: 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--header-bg); border-bottom: 1px solid var(--header-line); }
.nav-wrap { height: 76px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; text-decoration: none; font-size: 1.05rem; }
.site-header .brand { color: var(--header-text); }
.brand-mark { width: 32px; height: 32px; border-radius: 22%; display: block; }
.nav-end { display: flex; align-items: center; gap: 28px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { color: var(--header-muted); font-size: 0.9rem; text-decoration: none; }
.site-nav a:hover, .site-nav a:focus { color: var(--header-text); }
.nav-toggle { display: none; background: transparent; color: var(--header-text); border: 1px solid var(--header-line); border-radius: 8px; padding: 8px 10px; font: inherit; }

/* Dark / light switch. theme.js fills the button; without JavaScript it stays empty and hidden. */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--header-line); border-radius: 999px; background: transparent; color: var(--header-text); font: inherit; cursor: pointer; }
.theme-toggle:hover, .theme-toggle:focus-visible { border-color: var(--accent); }
.theme-toggle:empty { display: none; }
.theme-toggle svg { width: 18px; height: 18px; flex: none; }
.theme-toggle .when-dark, .theme-toggle .when-light { display: inline-flex; align-items: center; gap: 12px; }
:root:not([data-theme="light"]) .theme-toggle .when-light, :root[data-theme="light"] .theme-toggle .when-dark { display: none; }

/* Hero */
.hero, .page-hero { background: radial-gradient(circle at 50% 0, var(--glow), transparent 48%); }
.hero { padding: 88px 0 76px; text-align: center; }
.hero-content { max-width: 800px; }
.eyebrow { margin: 0 0 13px; color: var(--accent-text); font-weight: 800; text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.67rem; }
.hero .eyebrow { display: inline-block; padding: 7px 12px; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); letter-spacing: 0.06em; text-transform: none; }
.hero h1, .page-hero h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 5.2rem); line-height: 1.02; letter-spacing: -0.058em; }
.hero h1 span, h1 span, h2 span { color: var(--accent-heading); }
.lead { max-width: 690px; margin: 25px auto; color: var(--muted); font-size: 1.07rem; }
.button-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 30px 0 40px; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 45px; padding: 10px 20px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent) !important; font-weight: 800; font-size: 0.9rem; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--accent-hover); }
.button-small { min-height: 36px; padding: 7px 15px; font-size: 0.82rem; }
.button-ghost { background: transparent; border: 1px solid var(--ghost-line); color: var(--text) !important; }
.button-ghost:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Life Score */
.score-card { width: min(100%, 330px); margin: 0 auto; padding: 24px; border: 1px solid var(--line); background: var(--panel); border-radius: 20px; box-shadow: 0 20px 60px var(--shadow); }
.score-label { text-transform: uppercase; letter-spacing: 0.22em; color: var(--muted); font-size: 0.58rem; font-weight: 800; margin: 0 0 16px; }
.score-ring { width: 140px; height: 140px; margin: 0 auto 19px; border-radius: 50%; display: grid; place-content: center; background: conic-gradient(var(--accent) 0 78%, var(--ring-track) 78%); position: relative; }
.score-ring:before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--panel); }
.score-ring span { position: relative; z-index: 1; font-size: 2.2rem; font-weight: 800; color: var(--accent-heading); }
.pillar-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.pillar-scores span { display: grid; gap: 3px; font-size: 0.52rem; color: var(--muted); }
.pillar-scores b { font-size: 0.76rem; color: var(--accent-heading); }

/* Sections */
.section { padding: 105px 0; }
/* In-page links (#/pricing, #/support#contact) stop below the sticky header. */
#features, #pricing, #contact { scroll-margin-top: 92px; }
.section-alt { background: var(--bg-alt); }
.section-alt .feature-card, .section-alt .post-card, .section-alt .score-explainer { background: var(--panel-on-alt); }
h2 { font-size: clamp(2rem, 4.4vw, 3.5rem); line-height: 1.08; letter-spacing: -0.045em; margin: 0 0 16px; }
.section-intro { margin: 0 0 42px; color: var(--muted); max-width: 635px; }
.feature-grid, .pricing-grid, .post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card, .post-card, .help-card { border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 24px; }
.feature-icon { font-size: 1.5rem; }
.feature-card h3, .post-card h3, .plan-card h3, .help-card h2 { margin: 17px 0 8px; font-size: 1.1rem; color: var(--text); }
.feature-card p, .post-card p, .help-card p { color: var(--muted); font-size: 0.9rem; margin: 0; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.score-explainer { display: grid; grid-template-columns: 1fr 180px; gap: 25px; align-items: center; padding: 27px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.score-row-list { display: grid; gap: 14px; }
.score-row-list div { display: flex; justify-content: space-between; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 9px; font-size: 0.9rem; }
.score-row-list b { color: var(--text); }
.large-score { width: 170px; height: 170px; border: 12px solid var(--accent); border-radius: 50%; display: grid; place-content: center; text-align: center; }
.large-score span { font-size: 2.8rem; font-weight: 800; color: var(--accent-heading); }
.large-score small { font-size: 0.55rem; color: var(--muted); max-width: 96px; }

/* Pricing */
.plan-card { position: relative; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 28px; }
.plan-card.featured { border-color: var(--accent); box-shadow: 0 14px 42px var(--shadow); }
.plan-badge { position: absolute; top: -13px; left: 20px; padding: 5px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.68rem; font-weight: 800; }
.price { margin: 20px 0 0; font-size: 2.6rem; font-weight: 800; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.plan-caption { margin: 0; color: var(--muted); font-size: 0.85rem; }
.plan-card ul { padding: 0; list-style: none; margin: 24px 0; min-height: 175px; }
.plan-card li { margin: 10px 0; color: var(--muted); font-size: 0.88rem; }
.plan-card li::first-letter { color: var(--accent-text); }
.fine-print { color: var(--muted); font-size: 0.78rem; text-align: center; margin: 25px 0 0; }

/* Blog */
.section-heading-row { display: flex; align-items: end; justify-content: space-between; margin-bottom: 40px; }
.section-heading-row h2 { margin: 0; }
.text-link, .back-link { color: var(--accent-text); font-weight: 700; text-decoration: none; }
.post-card { display: block; text-decoration: none; transition: transform 0.2s, border-color 0.2s; }
.post-card:hover { transform: translateY(-4px); border-color: var(--accent-line); }
.post-category { display: block; color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.65rem; font-weight: 800; margin: 0 0 11px; }
.post-meta, .article-meta { display: block; color: var(--muted); font-size: 0.76rem; margin-top: 18px; }
.cta { padding: 105px 0; background: radial-gradient(circle at 45% 0, var(--glow), transparent 52%), var(--bg); }
.cta .container { max-width: 900px; text-align: center; }
.cta .section-intro { margin-inline: auto; }

/* Pages and articles */
.page-hero { min-height: 70vh; padding: 100px 0; }
.page-hero h1 { font-size: clamp(2.7rem, 5vw, 4.4rem); }
.page-hero .post-grid { margin-top: 52px; }
.article-page { padding: 80px 0 105px; }
.article-container { width: min(calc(100% - 40px), 760px); margin: 0 auto; }
.article-container h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); letter-spacing: -0.055em; line-height: 1.05; margin: 18px 0; }
.article-body { margin-top: 44px; }
.article-body p { color: var(--body); font-size: 1.04rem; line-height: 1.85; margin: 0 0 22px; }
.article-body ul { color: var(--body); font-size: 1rem; line-height: 1.75; margin: 0 0 22px; padding-left: 1.3em; }
.article-body li { margin: 0 0 8px; }
.article-body li::marker { color: var(--accent-heading); }
.article-body a { color: var(--accent-text); }
.article-body h2 { font-size: 1.4rem; margin: 42px 0 10px; }
.article-cta, .contact-card { margin-top: 48px; padding: 30px; border: 1px solid var(--accent-line); border-radius: 16px; background: var(--accent-soft); }
.article-cta h2, .contact-card h2 { font-size: 1.5rem; }
.article-cta p, .contact-card p { color: var(--muted); }
.contact-card p a { color: var(--accent-text); }
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 44px 0; }
.contact-card form { display: grid; gap: 15px; margin-top: 25px; }
.contact-card label { display: grid; gap: 7px; color: var(--muted); font-size: 0.85rem; }
.contact-card input, .contact-card textarea { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--input-bg); color: var(--text); font: inherit; }
.contact-card textarea { resize: vertical; }
.contact-card form .button { justify-self: start; }
.legal .article-body section { margin-bottom: 35px; }
.legal .article-body h2 { font-size: 1.45rem; }
.legal .article-body p { font-size: 1rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 60px 0 25px; background: var(--bg-alt); }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 38px; }
.footer-grid p { color: var(--muted); max-width: 300px; font-size: 0.85rem; margin: 16px 0; }
.footer-grid h3 { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 3px 0 15px; }
.footer-grid a:not(.button):not(.brand) { display: block; color: var(--muted); text-decoration: none; font-size: 0.85rem; margin: 7px 0; }
.footer-grid a:not(.button):not(.brand):hover { color: var(--accent-text); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 45px; padding-top: 20px; display: flex; justify-content: space-between; color: var(--muted); font-size: 0.73rem; }

@media (max-width: 800px) {
  .site-header { position: relative; }
  #features, #pricing, #contact { scroll-margin-top: 16px; }
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 76px; left: 0; right: 0; background: var(--header-bg); border-bottom: 1px solid var(--header-line); padding: 18px 20px; flex-direction: column; align-items: stretch; gap: 12px; }
  .site-nav.is-open { display: flex; }
  .site-nav .button { text-align: center; }
  /* In the phone menu the switch is a labelled row, not an icon. */
  .site-nav .theme-toggle { width: auto; height: auto; justify-content: flex-start; padding: 10px 0 2px; border: 0; border-top: 1px solid var(--header-line); border-radius: 0; color: var(--header-muted); font-size: 0.9rem; }
  .site-nav .theme-toggle .sr-only { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .hero { padding: 70px 0 60px; }
  .section, .cta { padding: 72px 0; }
  .feature-grid, .pricing-grid, .post-grid, .help-grid, .two-column, .footer-grid { grid-template-columns: 1fr; }
  .score-explainer { grid-template-columns: 1fr; }
  .large-score { margin: auto; }
  .section-heading-row { align-items: start; gap: 20px; flex-direction: column; }
  .page-hero { padding: 70px 0; min-height: 65vh; }
  .footer-bottom { gap: 12px; flex-direction: column; }
  .article-page { padding: 56px 0 76px; }
}
