* {
    box-sizing: border-box;
}

:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --text: #152033;
    --muted: #758198;
    --line: #e6eaf0;
    --blue: #2f6fed;
    --blue-dark: #2059c9;
    --green: #18a86b;
    --shadow: 0 18px 50px rgba(31, 48, 79, .09);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.testing {
    overflow-x: hidden;
}

.site-header {
    height: 72px;
    padding: 0 6vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.4px;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 3px;
    padding: 6px;
    background: var(--blue);
}

.brand-mark span {
    width: 3px;
    background: #fff;
    border-radius: 4px;
}

.brand-mark span:nth-child(1) { height: 7px; }
.brand-mark span:nth-child(2) { height: 12px; }
.brand-mark span:nth-child(3) { height: 16px; }

.nav {
    display: flex;
    gap: 34px;
}

.nav a {
    color: #657187;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.nav a:hover {
    color: var(--blue);
}

.menu-btn {
    display: none;
    border: 0;
    background: transparent;
    font-size: 22px;
}

.hero {
    max-width: 1050px;
    margin: 0 auto;
    padding: 76px 24px 60px;
}

.hero-copy {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 34px;
}

.eyebrow {
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

h1 {
    margin: 10px 0 12px;
    font-size: clamp(36px, 5vw, 54px);
    line-height: 1;
    letter-spacing: -2.5px;
}

.hero-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.test-card {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 34px 24px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.server-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.server-row > div:first-child {
    display: grid;
    gap: 4px;
}

.muted,
.server-row strong {
    font-size: 12px;
}

.muted {
    color: var(--muted);
    letter-spacing: .7px;
    font-weight: 700;
}

.server-row strong {
    font-size: 14px;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #5c687b;
    font-size: 13px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(24,168,107,.10);
}

.gauge-wrap {
    display: flex;
    justify-content: center;
    margin: 35px 0 20px;
}

.gauge {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at center, #fff 0 62%, transparent 63%),
        conic-gradient(var(--blue) 0deg, var(--blue) 0deg, #e9eef7 0deg);
    position: relative;
    transition: background .25s linear;
}

.gauge::after {
    content: "";
    position: absolute;
    inset: 11px;
    border-radius: 50%;
    border: 1px solid #edf0f5;
}

.gauge-inner {
    z-index: 1;
    text-align: center;
    display: grid;
    gap: 4px;
}

.gauge-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.1px;
}

.gauge-inner strong {
    font-size: 42px;
    line-height: 1;
    letter-spacing: -2px;
}

.gauge-unit {
    color: var(--muted);
    font-size: 13px;
}

.phase {
    text-align: center;
    color: #647188;
    min-height: 22px;
    font-size: 13px;
    font-weight: 600;
}

.progress-track {
    height: 6px;
    margin: 13px 0 26px;
    overflow: hidden;
    border-radius: 10px;
    background: #edf1f6;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: var(--blue);
    border-radius: inherit;
    transition: width .15s ease;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 22px;
}

.stat {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-direction: column;
    border-right: 1px solid var(--line);
}

.stat:last-child {
    border-right: 0;
}

.stat span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
}

.stat strong {
    font-size: 20px;
}

.stat small {
    color: var(--muted);
    font-size: 10px;
}

.start-btn {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: var(--blue);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .7px;
    cursor: pointer;
    transition: transform .15s, background .15s;
}

.start-btn:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

.start-btn:disabled {
    cursor: wait;
    opacity: .72;
}

.privacy-note {
    margin: 13px 0 0;
    text-align: center;
    color: #9aa4b4;
    font-size: 10px;
}

.result-section,
.info-section {
    max-width: 1050px;
    margin: 0 auto;
    padding: 55px 24px;
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading h2,
.info-section h2 {
    margin: 7px 0 0;
    font-size: 28px;
    letter-spacing: -1px;
}

.result-card {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.result-main {
    display: grid;
    align-content: center;
}

.result-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.result-main strong {
    margin-top: 7px;
    font-size: 32px;
}

.result-main p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.result-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.result-metrics > div {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 4px;
}

.result-metrics span {
    color: var(--muted);
    font-size: 11px;
}

.result-metrics strong {
    font-size: 20px;
}

.result-metrics small {
    color: var(--muted);
    font-size: 10px;
}

.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    padding-top: 30px;
    padding-bottom: 90px;
}

.info-section p {
    color: var(--muted);
    line-height: 1.8;
    font-size: 14px;
}

footer {
    max-width: 1050px;
    margin: auto;
    padding: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    color: #9aa4b4;
    font-size: 11px;
}

/* Horror layer: hidden and inert until JS activates it. */
.jumpscare {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    overflow: hidden;
    background: #000;
    pointer-events: none;
}

.jumpscare.active {
    display: block;
    animation: scare-in .07s steps(2, end) both;
}

.jumpscare img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.02);
    filter: contrast(1.2) brightness(.72);
}

.jumpscare.active img {
    animation: scare-lunge 4s cubic-bezier(.16,.85,.25,1) forwards;
    transform-origin: center center;
}

@keyframes scare-lunge {
    0% { transform: scale(1.02); filter: contrast(1.2) brightness(.72); }
    14% { transform: scale(1.04); filter: contrast(1.25) brightness(.68); }
    32% { transform: scale(1.10); filter: contrast(1.28) brightness(.65); }
    46% { transform: scale(1.62); filter: contrast(1.45) brightness(.78); }
    53% { transform: scale(1.48) translate(-1%, 1%); filter: contrast(1.35) brightness(.70); }
    59% { transform: scale(1.72) translate(1%, -1%); filter: contrast(1.5) brightness(.76); }
    68% { transform: scale(1.64) translate(-.5%, .5%); filter: contrast(1.4) brightness(.68); }
    100% { transform: scale(1.70); filter: contrast(1.42) brightness(.70); }
}

.scare-flash {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
}

@keyframes scare-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 100;
    max-width: 300px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.97);
    box-shadow: var(--shadow);
    color: #566278;
    font-size: 12px;
    transform: translateY(130%);
    opacity: 0;
    transition: .25s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 720px) {
    .site-header { padding: 0 20px; }
    .nav { display: none; }
    .menu-btn { display: block; }
    .hero { padding-top: 45px; }
    .test-card { padding: 22px 18px; }
    .result-card,
    .info-section { grid-template-columns: 1fr; }
    .result-metrics { grid-template-columns: repeat(2, 1fr); }
    .gauge { width: 190px; height: 190px; }
    .gauge-inner strong { font-size: 36px; }
}
