/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #faf8f5;
    --text: #141414;
    --text-muted: #555555;
    --accent: #ec4899;
    --line: #e8e4df;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-hand: 'Caveat', cursive;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    width: 100%;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ===== NAVBAR ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: var(--bg);
    transition: box-shadow 0.3s ease;
}

.navbar.scrolled { box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05); }

.nav-logo a {
    font-size: 21px;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.6px;
    color: var(--text);
    display: inline-block;
}

.logo-star { color: var(--accent); font-size: 19px; margin-left: 1px; }
.nav-links { display: none; }
.nav-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.nav-search {
    background: none; border: none; cursor: pointer;
    color: var(--text); padding: 4px;
    display: flex; align-items: center; justify-content: center;
}

.nav-search svg { width: 22px; height: 22px; }

.nav-hamburger {
    background: none; border: none; cursor: pointer;
    display: flex; flex-direction: column; gap: 5px; padding: 4px;
}

.nav-hamburger span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }
.nav-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== HANDWRITTEN ===== */
.handwritten { font-family: var(--font-hand); font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.15; }

/* ===== HERO ===== */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 82px 20px 32px;
    position: relative;
    overflow-x: clip;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 2;
}

.tagline-wrapper { position: relative; display: inline-block; transform: rotate(-6deg); transform-origin: left bottom; margin-bottom: 20px; margin-left: 2px; }
.tagline-text { display: block; text-align: left; }
.tagline-underline { position: absolute; bottom: -6px; left: -2px; width: 135px; height: 10px; }
.doodle-crown { position: absolute; top: 4px; right: 8px; width: 44px; height: 36px; z-index: 3; }

.hero-title {
    font-size: clamp(44px, 13vw, 54px);
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: -2px;
    margin-bottom: 18px;
    position: relative;
    display: inline-block;
    text-align: left;
}

.title-star { color: var(--accent); font-size: 0.55em; vertical-align: super; position: relative; top: -4px; margin-left: 2px; }

.title-burst { position: absolute; top: 50%; right: -34px; transform: translateY(-50%); width: 32px; height: 32px; pointer-events: none; }

.hero-description { font-size: 15px; line-height: 1.55; color: var(--text-muted); margin-bottom: 26px; max-width: 360px; }

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #141414;
    color: #ffffff;
    padding: 13px 28px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    border: 2px solid #141414;
    align-self: center;
    margin: 4px auto 34px;
    transition: all 0.25s ease;
}

.hero-btn:hover { background: transparent; color: #141414; }
.hero-btn svg { transition: transform 0.2s ease; }
.hero-btn:hover svg { transform: translateX(4px); }

/* ===== POLAROID ===== */
.hero-image-wrapper { display: flex; justify-content: center; align-items: center; position: relative; width: 100%; max-width: 340px; padding: 8px 4px; }

.doodle-curve-left, .doodle-circle, .doodle-arrow, .doodle-starburst, .doodle-smiley { display: none; }

.polaroid { position: relative; width: 100%; transform: rotate(1.5deg); z-index: 3; }

.polaroid::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #ffffff;
    transform: rotate(-2deg) translate(-2px, 3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    z-index: -1;
    border-radius: 2px;
}

.polaroid-frame { background: #ffffff; padding: 8px 8px 24px; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.04); position: relative; border-radius: 2px; }

.polaroid-tape {
    position: absolute;
    top: -10px; left: -10px;
    width: 66px; height: 24px;
    background-color: #dfd7c4;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(0, 0, 0, 0.02) 3px, rgba(0, 0, 0, 0.02) 6px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2) 2px, transparent 2px, transparent 5px);
    transform: rotate(-28deg);
    z-index: 10;
    opacity: 0.9;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.polaroid-img { width: 100%; aspect-ratio: 4 / 3.2; object-fit: cover; border-radius: 1px; }

.polaroid-doodle { position: absolute; top: 18px; right: 18px; display: flex; flex-direction: column; align-items: center; z-index: 5; background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(2px); padding: 3px 6px; border-radius: 4px; }
.polaroid-doodle svg:first-child { width: 24px; height: 18px; }
.polaroid-text { font-size: 26px; font-weight: 700; letter-spacing: 1.5px; line-height: 1; color: #141414; }

/* ===== ARTICLES & RESOURCES ===== */
.resources { padding: 60px 20px 70px; border-top: 1px solid var(--line); }

.resources-head {
    max-width: 1120px;
    margin: 0 auto 34px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.resources-kicker { display: inline-block; font-size: 24px; color: var(--accent); transform: rotate(-2deg); margin-bottom: 4px; }

.resources-title { font-size: clamp(30px, 5vw, 44px); font-weight: 900; letter-spacing: -1.5px; }

.resources-filters { display: flex; gap: 10px; flex-wrap: wrap; }

.filter-pill {
    border: 1.5px solid #e0dad2;
    background: #fff;
    border-radius: 999px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-pill:hover { border-color: var(--accent); color: var(--accent); }

.filter-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(232, 93, 38, 0.3); }

.resources-grid {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}

.res-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.res-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12); }

.res-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #efeae3; }
.res-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.res-card:hover .res-thumb img { transform: scale(1.06); }

.res-tag { position: absolute; top: 12px; left: 12px; background: var(--text); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; }

.res-body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; }

.res-title { font-size: 19px; font-weight: 800; line-height: 1.3; letter-spacing: -0.3px; transition: color 0.25s; }
.res-card:hover .res-title { color: var(--accent); }

.res-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

.res-meta { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.res-sep { color: var(--accent); }

.res-soon { border: 2px dashed rgba(20, 20, 20, 0.2); background: transparent; box-shadow: none; align-items: center; justify-content: center; min-height: 320px; }
.res-soon:hover { transform: none; box-shadow: none; border-color: var(--accent); }
.res-soon-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px; text-align: center; opacity: 0.75; }
.res-soon-inner svg { color: var(--accent); }
.res-soon-inner .handwritten { font-size: 24px; }
.res-soon-tag { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); border: 1.5px solid #ddd6cc; padding: 5px 12px; border-radius: 999px; }

.res-card.hidden { display: none; }

/* ===== FOOTER ===== */
.footer { text-align: center; padding: 30px 20px 40px; border-top: 1px solid var(--line); }
.footer-doodle { margin-bottom: 16px; }
.footer-text { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.footer-copy { font-size: 12px; color: var(--text-muted); }

/* ===== MOBILE MENU ===== */
.mobile-menu {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-menu.open { opacity: 1; pointer-events: all; }
.mobile-close { position: absolute; top: 20px; right: 24px; background: none; border: none; font-size: 36px; cursor: pointer; color: var(--text); }
.mobile-links { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.mobile-links a { font-size: 26px; font-weight: 700; color: var(--text); transition: opacity 0.3s; }
.mobile-links a:hover { opacity: 0.5; }

/* ===== DESKTOP (>= 769px) ===== */
@media (min-width: 769px) {
    .navbar { padding: 24px 48px; }
    .nav-logo a { font-size: 24px; }
    .nav-links { display: flex; align-items: center; gap: 28px; }

    .nav-link { font-size: 14px; font-weight: 500; color: var(--text-muted); position: relative; padding-bottom: 4px; transition: color 0.3s; }
    .nav-link:hover, .nav-link.active { color: var(--text); }
    .nav-link.active::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px; background: var(--accent); border-radius: 2px; }
    .nav-more { display: flex; align-items: center; gap: 4px; }

    .hero { flex-direction: row; justify-content: space-between; padding: 120px 48px 60px; overflow: visible; }
    .hero-content { max-width: 520px; }
    .tagline-wrapper { margin-left: 0; transform: none; margin-bottom: 18px; }
    .tagline-text { font-size: 32px; }
    .tagline-underline { width: 100%; bottom: -8px; }
    .doodle-crown { top: 95px; right: 60px; width: 60px; height: 50px; }
    .hero-title { font-size: clamp(64px, 8vw, 100px); letter-spacing: -3px; margin-bottom: 20px; }
    .title-star { font-size: 0.4em; top: -6px; }
    .title-burst { right: -60px; top: 42%; width: 50px; height: 50px; }
    .hero-description { font-size: 17px; max-width: 440px; margin: 0 0 40px 0; }
    .hero-btn { align-self: flex-start; margin: 0; padding: 16px 36px; font-size: 16px; }
    .hero-image-wrapper { max-width: 500px; padding: 0; }

    .doodle-curve-left { display: block; position: absolute; top: -20px; left: -40px; z-index: 1; }
    .doodle-circle { display: block; position: absolute; top: 50%; right: -35px; transform: translateY(-50%); z-index: 1; }
    .doodle-smiley { display: block; position: absolute; bottom: 20px; right: 10px; z-index: 5; }
    .doodle-arrow { display: block; position: absolute; bottom: -15px; left: -25px; z-index: 5; }
    .doodle-starburst { display: block; position: absolute; top: 15px; right: -15px; z-index: 5; }

    .polaroid { width: auto; transform: rotate(-3deg); }
    .polaroid::before { transform: rotate(2.5deg) translate(5px, 6px); }
    .polaroid-img { width: 360px; aspect-ratio: 4 / 3; }
    .polaroid-frame { padding: 12px 12px 50px; }
    .polaroid-tape { width: 80px; height: 30px; left: 20px; top: -18px; transform: rotate(-20deg); background: linear-gradient(135deg, #f0e6d3 0%, #e8dcc8 30%, #f5edd8 60%, #e0d4be 100%); }
    .polaroid-doodle { top: 16px; right: 16px; background: none; backdrop-filter: none; padding: 0; }
    .polaroid-doodle svg:first-child { width: 26px; height: 20px; }
    .polaroid-text { font-size: 32px; }

    .resources { padding: 70px 48px 90px; }
    .footer { padding: 40px 48px 50px; }
}

@media (min-width: 1024px) {
    .polaroid-img { width: 380px; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(-1deg); } }
@keyframes drawLine { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }

.hero-content { animation: fadeInUp 0.8s ease-out; }
.hero-image-wrapper { animation: fadeInUp 1s ease-out 0.3s both; }
.polaroid { animation: wiggle 4s ease-in-out infinite; }
.doodle-crown { animation: float 3.5s ease-in-out infinite 0.5s; }

.tagline-underline path { stroke-dasharray: 200; stroke-dashoffset: 200; animation: drawLine 1.2s ease-out 0.4s forwards; }

@keyframes btnBounce {
    0% { opacity: 0; transform: translateY(30px) scale(0.85); }
    60% { opacity: 1; transform: translateY(-6px) scale(1.04); }
    80% { transform: translateY(3px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes btnShimmer { 0% { left: -75%; } 60% { left: 125%; } 100% { left: 125%; } }
@keyframes btnGlowPulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(20, 20, 20, 0.25), 0 0 0 0 rgba(232, 93, 38, 0); }
    50% { box-shadow: 0 6px 20px rgba(20, 20, 20, 0.35), 0 0 0 8px rgba(232, 93, 38, 0.12); }
}
@keyframes btnArrowNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

/* ===== LIVE BACKGROUND DOODLES ===== */
.doodle-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-doodle { position: absolute; opacity: 0.13; }

.bg-doodle path, .bg-doodle circle {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: doodleDraw var(--dur, 7s) ease-in-out var(--delay, 0s) infinite;
}

.d1  { top: 16%; left: 6%;      --dur: 6s;   --delay: 0s;   transform: rotate(8deg); }
.d2  { top: 26%; right: 5%;     --dur: 7s;   --delay: 1.2s; transform: rotate(-6deg); }
.d3  { bottom: 30%; left: 5%;   --dur: 8s;   --delay: 2s;   transform: rotate(-10deg); }
.d4  { bottom: 18%; right: 8%;  --dur: 6.5s; --delay: 0.6s; transform: rotate(5deg); }
.d5  { top: 46%; left: 44%;     --dur: 9s;   --delay: 3s; }
.d6  { top: 60%; right: 12%;    --dur: 8s;   --delay: 1.6s; }
.d7  { bottom: 8%; left: 12%;   --dur: 7.5s; --delay: 2.6s; transform: rotate(-4deg); }
.d8  { top: 70%; left: 6%;      --dur: 6.8s; --delay: 0.9s; }
.d9  { top: 12%; right: 30%;    --dur: 8.5s; --delay: 3.4s; transform: rotate(12deg); }
.d10 { bottom: 40%; right: 30%; --dur: 7.2s; --delay: 4s; }

@keyframes doodleDraw {
    0% { stroke-dashoffset: 100; opacity: 0; }
    10% { opacity: 1; }
    45% { stroke-dashoffset: 0; opacity: 1; }
    80% { stroke-dashoffset: 0; opacity: 1; }
    95% { opacity: 0; }
    100% { stroke-dashoffset: 100; opacity: 0; }
}

/* ===== MOBILE (<= 768px) ===== */
@media (max-width: 768px) {
    .d5, .d9, .d10 { display: none; }
    .bg-doodle { opacity: 0.11; }
    .d1 { top: 20%; left: 4%; }
    .d2 { top: 34%; right: 3%; }
    .d6 { top: 66%; right: 6%; }
    .d8 { top: 76%; left: 4%; }
}

@media (max-width: 768px) {
    :root { --u: min(1vw, 5px); }

    .navbar { padding: calc(var(--u) * 2) calc(var(--u) * 5); }
    .nav-logo a { font-size: calc(var(--u) * 5.6); line-height: 1; letter-spacing: -0.04em; }
    .logo-star { font-size: calc(var(--u) * 5); }
    .nav-actions { gap: calc(var(--u) * 6); }
    .nav-search svg { width: calc(var(--u) * 5.4); height: calc(var(--u) * 5.4); }
    .nav-hamburger { gap: calc(var(--u) * 1.9); }
    .nav-hamburger span { width: calc(var(--u) * 7.4); height: 2.5px; }
    .nav-hamburger.active span:nth-child(1) { transform: translateY(calc(var(--u) * 1.9 + 2.5px)) rotate(45deg); }
    .nav-hamburger.active span:nth-child(3) { transform: translateY(calc(var(--u) * -1.9 - 2.5px)) rotate(-45deg); }

    .hero-image-wrapper { display: none !important; }

    .hero {
        min-height: 0;
        padding: calc(var(--u) * 4) calc(var(--u) * 5) calc(var(--u) * 10);
        justify-content: flex-start;
    }
    .hero-content { width: 100%; max-width: 100%; padding: 0 calc(var(--u) * 2); }

    .handwritten.tagline-text { font-size: calc(var(--u) * 8.5); }
    .tagline-wrapper { margin: 0 0 calc(var(--u) * 5) 0; transform: rotate(-5deg); }
    .tagline-underline { width: calc(var(--u) * 40); height: calc(var(--u) * 2.5); left: calc(var(--u) * -0.4); bottom: calc(var(--u) * -1.5); }

    .doodle-crown { top: calc(var(--u) * -4); right: calc(var(--u) * 1); width: calc(var(--u) * 13); height: calc(var(--u) * 10.5); }

    .hero-title { font-size: calc(var(--u) * 17); line-height: 0.92; letter-spacing: calc(var(--u) * -0.55); margin-bottom: calc(var(--u) * 6); width: 100%; }
    .title-star { font-size: 0.55em; }
    .title-burst { right: calc(var(--u) * -9); width: calc(var(--u) * 9); height: calc(var(--u) * 9); }

    .hero-description { font-size: calc(var(--u) * 4.8); line-height: 1.6; max-width: calc(var(--u) * 88); margin-bottom: calc(var(--u) * 8); }

    .hero-btn {
        align-self: flex-start;
        font-size: calc(var(--u) * 4.4);
        padding: calc(var(--u) * 4) calc(var(--u) * 8.5);
        margin: 0 0 calc(var(--u) * 2) 0;
        gap: calc(var(--u) * 2.5);
        position: relative;
        overflow: hidden;
        isolation: isolate;
        animation: btnBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both, btnGlowPulse 2.4s ease-in-out 1.2s infinite;
        box-shadow: 0 4px 14px rgba(20, 20, 20, 0.25);
    }
    .hero-btn::before {
        content: '';
        position: absolute;
        top: 0; left: -75%;
        width: 50%; height: 100%;
        background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.25) 45%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0.25) 55%, transparent 100%);
        transform: skewX(-22deg);
        animation: btnShimmer 2.8s ease-in-out 1.6s infinite;
        z-index: 1;
        pointer-events: none;
    }
    .hero-btn > * { position: relative; z-index: 2; }
    .hero-btn svg { width: calc(var(--u) * 5); height: calc(var(--u) * 5); animation: btnArrowNudge 1.6s ease-in-out 1s infinite; }
    .hero-btn:active { transform: scale(0.96); transition: transform 0.1s; }

    /* Resources mobile */
    .resources { padding: 40px 16px 50px; }
    .resources-head { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
    .resources-filters { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
    .filter-pill { flex: 0 0 auto; padding: 9px 18px; font-size: 12px; }
    .resources-grid { grid-template-columns: 1fr; gap: 20px; }
    .res-soon { min-height: 220px; }
}

/* ===== MOBILE HERO COMPACT — FINAL OVERRIDE ===== */
@media (max-width: 768px) {
    .hero {
        min-height: 0 !important;
        height: auto !important;
        padding: calc(var(--u, 4px) * 24) calc(var(--u, 4px) * 5) calc(var(--u, 4px) * 20) !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
    }

    .hero-content {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .tagline-wrapper {
        margin-top: 0 !important;
        margin-bottom: calc(var(--u, 4px) * 4) !important;
    }

    .doodle-crown {
        top: calc(var(--u, 4px) * 1) !important;
    }
}
