:root {
    --cream: #FAFAF5;
    --ivory: #F5F0EB;
    --primary: #0A192F;
    --secondary: #E8553D;
    --sage: #7BA68C;
    --accent: #C9A959;
    --warmgray: #6B7280;

    --ff-head: 'Syne', sans-serif;
    --ff-serif: 'Cormorant Garamond', serif;
    --ff-mono: 'DM Mono', monospace;

    /* Semantic mappings for consistency with kkfinancialusa structure */
    --em: var(--secondary);
    --em-dim: rgba(232, 85, 61, 0.35);
    --em-faint: rgba(232, 85, 61, 0.07);
    --bg: var(--cream);
    --surface: var(--ivory);
    --surface2: #EBE6E0;
    --text: #000;
    --muted: rgba(0, 0, 0, 0.65);
    /* Adjusted muted value for black text contrast */
    --border: rgba(0, 0, 0, 0.1);
}

/* ── Global Styles ── */
body {
    background-color: var(--bg);
    color: #000;
    font-family: var(--ff-serif);
    font-size: 1.15rem;
    /* Enlarge base font size */
    font-weight: 400;
    /* Changed from 600 to 400 (normal) */
}

.font-head {
    font-family: var(--ff-head);
}

.font-serif {
    font-family: var(--ff-serif);
}

.font-mono {
    font-family: var(--ff-mono);
}

/* ── Grain overlay ── */
.kkf-grain::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 100;
    opacity: 0.25;
}

/* ── Scroll reveal ── */
.kkf-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.kkf-reveal.kkf-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Section UI Elements ── */
.kkf-label {
    font-family: var(--ff-head);
    font-size: 14px;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--em);
    display: block;
    margin-bottom: 16px;
}

.kkf-sec-title {
    font-family: var(--ff-head);
    font-size: clamp(1.8rem, 5vw, 3.6rem);
    font-weight: 400;
    color: var(--text);
    line-height: 1.05;
    letter-spacing: -1px;
}

.kkf-sec-title em {
    font-family: var(--ff-serif);
    font-style: italic;
    color: var(--em);
    font-weight: 400;
}

.kkf-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.kkf-divider-line {
    width: 60px;
    height: 1px;
    background: var(--em-dim);
}

.kkf-divider-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--em);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.25;
    }
}

/* ── Hero Advanced ── */
#kkf-hero {
    position: relative;
    background: var(--primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: #fff;
    font-weight: 400;
}

.hero-stripe {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 55%, #242442 55%);
    z-index: 0;
}

.hero-orb {
    position: absolute;
    right: -120px;
    top: -120px;
    width: min(680px, 100vw);
    height: min(680px, 100vw);
    background: radial-gradient(circle, rgba(232, 85, 61, 0.13) 0%, transparent 70%);
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    margin: 0 auto;
    padding: 120px 24px 100px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 80px;
    align-items: center;
    width: 100%;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ff-head);
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid rgba(201, 169, 89, 0.3);
    padding: 6px 16px;
    border-radius: 2px;
    margin-bottom: 28px;
}

.hero-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--secondary);
    color: #fff;
    font-family: var(--ff-serif);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 16px 34px;
    clip-path: polygon(0 0, 100% 0, 96% 100%, 0 100%);
    text-decoration: none;
    transition: all 0.3s;
}

.hero-btn-primary:hover {
    background: var(--accent);
    transform: translateX(4px);
}

.hero-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--ff-mono);
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.3s;
}

.hero-btn-secondary:hover {
    color: var(--secondary);
}

.hero-btn-secondary span {
    display: inline-block;
    width: 28px;
    height: 1px;
    background: currentColor;
}

/* ── Ticker Card ── */
.hero-ticker-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 2px solid var(--secondary);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

/* ── Feature Cards ── */
.feat-card {
    background: var(--surface);
    padding: 36px;
    border: 1px solid var(--border);
    transition: all 0.4s;
    clip-path: polygon(0 0, 100% 0, 100% 92%, 96% 100%, 0 100%);
    cursor: pointer;
}

.feat-card:hover,
.feat-card.open {
    background: #fff;
    border-color: var(--em);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.feat-num {
    position: absolute;
    top: 16px;
    right: 20px;
    font-family: var(--ff-head);
    font-size: 4.5rem;
    font-weight: 400;
    color: rgba(232, 85, 61, 0.04);
    line-height: 1;
    transition: color 0.4s;
    pointer-events: none;
    z-index: 0;
}

.feat-card:hover .feat-num,
.feat-card.open .feat-num {
    color: rgba(232, 85, 61, 0.09);
}

.feat-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--em);
    fill: none;
    stroke-width: 1.5;
}

/* ── Blog Grid ── */
.kkf-blog-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
}

.kkf-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: var(--surface);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.65s ease, transform 0.65s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    /* Enhanced background/border shadow */
}

.kkf-card:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    /* Enhance shadow on hover */
    border-color: rgba(0, 0, 0, 0.25);
}

.kkf-card.kkf-visible {
    opacity: 1;
    transform: translateY(0);
}

.kkf-card:nth-child(1) {
    transition-delay: 0.05s;
}

.kkf-card:nth-child(2) {
    transition-delay: 0.18s;
}

.kkf-card:nth-child(3) {
    transition-delay: 0.30s;
}

.kkf-card:nth-child(4) {
    transition-delay: 0.42s;
}

.kkf-card:nth-child(5) {
    transition-delay: 0.54s;
}

.kkf-card:nth-child(1) {
    grid-row: 1/3;
    clip-path: polygon(0 0, 100% 0, 94% 100%, 0 100%);
    min-height: 600px;
}

.kkf-card:nth-child(2) {
    clip-path: polygon(6% 0, 100% 0, 100% 92%, 0 100%);
}

.kkf-card:nth-child(3) {
    clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 100%);
}

.kkf-card:nth-child(4) {
    clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
    margin-top: -2px;
}

.kkf-card:nth-child(5) {
    clip-path: polygon(0 0, 100% 8%, 100% 100%, 6% 100%);
    margin-top: -2px;
}

.kkf-card:nth-child(2),
.kkf-card:nth-child(3),
.kkf-card:nth-child(4),
.kkf-card:nth-child(5) {
    min-height: 296px;
}

.kkf-card-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.85s cubic-bezier(.25, .46, .45, .94), filter 0.6s ease;
    filter: brightness(0.35) saturate(0.55);
}

.kkf-card:hover .kkf-card-img {
    transform: scale(1.08);
    filter: brightness(0.22) saturate(0.4);
}

.kkf-card-body {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px 28px;
    background: linear-gradient(to top, rgba(26, 26, 46, 0.96) 0%, rgba(26, 26, 46, 0.5) 50%, transparent 100%);
    transition: background 0.5s ease;
    color: #fff;
}

.kkf-card:hover .kkf-card-body {
    background: linear-gradient(to top, rgba(26, 26, 46, 0.98) 0%, rgba(26, 26, 46, 0.75) 60%, rgba(26, 26, 46, 0.25) 100%);
}

.kkf-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--ff-serif);
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--em);
    border: 1px solid rgba(232, 85, 61, 0.35);
    padding: 5px 12px;
    border-radius: 2px;
    margin-bottom: 12px;
    width: fit-content;
    opacity: 0.85;
    transform: translateY(5px);
    transition: all 0.4s ease;
}

.kkf-card:hover .kkf-cat {
    background: rgba(232, 85, 61, 0.12);
    opacity: 1;
    transform: translateY(0);
}

.kkf-cat-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--em);
    animation: blink 2s infinite;
    flex-shrink: 0;
}

.kkf-card-title {
    font-family: var(--ff-serif);
    color: #fff;
    line-height: 1.22;
    margin: 0 0 10px;
    transition: color 0.3s;
}

.kkf-card:nth-child(1) .kkf-card-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 400;
}

.kkf-card:not(:nth-child(1)) .kkf-card-title {
    font-size: clamp(1.2rem, 1.8vw, 1.4rem);
    font-weight: 400;
}

.kkf-card:hover .kkf-card-title {
    color: var(--accent);
}

.kkf-excerpt {
    font-family: var(--ff-serif);
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.75;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.55s cubic-bezier(.25, .46, .45, .94), opacity 0.4s ease 0.05s;
}

.kkf-card:hover .kkf-excerpt {
    max-height: 120px;
    opacity: 1;
}

.kkf-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-family: var(--ff-serif);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    flex-wrap: wrap;
}

.kkf-meta-date {
    color: rgba(232, 85, 61, 0.65);
    font-weight: 400;
}

.kkf-meta-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}

.kkf-read {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ff-serif);
    font-size: 0.9rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--em);
    text-decoration: none;
    margin-top: 18px;
    transform: translateX(-10px);
    opacity: 0;
    transition: transform 0.4s ease 0.1s, opacity 0.4s ease 0.1s;
}

.kkf-card:hover .kkf-read {
    transform: translateX(0);
    opacity: 1;
}

.kkf-read-line {
    display: inline-block;
    width: 28px;
    height: 1px;
    background: var(--em);
    position: relative;
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.kkf-read-line::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -3px;
    border-right: 6px solid var(--em);
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
}

.kkf-read:hover .kkf-read-line {
    width: 44px;
}

.kkf-feat-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--em);
    color: #fff;
    font-family: var(--ff-mono);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 5px 14px;
    clip-path: polygon(0 0, 100% 0, 94% 100%, 6% 100%);
    z-index: 3;
}

.kkf-num {
    position: absolute;
    top: 14px;
    left: 20px;
    font-family: var(--ff-head);
    font-size: 4rem;
    font-weight: 800;
    color: rgba(232, 85, 61, 0.2);
    /* Using secondary/em color */
    line-height: 1;
    pointer-events: none;
    transition: color 0.4s;
    z-index: 1;
}

.kkf-card:hover .kkf-num {
    color: rgba(232, 85, 61, 0.4);
}

/* ── Topics Section ── */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
}

.topic-card {
    background: var(--bg);
    padding: 36px 24px 28px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    clip-path: polygon(0 0, 100% 0, 100% 88%, 92% 100%, 0 100%);
    transition: background 0.4s;
    border: 1px solid var(--border);
}

.topic-card:hover {
    background: var(--surface2);
}

/* ── How it works ── */
.how-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.how-track::before {
    content: '';
    position: absolute;
    top: 36px;
    left: calc(12.5%);
    right: calc(12.5%);
    height: 1px;
    background: linear-gradient(90deg, var(--em-dim), var(--em), var(--em-dim));
    z-index: 0;
}

.how-step-num {
    width: 72px;
    height: 72px;
    border: 1px solid var(--em-dim);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    position: relative;
    clip-path: polygon(15% 0, 85% 0, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0 85%, 0 15%);
    transition: all 0.4s;
}

.how-step:hover .how-step-num {
    background: var(--em-faint);
    border-color: var(--em);
}

/* ── Testimonials ── */
.testi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.testi-card {
    background: #fff;
    padding: 40px 36px;
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 96% 0, 100% 6%, 100% 100%, 4% 100%, 0 94%);
    transition: background 0.4s;
    border: 1px solid var(--border);
}

.testi-avatar {
    width: 40px;
    height: 40px;
    background: var(--em-faint);
    border: 1px solid var(--em-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ff-head);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--em);
    clip-path: polygon(15% 0, 85% 0, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0 85%, 0 15%);
}

/* ── CTA banner ── */
#kkf-cta {
    background: var(--primary);
    position: relative;
    overflow: hidden;
    padding: 90px 0;
    color: #fff;
}

#kkf-cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--em), transparent);
}

.cta-btn-main {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: var(--em);
    color: #fff;
    font-family: var(--ff-mono);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 18px 40px;
    text-decoration: none;
    clip-path: polygon(0 0, 100% 0, 96% 100%, 0 100%);
    white-space: nowrap;
    transition: all 0.3s;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .topics-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .topic-card {
        clip-path: none;
    }
}

@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-right {
        display: none;
    }

    .kkf-blog-grid {
        grid-template-columns: 1fr 1fr;
    }

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

@media (max-width: 900px) {
    .how-track {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .how-track::before {
        display: none;
    }

    /* Blog grid */
    .kkf-blog-grid {
        grid-template-columns: 1fr 1fr;
    }

    .kkf-card:nth-child(1) {
        grid-column: auto;
        grid-row: auto;
        min-height: 360px;
        clip-path: none;
    }

    .kkf-card:nth-child(n) {
        clip-path: none !important;
        margin-top: 0 !important;
    }

    .kkf-card:nth-child(2),
    .kkf-card:nth-child(3),
    .kkf-card:nth-child(4),
    .kkf-card:nth-child(5) {
        min-height: 260px;
    }
}

@media (max-width: 768px) {
    .kkf-blog-grid {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 580px) {
    .how-track {
        grid-template-columns: 1fr;
    }

    /* Blog grid single column */
    .kkf-blog-grid {
        grid-template-columns: 1fr;
    }

    .kkf-card:nth-child(1) {
        grid-column: auto;
        min-height: 300px;
    }

    .kkf-card:nth-child(n) {
        min-height: 240px !important;
    }
}

/* ── Visibility & Round 2 Refinements ── */
.kkf-view-all {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 16px 40px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--primary);
    font-family: var(--ff-head);
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.4s ease;
    clip-path: polygon(0 0, 100% 0, 96% 100%, 0 100%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.kkf-view-all:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(232, 85, 61, 0.1);
}

.kkf-pill {
    background: var(--em-faint);
    color: var(--em);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    border: 1px solid var(--em-dim);
}

/* ── "Medium" adjustments for Header/Footer ── */
.desktop-nav .menu-item > a,
.nav-link {
    font-size: 16px !important; /* Bumped to medium */
}

.mob-link,
.mobile-nav .menu-item > a {
    font-size: 13px !important; /* Bumped to medium */
}

footer h4 {
    font-size: 1.25rem !important; /* Medium */
}

footer p, footer li, footer a:not(.footer-logo) {
    font-size: 1.1rem; /* Medium */
}

footer .bottom-bar p, 
footer .bottom-bar a,
footer .bottom-bar span {
    font-size: 0.7rem !important;
    letter-spacing: 2px !important;
}

footer .social-links span {
    font-size: 1rem !important;
}

@media (max-width: 400px) {
    .kkf-blog-grid {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ── TOUCH: disable hover-reveal effects on touch screens ── */
@media (hover: none) {
    .kkf-excerpt {
        max-height: 80px;
        opacity: 0.8;
    }

    .kkf-read {
        transform: translateX(0);
        opacity: 1;
    }

    .kkf-cat {
        transform: translateY(0);
        opacity: 1;
    }
}