/* ==========================================================
   krishnadas.in — main stylesheet
   Fonts: Poppins (headings, menu) + Carme (body)
   ========================================================== */

:root {
    /* original palette (kept) */
    --bg-color: #f5f0e1;       /* cream */
    --link-color: #1e5841;     /* green */
    --bg-footer: #d9c29b;      /* sand */
    --txt-color: #101010;
    --border-color: #a49f96;
    --heading-color: #03080c;
    --active-link: #088178;

    /* additions */
    --green-dark: #173f30;     /* logo badge green */
    --gold: #c8a24a;           /* logo badge gold */
    --surface: #fffdf7;        /* cards */
    --muted: #5f5b52;
    --line: #e6dfcc;
    --radius: 14px;
    --shadow-sm: 0 1px 3px rgba(23, 63, 48, .08);
    --shadow-md: 0 10px 30px rgba(23, 63, 48, .10);
    --header-h: 72px;
    --font-head: "Poppins", sans-serif;
    --font-body: "Carme", "Noto Sans Malayalam", sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    color: var(--txt-color);
    background: #fbf8ef;
}

main { flex: 1; }

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

a { color: var(--link-color); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--heading-color);
    line-height: 1.25;
    font-weight: 600;
}
h1 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 3.6vw, 38px); letter-spacing: -0.01em; }
h3 { font-size: 21px; }
h4 { font-size: 19px; }
h6 { font-weight: 700; font-size: 12px; }

p { font-size: 17px; color: var(--txt-color); margin: 0 0 1em; }

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

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout helpers ---------- */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}
.flex { display: flex; justify-content: center; align-items: center; height: 100%; }

.section    { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-p1 { padding: 40px 80px; }   /* legacy */
.section-m1 { margin: 40px 0; }       /* legacy */

.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head p { color: var(--muted); }

.eyebrow {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--link-color);
    margin-bottom: 14px;
}
.eyebrow .dot { color: var(--gold); margin: 0 6px; }

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

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 15px;
    padding: 12px 24px;
    border-radius: 999px;
    border: 2px solid var(--green-dark);
    background: var(--green-dark);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { background: var(--link-color); border-color: var(--link-color); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--green-dark); }
.btn-outline:hover { background: var(--green-dark); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--green-dark); }
.btn-gold:hover { background: #d8b45c; border-color: #d8b45c; }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ==========================================================
   Header
   ========================================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-color);
    height: var(--header-h);
    box-shadow: 0 2px 14px rgba(0, 0, 0, .08);
}
.header .flex { justify-content: space-between; }
.header .logo { height: 50px; width: auto; }

.main-menu ul { display: flex; align-items: center; gap: 6px; }
.main-menu li { list-style: none; position: relative; }
.main-menu li a {
    display: block;
    padding: 8px 14px;
    text-decoration: none;
    font-family: var(--font-head);
    font-weight: 400;
    font-size: 15px;
    color: var(--txt-color);
    transition: color .25s ease;
}
.main-menu li a:hover { color: var(--link-color); }
.main-menu li a.active { color: var(--active-link); font-weight: 500; }
.main-menu li a.active::after,
.main-menu li a:hover::after {
    content: "";
    position: absolute;
    left: 14px;
    bottom: 2px;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--active-link);
}
.main-menu li a.menu-icon {
    width: 40px; height: 40px; padding: 0;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    margin-left: 8px;
}
.main-menu li a.menu-icon::after { display: none; }
.main-menu li a.menu-icon:hover { border-color: var(--link-color); }

.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    border: 0; background: transparent;
    cursor: pointer;
    position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    position: absolute;
    left: 11px;
    width: 22px; height: 2px;
    background: var(--green-dark);
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
    content: "";
}
.nav-toggle span { top: 21px; }
.nav-toggle span::before { left: 0; top: -7px; }
.nav-toggle span::after  { left: 0; top: 7px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span::after  { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================
   Hero
   ========================================================== */
.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(900px 400px at 85% 20%, rgba(200,162,74,.18), transparent 60%),
        linear-gradient(180deg, var(--bg-color) 0%, #fbf8ef 100%);
    padding: 90px 0 100px;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    align-items: center;
    gap: 60px;
}
.hero h1 { margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--link-color); }
.hero .lead { font-size: 19px; color: var(--muted); max-width: 540px; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-badge { position: relative; justify-self: center; width: min(340px, 80%); aspect-ratio: 1; }
.hero-badge::before {
    content: "";
    position: absolute; inset: -18px;
    border-radius: 50%;
    border: 1px dashed rgba(23,63,48,.25);
}
.hero-badge img {
    width: 100%; height: 100%;
    border-radius: 50%;
    box-shadow: 0 25px 60px rgba(23,63,48,.25);
}

/* ==========================================================
   Cards
   ========================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease;
}
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover, .card.hoverable:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 16px; margin-bottom: 0; }

.icon-circle {
    width: 54px; height: 54px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--green-dark);
    color: var(--gold);
    font-size: 21px;
    margin-bottom: 20px;
}
.card-link {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 18px;
    font-family: var(--font-head); font-size: 14px; font-weight: 500;
    color: var(--link-color);
}

/* Feature (tool) block */
.feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    background: var(--green-dark);
    color: #f3efe3;
    border-radius: 24px;
    padding: 56px;
    position: relative;
    overflow: hidden;
}
.feature::after {
    content: "";
    position: absolute; right: -120px; top: -120px;
    width: 340px; height: 340px;
    border-radius: 50%;
    border: 2px solid rgba(200,162,74,.35);
}
.feature > * { position: relative; z-index: 1; }
.feature h2 { color: #fff; margin-bottom: 14px; }
.feature p { color: #d8d3c4; }
.feature .eyebrow { color: var(--gold); }
.feature ul { list-style: none; margin: 20px 0 30px; }
.feature li { padding: 6px 0 6px 30px; position: relative; color: #ece7d8; }
.feature li::before {
    content: "\f005"; font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; left: 0; top: 7px; color: var(--gold); font-size: 14px;
}

/* Mock preview inside feature */
.mock {
    background: var(--surface);
    border-radius: 16px;
    padding: 18px;
    color: var(--txt-color);
    box-shadow: 0 20px 50px rgba(0,0,0,.3);
    position: relative; z-index: 1;
}
.mock-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; }
.mock-row + .mock-row { margin-top: 6px; }
.mock-row.hl { background: #fff6dc; border-left: 4px solid var(--gold); }
.mock-rank { font-family: var(--font-head); font-weight: 600; color: var(--muted); width: 28px; }
.mock-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-footer); flex-shrink: 0; }
.mock-name { font-family: var(--font-head); font-size: 14px; font-weight: 500; }
.mock-stars { color: var(--gold); font-size: 13px; letter-spacing: 1px; }
.mock-bar { height: 8px; border-radius: 4px; background: var(--line); margin-top: 6px; }

/* ==========================================================
   Page header (inner pages)
   ========================================================== */
.page-hero {
    background: linear-gradient(180deg, var(--bg-color), #fbf8ef);
    padding: 64px 0 48px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}
.page-hero p { color: var(--muted); max-width: 620px; margin: 12px auto 0; }

.prose { max-width: 720px; margin: 0 auto; }
.prose h2 { margin: 40px 0 14px; font-size: 28px; }
.prose p { font-size: 18px; }

.empty-state {
    text-align: center;
    padding: 60px 30px;
    border: 2px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
}
.empty-state i { font-size: 34px; color: var(--gold); margin-bottom: 14px; }

/* Blog post card */
.post-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.post-card .thumb { aspect-ratio: 16/9; background: var(--bg-footer); object-fit: cover; width: 100%; }
.post-card .body { padding: 24px; }
.post-card .meta { font-size: 13px; color: var(--muted); font-family: var(--font-head); margin-bottom: 8px; }
.post-card .body { flex: 1; display: flex; flex-direction: column; }
.post-card .body h3 { font-size: 19px; line-height: 1.4; }
.post-card .body p { margin-top: 6px; }
.post-card .card-link { margin-top: auto; padding-top: 16px; }
.post-card .thumb { transition: transform .4s ease; }
.post-card:hover .thumb { transform: scale(1.03); }
.thumb-placeholder { display: grid; place-items: center; background: var(--green-dark) !important; color: var(--gold); font-size: 40px; }

/* Loading placeholders while posts are fetched */
.skeleton { pointer-events: none; }
.skeleton .thumb, .skeleton .sk-line {
    background: linear-gradient(90deg, #eee7d4 25%, #f6f1e3 50%, #eee7d4 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
}
.skeleton .sk-line { height: 14px; border-radius: 7px; margin-bottom: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.section-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head-row .eyebrow { margin-bottom: 6px; }

.tag {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #e9f1ec;
    color: var(--link-color);
}

/* ==========================================================
   Footer
   ========================================================== */
.footer {
    background: var(--green-dark);
    color: #cfc9b8;
    padding: 60px 0 0;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer-brand img { height: 46px; width: auto; background: var(--bg-color); padding: 6px 12px; border-radius: 10px; margin-bottom: 16px; }
.footer p { color: #cfc9b8; font-size: 15px; }
.footer h4 { color: #fff; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 10px; }
.footer a { color: #e6e0cf; text-decoration: none; transition: color .2s; }
.footer a:hover { color: var(--gold); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 20px 0;
    font-size: 14px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.footer-bottom .dot { color: var(--gold); }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 960px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 50px; }
    .hero .lead { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .hero-badge { width: 220px; grid-row: 1; }
    .feature { grid-template-columns: 1fr; padding: 40px 28px; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
    .section-p1 { padding: 30px 24px; }
}

/* Mobile menu (only for headers that have the toggle button) */
@media (max-width: 820px) {
    .site-header .nav-toggle { display: block; }
    .site-header .main-menu {
        position: absolute;
        top: var(--header-h); left: 0; right: 0;
        background: var(--bg-color);
        box-shadow: 0 12px 20px rgba(0,0,0,.08);
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }
    .site-header.nav-open .main-menu { max-height: 420px; }
    .site-header .main-menu ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 20px; }
    .site-header .main-menu li a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
    .site-header .main-menu li a.active::after,
    .site-header .main-menu li a:hover::after { display: none; }
    .site-header .main-menu li a.menu-icon {
        width: auto; height: auto; border: 0; border-radius: 0; background: none;
        margin: 0; display: flex; gap: 10px; justify-content: flex-start; padding: 14px 4px;
    }
    .site-header .main-menu .menu-icon .label { display: inline; }

    /* Fallback for older pages without the toggle: keep menu usable */
    .header:not(.site-header) .main-menu li a { padding: 6px 8px; font-size: 14px; }
}
.main-menu .menu-icon .label { display: none; }

@media (max-width: 600px) {
    body { font-size: 16px; }
    .section { padding: 56px 0; }
    .hero { padding: 56px 0 64px; }
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .card { padding: 24px; }
    .header .logo { height: 42px; }
    .container { padding: 0 18px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .feature { border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Social icons (footer) ---------- */
.social-links { display: flex; flex-wrap: wrap; gap: 10px; }
.social-links a {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
    font-size: 16px; text-decoration: none; transition: background .2s, color .2s, transform .2s;
}
.social-links a:hover { transform: translateY(-2px); }
.footer-social { margin-top: 18px; }
.footer-social a { background: rgba(255,255,255,.08); color: #e6e0cf; }
.footer-social a:hover { background: var(--gold); color: var(--green-dark); }

/* ---------- About page intro (compact) ---------- */
.about-intro {
    padding: 64px 0 72px;
    background:
        radial-gradient(700px 300px at 10% 0%, rgba(200,162,74,.14), transparent 60%),
        linear-gradient(180deg, var(--bg-color) 0%, #fbf8ef 100%);
}
.about-grid { display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: center; }
.about-photo img {
    width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%;
    border: 4px solid var(--surface); box-shadow: 0 0 0 2px var(--gold), 0 18px 40px rgba(23,63,48,.18);
}
.about-text h1 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 16px; }
.about-text p { color: var(--muted); max-width: 620px; }
.about-text .hero-actions { margin-top: 26px; }

@media (max-width: 760px) {
    .about-intro { padding: 32px 0 44px; }
    .about-grid { grid-template-columns: 1fr; gap: 20px; }
    .about-photo { width: 104px; }
    .about-photo img { border-width: 3px; box-shadow: 0 0 0 2px var(--gold), 0 10px 24px rgba(23,63,48,.16); }
    .about-text h1 { margin-bottom: 12px; }
    .about-text .hero-actions .btn { flex: 1; justify-content: center; }
}

/* ---------- Compact page titles (all remaining .page-hero blocks) ---------- */
.page-hero { padding: 40px 0 32px; }
.page-hero h1 { font-size: clamp(26px, 4vw, 36px); }
.page-hero p { font-size: 16px; margin-top: 8px; }
@media (max-width: 600px) {
    .page-hero { padding: 28px 0 24px; }
}
