/*
 * Hero - Page Weight: a centred title, a URL field with a button, and under it
 * the card the script fills with the answer.
 */

.hero-page-weight {
    position: relative;
    font-variant-numeric: tabular-nums;
    /* The same room above and below, whether or not there is an answer. */
    padding-top: clamp(36px, 7vw, 80px);
    padding-bottom: clamp(40px, 7vw, 80px);
    margin-bottom: var(--section-gap);
    overflow: hidden;
}

.hero-page-weight__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-page-weight__blob {
    position: absolute;
    border-radius: 999px;
    filter: blur(60px);
}

.hero-page-weight__blob--a {
    left: -6%;
    top: -40px;
    width: 440px;
    height: 440px;
    background: radial-gradient(circle, rgba(123, 108, 246, 0.42), transparent 68%);
    animation: hero-page-weight-blob-a 18s ease-in-out infinite;
}

.hero-page-weight__blob--b {
    right: -4%;
    top: 20px;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(242, 160, 184, 0.4), transparent 68%);
    animation: hero-page-weight-blob-b 22s ease-in-out infinite;
}

@keyframes hero-page-weight-blob-a {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(24px, -30px, 0) scale(1.06); }
}

@keyframes hero-page-weight-blob-b {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-28px, 24px, 0) scale(0.94); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-page-weight__blob { animation: none; }
}

.hero-page-weight__inner {
    position: relative;
    text-align: center;
}

.hero-page-weight__title {
    max-width: 860px;
    margin: 0 auto 22px;
    font-size: clamp(36px, 8vw, 60px);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -0.045em;
    text-wrap: balance;
}

.hero-page-weight__title mark {
    background: linear-gradient(100deg, #6b5ef0, #c17be0 55%, #f2a0b8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-page-weight__tagline {
    max-width: 620px;
    margin: 0 auto 32px;
    font-size: clamp(16px, 2.2vw, 18px);
    line-height: 1.6;
    color: var(--ink-soft);
    text-wrap: pretty;
}

.hero-page-weight__title:has(+ .hero-page-weight__field) {
    margin-bottom: 32px;
}

/* The pill that holds the address and the button. */
.hero-page-weight__field {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 640px;
    margin: 0 auto 14px;
    padding: 8px;
    border-radius: clamp(18px, 4vw, 999px);
    background: var(--surface);
    border: 1px solid rgba(22, 21, 28, 0.1);
    box-shadow: 0 30px 60px -40px rgba(70, 56, 180, 0.6);
}

.hero-page-weight__field:focus-within {
    border-color: var(--accent);
}

.hero-page-weight__field--invalid,
.hero-page-weight__field--invalid:focus-within {
    border-color: #d64550;
}

.hero-page-weight__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.hero-page-weight__input {
    flex: 999 1 240px;
    min-width: 0;
    min-height: 48px;
    padding: 12px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    font-family: inherit;
    /* 16px: smaller and iOS zooms the page when the field is focused. */
    font-size: 16px;
    color: var(--ink);
}

.hero-page-weight__input:focus {
    outline: none;
}

.hero-page-weight__button {
    flex: 1 0 auto;
    /* Wide enough for the busy label, so changing it never resizes the pill. */
    min-width: 170px;
    min-height: 48px;
    padding: 14px 26px;
    border: 0;
    border-radius: clamp(12px, 3vw, 999px);
    background: linear-gradient(135deg, #6b5ef0, #8f63e8);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.hero-page-weight__button:hover {
    filter: brightness(1.06);
}

.hero-page-weight__button:disabled {
    cursor: default;
    filter: none;
    animation: hero-page-weight-pulse 0.9s ease-in-out infinite;
}

@keyframes hero-page-weight-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-page-weight__button:disabled { animation: none; opacity: 0.75; }
    .hero-page-weight__status--error { animation: none; }
}

.hero-page-weight__hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--ink-muted);
}

/* Always there, so a message appearing never moves the card. */
.hero-page-weight__status {
    min-height: 22px;
    margin: 0 0 28px;
    font-size: 14px;
    line-height: 22px;
    color: var(--ink-soft);
}

.hero-page-weight__status--error {
    color: #d64550;
    animation: hero-page-weight-message-in 0.25s ease-out both;
}

@keyframes hero-page-weight-message-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

/* ---- the answer */

.hero-page-weight__results {
    position: relative;
}

.hero-page-weight__card {
    display: grid;
    /* minmax(0, ...): a wide table scrolls in its own box instead of widening the whole card. */
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 32px;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 48px 96px -56px rgba(70, 56, 180, 0.45);
    text-align: left;
}

.hero-page-weight__summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.hero-page-weight__verdict {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
}

.hero-page-weight__verdict-badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.hero-page-weight__verdict-badge--light { background: rgba(31, 157, 99, 0.1); color: #1a8556; }
.hero-page-weight__verdict-badge--normal { background: rgba(107, 94, 240, 0.1); color: var(--accent-ink); }
.hero-page-weight__verdict-badge--heavy { background: rgba(214, 69, 80, 0.07); color: #c13a45; }

.hero-page-weight__verdict-text {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.015em;
}

.hero-page-weight__meta {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--ink-muted);
}

.hero-page-weight__host {
    font-weight: 500;
    color: var(--ink-body);
    overflow-wrap: anywhere;
}

.hero-page-weight__checked:not(:empty)::before {
    content: '·';
    margin: 0 6px;
}

/* ---- the three numbers */

.hero-page-weight__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 16px;
}

.hero-page-weight__stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid rgba(22, 21, 28, 0.06);
}

.hero-page-weight__stat--a { background: linear-gradient(135deg, #f3f1ff, #faf8ff); }
.hero-page-weight__stat--b { background: linear-gradient(135deg, #fdf1f5, #fef9fb); }
.hero-page-weight__stat--c { background: linear-gradient(135deg, #eff6ff, #f8fbff); }

.hero-page-weight__stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-muted);
}

.hero-page-weight__stat-value {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.hero-page-weight__stat-value--good {
    color: #1a8556;
}

.hero-page-weight__stat-note {
    font-size: 13px;
    color: var(--ink-muted);
}

/* ---- panels */

.hero-page-weight__section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.hero-page-weight__section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.hero-page-weight__section-note {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-muted);
}

.hero-page-weight__panels {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.hero-page-weight__panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1 1 380px;
    min-width: 0;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--line);
}

.hero-page-weight__panel--wide {
    flex-basis: 460px;
}

/* ---- head and body */

.hero-page-weight__split-bar {
    display: flex;
    gap: 3px;
    height: 10px;
}

.hero-page-weight__split-segment {
    flex: var(--share) 1 0;
    border-radius: 999px;
}

.hero-page-weight__split-segment--head { background: linear-gradient(135deg, #6b5ef0, #a77df0); }
.hero-page-weight__split-segment--body { background: linear-gradient(135deg, #c17be0, #f2a0b8); }

.hero-page-weight__split-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 13px;
    color: var(--ink-soft);
}

.hero-page-weight__split-legend b {
    font-weight: 600;
    color: var(--ink);
}

.hero-page-weight__table-wrap {
    overflow-x: auto;
}

.hero-page-weight__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.hero-page-weight__table thead th {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    font-weight: 500;
    text-align: right;
    color: var(--ink-muted);
}

.hero-page-weight__table thead th:first-child,
.hero-page-weight__table tbody th {
    text-align: left;
}

.hero-page-weight__table tbody th {
    font-weight: 400;
    color: var(--ink-body);
}

.hero-page-weight__table td,
.hero-page-weight__table tbody th {
    padding: 11px 0;
    border-bottom: 1px solid rgba(22, 21, 28, 0.06);
}

.hero-page-weight__table td {
    text-align: right;
    white-space: nowrap;
}

.hero-page-weight__visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* ---- what the HTML is made of */

.hero-page-weight__parts {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-page-weight__part {
    display: grid;
    grid-template-columns: 148px minmax(60px, 1fr) 64px 48px;
    align-items: center;
    gap: 14px;
    min-height: 32px;
    font-size: 15px;
    color: var(--ink-body);
}

.hero-page-weight__meter {
    height: 6px;
    border-radius: 999px;
    background: rgba(22, 21, 28, 0.05);
    overflow: hidden;
}

.hero-page-weight__meter-fill {
    width: var(--share);
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6b5ef0, #8f63e8);
}

.hero-page-weight__meter-fill--text { background: #1f9d63; }

.hero-page-weight__part-value {
    font-size: 14px;
    text-align: right;
}

.hero-page-weight__part-share {
    font-size: 13px;
    text-align: right;
    color: var(--ink-muted);
}

.hero-page-weight__panel-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--ink-muted);
}

/* ---- what stands out */

.hero-page-weight__section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-page-weight__findings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 16px;
}

.hero-page-weight__finding {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border-radius: 18px;
    border: 1px solid rgba(22, 21, 28, 0.06);
}

.hero-page-weight__finding--bad,
.hero-page-weight__finding--warn { background: linear-gradient(135deg, #fdf1f5, #fef9fb); }
.hero-page-weight__finding--info { background: linear-gradient(135deg, #f3f1ff, #faf8ff); }

.hero-page-weight__finding-label {
    font-size: 13px;
    font-weight: 500;
}

.hero-page-weight__finding--bad .hero-page-weight__finding-label,
.hero-page-weight__finding--warn .hero-page-weight__finding-label { color: #b03f6e; }
.hero-page-weight__finding--info .hero-page-weight__finding-label { color: var(--accent-ink); }

.hero-page-weight__finding-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-body);
}

.hero-page-weight__footnote {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-muted);
}

/* The site's bot protection turned the checker away. */
.hero-page-weight__notice {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px;
    border-radius: 20px;
    background: rgba(214, 140, 40, 0.06);
    border: 1px solid rgba(214, 140, 40, 0.28);
    text-align: left;
}

.hero-page-weight__notice-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.hero-page-weight__notice-text,
.hero-page-weight__notice-lead {
    margin: 10px 0 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-body);
}

.hero-page-weight__notice-lead { font-weight: 600; }

.hero-page-weight__notice-list {
    margin: 8px 0 0;
    padding-left: 22px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-body);
}

.hero-page-weight__notice-list li:not(:last-child) { margin-bottom: 6px; }

.hero-page-weight__notice-bot {
    margin: 16px 0 0;
    font-size: 14px;
    color: var(--ink-soft);
}

.hero-page-weight__notice-bot code {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(22, 21, 28, 0.05);
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .hero-page-weight__card { padding: 22px; }

    .hero-page-weight__notice { padding: 20px; }

    .hero-page-weight__panel { padding: 20px; }
}

@media (max-width: 767px) {
    .hero-page-weight__button { min-width: 0; }

    .hero-page-weight__stat-value { font-size: 32px; }

    /* The name and the numbers share a line; the bar sits under them. */
    .hero-page-weight__part {
        grid-template-columns: minmax(0, 1fr) auto 44px;
        gap: 6px 10px;
        padding: 6px 0;
    }

    .hero-page-weight__meter { grid-row: 2; grid-column: 1 / -1; }
}
