/* ============================================================================
   Synthos Research — brand + accessibility override layer (loaded AFTER Casper's
   screen.css). Keeps Casper's proven rendering; restyles it to a WCAG-AAA dark
   high-contrast surface for low-vision readers (retinitis pigmentosa). No
   color-only encoding; >=7:1 body contrast; large resizable type.
   ========================================================================== */

:root {
    /* Synthos palette */
    --syn-bg:        #0e141d;   /* deep slate, NOT pitch black */
    --syn-surface:   #161e2a;   /* raised cards / header */
    --syn-ink:       #f5f8fd;   /* near-white body text (AAA on bg) */
    --syn-muted:     #aebfd4;   /* secondary text, still >=4.5:1 */
    --syn-grid:      #243244;   /* hairlines / borders */
    --syn-accent:    #6fd6ff;   /* cyan — links, focus, buttons */
    --syn-accent-2:  #8affc1;   /* green — secondary brand */

    /* Override Ghost + Casper hooks */
    --ghost-accent-color: #6fd6ff;
    --color-darkmode: #0e141d;
    --background-color: #0e141d;
}

/* Force the dark surface everywhere (we hard-set html.dark-mode in default.hbs) */
html.dark-mode,
html.dark-mode body {
    color: var(--syn-ink) !important;
    background: var(--syn-bg) !important;
}

html.dark-mode img { opacity: 1; }            /* don't dim our charts */

/* Body type: larger + airier for low vision */
body {
    font-size: 1.9rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Headings — full-strength ink, bold */
html.dark-mode h1, html.dark-mode h2, html.dark-mode h3,
html.dark-mode h4, html.dark-mode h5, html.dark-mode h6,
.gh-article-title, .post-card-title {
    color: var(--syn-ink) !important;
    letter-spacing: -0.012em;
}

/* Article body — the part that must read perfectly */
html.dark-mode .gh-content,
html.dark-mode .gh-content p,
html.dark-mode .gh-content li {
    color: var(--syn-ink) !important;
}
.gh-content { font-size: 1.95rem; line-height: 1.75; }
.gh-content > p,
.gh-content > ul,
.gh-content > ol,
.gh-content > blockquote { margin-bottom: 1.5em; }

/* Links: cyan, underlined (never color-only) */
html.dark-mode a,
html.dark-mode .gh-content a {
    color: var(--syn-accent) !important;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}
html.dark-mode a:hover { color: var(--syn-accent-2) !important; }

/* Secondary / meta text */
html.dark-mode .gh-article-meta,
html.dark-mode .post-card-meta,
html.dark-mode .gh-author-meta,
html.dark-mode .byline-meta {
    color: var(--syn-muted) !important;
}

/* Header / nav */
html.dark-mode .gh-head { background: var(--syn-bg); border-bottom: 1px solid var(--syn-grid); }
html.dark-mode .gh-head-link { color: var(--syn-ink) !important; }
html.dark-mode .gh-head-button {
    background: var(--syn-accent) !important;
    color: #06121b !important;
    font-weight: 700;
    border-radius: 6px;
}

/* Tables (deep-dive valuation grids) */
html.dark-mode .gh-content table { border-color: var(--syn-grid); }
html.dark-mode .gh-content th,
html.dark-mode .gh-content td {
    border-color: var(--syn-grid) !important;
    color: var(--syn-ink) !important;
}
html.dark-mode .gh-content thead th { background: var(--syn-surface); }

/* Blockquotes / code */
html.dark-mode .gh-content blockquote {
    border-left: 3px solid var(--syn-accent);
    color: var(--syn-muted) !important;
}
html.dark-mode .gh-content :not(pre) > code {
    background: var(--syn-surface);
    color: var(--syn-accent-2);
    padding: 0.1em 0.4em;
    border-radius: 4px;
}
html.dark-mode .gh-content pre { background: #0a0f16; border: 1px solid var(--syn-grid); }

/* Cards on index */
html.dark-mode .post-card { border-bottom: 1px solid var(--syn-grid); }
html.dark-mode .post-card-excerpt { color: var(--syn-muted) !important; }

/* Footer */
html.dark-mode .site-footer { background: var(--syn-bg); border-top: 1px solid var(--syn-grid); color: var(--syn-muted); }

/* Visible keyboard focus everywhere (a11y) */
html.dark-mode a:focus-visible,
html.dark-mode button:focus-visible,
html.dark-mode input:focus-visible {
    outline: 3px solid var(--syn-accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Respect users who crank contrast even higher */
@media (prefers-contrast: more) {
    html.dark-mode body, html.dark-mode .gh-content p, html.dark-mode .gh-content li { color: #ffffff !important; }
    html.dark-mode a { color: #9fe4ff !important; }
}

/* ---- Brand wordmark + animated golden-ratio mark in the header ------------ */
.syn-brand { display: inline-flex; align-items: center; gap: 0.5em; text-decoration: none !important; }
.syn-brand .brand-mark { flex: 0 0 auto; }
.syn-brand-text { font-weight: 800; font-size: 1.7rem; color: var(--syn-ink); letter-spacing: -0.01em; }
.syn-brand-text .ax { color: var(--syn-accent); }
.syn-brand-sub { color: var(--syn-muted); font-weight: 600; }

.bm-pts { transform-box: view-box; transform-origin: 32px 32px;
    animation: bmConverge 5s cubic-bezier(.55,.05,.35,1) infinite; }
@keyframes bmConverge {
    0% { transform: rotate(0) scale(1); opacity: 0; }
    12% { opacity: 1; }
    68% { transform: rotate(320deg) scale(.12); opacity: 1; }
    82% { opacity: 0; }
    100% { transform: rotate(360deg) scale(.12); opacity: 0; }
}
.bm-core { transform-box: view-box; transform-origin: 32px 32px;
    animation: bmCore 5s cubic-bezier(.55,.05,.35,1) infinite; }
@keyframes bmCore {
    0%,52% { transform: scale(.35); opacity: .2; }
    72% { transform: scale(1.45); opacity: 1; }
    100% { transform: scale(1); opacity: .92; }
}
@media (prefers-reduced-motion: reduce) {
    .bm-pts { animation: none; opacity: 1; transform: none; }
    .bm-core { animation: none; transform: scale(1.05); opacity: 1; }
}

/* ============================================================================
   Homepage components (hero / ticker / edge cards / pricing) — ported from the
   hand-built theme, remapped onto the Synthos palette vars.
   ========================================================================== */
:root { --maxw: 1200px; --warn: #f5b54b; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
html.dark-mode .wrap h1, html.dark-mode .wrap h2, html.dark-mode .wrap h3 { line-height: 1.15; }

/* Buttons */
.btn { display: inline-block; font-weight: 700; font-size: 1.05rem; padding: .75rem 1.3rem;
    border-radius: 10px; border: 1px solid var(--syn-grid); text-decoration: none !important; cursor: pointer; }
html.dark-mode .btn-primary { background: var(--syn-accent) !important; color: #04222e !important; border-color: var(--syn-accent); }
html.dark-mode .btn-primary:hover { color: #04222e !important; filter: brightness(1.06); }
html.dark-mode .btn-ghost { background: transparent; color: var(--syn-ink) !important; }
html.dark-mode .btn-ghost:hover { border-color: var(--syn-accent); }
.cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* Live ticker — auto-scrolling marquee (two copies in a track, translateX -50% loops) */
html.dark-mode .ticker { border-bottom: 1px solid var(--syn-grid); background: var(--syn-surface); overflow: hidden; }
.ticker:empty { display: none; }
.ticker-track { display: flex; width: max-content; animation: synTicker 70s linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
@keyframes synTicker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-inner { display: flex; gap: 1.8rem; align-items: center; padding: .6rem 1.25rem;
    white-space: nowrap; font-size: 1.5rem; }
html.dark-mode .tk { color: var(--syn-muted); }
html.dark-mode .tk b { color: var(--syn-ink); font-weight: 700; margin-right: .4rem; }
.tk-chg { font-weight: 700; }
html.dark-mode .tk.up .tk-chg, html.dark-mode .tk-chg.up { color: #7ce0a3; }
html.dark-mode .tk.down .tk-chg, html.dark-mode .tk-chg.down { color: #ff8a8a; }
html.dark-mode .tk-y b { color: var(--syn-accent); }
/* Accessibility: never auto-move for reduced-motion users — static + scrollable instead */
@media (prefers-reduced-motion: reduce) {
    html.dark-mode .ticker { overflow-x: auto; }
    .ticker-track { animation: none; width: auto; }
    .ticker-inner[aria-hidden="true"] { display: none; }
}

/* Hero */
.hero { padding: 4.5rem 1.25rem 3rem; max-width: var(--maxw); margin: 0 auto; }
html.dark-mode .eyebrow { color: var(--syn-accent-2); font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase; font-size: 1.3rem; margin: 0; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); margin: .5rem 0 1rem; font-weight: 800; }
.grad { background: linear-gradient(90deg, var(--syn-accent), var(--syn-accent-2));
    -webkit-background-clip: text; background-clip: text; color: transparent; }
html.dark-mode .lede { font-size: 2.1rem; color: var(--syn-muted); max-width: 52ch; line-height: 1.5; }
html.dark-mode .micro { color: var(--syn-muted); font-size: 1.5rem; margin-top: .7rem; }

/* Sections */
.section { padding: 3rem 1.25rem; border-top: 1px solid var(--syn-grid); max-width: var(--maxw); margin: 0 auto; }
.section h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 0 0 .3rem; }
html.dark-mode .sub2 { color: var(--syn-muted); max-width: 62ch; margin: 0 0 1.8rem; font-size: 1.7rem; }

/* Edge cards */
.grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
html.dark-mode .card { background: var(--syn-surface); border: 1px solid var(--syn-grid); border-radius: 14px; padding: 1.6rem; }
.card h3 { margin: .5rem 0 .5rem; font-size: 1.5rem; }
html.dark-mode .card p { color: var(--syn-muted); margin: 0; font-size: 1.55rem; line-height: 1.5; }
html.dark-mode .tag { display: inline-block; font-size: 1.15rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--syn-accent-2); border: 1px solid var(--syn-grid);
    border-radius: 999px; padding: .25rem .7rem; }

/* Pricing tiers */
.tiers { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.tiers-2 { max-width: 760px; margin-inline: auto; }
html.dark-mode .tier { background: var(--syn-surface); border: 1px solid var(--syn-grid); border-radius: 14px;
    padding: 1.8rem; display: flex; flex-direction: column; }
html.dark-mode .tier.feature { border-color: var(--syn-accent); box-shadow: 0 0 0 1px var(--syn-accent); }
.price { font-size: 2.6rem; font-weight: 800; margin: .3rem 0; }
html.dark-mode .price .per { font-size: 1.4rem; color: var(--syn-muted); font-weight: 600; }
html.dark-mode .tier ul { list-style: none; padding: 0; margin: 1rem 0 1.5rem; color: var(--syn-ink); font-size: 1.55rem; }
html.dark-mode .tier li { padding: .45rem 0; border-bottom: 1px dashed var(--syn-grid); }
html.dark-mode .tier li::before { content: "\2713\00a0\00a0"; color: var(--syn-accent-2); font-weight: 800; }
.tier .btn { margin-top: auto; text-align: center; }

/* Disclaimer note */
html.dark-mode .disc { background: var(--syn-surface); border: 1px solid var(--syn-grid);
    border-left: 4px solid var(--warn); border-radius: 10px; padding: 1.1rem 1.3rem;
    color: var(--syn-muted); font-size: 1.4rem; margin-top: 1.8rem; line-height: 1.55; }
