:root {
    --navy: #1E2636;
    --blue: #2E9BE6;
    --blue-dark: #1E7CC9;
    --porcelain: #F3F6FB;
    --ink: #19212E;
    --muted: #5A6678;
    --line: #E2E8F1;
    --hero-1: #EAF4FD;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(30, 38, 54, .08);
    --container: 1120px;
    font-synthesis: none;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--ink);
    background: #fff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--navy); line-height: 1.15; letter-spacing: -.01em; }

a { color: var(--blue-dark); }

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

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

.skip-link {
    position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff;
    padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-weight: 600; text-decoration: none; cursor: pointer;
    border-radius: 8px; padding: 10px 18px; border: 1.5px solid transparent;
    transition: background-color .15s, color .15s, border-color .15s, transform .05s;
    font-size: 15px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-dark); }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 10px; }

.badge {
    display: inline-block; background: #DCEDFB; color: var(--blue-dark);
    font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: 999px; margin: 0 0 16px;
}

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { display: block; }
.brand-name { display: flex; flex-direction: column; font-weight: 800; color: var(--navy); font-size: 19px; letter-spacing: .04em; line-height: .98; }
.brand-name span { color: var(--blue); }

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav > a { color: var(--navy); text-decoration: none; font-weight: 500; }
.site-nav > a:hover, .site-nav > a.active { color: var(--blue-dark); }
.site-nav .nav-cta { color: #fff; }
.nav-signin { font-weight: 500; }
.nav-signout { margin: 0; }
.linklike { background: none; border: 0; color: var(--navy); font: inherit; cursor: pointer; padding: 0; }
.linklike:hover { color: var(--blue-dark); }

.nav-toggle { display: none; }
.nav-burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
.nav-burger span { width: 24px; height: 2px; background: var(--navy); border-radius: 2px; }

/* Hero */
.hero { background: linear-gradient(160deg, var(--hero-1), var(--porcelain) 70%); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 72px 0; }
.hero-copy h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; margin: 0 0 18px; }
.hero-copy h1 .accent { color: var(--blue); }
.lede { font-size: 1.12rem; color: var(--muted); margin: 0 0 24px; max-width: 36em; }
.lede strong { color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.hero-note { font-size: 14px; color: var(--muted); margin: 0; }

.hero-art { display: flex; justify-content: center; }
.app-frame {
    background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
    padding: 0 28px 28px; width: 100%; max-width: 360px; text-align: center;
}
.app-frame-bar { display: flex; gap: 7px; padding: 14px 0; }
.app-frame-bar span { width: 11px; height: 11px; border-radius: 50%; background: #E2E8F1; }
.app-frame-bar span:first-child { background: #F0A0A0; }
.app-frame-bar span:nth-child(2) { background: #F2D08A; }
.app-frame-bar span:nth-child(3) { background: #A6D9A0; }
.app-frame img { margin: 4px auto 0; }
.app-frame-caption {
    background: var(--porcelain); border-radius: 12px 12px 12px 4px; padding: 12px 16px;
    color: var(--navy); font-weight: 500; margin: 8px 0 0; display: inline-block; text-align: left;
}

/* Sections */
.section { padding: 64px 0; }
.page-head { background: linear-gradient(160deg, var(--hero-1), var(--porcelain) 80%); border-bottom: 1px solid var(--line); padding: 56px 0 44px; }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin: 0 0 12px; }

/* Feature cards */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.feature-icon { width: 48px; height: 48px; color: var(--blue); margin-bottom: 14px; }
.feature-icon svg { width: 100%; height: 100%; }
.feature h2 { font-size: 1.25rem; margin: 0 0 8px; }
.feature p { color: var(--muted); margin: 0; }

/* CTA band */
.cta-band { background: var(--navy); color: #fff; }
.cta-inner { text-align: center; padding: 64px 0; }
.cta-inner h2 { color: #fff; font-size: 1.9rem; margin: 0 0 10px; }
.cta-inner p { color: #C7D2E0; margin: 0 0 24px; }

/* Prose */
.prose { max-width: 760px; }
.prose.narrow { max-width: 620px; }
.prose h2 { margin: 36px 0 12px; font-size: 1.5rem; }
.prose h3 { margin: 24px 0 6px; font-size: 1.12rem; }
.prose p { color: #2c3645; }
.checklist { list-style: none; padding: 0; margin: 0 0 8px; }
.checklist li { position: relative; padding-left: 30px; margin-bottom: 10px; color: #2c3645; }
.checklist li::before {
    content: ""; position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 50%;
    background: #DCEDFB url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E7CC9' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/12px no-repeat;
}
.steps { padding-left: 20px; }
.steps li { margin-bottom: 10px; color: #2c3645; }
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.tag-list span { background: var(--porcelain); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--navy); font-size: 14px; }

/* Signup form */
.form-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.signup-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; color: var(--navy); }
.field .optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
    font: inherit; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46, 155, 230, .15); }
.field-error { color: #C23A3A; font-size: 13px; }
.validation-summary { color: #C23A3A; }
.validation-summary ul { margin: 0 0 12px; padding-left: 18px; }
.form-fineprint { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.signup-aside { background: var(--porcelain); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.signup-aside h2 { font-size: 1.2rem; margin: 0 0 12px; }

/* Data table (admin) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table thead th { background: var(--porcelain); color: var(--navy); font-weight: 600; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--hero-1); }

/* Footer */
.site-footer { background: var(--porcelain); border-top: 1px solid var(--line); margin-top: 8px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 36px 0 20px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand strong { color: var(--navy); }
.footer-brand p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--navy); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--blue-dark); }
.footer-legal { color: var(--muted); font-size: 13px; padding: 0 0 28px; }

/* Responsive */
@media (max-width: 860px) {
    .hero-inner { grid-template-columns: 1fr; gap: 32px; padding: 48px 0; }
    .hero-art { order: -1; }
    .feature-grid { grid-template-columns: 1fr; }
    .form-wrap { grid-template-columns: 1fr; }

    .nav-burger { display: flex; }
    .site-nav {
        position: absolute; top: 76px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line);
        flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0; display: none; box-shadow: var(--shadow);
    }
    .nav-toggle:checked ~ .site-nav { display: flex; }
    .site-nav > a, .site-nav .nav-signout { padding: 12px 24px; }
    .site-nav .nav-cta { margin: 10px 24px; }
}

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

/* ── News / CMS ── */
.news-item { padding: 24px 0; border-bottom: 1px solid var(--line); }
.news-item:first-child { padding-top: 0; }
.news-item h2 { font-size: 1.4rem; margin: 0 0 6px; }
.news-item h2 a { text-decoration: none; }
.news-meta { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.pill { display: inline-block; background: var(--porcelain); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; color: var(--navy); margin-right: 6px; }

/* ── Pager ── */
.pager { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.pager-status { color: var(--muted); font-size: 14px; }

/* ── Forum categories ── */
.forum-cats { display: grid; gap: 14px; }
.forum-cat { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); text-decoration: none; transition: border-color .15s; }
.forum-cat:hover { border-color: var(--blue); }
.forum-cat-main h2 { font-size: 1.2rem; margin: 0 0 4px; }
.forum-cat-main p { margin: 0; color: var(--muted); }
.forum-cat-stats { text-align: right; white-space: nowrap; }
.forum-stat { display: block; font-size: 14px; color: var(--navy); }
.forum-stat.muted { color: var(--muted); font-size: 13px; }
.forum-threads td:first-child { width: 58%; }

/* ── Forum posts ── */
.posts { display: flex; flex-direction: column; gap: 18px; }
.post { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); }
.post-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.post-author { font-weight: 700; color: var(--navy); text-decoration: none; }
.post-author:hover { color: var(--blue-dark); }
.post-body { max-width: none; }
.post-body > :first-child { margin-top: 0; }
.post-actions { display: flex; gap: 14px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.reaction { display: inline-flex; align-items: center; gap: 6px; background: var(--porcelain); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 14px; color: var(--navy); }
.reaction:hover { border-color: var(--blue); }
.reaction.on { background: #DCEDFB; border-color: var(--blue); color: var(--blue-dark); }

/* ── Reply / admin forms ── */
.reply-box { margin-top: 32px; }
.reply-box h2 { font-size: 1.3rem; }
.field-check label { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.signup-form select { font: inherit; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.mod-bar { display: flex; gap: 16px; margin-top: 8px; }
.row-actions { display: flex; gap: 14px; white-space: nowrap; }
.linklike.danger { color: #C23A3A; }
.linklike.danger:hover { color: #9b2c2c; }

/* ── Search ── */
.search-form { display: flex; gap: 10px; max-width: 520px; margin-top: 16px; }
.search-form input[type=search] { flex: 1; font: inherit; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 9px; }
.search-form input[type=search]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46, 155, 230, .15); }

/* ── Notifications ── */
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-list li { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; }
.notif-list li.unread { border-left: 3px solid var(--blue); background: var(--hero-1); }
.notif-list a { text-decoration: none; color: var(--navy); font-weight: 600; }

/* ── Admin dashboard ── */
.stat-grid { grid-template-columns: repeat(4, 1fr); }
.feature.stat { text-align: center; padding: 24px; }
.stat-num { display: block; font-size: 2.2rem; font-weight: 800; color: var(--blue); line-height: 1; }
.stat-label { display: block; color: var(--muted); margin-top: 6px; font-size: 14px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ── Nav bell + badge ── */
.nav-bell { position: relative; text-decoration: none; font-size: 18px; }
.nav-badge { position: absolute; top: -8px; right: -10px; background: #C23A3A; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; padding: 2px 6px; border-radius: 999px; }

@media (max-width: 860px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .forum-cat { flex-direction: column; align-items: flex-start; }
    .forum-cat-stats { text-align: left; }
}
