/* =========================================================
   SINYAL.toolkit — design tokens
   Konsep: pusat kontrol jaringan malam hari — radar, sinyal, denyut.
   ========================================================= */
:root {
    --bg: #0B1220;
    --bg-grid: #0E1729;
    --surface: #121B2E;
    --surface-2: #182339;
    --border: #253150;
    --border-soft: #1B2740;
    --text: #E7ECF5;
    --text-muted: #8B98B4;
    --text-faint: #56638A;

    --ok: #3DDC84;
    --ok-dim: #1E5C3E;
    --warn: #F5A623;
    --warn-dim: #6B4A15;
    --danger: #FF5C5C;
    --danger-dim: #6B2323;
    --info: #4FD1FF;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius: 10px;
    --radius-lg: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: radial-gradient(ellipse 120% 80% at 50% -10%, #16213A 0%, var(--bg) 55%);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
}

/* subtle scanline / grid texture, purely decorative */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(var(--bg-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.35;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent 75%);
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--info); color: #04101c; }

/* ---------- Topbar ---------- */
.topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap;
    gap: 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.03em;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--ok);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.brand-mark::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid var(--border);
}
.blip {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 8px var(--ok);
    animation: pulse-blip 2.2s ease-in-out infinite;
}
@keyframes pulse-blip {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.75); }
}
.brand-accent { color: var(--text-muted); font-weight: 500; }

.topnav { display: flex; gap: 6px; flex-wrap: wrap; }
.topnav a {
    font-size: 0.86rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
.topnav a:hover { color: var(--text); border-color: var(--border); }
.topnav a.active {
    color: var(--info);
    border-color: var(--info);
    background: rgba(79, 209, 255, 0.08);
}

/* ---------- Layout ---------- */
.page {
    position: relative;
    z-index: 1;
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.hero {
    margin-bottom: 40px;
}
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--info);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.eyebrow::before {
    content: '';
    width: 16px; height: 1px;
    background: var(--info);
}
h1.title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}
.subtitle {
    color: var(--text-muted);
    font-size: 1.02rem;
    max-width: 640px;
    margin: 0;
}

/* ---------- Cards / grid ---------- */
.card {
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 26px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 8px;
}
@media (max-width: 800px) {
    .module-grid { grid-template-columns: 1fr; }
}

.module-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}
.module-card:hover { border-color: var(--border); transform: translateY(-2px); }
.module-card .icon-wrap {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
}
.module-card h3 { font-family: var(--font-display); margin: 0; font-size: 1.15rem; }
.module-card p { color: var(--text-muted); font-size: 0.92rem; margin: 0; flex-grow: 1; }
.module-card .go {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--info);
    display: flex; align-items: center; gap: 6px;
}

/* ---------- Forms ---------- */
.scan-form {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.scan-form input[type=text] {
    flex: 1;
    min-width: 220px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.95rem;
}
.scan-form input[type=text]:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 3px rgba(79, 209, 255, 0.15);
}
.btn {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.92rem;
    padding: 14px 22px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}
.btn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.btn-primary {
    background: var(--info);
    color: #04101c;
}
.btn-primary:hover { background: #74dcff; }

/* ---------- Status badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid currentColor;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: rgba(61,220,132,0.08); }
.badge-warn { color: var(--warn); background: rgba(245,166,35,0.08); }
.badge-danger { color: var(--danger); background: rgba(255,92,92,0.08); }
.badge-info { color: var(--info); background: rgba(79,209,255,0.08); }
.badge-neutral { color: var(--text-muted); background: rgba(139,152,180,0.08); }

/* ---------- Checklist ---------- */
.check-list { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check-item {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    background: var(--surface);
    align-items: flex-start;
}
.check-icon {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    margin-top: 2px;
}
.check-icon.ok { background: var(--ok-dim); color: var(--ok); }
.check-icon.warn { background: var(--warn-dim); color: var(--warn); }
.check-icon.bad { background: var(--danger-dim); color: var(--danger); }
.check-body { flex: 1; }
.check-label { font-size: 0.95rem; }
.check-tip { color: var(--text-muted); font-size: 0.86rem; margin-top: 5px; line-height: 1.5; }

/* ---------- Gauge (SEO score) ---------- */
.gauge-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.gauge { position: relative; width: 148px; height: 148px; flex-shrink: 0; }
.gauge svg { transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: var(--border-soft); stroke-width: 10; }
.gauge-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.4,0,.2,1); }
.gauge-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge-score { font-family: var(--font-mono); font-size: 2.1rem; font-weight: 700; }
.gauge-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Signal bars (Nawala) ---------- */
.signal-bars { display: flex; align-items: flex-end; gap: 4px; height: 42px; }
.signal-bars span {
    width: 9px;
    border-radius: 2px 2px 0 0;
    background: var(--border);
    transition: background 0.3s ease;
}
.signal-bars span:nth-child(1) { height: 25%; }
.signal-bars span:nth-child(2) { height: 50%; }
.signal-bars span:nth-child(3) { height: 75%; }
.signal-bars span:nth-child(4) { height: 100%; }
.signal-bars.level-4 span { background: var(--ok); }
.signal-bars.level-3 span:nth-child(-n+3) { background: var(--warn); }
.signal-bars.level-1 span:nth-child(1) { background: var(--danger); }

/* ---------- Pulse line (Cloudflare) ---------- */
.pulse-line { width: 100%; height: 70px; }
.pulse-path { fill: none; stroke-width: 2.5; }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.9rem; }
.data-table th, .data-table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
}
.data-table th { color: var(--text-muted); font-family: var(--font-mono); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table td.mono { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Alert boxes ---------- */
.alert {
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: 0.92rem;
    line-height: 1.55;
    margin-top: 18px;
}
.alert-ok { border-color: var(--ok-dim); background: rgba(61,220,132,0.06); color: #b7f3d1; }
.alert-warn { border-color: var(--warn-dim); background: rgba(245,166,35,0.06); color: #ffd699; }
.alert-danger { border-color: var(--danger-dim); background: rgba(255,92,92,0.06); color: #ffb3b3; }
.alert-info { border-color: rgba(79,209,255,0.3); background: rgba(79,209,255,0.06); color: #b9ebff; }

.section-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin: 36px 0 4px;
}
.section-sub { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 6px; }

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.stat-box {
    flex: 1;
    min-width: 140px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.stat-box .num { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; }
.stat-box .lbl { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }

.loading-note {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 14px;
}
.loading-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--info);
    animation: pulse-blip 1.4s ease-in-out infinite;
}

.footer {
    position: relative; z-index: 1;
    text-align: center;
    padding: 30px 24px 50px;
    color: var(--text-faint);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
}
.footer-dot { opacity: 0.5; }

code.inline {
    font-family: var(--font-mono);
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    border: 1px solid var(--border-soft);
}

.risk-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--danger-dim);
    color: #ffcfcf;
    margin: 3px 6px 3px 0;
}
