:root {
    --navy: #07111f;
    --navy-2: #0b1a2e;
    --navy-3: #12263f;
    --blue: #2563eb;
    --blue-2: #3b82f6;
    --cyan: #22d3ee;
    --green: #10b981;
    --purple: #8b5cf6;
    --orange: #f97316;
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    --radius: 22px;
    --header-h: 76px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    min-height: 100%;
}

body { padding-top: var(--header-h); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-h);
    z-index: 50;
    background: rgba(7, 17, 31, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
    font-size: 1.2rem;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-copy strong { font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-copy small { color: #93c5fd; font-size: 0.72rem; margin-top: 3px; }

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.nav-link, .desktop-nav .nav-link {
    color: #dbe7ff;
    background: none;
    border: 0;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-link:hover { color: #fff; background: rgba(255,255,255,0.06); }

.has-menu { position: relative; }
.mega-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 760px;
    background: #fff;
    color: var(--text);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 22px;
    display: none;
}
.has-menu.open .mega-menu { display: block; }

.mega-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.mega-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 10px;
}

.mega-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
}

.mega-link:hover { background: #f1f5f9; color: var(--blue); }
.mega-link i { color: var(--blue); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    font-weight: 700;
    border: 0;
    padding: 12px 18px;
}

.btn-primary, .header-cta {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    color: #fff !important;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover { filter: brightness(1.05); color: #fff; }
.btn-outline {
    background: #fff;
    color: var(--blue);
    border: 1px solid #dbeafe;
}
.btn-success { background: #059669; color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.12); color: #fff; }
.menu-toggle { display: none; }

.hero {
    background:
        radial-gradient(circle at 80% 20%, rgba(59,130,246,0.28), transparent 22%),
        radial-gradient(circle at 20% 80%, rgba(34,211,238,0.12), transparent 24%),
        linear-gradient(180deg, #07111f 0%, #0c1c33 100%);
    color: #fff;
    padding: 72px 0 84px;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.12) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.18;
    pointer-events: none;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    font-weight: 800;
    margin: 0 0 18px;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, #38bdf8, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p.sub {
    color: #c9d7ee;
    font-size: 1.08rem;
    max-width: 540px;
    margin-bottom: 28px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-radius: 16px;
    padding: 8px 8px 8px 16px;
    max-width: 560px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.18);
}

.search-box i { color: #94a3b8; }
.search-box input {
    flex: 1;
    border: 0;
    outline: none;
    font-size: 1rem;
    background: transparent;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #dbeafe;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.08);
}
.chip:hover { background: rgba(255,255,255,0.16); color: #fff; }

.hero-visual { position: relative; min-height: 360px; }
.laptop {
    width: 100%;
    max-width: 460px;
    margin-left: auto;
    background: linear-gradient(180deg, #163154, #0b1b2e);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.laptop-screen {
    background: #0f2744;
    border-radius: 16px;
    padding: 18px;
    min-height: 230px;
}
.screen-row { display: flex; gap: 10px; margin-bottom: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #334155; }
.dot.g { background: #22c55e; }
.dot.y { background: #eab308; }
.dot.r { background: #ef4444; }
.stat { display: flex; align-items: center; gap: 10px; color: #dbeafe; margin: 10px 0; font-weight: 600; }
.stat i { color: #22d3ee; }
.shield-badge {
    position: absolute;
    right: 8%;
    bottom: 12%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 30% 30%, #60a5fa, #1d4ed8 62%);
    box-shadow: 0 20px 40px rgba(37,99,235,0.4);
    font-size: 4rem;
    color: #fff;
}

.section { padding: 72px 0; }
.section.alt { background: #fff; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 28px;
}
.section-head h2, .page-hero h1, .cta-band h2 { letter-spacing: -0.03em; }
.eyebrow {
    color: var(--blue);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    margin-bottom: 8px;
}
.section-head p, .lead { color: var(--muted); }

.tool-grid, .popular-grid, .why-grid, .cat-grid {
    display: grid;
    gap: 18px;
}
.popular-grid { grid-template-columns: repeat(3, 1fr); }
.cat-grid { grid-template-columns: repeat(5, 1fr); }
.why-grid { grid-template-columns: repeat(5, 1fr); }

.tool-card, .why-card, .cat-card, .panel, .featured-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(226,232,240,0.8);
}

.tool-card, .why-card, .cat-card { padding: 22px; }
.tool-card h3, .cat-card h3, .why-card h3 { margin: 12px 0 8px; font-size: 1.05rem; }
.tool-card p, .cat-card p, .why-card p { color: var(--muted); margin: 0 0 16px; font-size: 0.92rem; }
.icon-pill {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
}
.accent-blue { background: #dbeafe; color: #1d4ed8; }
.accent-green { background: #d1fae5; color: #047857; }
.accent-purple { background: #ede9fe; color: #6d28d9; }
.accent-cyan { background: #cffafe; color: #0e7490; }
.accent-orange { background: #ffedd5; color: #c2410c; }
.link-arrow { color: var(--blue); font-weight: 700; font-size: 0.92rem; }
.tool-card:hover, .cat-card:hover { transform: translateY(-3px); transition: 0.2s ease; }

.cat-card ul { list-style: none; padding: 0; margin: 0; }
.cat-card li { margin: 8px 0; }
.cat-card a { color: var(--muted); }
.cat-card a:hover { color: var(--blue); }

.page-hero {
    background: linear-gradient(180deg, #07111f, #10243d);
    color: #fff;
    padding: 48px 0 40px;
}
.page-hero .lead { color: #cbd5e1; max-width: 680px; }

.featured {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    padding: 28px;
}
.checklist { list-style: none; padding: 0; }
.checklist li { display: flex; gap: 10px; margin: 10px 0; color: var(--text); }
.checklist i { color: var(--green); }
.reader-preview {
    background: linear-gradient(180deg, #0f2744, #163154);
    color: #fff;
    border-radius: 18px;
    padding: 22px;
    min-height: 260px;
}
.reader-preview h4 { margin-top: 0; }
.reader-line { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.16); margin: 10px 0; }
.reader-line.short { width: 62%; }

.why-card i { font-size: 1.5rem; color: var(--blue); }

.cta-band {
    margin: 20px 0 0;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    color: #fff;
    border-radius: 28px;
    padding: 42px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.cta-band p { color: #dbeafe; margin: 8px 0 0; }

.site-footer {
    background: var(--navy);
    color: #cbd5e1;
    padding: 56px 0 24px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 28px;
    padding-bottom: 28px;
}
.site-footer h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.site-footer a, .site-footer p { display: block; color: #94a3b8; margin: 8px 0; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 16px;
    font-size: 0.85rem;
}

.panel { padding: 24px; }
.tool-layout {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 22px;
    padding: 36px 0 64px;
}
.field { margin-top: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 8px; }
.field .hint { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.form-control, select.form-control, textarea.form-control {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    font-family: inherit;
    background: #fff;
}
.dropzone {
    border: 2px dashed #bfdbfe;
    background: #f8fbff;
    border-radius: 18px;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    cursor: pointer;
    color: var(--muted);
    transition: 0.2s ease;
}
.dropzone i { font-size: 1.8rem; color: var(--blue); margin-bottom: 8px; }
.dropzone.is-drag { border-color: var(--green); background: #ecfdf5; }
.dropzone.has-file { border-color: var(--blue); background: #eff6ff; color: var(--text); }
.dropzone input { display: none; }
.range-row { display: flex; justify-content: space-between; font-weight: 700; }
input[type=range] { width: 100%; accent-color: var(--blue); }
.side-card { padding: 22px; }
.side-card h3 { margin-top: 0; }
.side-card a { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--text); font-weight: 600; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.legal, .prose { padding: 36px 0 72px; max-width: 860px; }
.legal h2, .prose h2 { margin-top: 28px; }
.legal p, .prose p { color: #334155; line-height: 1.7; }
.panel.prose {
    padding: 32px 36px;
    max-width: none;
}

.contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 22px;
    padding: 36px 0 72px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 22px;
    padding: 36px 0 72px;
}

.toast-stack {
    position: fixed;
    top: calc(var(--header-h) + 16px);
    left: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: min(420px, calc(100vw - 32px));
}

.ss-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    color: #0f172a;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
    border: 1px solid #e2e8f0;
    border-left: 6px solid #2563eb;
    animation: toast-in 0.28s ease;
}

.ss-toast.is-leaving {
    animation: toast-out 0.22s ease forwards;
}

.ss-toast.success { border-left-color: #059669; }
.ss-toast.error { border-left-color: #dc2626; }
.ss-toast.warning { border-left-color: #d97706; }
.ss-toast.info { border-left-color: #2563eb; }

.ss-toast-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.ss-toast.success .ss-toast-icon { background: #d1fae5; color: #047857; }
.ss-toast.error .ss-toast-icon { background: #fee2e2; color: #b91c1c; }
.ss-toast.warning .ss-toast-icon { background: #ffedd5; color: #c2410c; }
.ss-toast.info .ss-toast-icon { background: #dbeafe; color: #1d4ed8; }

.ss-toast-copy { flex: 1; min-width: 0; }
.ss-toast-copy strong {
    display: block;
    font-size: 0.86rem;
    margin-bottom: 2px;
}
.ss-toast-copy p {
    margin: 0;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.45;
}

.ss-toast-close {
    border: 0;
    background: transparent;
    color: #64748b;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
}

.ss-toast-close:hover { background: #f1f5f9; color: #0f172a; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-16px); }
}
.progress-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7,17,31,0.55);
    display: none;
    place-items: center;
    z-index: 90;
}
.progress-overlay.is-open {
    display: grid;
}
.progress-card {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    width: min(420px, calc(100% - 32px));
    text-align: center;
}
.spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 4px solid #dbeafe;
    border-top-color: var(--blue);
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.search-modal, .mobile-drawer {
    position: fixed;
    inset: 0;
    background: rgba(7,17,31,0.55);
    display: none;
    z-index: 70;
}
.search-modal.open, .mobile-drawer.open { display: block; }
.search-panel, .drawer-panel {
    background: #fff;
    margin: 10vh auto 0;
    width: min(720px, calc(100% - 24px));
    border-radius: 18px;
    padding: 16px;
}
.search-head, .drawer-head { display: flex; align-items: center; gap: 10px; }
.search-head input {
    flex: 1;
    border: 0;
    outline: none;
    font-size: 1.05rem;
}
.search-results a, .drawer-panel a {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
}
.search-results a:hover, .drawer-panel a:hover { background: #f1f5f9; }
.drawer-panel { margin: 0 0 0 auto; height: 100%; width: min(360px, 100%); overflow: auto; border-radius: 0; }

.editor-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.editor-toolbar button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 6px 10px;
}
.editor-canvas {
    min-height: 360px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    background: #fff;
}

.editor-canvas[data-empty="true"]::before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
}

.viewer-wrap { max-width: 880px; margin: 24px auto 64px; }
.viewer-toolbar {
    background: #fff;
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}
.story-host .storyText, .story-host .reader {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.download-card { text-align: center; padding: 36px; }
.download-card .file-name { font-weight: 700; margin: 8px 0 18px; }

.is-reader { background: #f7f4ee; }

@media (max-width: 992px) {
    .hero-grid, .featured, .tool-layout, .split, .contact-grid, .about-grid, .footer-grid, .why-grid, .cat-grid, .popular-grid {
        grid-template-columns: 1fr;
    }
    .desktop-nav { display: none; }
    .menu-toggle { display: grid; place-items: center; }
    .cta-band { flex-direction: column; align-items: flex-start; }
    .mega-menu { width: 90vw; }
}
