:root {
    --max: 720px;

    /* Core palette (exact values) */
    --bg: #0B0D17;      /* Primary Background */
    --surface: #141824;     /* Card / Surface */
    --border: #2A2F40;      /* Border / Divider */
    --text: #FFFFFF;        /* Text Primary */
    --text-muted: #C6C8D1;      /* Text Secondary */
    --placeholder: #5A5D6B;     /* Placeholder */

    --accent: #00E5FF;      /* Primary Accent (Neon Cyan) */
    --accent-2: #8B5CF6;        /* Electric Violet */
    --accent-3: #E63EFF;        /* Magenta Pink */

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

    --shadow-glow: 0 0 20px rgba(0, 229, 255, .2);
    --shadow-card: 0 0 24px rgba(139, 92, 246, .12);
    --focus-ring: 0 0 0 2px rgba(0, 229, 255, .6), 0 0 0 6px rgba(0, 229, 255, .12);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    background: var(--bg);     /* dark base only */
}

body {
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(230, 62, 255, .10), transparent 60%),
        radial-gradient(900px 500px at 20% 0%, rgba(139, 92, 246, .12), transparent 60%),
        var(--bg);
    position: relative;        /* enables the ::before overlay */
    min-height: 100%;
}

/* Fixed, non-repeating gradient overlay */
body::before{
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;                /* sits above body bg, below content */
    pointer-events: none;

    background:
    radial-gradient(1200px 600px at 80% -10%, rgba(230, 62, 255, .10), transparent 60%),
    radial-gradient(900px 500px at 20% 0%, rgba(139, 92, 246, .12), transparent 60%);
    background-repeat: no-repeat, no-repeat;
    background-position: 80% -10%, 20% 0%;
}

/* Ensure your app content paints above the overlay */
body > * { position: relative; z-index: 1; }

header {
    padding: 40px 24px 24px;
    text-align: center;
}

header h1 {
    margin: 0 0 6px;
    font-size: clamp(28px, 4.5vw, 42px);
    letter-spacing: .2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 18px rgba(0, 229, 255, .2);
}

header p {
    margin: 0;
    color: var(--text-muted);
    max-width: 56ch;
    margin-inline: auto;
}

main {
    margin-bottom: 40px;
    flex-grow: 1;
}

form {
    display: grid;
    gap: 14px;
}

label {
    font-weight: 600;
    color: var(--text);
    display: inline-block;
    margin-bottom: 6px;
}

input[type="email"],
input[type="text"] {
    width: 100%;
    padding: 14px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

input::placeholder {
    color: var(--placeholder);
}

input:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

button {
    padding: 12px 16px;
    border: 0;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    color: #000;
    background: var(--accent);
    box-shadow: var(--shadow-glow);
    transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
}

button:hover {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 28px rgba(139, 92, 246, .28);
}

button:active {
    transform: translateY(1px);
}

button[disabled] {
    opacity: .6;
    cursor: wait;
}

.muted {
    color: var(--text-muted);
    font-size: 14px;
}

.result {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--text-muted);
    line-height: 1.55;
}

.row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.card {
    background: var(--surface);
    width: 92%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
}

/* Medium screens (tablets) */
@media (max-width: 900px) {
    .card {
        width: 94%;
        padding: 20px;
        border-radius: 12px;
    }
}

/* Small screens (mobile) */
@media (max-width: 600px) {
    body {
        padding: 0 8px;
    }

    body::before{
        background-size: 1100px 550px, 800px 460px;
        background-position: 90% -10%, 10% 0%;
    }

    header {
        padding: 36px 16px 24px;
    }

    input[type="email"],
    input[type="text"] {
        font-size: 15px;
        padding: 12px 10px;
    }

    button {
        width: 100%;
        font-size: 15px;
        padding: 14px;
    }

    .row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .hero-desc {
        font-size: 0.95rem;
        line-height: 1.6;
        padding: 0 8px;
    }
}

.hero-desc {
    color: var(--text-muted);
    max-width: 680px;
    margin: 12px auto;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    opacity: 0.9;
}

.hero-desc .accent-strong {
    background: linear-gradient(90deg, var(--accent), var(--accent-3));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

.result-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Two-column flow: text left, chart floats right; text also flows beneath */
.result-body {
    position: relative;
}

/* Keep chart in exact box so mask aligns perfectly */
.score-wrap {
    float: right;
    width: 140px;
    height: 140px;
    margin: 0 0 8px 24px;
    /* no top margin, small bottom */
    position: relative;
    shape-outside: circle(50%);
    -webkit-shape-outside: circle(50%);
}

/* Absolute centering for the number; label anchored on top */
.score-center {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.score-label {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: var(--text-muted);
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
}

.brand-name {
    margin: 0 0 4px 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    opacity: .95;
}

/* Mobile stacking keeps centering correct */
@media (max-width:680px) {
    .score-wrap {
        float: none;
        margin: 8px auto 16px;
    }

    .result-view {
        text-align: center;
    }

    .blurb {
        text-align: left;
    }
}

.domain {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0 0 16px 0;
    font-style: italic;
}

.blurb {
    font-size: 1rem;
    line-height: 1.5rem;
    color: var(--text-muted);
}

.donut {
    display: block;
}

/* Clear float at the end to keep container height correct */
.clearfix::after {
    content: "";
    display: block;
    clear: both;
}

/* ===== Improve visibility callout (shown when score < 80%) ===== */
.improve-box {
    margin-top: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 229, 255, 0.45);
    /* light blue border */
    background: rgba(0, 229, 255, 0.06);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.95rem;
    /* a bit smaller */
    line-height: 1.5;
}

.improve-box strong {
    color: var(--text);
    font-weight: 700;
}

.improve-box a {
    color: var(--accent);
    text-decoration: underline;
}

.improve-box a:hover {
    text-decoration: none;
    filter: brightness(1.1);
}

footer {
  width: 100%;
  text-align: center;
  padding: 12px 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-container {
  margin-top: 0.75rem;
}

.progress-container .small {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.progress-bar {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar-inner {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00e5ff, #8b5cf6);
  transition: width 0.4s ease-out;
}

/* Indeterminate mode – pulse */
.progress-bar-inner.indeterminate {
position: absolute;
  inset: 0;
  width: 40%; 
  animation: progressSlide 1.1s infinite ease-in-out;
  transform-origin: left center;
}

@keyframes progressSlide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(220%);
  }
}
