:root {
    --ink: #0f172a;
    --muted: #64748b;
    --line: rgba(72, 102, 139, 0.22);
    --panel: rgba(255, 255, 255, 0.92);
    --soft: #f8fafc;
    --brand: #48668b;
    --brand-dark: #314a68;
    --accent: #cfab6e;
    --warn: #f59f00;
    --danger: #e03131;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
    --radius: 24px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
    min-height: 100%;
    background: #0b0f14;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #fff;
    background:
        radial-gradient(circle at 0 0, rgba(72, 102, 139, 0.34) 0 10rem, transparent 10.2rem),
        radial-gradient(circle at 100% 14rem, rgba(207, 171, 110, 0.28) 0 11rem, transparent 11.2rem),
        linear-gradient(180deg, #0b0f14 0%, #101828 48%, #0b0f14 100%);
    line-height: 1.6;
    padding-top: 4rem;
}
.parallax-layer { position: fixed; inset: 0; z-index: -1; pointer-events: none; will-change: transform; }
.blob { filter: blur(40px) saturate(120%); opacity: .2; mix-blend-mode: screen; }

body > footer {
    background: #0f172a;
}

.speed-page {
    width: 100%;
    margin: 0;
    padding: 48px 16px 96px;
    color: var(--ink);
    background: transparent;
}

.speed-page > .hero,
.speed-page > .tool-card,
.speed-page > .results,
.speed-page > .provider-credit {
    width: min(1120px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: stretch;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

.speed-page h1,
.speed-page h2,
.speed-page h3,
.speed-page h4,
.speed-page label,
.speed-page legend {
    color: var(--ink);
}

h1 {
    margin-bottom: 16px;
    font-size: clamp(2.35rem, 6vw, 4.65rem);
    line-height: 0.96;
    letter-spacing: -0.055em;
}

h2 {
    margin-bottom: 8px;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    letter-spacing: -0.035em;
}

h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.hero__content,
.tool-card,
.result-section,
.results-cta {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.hero__content { padding: clamp(28px, 5vw, 54px); }

.hero__subtitle {
    max-width: 740px;
    margin-bottom: 14px;
    color: #334158;
    font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero__helper { max-width: 640px; margin-bottom: 0; color: var(--muted); }

.tool-card { padding: clamp(22px, 4vw, 34px); margin-bottom: 32px; }
.tool-card__header p, .section-heading p { color: var(--muted); margin-bottom: 0; }

.speed-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 18px;
    align-items: end;
    margin-top: 24px;
}

.field-group label,
.strategy-group legend {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
}

.field-group input {
    width: 100%;
    min-height: 56px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    background: #fff;
    font: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field-group input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(44, 107, 237, 0.14);
}

.field-help { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }

.strategy-group {
    display: flex;
    gap: 10px;
    min-width: 310px;
    padding: 0;
    border: 0;
}

.strategy-group legend { width: 100%; }

.strategy-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
}

.strategy-option:has(input:checked) {
    border-color: var(--brand);
    box-shadow: inset 0 0 0 1px var(--brand);
}

.strategy-option small { display: block; color: var(--muted); font-size: 0.78rem; }

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.primary-button {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 14px 30px rgba(44, 107, 237, 0.28);
}

.primary-button:hover,
.secondary-button:hover { transform: translateY(-1px); }

.primary-button:disabled { opacity: 0.65; cursor: wait; transform: none; }

.secondary-button {
    margin-top: 16px;
    color: var(--ink);
    background: rgba(207, 171, 110, 0.2);
}

.status-message,
.error-message {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 16px;
    font-weight: 700;
}

.status-message { color: #155d48; background: #e6fcf5; }
.error-message { color: #8f1b1b; background: #fff0f0; }

.results { display: grid; gap: 24px; }

.results__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    padding: 28px;
    border-radius: var(--radius);
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #48668b);
    box-shadow: var(--shadow);
}

.results__summary { margin-bottom: 0; color: rgba(255,255,255,0.82); }
.results__header h2 { color: #fff; }
.results__header .eyebrow { color: #91b4ff; }

.cached-badge {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    color: #dff7ec;
    background: rgba(18, 184, 134, 0.16);
    font-size: 0.84rem;
    font-weight: 900;
}

.result-section { padding: clamp(20px, 4vw, 30px); }

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    margin-bottom: 18px;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.score-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--soft);
}

.score-ring {
    --score-color: var(--accent);
    display: grid;
    place-items: center;
    width: 108px;
    height: 108px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: conic-gradient(var(--score-color) calc(var(--score) * 1%), #e5eaf2 0);
}

.score-ring span {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: #fff;
    font-size: 1.8rem;
    font-weight: 950;
    letter-spacing: -0.06em;
}

.score-card h4 { margin: 0 0 4px; font-size: 1rem; }
.score-card p { margin: 0; color: var(--muted); font-weight: 700; }

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

.metric-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.metric-card strong { display: block; margin-bottom: 5px; }
.metric-value { font-size: 1.45rem; font-weight: 950; letter-spacing: -0.045em; }
.metric-card p { margin: 8px 0 0; color: var(--muted); font-size: 0.92rem; }

.field-data {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    color: #345;
    background: #f4f7fb;
}

.audit-list { display: grid; gap: 12px; }

.audit-item {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.audit-item__top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.audit-item h4 { margin: 0; }
.audit-item p { margin: 0; color: var(--muted); }
.audit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.pill {
    padding: 5px 9px;
    border-radius: 999px;
    background: #edf2f7;
    color: #3c4858;
    font-size: 0.8rem;
    font-weight: 800;
}

.pill--savings { color: #7a4c00; background: #fff4d6; }
.pill--passed { color: #087f5b; background: #dff7ec; }

.prompt-section {
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(245,248,255,0.92));
}

.prompt-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f2f6fb;
}

.prompt-tab {
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.prompt-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 10px 24px rgba(44, 107, 237, 0.22);
}

.prompt-panel {
    display: grid;
    gap: 14px;
}

.prompt-instructions {
    padding: 18px;
    border: 1px solid #dbe7ff;
    border-radius: 18px;
    background: #f7faff;
}

.prompt-instructions h4 {
    margin: 0 0 8px;
}

.prompt-instructions ol {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--muted);
}

.prompt-panel label {
    font-weight: 900;
}

.prompt-output {
    width: 100%;
    min-height: 320px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #101828;
    color: #f8fbff;
    font: 0.92rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    resize: vertical;
}

.prompt-output:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(44, 107, 237, 0.14);
}

.copy-prompt-button {
    justify-self: start;
    margin-top: 0;
}

.copy-status {
    margin: 12px 0 0;
    color: #155d48;
    font-weight: 800;
}

.technical-details {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 12px 18px;
    margin: 0;
}

.technical-details dt { color: var(--muted); font-weight: 900; }
.technical-details dd { margin: 0; word-break: break-word; }

.results-cta {
    padding: 30px;
    text-align: center;
    background: linear-gradient(135deg, #ffffff, #eef5ff);
}

.results-cta p { color: var(--muted); }

.provider-credit {
    max-width: 760px;
    margin: 26px auto 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.9rem;
    text-align: center;
}

.provider-credit a {
    color: #91b4ff;
    font-weight: 800;
    text-decoration: none;
}

.provider-credit a:hover { text-decoration: underline; }

@media (max-width: 920px) {
    .speed-form { grid-template-columns: 1fr; }
    .strategy-group { min-width: 0; }
    .score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .speed-page { padding: 20px 10px 72px; }
    .strategy-group,
    .results__header,
    .section-heading,
    .audit-item__top { display: block; }
    .strategy-option + .strategy-option { margin-top: 10px; }
    .score-grid,
    .metrics-grid { grid-template-columns: 1fr; }
    .technical-details { grid-template-columns: 1fr; }
    .prompt-tabs { display: flex; width: 100%; }
    .prompt-tab { flex: 1; }
}

.tool-hero {
    width: min(1120px, 100%);
    margin: 0 auto 28px;
    padding: clamp(2rem, 5vw, 4rem);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 24px;
    background: rgba(255,255,255,.05);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}
.tool-hero::after { content: ''; position: absolute; inset: auto -7rem -8rem auto; width: 20rem; height: 20rem; border-radius: 999px; background: rgba(207, 171, 110, 0.28); filter: blur(35px); pointer-events: none; }
.tool-breadcrumb { margin: 0 0 2rem; color: rgba(255,255,255,.60); font-size: .875rem; }
.tool-breadcrumb a { color: rgba(255,255,255,.60); text-decoration: none; }
.tool-breadcrumb a:hover { color: #fff; }
.tool-breadcrumb span { margin-left: .5rem; }
.tool-hero__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(280px, 5fr); gap: 2.5rem; align-items: center; }
.tool-hero .eyebrow { color: var(--accent); letter-spacing: .25em; }
.speed-page .tool-hero h1, .speed-page .tool-hero h2 { color: #fff; }
.tool-hero h1 { max-width: 760px; }
.tool-hero__lead { max-width: 760px; font-size: clamp(1.05rem, 2vw, 1.22rem); color: rgba(255,255,255,.75); }
.tool-hero__helper { max-width: 760px; margin: 1rem 0 0; color: rgba(255,255,255,.72); }
.tool-hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.tool-hero__primary, .tool-hero__secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: .75rem 1.25rem; border-radius: .75rem; font-weight: 800; text-decoration: none; }
.tool-hero__primary { color: #fff; background: var(--brand); box-shadow: 0 10px 30px rgba(72,102,139,.3); }
.tool-hero__primary:hover { background: var(--brand-dark); }
.tool-hero__secondary { color: #fff; border: 1px solid rgba(255,255,255,.10); }
.tool-hero__secondary:hover { border-color: rgba(255,255,255,.30); }
.tool-hero__card { border: 1px solid rgba(255,255,255,.10); border-radius: 1.5rem; background: rgba(255,255,255,.05); padding: 1.5rem; }
.tool-hero__card h2 { margin-top: 1.25rem; font-size: 1.25rem; }
.tool-hero__card ul { margin: 1rem 0 0; padding-left: 0; list-style: none; }
.tool-hero__card li { margin-top: .75rem; color: rgba(255,255,255,.75); }
.tool-hero__badge { display: inline-flex; border-radius: 999px; border: 1px solid rgba(207,171,110,.30); background: rgba(207,171,110,.15); color: var(--accent); padding: .25rem .75rem; font-size: .875rem; font-weight: 800; }
@media (max-width: 860px) { .tool-hero__grid { grid-template-columns: 1fr; } }
