/* ===================================================================
   Theme tokens
   Dark is the brand default; :root[data-theme="light"] overrides it.
   Hues are taken from the TraderTaxNinja logo: navy, electric blue, and teal.
=================================================================== */
:root {
    --bg-color: #0b1220;
    --bg-raised: #111e33;
    --surface: rgba(25, 41, 65, 0.82);
    --surface-solid: #192941;
    --text-color: #e5edf9;
    --text-muted: #a5b6ce;
    --heading-color: #f5f8ff;
    --primary-color: #78b7ff;
    --primary-hover: #a9d2ff;
    --accent-color: #a5a0ff;
    --border-color: rgba(139, 169, 211, 0.18);
    --border-strong: rgba(139, 169, 211, 0.34);
    --gradient-start: #2459aa;
    --gradient-end: #6453b8;
    --rule-color: rgba(139, 169, 211, 0.2);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    --font-main: 'Inter', sans-serif;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg-color: #edf8fa;
    --bg-raised: #ffffff;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-solid: #ffffff;
    --text-color: #173d63;
    --text-muted: #52718d;
    --heading-color: #0c2c54;
    --primary-color: #1463bd;
    --primary-hover: #0d7fbe;
    --accent-color: #0aaead;
    --border-color: rgba(15, 48, 88, 0.13);
    --border-strong: rgba(15, 48, 88, 0.25);
    --gradient-start: #1463bd;
    --gradient-end: #0aaead;
    --rule-color: rgba(15, 48, 88, 0.15);
    --shadow: 0 20px 40px rgba(15, 48, 88, 0.12);
    color-scheme: light;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.55;
    overflow-x: hidden;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    color: inherit;
}

/* Typography - denser scale than a typical SaaS site, closer to a news page */
h1, h2, h3, h4 {
    color: var(--heading-color);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.65rem;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1.25rem;
    color: var(--text-muted);
}

.highlight {
    color: var(--primary-color);
}

.gradient-text {
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rule {
    border: none;
    border-top: 1px solid var(--rule-color);
    margin: 2.5rem 0;
}

/* Kicker: small eyebrow label above a headline, the "SECTION NAME" tag look */
.kicker {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.6rem;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--gradient-end));
    color: #fff;
    padding: 0.65rem 1.6rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px 0 rgba(20, 99, 189, 0.3);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(13, 193, 190, 0.28);
}

.btn-secondary {
    display: inline-block;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55rem 1.3rem;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    transition: background 0.2s, border-color 0.2s;
    background: transparent;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--primary-color);
}

.btn-text {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-text:hover {
    text-decoration: underline;
}

/* ===================================================================
   Masthead - identity bar. Toggle sits to the left of the auth actions.
=================================================================== */
.masthead {
    position: sticky;
    top: 0;
    width: 100%;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.masthead-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--heading-color);
    letter-spacing: -0.02em;
}

.logo a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
}

.header-logo {
    display: block;
    width: 256px;
    height: 54px;
    max-height: 64px;
    background: url("assets/logo-text-on-transparent-wide-dark-header.png") center / contain no-repeat;
}

.footer-col .logo {
    margin-bottom: 0.75rem;
}

.logo-lockup {
    display: block;
    width: 9rem;
    height: 6.2rem;
    background: url("assets/logo-text-on-transparent-dark.png") center / contain no-repeat;
}

:root[data-theme="light"] .header-logo {
    background-image: url("assets/logo-text-on-transparent-wide-header.png");
}

:root[data-theme="light"] .logo-lockup {
    background-image: url("assets/logo-text-on-transparent.png");
}

.masthead-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
    background: var(--surface);
    border-color: var(--primary-color);
}

.theme-icon {
    width: 1rem;
    height: 1rem;
    display: block;
}

.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Topic nav - dense secondary strip, Register's row of section links */
.topic-nav {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.topic-nav-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.55rem 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.topic-nav-inner::-webkit-scrollbar {
    display: none;
}

.topic-nav a {
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.topic-nav a:hover,
.topic-nav a.active {
    color: var(--primary-color);
}

/* ===================================================================
   Lead story - the big headline block at the top of a page
=================================================================== */
.lead-story {
    padding: 3rem 0 2.5rem;
    position: relative;
}

.lead-story::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(13, 193, 190, 0.16) 0%, rgba(7, 26, 51, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

.lead-story-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.lead-story h1 {
    font-size: 3rem;
}

.lead-story-sub {
    font-size: 1.1rem;
    margin-bottom: 1.75rem;
}

.cta-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.image-wrapper {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.lead-story-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Page hero for interior pages (features/pricing/terms) - a plainer band */
.page-hero {
    padding: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--rule-color);
}

.page-hero h1 {
    font-size: 2.25rem;
}

.page-hero-sub {
    font-size: 1.05rem;
    max-width: 640px;
}

/* ===================================================================
   Content layout - main column + right rail, the core Register pattern
=================================================================== */
.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 3rem;
    padding: 2.5rem 0 3rem;
    align-items: start;
}

.content-main h2 {
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    margin-bottom: 1.5rem;
}

/* Story grid - the dense card river */
.story-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem 2rem;
}

.story-card {
    display: flex;
    flex-direction: column;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule-color);
}

.story-card-icon {
    height: 2rem;
    margin-bottom: 0.75rem;
}

.story-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.story-card p {
    font-size: 0.92rem;
    margin-bottom: 0.6rem;
}

.story-card .btn-text {
    font-size: 0.85rem;
}

/* ===================================================================
   Sidebar - "Most popular" style widgets down the right rail
=================================================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.widget-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--rule-color);
}

.widget-list {
    list-style: none;
}

.widget-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--rule-color);
    font-size: 0.88rem;
}

.widget-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.widget-list a {
    text-decoration: none;
    font-weight: 600;
    color: var(--text-color);
    transition: color 0.15s;
}

.widget-list a:hover {
    color: var(--primary-color);
}

.widget-list .widget-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.widget-cta {
    text-align: center;
}

.widget-cta p {
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.widget .btn-primary,
.widget .btn-secondary {
    width: 100%;
    text-align: center;
}

.problem-solution {
    padding: 2.5rem 0;
}

/* Glass cards - kept for banded sections (accountants, CTA banner) */
.glass-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 0.75rem;
}

.text-center {
    text-align: center;
}

/* CTA banner */
.cta-banner {
    padding: 1rem 0 3.5rem;
}

.cta-card {
    text-align: center;
    background: linear-gradient(135deg, var(--surface-solid), rgba(13, 193, 190, 0.12));
}

/* ===================================================================
   Footer - dense multi-column, small type
=================================================================== */
.site-footer {
    background: var(--bg-raised);
    padding: 2.5rem 0 calc(96px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-col h4 {
    margin-bottom: 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.footer-col a {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    margin-bottom: 0.6rem;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--primary-color);
}

.footer-col p {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ===================================================================
   Feature grid (features.html) - reuses the story-card visual language
   but as a standalone grid rather than main+sidebar.
=================================================================== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    padding: 1.75rem;
    border-radius: 0.5rem;
    transition: transform 0.15s, border-color 0.15s;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.feature-card h3 {
    color: var(--primary-color);
}

.feature-icon {
    margin-bottom: 0.75rem;
    display: block;
    height: 2rem;
}

.marketing-icon {
    display: block;
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}

:root[data-theme="dark"] .theme-icon,
:root[data-theme="dark"] .marketing-icon {
    filter: brightness(0) invert(1);
}

/* ===================================================================
   Pricing cards (pricing.html)
=================================================================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.pricing-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 0.75rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-color);
}

.pricing-card.popular {
    background: linear-gradient(160deg, var(--surface-solid), rgba(20, 99, 189, 0.14));
    border-color: var(--primary-color);
    position: relative;
}

.popular-tag {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.9rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1.25rem 0;
    color: var(--heading-color);
}

.price span {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
}

.plan-name {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.features-list {
    list-style: none;
    margin: 1.5rem 0;
    text-align: left;
    flex-grow: 1;
}

.features-list li {
    margin-bottom: 0.75rem;
    padding-left: 1.4rem;
    position: relative;
    font-size: 0.9rem;
    color: var(--text-color);
}

.features-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* Generic checklist used inside story text (feature-list on the home lead) */
.feature-list {
    list-style: none;
    margin-top: 1rem;
}

.feature-list li {
    margin-bottom: 0.5rem;
    padding-left: 1.4rem;
    position: relative;
    color: var(--text-color);
    font-size: 0.92rem;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* ===================================================================
   Terms page - single reading column with a jump-link rail
=================================================================== */
.terms-content h2 {
    margin-top: 2rem;
    font-size: 1.3rem;
    border-bottom: none;
    padding-bottom: 0;
    display: block;
}

.terms-content p,
.terms-content ul {
    color: var(--text-color);
}

.terms-content ul {
    margin-bottom: 1.25rem;
    padding-left: 1.75rem;
}

.terms-content li {
    margin-bottom: 0.4rem;
}

.toc-list {
    list-style: none;
    counter-reset: toc;
}

.toc-list li {
    counter-increment: toc;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rule-color);
    font-size: 0.85rem;
}

.toc-list li:last-child {
    border-bottom: none;
}

.toc-list a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
}

.toc-list a:hover {
    color: var(--primary-color);
}

.toc-list a::before {
    content: counter(toc) ". ";
    color: var(--primary-color);
}

/* ===================================================================
   Contact form
=================================================================== */
.contact-layout {
    max-width: 860px;
    padding-bottom: 5rem;
}

.contact-hero {
    border-bottom: none;
    padding-bottom: 3rem;
}

.contact-form {
    display: grid;
    gap: 1.35rem;
    padding: 2.5rem;
    background: linear-gradient(145deg, var(--surface-solid), var(--surface));
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
}

.contact-form-intro {
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--rule-color);
}

.contact-form-intro h2 {
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
}

.contact-form-intro p {
    margin: 0;
    font-size: 0.95rem;
}

.form-row {
    display: grid;
    gap: 0.45rem;
}

.form-row label {
    color: var(--heading-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-row label span {
    color: var(--text-muted);
    font-weight: 400;
}

.form-row input,
.form-row textarea {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 0.45rem;
    background: var(--surface-solid);
    color: var(--text-color);
    font: inherit;
    line-height: 1.5;
    padding: 0.8rem 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-row textarea { min-height: 11rem; resize: vertical; }

.form-row input:focus,
.form-row textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(13, 193, 190, 0.18);
    outline: none;
}

.contact-honeypot { display: none; }

.contact-status { min-height: 1.3rem; margin: 0; font-size: 0.9rem; }
.contact-status.is-success { color: var(--accent-color); }
.contact-status.is-error { color: #d75757; }

/* ===================================================================
   Home-page detail sections
=================================================================== */
.detail-section {
    padding: 5rem 0;
    scroll-margin-top: 1.5rem;
}

.detail-section-rules {
    background: var(--bg-raised);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.detail-section-heading {
    max-width: 720px;
    margin-bottom: 2rem;
}

.detail-section-heading h2,
.security-copy h2 {
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

.detail-section-heading p,
.security-copy > p {
    font-size: 1.05rem;
}

.rule-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.rule-card {
    min-height: 220px;
    padding: 1.6rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.7rem;
}

.rule-number {
    margin-bottom: 1.75rem;
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.rule-card h3 { margin-bottom: 0.6rem; color: var(--heading-color); }
.rule-card p { margin: 0; font-size: 0.92rem; }

.detail-disclaimer {
    margin: 1.4rem 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.security-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 4rem;
    align-items: center;
}

.security-copy .btn-text { display: inline-block; margin-top: 0.35rem; }

.security-assurances {
    display: grid;
    gap: 0.8rem;
}

.security-assurance {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    gap: 1rem;
    align-items: start;
    padding: 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
}

.security-assurance .marketing-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.55rem;
    border-radius: 0.5rem;
    background: rgba(13, 193, 190, 0.12);
}

.security-assurance h3 { margin-bottom: 0.3rem; font-size: 1rem; }
.security-assurance p { margin: 0; font-size: 0.88rem; }

@media (max-width: 640px) {
    .contact-form { padding: 1.4rem; }
}

/* ===================================================================
   Responsive
=================================================================== */
@media (max-width: 900px) {
    .lead-story-grid {
        grid-template-columns: 1fr;
    }

    .content-layout {
        grid-template-columns: 1fr;
    }

    .story-grid {
        grid-template-columns: 1fr;
    }

    .rule-grid,
    .security-grid {
        grid-template-columns: 1fr;
    }

    .security-grid { gap: 2rem; }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    h1, .lead-story h1 {
        font-size: 2.1rem;
    }

    .masthead-inner {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .masthead-actions {
        gap: 0.6rem;
    }

    .cta-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: left;
    }
}

.theme-toggle { width:40px; height:40px; border:0; border-radius:50%; color:var(--text-muted); }
.theme-icon { width:20px; height:20px; }
.theme-toggle:focus-visible { outline:2px solid var(--primary-color); outline-offset:3px; }

/* Product version/build-time bubble in the footer (right-hand side); muted pill. Absent when no version is baked in. */
.footer-badge-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.build-badge {
    display: inline-block;
    padding: 0.1rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-raised);
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

