@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Figtree:wght@400;600;700;800&display=swap');

:root {
    --bg:         #080b0f;
    --bg2:        #0d1117;
    --bg3:        #111820;
    --border:     #1e2a38;
    --accent:     #f97316;
    --accent2:    #fb923c;
    --text:       #e2e8f0;
    --text-muted: #64748b;
    --green:      #4ade80;
    --yellow:     #facc15;
    --red:        #f87171;
    --mono:       'Space Mono', monospace;
    --sans:       'Figtree', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    min-height: 100vh;
    line-height: 1.6;
}

/* ── HEADER ── */
.header {
    padding: 28px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.logo span { color: var(--text-muted); font-weight: 400; }

.tagline {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--mono);
    margin-left: auto;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ── HERO ── */
.hero {
    padding: 80px 40px 60px;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.hero p {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 500px;
    margin: 0 auto 40px;
    font-family: var(--mono);
}

/* ── FORM ── */
.form-wrap {
    display: flex;
    gap: 12px;
    max-width: 680px;
    margin: 0 auto;
}

.url-input {
    flex: 1;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
    padding: 14px 18px;
    border-radius: 6px;
    outline: none;
    transition: border-color .2s;
}

.url-input:focus { border-color: var(--accent); }
.url-input::placeholder { color: var(--text-muted); }

.btn-analyze {
    background: var(--accent);
    color: #000;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 13px;
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background .2s, transform .1s;
    white-space: nowrap;
}

.btn-analyze:hover    { background: var(--accent2); }
.btn-analyze:active   { transform: scale(.98); }
.btn-analyze:disabled { opacity: .5; cursor: not-allowed; }

/* ── LOADER ── */
.loader {
    display: none;
    text-align: center;
    padding: 60px 40px;
    font-family: var(--mono);
    color: var(--text-muted);
    font-size: 13px;
}

.loader.active { display: block; }

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── REPORT ── */
.report {
    display: none;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
}

.report.active { display: block; }

.report-header {
    margin-bottom: 40px;
}

.report-url {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.overall-score {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 32px;
}

.score-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex-shrink: 0;
}

.score-number {
    font-family: var(--mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.score-max {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
}

.score-info h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.score-label {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-muted);
}

/* ── LAYERS GRID ── */
.layers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.layer-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    transition: border-color .2s;
}

.layer-card:hover { border-color: var(--accent); }

.layer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.layer-name {
    font-size: 12px;
    font-family: var(--mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.layer-score {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 700;
}

.layer-bar-bg {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 12px;
}

.layer-bar {
    height: 4px;
    border-radius: 2px;
    transition: width 1s ease;
}

.layer-details {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    font-family: var(--mono);
}

/* Score colors */
.score-high   { color: var(--green); }
.score-mid    { color: var(--yellow); }
.score-low    { color: var(--red); }
.bar-high     { background: var(--green); }
.bar-mid      { background: var(--yellow); }
.bar-low      { background: var(--red); }

/* ── RECOMMENDATIONS ── */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    font-family: var(--mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
}

.rec-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--red);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 16px;
}

.rec-card.priority-medium { border-left-color: var(--yellow); }
.rec-card.priority-low    { border-left-color: var(--green); }

.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rec-layer {
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.rec-score {
    font-family: var(--mono);
    font-size: 13px;
}

.rec-details {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

.rec-problems h4,
.rec-suggestions h4 {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.rec-list {
    list-style: none;
    margin-bottom: 16px;
}

.rec-list li {
    font-size: 13px;
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
    color: var(--text);
    line-height: 1.5;
}

.rec-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.rec-suggestions .rec-list li::before { color: var(--accent); }

/* ── META ── */
.meta-bar {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 24px;
    margin-bottom: 32px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
}

.meta-item strong { color: var(--text); }

/* ── ERROR ── */
.error-msg {
    display: none;
    background: #1a0a0a;
    border: 1px solid var(--red);
    color: var(--red);
    padding: 16px 20px;
    border-radius: 8px;
    font-family: var(--mono);
    font-size: 13px;
    max-width: 680px;
    margin: 0 auto 20px;
}

.error-msg.active { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .header  { padding: 20px; }
    .hero    { padding: 48px 20px 40px; }
    .report  { padding: 24px 20px; }
    .form-wrap { flex-direction: column; }
    .overall-score { flex-direction: column; text-align: center; }
    .tagline { display: none; }
}
