/* =========================================================
   KapsBook — Design tokens
   Palette: teal (Akaunting-hosted SaaS) + charcoal (trust, ledger-ink)
   Type: Fraunces (display) / Inter (UI+body) / IBM Plex Mono (figures)
   Signature: the animated "Ledger Card" ticking through real entries
   ========================================================= */

:root {
    --charcoal: #14201C;
    --charcoal-soft: #1E2C27;
    --teal: #0F766E;
    --teal-deep: #0B5C56;
    --teal-bright: #2DD4BF;
    --teal-pale: #E6F5F2;
    --paper: #F7F9F7;
    --ink: #1B2420;
    --ink-muted: #5C6B65;
    --rule: #D8E3DF;
    --positive: #0F766E;
    --negative: #A85630;
    --white: #FFFFFF;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

    --radius: 14px;
    --radius-sm: 8px;
    --shadow-card: 0 20px 45px -20px rgba(20, 32, 28, 0.35);
    --shadow-soft: 0 8px 24px -12px rgba(20, 32, 28, 0.18);
    --max-width: 1200px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================================
   Reset & base
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    color: var(--charcoal);
    margin: 0 0 .5em;
    line-height: 1.15;
    font-weight: 600;
}

p {
    margin: 0 0 1em;
    color: var(--ink-muted);
}

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

.wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--teal);
    font-weight: 600;
    margin-bottom: 12px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--charcoal);
    color: var(--white);
    padding: 12px 18px;
    z-index: 1000;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    left: 0;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--teal);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--teal-deep);
}

.btn-outline {
    border-color: var(--rule);
    color: var(--charcoal);
    background: transparent;
}

.btn-outline:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.btn-ghost {
    color: var(--charcoal-soft);
    font-weight: 500;
}

.btn-ghost:hover {
    color: var(--teal);
}

.btn-lg {
    padding: 15px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247, 249, 247, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    display: inline-flex;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 20px;
    color: var(--charcoal);
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-menu a {
    font-size: 15px;
    font-weight: 500;
    color: var(--charcoal-soft);
    transition: color .15s ease;
}

.nav-menu a:hover {
    color: var(--teal);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--charcoal);
    margin: 0 auto;
    transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile {
    display: none;
    flex-direction: column;
    gap: 18px;
    padding: 20px 24px 28px;
    border-top: 1px solid var(--rule);
}

.nav-mobile.open {
    display: flex;
}

.nav-menu-mobile {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nav-menu-mobile a {
    font-size: 16px;
    font-weight: 500;
}

/* =========================================================
   Hero + Ledger card (signature element)
   ========================================================= */
.hero {
    padding: 88px 0 64px;
    overflow: hidden;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    align-items: center;
}

.hero-title {
    font-size: clamp(38px, 5vw, 58px);
    letter-spacing: -0.01em;
}

.hero-sub {
    font-size: 18px;
    max-width: 46ch;
    color: var(--ink-muted);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 28px 0 16px;
}

.hero-note {
    font-size: 13.5px;
    color: var(--ink-muted);
    font-family: var(--font-mono);
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.ledger-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--rule);
    overflow: hidden;
    transform: rotate(1.5deg);
}

.ledger-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: var(--charcoal);
}

.ledger-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
}

.ledger-card-title {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: .06em;
    color: rgba(234, 247, 244, 0.85);
    text-transform: uppercase;
}

.ledger-rows {
    padding: 6px 0;
}

.ledger-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 20px;
    border-bottom: 1px dashed var(--rule);
    opacity: 0;
    animation: ledger-in .5s ease forwards;
    animation-delay: var(--d, 0s);
}

.ledger-row:last-child {
    border-bottom: none;
}

.lr-label {
    font-size: 13.5px;
    color: var(--charcoal-soft);
}

.lr-amount {
    font-family: var(--font-mono);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
}

.lr-in {
    color: var(--positive);
}

.lr-out {
    color: var(--negative);
}

@keyframes ledger-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ledger-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--teal-pale);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--charcoal-soft);
    font-weight: 600;
}

.ledger-balance {
    font-size: 17px;
    color: var(--teal-deep);
}

/* =========================================================
   Trust bar
   ========================================================= */
.trust-bar {
    background: var(--charcoal);
    padding: 40px 0;
}

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

.trust-label {
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(234, 247, 244, 0.55);
    margin-bottom: 28px;
}

.trust-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.trust-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trust-num {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--teal-bright);
    font-weight: 600;
}

.trust-desc {
    font-size: 13.5px;
    color: rgba(247, 249, 247, 0.75);
}

/* =========================================================
   Section head (shared)
   ========================================================= */
.section-head {
    max-width: 640px;
    margin: 0 auto 48px;
    text-align: center;
}

.section-head h2 {
    font-size: clamp(28px, 3.4vw, 38px);
}

.section-sub {
    font-size: 16.5px;
}

/* =========================================================
   Features
   ========================================================= */
.features {
    padding: 96px 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 28px 26px;
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}

.feature-card:hover {
    box-shadow: var(--shadow-soft);
    border-color: var(--teal-bright);
    transform: translateY(-3px);
}

.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--teal-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14.5px;
    margin: 0;
}

/* =========================================================
   How it works
   ========================================================= */
.how-it-works {
    padding: 0 0 96px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    counter-reset: step;
}

.step {
    position: relative;
    padding: 32px 24px 24px;
    border-top: 3px solid var(--teal);
    background: var(--white);
    border-radius: var(--radius-sm);
}

.step-num {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--teal);
    display: block;
    margin-bottom: 10px;
}

.step h3 {
    font-size: 17px;
    margin-bottom: 8px;
}

.step p {
    font-size: 14.5px;
    margin: 0;
}

/* =========================================================
   Open source strip
   ========================================================= */
.open-source {
    padding: 72px 0;
    background: var(--teal-pale);
}

.open-source-inner {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 40px;
    align-items: center;
}

.os-copy p {
    color: var(--charcoal-soft);
}

.link-arrow {
    color: var(--teal-deep);
    font-weight: 600;
    font-size: 15px;
}

.link-arrow:hover {
    text-decoration: underline;
}

.os-badge {
    background: var(--charcoal);
    color: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.os-badge svg {
    flex-shrink: 0;
    color: var(--teal-bright);
}

.os-badge p {
    color: rgba(247, 249, 247, 0.8);
    font-size: 14px;
    margin: 0;
}

.os-badge strong {
    color: var(--white);
}

/* =========================================================
   Pricing
   ========================================================= */
.pricing {
    padding: 96px 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

.price-card {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.price-card-featured {
    border-color: var(--teal);
    box-shadow: var(--shadow-card);
    transform: translateY(-8px);
}

.price-badge {
    position: absolute;
    top: -13px;
    left: 28px;
    background: var(--teal);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 999px;
    font-weight: 600;
}

.price-name {
    font-size: 20px;
    margin-bottom: 6px;
}

.price-desc {
    font-size: 14px;
    min-height: 42px;
}

.price-amount {
    font-family: var(--font-mono);
    font-size: 42px;
    font-weight: 600;
    color: var(--charcoal);
    margin: 8px 0 20px;
}

.price-amount-custom {
    font-size: 32px;
}

.price-currency {
    font-size: 22px;
    vertical-align: top;
    margin-right: 2px;
    color: var(--ink-muted);
}

.price-period {
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-muted);
    font-family: var(--font-body);
}

.price-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
    flex: 1;
}

.price-features li {
    font-size: 14.5px;
    color: var(--charcoal-soft);
    padding-left: 24px;
    position: relative;
}

.price-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 14px;
    height: 8px;
    border-left: 2px solid var(--teal);
    border-bottom: 2px solid var(--teal);
    transform: rotate(-45deg);
}

.pricing-note {
    text-align: center;
    font-size: 14px;
    margin-top: 36px;
}

.pricing-note a {
    color: var(--teal-deep);
    font-weight: 600;
}

/* =========================================================
   FAQ
   ========================================================= */
.faq {
    padding: 0 0 96px;
}

.faq-list {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    padding: 6px 22px;
}

.faq-item summary {
    cursor: pointer;
    padding: 16px 0;
    font-weight: 600;
    color: var(--charcoal);
    font-size: 15.5px;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-family: var(--font-mono);
    font-size: 20px;
    color: var(--teal);
    margin-left: 12px;
}

.faq-item[open] summary::after {
    content: '\2212';
}

.faq-item p {
    padding-bottom: 18px;
    margin: 0;
    font-size: 14.5px;
}

/* =========================================================
   Final CTA
   ========================================================= */
.final-cta {
    background: var(--charcoal);
    padding: 88px 0;
}

.final-cta-inner {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}

.final-cta h2 {
    color: var(--white);
    font-size: clamp(28px, 3.6vw, 36px);
}

.final-cta p {
    color: rgba(247, 249, 247, 0.7);
    font-size: 16px;
    margin-bottom: 28px;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
    background: var(--charcoal-soft);
    color: rgba(247, 249, 247, 0.85);
    padding: 64px 0 0;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(247, 249, 247, 0.12);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-brand .brand-name {
    color: var(--white);
}

.footer-tagline {
    font-size: 13.5px;
    color: rgba(247, 249, 247, 0.55);
    margin: 0;
    max-width: 26ch;
}

.footer-col h3 {
    font-family: var(--font-mono);
    color: rgba(247, 249, 247, 0.5);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col a {
    font-size: 14px;
    color: rgba(247, 249, 247, 0.75);
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 22px 0;
    font-size: 13px;
    color: rgba(247, 249, 247, 0.45);
}

.footer-bottom a {
    color: rgba(247, 249, 247, 0.65);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        order: -1;
    }

    .trust-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .open-source-inner {
        grid-template-columns: 1fr;
    }

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

    .price-card-featured {
        transform: none;
    }

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

@media (max-width: 680px) {

    .site-nav,
    .header-actions {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

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

    .trust-stats {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .hero {
        padding: 56px 0 40px;
    }

    .ledger-card {
        transform: none;
    }
}