/* ==========================================================================
   Coloring Ninja — design system v2
   Fonts: Fredoka (display) + Nunito (body). Brand teal kept from the logo.
   ========================================================================== */

:root {
    --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
    --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --ink: #1a1d2e;
    --ink-2: #4b5068;
    --ink-3: #868ca3;
    --line: #e9e6ef;
    --line-2: #f1eff5;

    --bg: #fffdfa;
    --surface: #ffffff;
    --cream: #fbf5ec;
    --mint: #edfaf8;

    --brand: #28bfb5;
    --brand-600: #1aa59b;
    --brand-700: #13867e;
    --brand-100: #d5f3f0;
    --brand-50: #eefaf9;

    --coral: #ff6f61;
    --coral-600: #e85a4c;
    --sun: #ffc83d;
    --violet: #8b7cf6;
    --sky: #4cc3ff;

    --header-bg: #12142a;

    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(26, 29, 46, .05), 0 2px 8px rgba(26, 29, 46, .05);
    --shadow-md: 0 4px 14px rgba(26, 29, 46, .08), 0 1px 3px rgba(26, 29, 46, .05);
    --shadow-lg: 0 14px 40px rgba(26, 29, 46, .12), 0 2px 6px rgba(26, 29, 46, .05);
    --shadow-brand: 0 8px 22px rgba(40, 191, 181, .32);

    --container: 1200px;
    --gutter: 20px;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
img, picture, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-600); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
input, textarea, select { font-size: 16px !important; } /* prevents iOS zoom on focus */
::selection { background: var(--brand-100); color: var(--ink); }
:focus-visible { outline: 3px solid rgba(40, 191, 181, .45); outline-offset: 2px; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    color: var(--ink);
    letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.3vw, 2.15rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { color: var(--ink-2); }
strong { color: var(--ink); }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container, .main-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.main-container { padding-top: 24px; padding-bottom: 24px; }
.container-sm { max-width: 820px; }
.container-xs { max-width: 480px; }

.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }
.section-cream { background: var(--cream); }
.section-mint { background: var(--mint); }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.section-head h2 { margin: 0; }
.section-head p { margin-top: 6px; }
.section-head .link-more { white-space: nowrap; font-weight: 700; }
.section-head.center { flex-direction: column; align-items: center; text-align: center; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand-700);
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    padding: 6px 12px;
    border-radius: var(--r-pill);
}

.page-head { text-align: center; padding: 36px 0 24px; }
.page-head h1 { margin-bottom: 10px; }
.page-head p { max-width: 640px; margin: 0 auto; font-size: 1.05rem; }
.page-head .breadcrumbs { justify-content: center; margin-bottom: 14px; }

.link-more::after { content: " →"; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--r-pill);
    font-family: var(--font-body);
    font-weight: 800;
    font-size: .95rem;
    line-height: 1.2;
    text-decoration: none;
    border: 2px solid transparent;
    transition: box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
    white-space: nowrap;
    cursor: pointer;
}
.btn:hover { transform: scale(1.02); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-600); color: #fff; box-shadow: 0 10px 26px rgba(40, 191, 181, .4); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2a2e45; color: #fff; box-shadow: var(--shadow-md); }
.btn-coral { background: var(--coral); color: #fff; box-shadow: 0 8px 22px rgba(255, 111, 97, .3); }
.btn-coral:hover { background: var(--coral-600); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); border-color: var(--line); }
.btn-light:hover { border-color: var(--brand); color: var(--brand-700); }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.header-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
    height: 68px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.55rem;
    color: #fff;
    letter-spacing: -.01em;
    flex-shrink: 0;
}
.logo:hover { color: #fff; }
.logo span { color: var(--brand); }
.logo-image { width: 36px; height: 36px; }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.nav-menu a {
    color: rgba(255, 255, 255, .78);
    font-weight: 700;
    font-size: .95rem;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    transition: color .15s, background-color .15s;
}
.nav-menu a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-menu a.active { color: #fff; background: rgba(255, 255, 255, .1); }
.nav-menu .nav-cta {
    margin-left: 8px;
    background: var(--brand);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--r-pill);
    box-shadow: 0 4px 14px rgba(40, 191, 181, .35);
}
.nav-menu .nav-cta:hover { background: var(--brand-600); }
.nav-menu .user-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border-radius: var(--r-pill);
    padding: 7px 12px 7px 8px;
}
.nav-menu .user-link:hover { background: rgba(255, 255, 255, .14); }
.user-avatar-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 800;
    font-family: var(--font-display);
}
.credit-badge {
    font-size: .78rem;
    font-weight: 800;
    color: var(--header-bg);
    background: var(--sun);
    border-radius: var(--r-pill);
    padding: 1px 8px;
}
.admin-link { color: var(--sun) !important; }

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: var(--r-sm);
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: #fff;
}
.menu-toggle:hover { background: rgba(255, 255, 255, .08); }
.menu-toggle .bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    position: relative;
    transition: background .2s;
}
.menu-toggle .bar::before, .menu-toggle .bar::after {
    content: "";
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .25s, top .25s;
}
.menu-toggle .bar::before { top: -7px; }
.menu-toggle .bar::after { top: 7px; }
.menu-toggle.active .bar { background: transparent; }
.menu-toggle.active .bar::before { top: 0; transform: rotate(45deg); }
.menu-toggle.active .bar::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 900px) {
    .header-container { height: 62px; gap: 12px; }
    .logo { font-size: 1.35rem; }
    .logo-image { width: 32px; height: 32px; }
    .menu-toggle { display: inline-flex; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 10px 12px 16px;
        background: var(--header-bg);
        border-bottom: 1px solid rgba(255, 255, 255, .08);
        box-shadow: 0 16px 30px rgba(0, 0, 0, .3);
    }
    .nav-menu.active { display: flex; }
    .nav-menu a { padding: 12px 14px; font-size: 1rem; }
    .nav-menu .nav-cta { margin: 8px 0 0; text-align: center; justify-content: center; display: flex; }
    .nav-menu .user-link { justify-content: flex-start; border-radius: var(--r-sm); }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--header-bg);
    color: #b7bccf;
    margin-top: 72px;
    padding: 60px 0 0;
}
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 44px;
}
.footer-logo { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.footer-logo-img { width: 34px; height: 34px; }
.footer-logo-text { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; color: #fff; }
.footer-logo-accent { color: var(--brand); }
.footer-desc { font-size: .92rem; color: #9aa0b8; line-height: 1.65; margin: 0 0 10px; max-width: 340px; }
.footer-col h4 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: .8rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #9aa0b8; font-size: .93rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 20px 0 24px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: .82rem;
    color: #7a8099;
}
.footer-bottom p { color: inherit; }
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
    .footer-grid { grid-template-columns: 1fr; gap: 26px; }
    .site-footer { margin-top: 48px; padding-top: 44px; }
}

/* --------------------------------------------------------------------------
   Cards, grids, thumbnails
   -------------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }

.recent-generations, .images-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
}
.generation-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.generation-item:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.generation-item a { display: block; color: inherit; }
.generation-item picture, .generation-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
    padding: 10px;
}
.generation-item picture { padding: 0; }
.generation-item picture img { padding: 10px; }
.gen-title {
    display: block;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--line-2);
    font-size: .88rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 640px) {
    .recent-generations, .images-container { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .generation-item picture img, .generation-item img { padding: 6px; }
    .gen-title { padding: 8px 10px 10px; font-size: .8rem; }
}

/* Blog cards */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.blog-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.blog-card:hover { box-shadow: var(--shadow-md); border-color: #d9d5e3; }
.blog-card-image { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--cream); }
.blog-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.blog-card:hover .blog-card-image img { transform: scale(1.04); }
.blog-card-content { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.blog-card-content h2, .blog-card-content h3 { font-size: 1.15rem; line-height: 1.3; }
.blog-card-content h2 a, .blog-card-content h3 a { color: var(--ink); }
.blog-card-content h2 a:hover, .blog-card-content h3 a:hover { color: var(--brand-700); }
.blog-meta { font-size: .82rem; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; }
.blog-meta a { color: var(--brand-700); font-weight: 700; }
.blog-excerpt { font-size: .92rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { margin-top: auto; font-weight: 800; font-size: .9rem; }
.read-more::after { content: " →"; }

/* Compact blog recommendation cards (home, page) */
.blog-recommendations { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.blog-rec-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    color: inherit;
    transition: box-shadow .2s, border-color .2s;
}
.blog-rec-card:hover { box-shadow: var(--shadow-md); border-color: #d9d5e3; color: inherit; }
.blog-rec-card img { width: 100%; height: 150px; object-fit: cover; }
.blog-rec-card h3 { font-size: .98rem; margin: 12px 14px 4px; line-height: 1.35; }
.blog-rec-card p { font-size: .84rem; margin: 0 14px 14px; line-height: 1.45; }
@media (max-width: 900px) { .blog-recommendations { grid-template-columns: repeat(2, 1fr); gap: 12px; } .blog-rec-card img { height: 120px; } }

/* --------------------------------------------------------------------------
   Chips, tags, breadcrumbs, pagination
   -------------------------------------------------------------------------- */
.tags-grid, .tag-list, .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tags-grid { justify-content: center; }
.tag-link, .chip, .tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--r-pill);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: .88rem;
    font-weight: 700;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.tag-link:hover, .chip:hover, .tag:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); box-shadow: var(--shadow-sm); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    color: var(--ink-3);
    margin-bottom: 14px;
}
.breadcrumbs a { color: var(--ink-2); font-weight: 700; }
.breadcrumbs a:hover { color: var(--brand-700); }
.breadcrumbs span { color: var(--ink-3); }

.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 36px 0 10px;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-weight: 700;
    font-size: .9rem;
    transition: background-color .15s, border-color .15s, color .15s;
}
.page-link:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.page-link.current { background: var(--ink); border-color: var(--ink); color: #fff; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    padding: 32px;
}
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 800; font-size: .88rem; margin-bottom: 6px; color: var(--ink); }
.input, .form-group input, .form-group textarea, .textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    background: #fff;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
    min-height: 46px;
}
.input:focus, .form-group input:focus, .form-group textarea:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(40, 191, 181, .18);
}
.form-help { font-size: .82rem; color: var(--ink-3); margin-top: 6px; }
.submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 22px;
    border-radius: var(--r-pill);
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: var(--shadow-brand);
    transition: background-color .2s, box-shadow .2s;
}
.submit-button:hover { background: var(--brand-600); }
.alert {
    padding: 12px 16px;
    border-radius: var(--r-md);
    font-size: .93rem;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-error, .error-message { background: #fff1f0; border-color: #ffd3cf; color: #b3261e; padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 18px; text-align: center; }
.alert-success, .success-banner { background: #eefbf3; border-color: #c6ecd4; color: #14663a; padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 18px; text-align: center; }
.alert-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }

/* --------------------------------------------------------------------------
   Prose (long-form text: blog posts, legal, tag descriptions)
   -------------------------------------------------------------------------- */
.prose { font-size: 1.05rem; line-height: 1.75; color: var(--ink-2); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2em; font-size: 1.6rem; }
.prose h3 { margin-top: 1.6em; font-size: 1.25rem; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p { color: var(--ink-2); }
.prose a { color: var(--brand-700); text-decoration: underline; text-decoration-color: var(--brand-100); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--brand); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .4em 0; }
.prose img { border-radius: var(--r-md); }
.prose blockquote { border-left: 4px solid var(--brand); padding: 6px 0 6px 18px; color: var(--ink-2); font-style: italic; background: var(--mint); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); }

/* --------------------------------------------------------------------------
   Misc states
   -------------------------------------------------------------------------- */
.no-results, .no-posts { text-align: center; padding: 48px 20px; color: var(--ink-3); font-size: 1.05rem; }
.muted { color: var(--ink-3); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

/* CTA band */
.cta-band {
    background: linear-gradient(135deg, var(--header-bg) 0%, #1c2140 60%, #1f3d4a 100%);
    color: #fff;
    border-radius: var(--r-xl);
    padding: 48px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-band::before {
    content: "";
    position: absolute;
    inset: auto -10% -60% auto;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(40, 191, 181, .35), transparent 65%);
}
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { color: rgba(255, 255, 255, .72); max-width: 560px; margin: 0 auto 22px; }
.cta-band .btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; }

@media print {
    .site-header, .site-footer { display: none; }
}
