/* ELI5 Park - shared brand layer (nav, footer, Pip chat, home + grown-ups pages).
   Loaded on every page. Page-specific legacy styles are softened by theme.css. */

@font-face {
    font-family: 'Fredoka';
    font-style: normal;
    font-display: swap;
    font-weight: 300 700;
    src: url('fonts/fredoka-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-display: swap;
    font-weight: 200 1000;
    src: url('fonts/nunito-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
    --ep-ink: #1f2a44;
    --ep-ink-soft: #4a5672;
    --ep-muted: #6b7690;
    --ep-paper: #ffffff;
    --ep-cream: #fffaf0;
    --ep-sky: #dff3ff;
    --ep-sky-strong: #2b9bf0;
    --ep-green: #22a06b;
    --ep-green-dark: #15784f;
    --ep-grass: #7ed957;
    --ep-sun: #ffc93c;
    --ep-coral: #ff6b6b;
    --ep-grape: #7c5cff;
    --ep-line: #e3e9f3;
    --ep-radius: 22px;
    --ep-shadow: 0 2px 0 rgba(31, 42, 68, .06), 0 12px 32px -12px rgba(31, 42, 68, .22);
    --ep-font-display: 'Fredoka', 'Nunito', ui-rounded, 'Segoe UI', system-ui, sans-serif;
    --ep-font-body: 'Nunito', ui-rounded, 'Segoe UI', system-ui, sans-serif;
}

/* The nav and footer span the full width, so pages no longer pad the body itself. */
html body { padding: 0; margin: 0; }
.ep-skip { position: absolute; left: -999px; top: 8px; z-index: 1000; background: var(--ep-ink); color: #fff; padding: 10px 16px; border-radius: 12px; }
.ep-skip:focus { left: 12px; }

/* ---------- Top navigation ---------- */
.ep-nav {
    position: sticky; top: 0; z-index: 900;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--ep-line);
    font-family: var(--ep-font-body);
    color: var(--ep-ink);
}
.ep-nav * { box-sizing: border-box; }
.ep-nav-inner {
    max-width: 1320px; margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; gap: 14px;
}
.ep-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ep-ink); flex-shrink: 0; }
.ep-brand img { width: 40px; height: 40px; display: block; transition: transform .25s; }
.ep-brand:hover img { transform: rotate(-8deg) scale(1.06); }
.ep-brand-text { font-family: var(--ep-font-display); font-size: 23px; font-weight: 600; letter-spacing: -.01em; line-height: 1; white-space: nowrap; }
.ep-brand-text b { color: var(--ep-green); font-weight: 700; }

.ep-links { display: flex; gap: 2px; flex: 1; justify-content: safe center; min-width: 0; }
.ep-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 11px; border-radius: 999px;
    font-weight: 700; font-size: 15px; color: var(--ep-ink-soft);
    text-decoration: none; white-space: nowrap;
    transition: background .15s, color .15s, transform .15s;
}
.ep-link:hover { background: var(--ep-sky); color: var(--ep-ink); transform: translateY(-1px); }
.ep-link.is-active { background: var(--ep-ink); color: #fff; }
.ep-link.is-grownup { color: var(--ep-muted); font-weight: 600; font-size: 14px; }
.ep-link .ep-emoji { font-size: 17px; line-height: 1; }

.ep-nav-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ep-ask-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font: 700 15px var(--ep-font-body); color: var(--ep-ink);
    background: var(--ep-sun); border: 0; border-radius: 999px;
    padding: 9px 16px; cursor: pointer;
    box-shadow: 0 3px 0 #e0a800;
    transition: transform .15s, box-shadow .15s;
}
.ep-ask-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #e0a800; }
.ep-ask-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #e0a800; }

/* Narrow screens: brand + Ask on one row, topic chips scroll sideways underneath. */
@media (max-width: 1300px) {
    .ep-nav-inner { flex-wrap: wrap; padding: 8px 16px 0; row-gap: 6px; }
    .ep-nav-actions { margin-left: auto; }
    .ep-links {
        order: 3; flex-basis: 100%; justify-content: flex-start;
        overflow-x: auto; scrollbar-width: none; padding: 2px 0 10px;
        mask-image: linear-gradient(90deg, #000 90%, transparent);
        -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent);
    }
    .ep-links::-webkit-scrollbar { display: none; }
    .ep-link { background: #f2f6fb; font-size: 14px; padding: 7px 12px; }
}
@media (max-width: 420px) {
    .ep-brand-text { font-size: 20px; }
    .ep-brand img { width: 34px; height: 34px; }
    .ep-ask-btn { padding: 8px 13px; font-size: 14px; }
}

/* ---------- Footer ---------- */
.ep-footer {
    margin-top: 56px;
    background: var(--ep-ink); color: #dfe6f5;
    font-family: var(--ep-font-body); font-size: 15px; line-height: 1.6;
    position: relative;
}
.ep-footer::before {
    content: ""; position: absolute; left: 0; right: 0; top: -28px; height: 30px;
    background: radial-gradient(60px 30px at 60px 30px, var(--ep-ink) 98%, transparent 100%) repeat-x;
    background-size: 120px 30px;
}
.ep-footer * { box-sizing: border-box; }
.ep-footer a { color: #fff; text-decoration: none; }
.ep-footer a:hover { color: var(--ep-sun); text-decoration: underline; }
.ep-footer-inner { max-width: 1140px; margin: 0 auto; padding: 32px 20px 28px; }
.ep-footer-top { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 28px; }
.ep-footer-brand { display: flex; flex-direction: column; gap: 10px; }
.ep-footer-brand .ep-brand { color: #fff; }
.ep-footer-brand .ep-brand-text b { color: var(--ep-grass); }
.ep-footer-brand p { margin: 0; color: #b9c3da; max-width: 300px; }
.ep-footer h3 { font: 600 15px var(--ep-font-display); color: var(--ep-sun); margin: 0 0 10px; letter-spacing: .02em; }
.ep-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ep-footer-bottom {
    margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12);
    display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; color: #b9c3da; font-size: 14px;
}
.ep-footer-bottom strong { color: #fff; }
@media (max-width: 820px) {
    .ep-footer-top { grid-template-columns: 1fr 1fr; }
    .ep-footer-brand { grid-column: 1 / -1; }
}

/* ---------- Pip chat ---------- */
.ep-chat-fab {
    position: fixed; right: 20px; bottom: 20px; z-index: 950;
    display: inline-flex; align-items: center; gap: 8px;
    font: 700 16px var(--ep-font-body); color: #fff;
    background: var(--ep-green); border: 0; border-radius: 999px;
    padding: 12px 20px 12px 14px; cursor: pointer;
    box-shadow: 0 4px 0 var(--ep-green-dark), 0 14px 30px -8px rgba(21, 120, 79, .6);
    transition: transform .18s, box-shadow .18s;
}
.ep-chat-fab .ep-fab-face { font-size: 26px; line-height: 1; display: inline-block; animation: ep-wiggle 4s ease-in-out infinite; }
.ep-chat-fab:hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--ep-green-dark), 0 18px 34px -8px rgba(21, 120, 79, .6); }
.ep-chat-fab[aria-expanded="true"] { display: none; }
@keyframes ep-wiggle { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(-14deg); } 94% { transform: rotate(12deg); } 97% { transform: rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .ep-chat-fab .ep-fab-face { animation: none; } }

.ep-chat {
    position: fixed; right: 20px; bottom: 20px; z-index: 960;
    width: 390px; max-width: calc(100vw - 32px);
    height: 600px; max-height: calc(100vh - 40px);
    display: flex; flex-direction: column;
    background: var(--ep-paper); color: var(--ep-ink);
    border-radius: 26px; overflow: hidden;
    box-shadow: 0 30px 70px -20px rgba(31, 42, 68, .45), 0 0 0 1px rgba(31, 42, 68, .06);
    font-family: var(--ep-font-body); font-size: 15.5px; line-height: 1.5;
    transform-origin: bottom right;
    animation: ep-pop .22s ease-out;
}
.ep-chat[hidden] { display: none; }
.ep-chat * { box-sizing: border-box; }
@keyframes ep-pop { from { opacity: 0; transform: scale(.9) translateY(10px); } }
@media (max-width: 520px) {
    .ep-chat { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; border-radius: 0; }
    .ep-chat-fab { right: 14px; bottom: 14px; padding: 11px 16px 11px 12px; }
    .ep-chat-fab .ep-fab-label { display: none; }
}

.ep-chat-head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 14px 14px 16px;
    background: linear-gradient(135deg, #2ebd7e, var(--ep-green));
    color: #fff;
}
.ep-chat-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: #fff; display: grid; place-items: center; font-size: 26px; flex-shrink: 0;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08);
}
.ep-chat-title { flex: 1; min-width: 0; }
.ep-chat-title strong { display: block; font: 600 19px var(--ep-font-display); }
.ep-chat-title span { font-size: 13px; opacity: .92; }
.ep-chat-close {
    width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255, 255, 255, .2); color: #fff; font-size: 22px; line-height: 1;
}
.ep-chat-close:hover { background: rgba(255, 255, 255, .32); }

.ep-chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: #f6fafd; }
.ep-msg { max-width: 88%; padding: 11px 14px; border-radius: 18px; word-wrap: break-word; }
.ep-msg p { margin: 0 0 6px; }
.ep-msg p:last-child { margin-bottom: 0; }
.ep-msg-bot { align-self: flex-start; background: #fff; border: 1px solid var(--ep-line); border-bottom-left-radius: 6px; }
.ep-msg-user { align-self: flex-end; background: var(--ep-sky-strong); color: #fff; border-bottom-right-radius: 6px; font-weight: 600; }
.ep-msg-snippet { background: var(--ep-cream); border-left: 4px solid var(--ep-sun); padding: 8px 10px; border-radius: 0 10px 10px 0; margin: 6px 0 8px; color: var(--ep-ink-soft); }
.ep-msg-snippet b { color: var(--ep-ink); }
.ep-msg-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ep-muted); margin: 8px 0 4px; }
.ep-source {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; margin-top: 6px; border-radius: 14px;
    background: #f2f6fb; color: var(--ep-ink); text-decoration: none; font-weight: 700; font-size: 14.5px;
    transition: background .15s, transform .15s;
}
.ep-source:hover { background: var(--ep-sky); transform: translateX(2px); }
.ep-source small { display: block; font-weight: 600; color: var(--ep-muted); font-size: 12.5px; }
.ep-source .ep-source-icon { font-size: 22px; }
.ep-source .ep-source-go { margin-left: auto; color: var(--ep-green); font-size: 18px; }
.ep-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.ep-typing i { width: 8px; height: 8px; border-radius: 50%; background: #b8c4d8; animation: ep-bounce 1s infinite; }
.ep-typing i:nth-child(2) { animation-delay: .15s; }
.ep-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ep-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

.ep-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ep-chip {
    border: 1.5px solid var(--ep-line); background: #fff; color: var(--ep-ink);
    border-radius: 999px; padding: 6px 12px; cursor: pointer;
    font: 700 13.5px var(--ep-font-body);
    transition: border-color .15s, background .15s;
}
.ep-chip:hover { border-color: var(--ep-green); background: #effaf4; }

.ep-chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--ep-line); background: #fff; }
.ep-chat-input {
    flex: 1; min-width: 0; border: 2px solid var(--ep-line); border-radius: 999px;
    padding: 11px 16px; font: 600 16px var(--ep-font-body); color: var(--ep-ink); outline: none;
}
.ep-chat-input:focus { border-color: var(--ep-sky-strong); }
.ep-chat-send {
    width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0;
    background: var(--ep-green); color: #fff; font-size: 20px; display: grid; place-items: center;
}
.ep-chat-send:disabled { opacity: .5; cursor: default; }
.ep-chat-note { padding: 0 14px 10px; background: #fff; font-size: 12px; color: var(--ep-muted); text-align: center; }

/* ---------- Shared page building blocks (home + grown-ups corner) ---------- */
.ep-page { font-family: var(--ep-font-body); color: var(--ep-ink); }
.ep-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.ep-section { margin-top: 56px; }
.ep-section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ep-section-head h2 { font: 600 clamp(26px, 3.4vw, 34px)/1.15 var(--ep-font-display); margin: 0; color: var(--ep-ink); }
.ep-section-head p { margin: 4px 0 0; color: var(--ep-ink-soft); font-size: 17px; }
.ep-eyebrow { display: inline-block; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ep-green-dark); }

.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.ep-card {
    --tint: var(--ep-sky);
    --accent: var(--ep-sky-strong);
    position: relative; display: flex; flex-direction: column; gap: 6px;
    padding: 22px; border-radius: var(--ep-radius);
    background: var(--ep-paper); color: var(--ep-ink); text-decoration: none;
    box-shadow: var(--ep-shadow); border: 2px solid transparent;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    overflow: hidden;
}
.ep-card::after {
    content: ""; position: absolute; right: -36px; top: -36px; width: 120px; height: 120px; border-radius: 50%;
    background: var(--tint); z-index: 0; transition: transform .3s;
}
.ep-card > * { position: relative; z-index: 1; }
.ep-card:hover { transform: translateY(-5px) rotate(-.4deg); border-color: var(--accent); }
.ep-card:hover::after { transform: scale(1.25); }
.ep-card-icon {
    width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center;
    font-size: 32px; background: var(--tint); margin-bottom: 6px;
}
.ep-card h3 { margin: 0; font: 600 21px/1.2 var(--ep-font-display); }
.ep-card p { margin: 0; color: var(--ep-ink-soft); font-size: 15.5px; line-height: 1.5; }
.ep-card-meta { margin-top: auto; padding-top: 10px; font-weight: 800; font-size: 13.5px; color: var(--accent); }
.ep-card.t-sky    { --tint: #dff3ff; --accent: #1f86d6; }
.ep-card.t-grape  { --tint: #ece7ff; --accent: #6a4be8; }
.ep-card.t-sun    { --tint: #fff1c7; --accent: #b77d00; }
.ep-card.t-coral  { --tint: #ffe3e3; --accent: #e04848; }
.ep-card.t-green  { --tint: #dcf6e8; --accent: #15784f; }
.ep-card.t-teal   { --tint: #d8f5f3; --accent: #0f8a83; }
.ep-card.t-pink   { --tint: #ffe2f1; --accent: #cc3d8a; }
.ep-card.t-orange { --tint: #ffe6d1; --accent: #d1661a; }
.ep-card.t-slate  { --tint: #e9eef6; --accent: #45526e; }

.ep-btn {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer;
    font: 700 17px var(--ep-font-body); border: 0; border-radius: 999px; padding: 14px 24px;
    transition: transform .15s, box-shadow .15s;
}
.ep-btn:hover { transform: translateY(-2px); }
.ep-btn-primary { background: var(--ep-green); color: #fff; box-shadow: 0 4px 0 var(--ep-green-dark); }
.ep-btn-sun { background: var(--ep-sun); color: var(--ep-ink); box-shadow: 0 4px 0 #e0a800; }
.ep-btn-ghost { background: #fff; color: var(--ep-ink); box-shadow: 0 0 0 2px var(--ep-line) inset; }

.ep-grownup-note {
    display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
    padding: 22px 26px; border-radius: var(--ep-radius);
    background: #fff; border: 2px dashed #cfd8e6; color: var(--ep-ink-soft);
}
.ep-grownup-note .ep-wave { font-size: 38px; }
.ep-grownup-note div { flex: 1; min-width: 220px; }
.ep-grownup-note strong { color: var(--ep-ink); font-family: var(--ep-font-display); font-weight: 600; font-size: 20px; display: block; }
.ep-grownup-note p { margin: 2px 0 0; font-size: 15.5px; }
