:root {
    --bg: #071528;
    --bg-2: #0a1d34;
    --surface: rgba(12, 31, 54, .82);
    --surface-strong: #102843;
    --border: rgba(148, 178, 211, .18);
    --text: #f5f8fc;
    --muted: #9fb0c4;
    --header: rgba(5, 17, 32, .76);
    --shadow: 0 26px 70px rgba(0, 0, 0, .27);
}
html[data-theme="light"] {
    --bg: #eef4fa;
    --bg-2: #f8fbfe;
    --surface: rgba(255, 255, 255, .9);
    --surface-strong: #fff;
    --border: rgba(27, 61, 97, .13);
    --text: #10233a;
    --muted: #62758b;
    --header: rgba(255, 255, 255, .84);
    --shadow: 0 24px 60px rgba(45, 76, 108, .12);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 12%, rgba(24, 120, 238, .16), transparent 34%),
        radial-gradient(circle at 84% 72%, rgba(255, 210, 44, .09), transparent 32%),
        linear-gradient(145deg, var(--bg), var(--bg-2));
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}
a { color: inherit; }
.starfield {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .35;
    background-image:
        radial-gradient(circle, rgba(255,255,255,.7) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(255,255,255,.3) 0 1px, transparent 1.5px);
    background-position: 0 0, 34px 49px;
    background-size: 92px 92px, 137px 137px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 82%);
}
html[data-theme="light"] .starfield { opacity: .05; }
.topbar {
    position: relative;
    z-index: 5;
    height: 82px;
    padding: 0 clamp(22px, 4vw, 68px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--header);
    backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { width: clamp(174px, 19vw, 224px); height: 42px; object-fit: contain; object-position: left center; }
.brand-dark { display: none; }
html[data-theme="light"] .brand-light { display: none; }
html[data-theme="light"] .brand-dark { display: block; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.back-site {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: color .2s ease;
}
.back-site:hover { color: var(--text); }
.theme-toggle {
    width: 46px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 15px;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    font-size: 19px;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 26px rgba(0,0,0,.08);
}
.theme-toggle .sun { display: none; }
html[data-theme="light"] .theme-toggle .sun { display: inline; }
html[data-theme="light"] .theme-toggle .moon { display: none; }
.shell { position: relative; z-index: 1; width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: clamp(54px, 7vw, 92px) 0 28px; }
.intro { display: flex; align-items: center; gap: 22px; max-width: 860px; margin-bottom: 42px; }
.k-mark {
    flex: 0 0 auto;
    width: 78px;
    height: 78px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow);
}
.k-mark img { width: 49px; height: 49px; }
.section-kicker { color: #58a6ff; font-size: 12px; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
.intro h1 { margin: 8px 0 10px; font-size: clamp(34px, 5vw, 58px); line-height: .98; letter-spacing: -.055em; }
.intro p { margin: 0; color: var(--muted); font-size: clamp(15px, 1.8vw, 18px); line-height: 1.65; }
.tools-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.tool-card {
    --accent: 88, 166, 255;
    position: relative;
    min-height: 360px;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: linear-gradient(160deg, rgba(var(--accent), .075), transparent 42%), var(--surface);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease;
}
.tool-card.connect { --accent: 255, 210, 44; }
.tool-card.councils { --accent: 79, 168, 255; }
.tool-card.finance { --accent: 239, 68, 68; }
.tool-card.support { --accent: 34, 197, 94; }
.tool-card:not(.disabled):hover {
    transform: translateY(-7px);
    border-color: rgba(var(--accent), .62);
    box-shadow: 0 30px 80px rgba(0,0,0,.28), 0 0 30px rgba(var(--accent), .11);
}
.card-glow {
    position: absolute;
    z-index: -1;
    width: 180px;
    height: 180px;
    top: -96px;
    right: -70px;
    border-radius: 50%;
    background: rgba(var(--accent), .22);
    filter: blur(35px);
}
.tool-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.tool-icon {
    width: 60px;
    height: 60px;
    border-radius: 19px;
    display: grid;
    place-items: center;
    color: rgb(var(--accent));
    background: rgba(var(--accent), .11);
    border: 1px solid rgba(var(--accent), .23);
    box-shadow: 0 0 22px rgba(var(--accent), .08);
}
.tool-icon svg { width: 29px; height: 29px; fill: currentColor; }
.tool-state {
    padding: 8px 11px;
    border: 1px solid rgba(var(--accent), .18);
    border-radius: 999px;
    color: rgb(var(--accent));
    background: rgba(var(--accent), .08);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.tool-copy { margin-top: auto; padding: 38px 0 28px; }
.tool-eyebrow { color: rgb(var(--accent)); font-size: 11px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.tool-copy h2 { margin: 9px 0 13px; font-size: clamp(23px, 2.5vw, 31px); letter-spacing: -.035em; }
.tool-copy p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.tool-footer { min-height: 45px; border-top: 1px solid var(--border); padding-top: 19px; display: flex; align-items: center; justify-content: space-between; color: var(--text); font-size: 13px; font-weight: 800; }
.arrow { color: rgb(var(--accent)); font-size: 27px; line-height: 1; transition: transform .2s ease; }
.tool-card:hover .arrow { transform: translateX(5px); }
.disabled { opacity: .68; cursor: not-allowed; }
.lock { color: var(--muted); }
.page-footer { margin-top: 42px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; justify-content: center; gap: 9px; color: var(--muted); font-size: 12px; }
.dot { opacity: .55; }
@media (max-width: 1100px) { .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 940px) { .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
    .topbar { height: 72px; padding: 0 18px; }
    .brand img { width: 165px; }
    .back-site { display: none; }
    .shell { width: min(100% - 28px, 1240px); padding-top: 42px; }
    .intro { align-items: flex-start; margin-bottom: 30px; }
    .k-mark { width: 58px; height: 58px; border-radius: 18px; }
    .k-mark img { width: 36px; height: 36px; }
    .tools-grid { grid-template-columns: 1fr; }
    .tool-card { min-height: 315px; grid-column: auto; }
    .page-footer { flex-wrap: wrap; }
}
