/*
 * Public single page (index.html): header, hero, create card, result card, footer.
 * Includes its own responsive rules so the page is self-contained.
 */

.home-body {
    min-height: 100vh;
    /* Soft brand glows are painted as background layers, so nothing can overflow. */
    background:
        radial-gradient(560px 480px at -4% -12%, var(--blob-1), transparent 70%) fixed,
        radial-gradient(620px 560px at 106% 34%, var(--blob-2), transparent 70%) fixed,
        radial-gradient(620px 460px at 38% 112%, var(--blob-3), transparent 70%) fixed,
        linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-2) 100%) fixed;
    color: var(--text);
}

.home-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1240px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-5) var(--space-4);
}

/* ------------------------------------------------------------------ header */

.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
}

.brand-word {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.brand-word-dark {
    color: var(--brand-word);
}

.brand-word-accent {
    color: var(--brand);
}

.brand-mark-sm .brand-icon {
    width: 30px;
    height: 30px;
}

.brand-mark-sm .brand-word {
    font-size: 22px;
}

.home-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.ghost-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
    transition: color var(--transition), border-color var(--transition);
}

.ghost-icon-btn:hover {
    color: var(--brand);
    border-color: var(--brand);
}

.ghost-icon-btn:active {
    transform: scale(0.95);
    background: var(--surface-secondary);
}

.language-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition);
}

.language-pill:focus-within {
    border-color: var(--brand);
}

.language-globe,
.language-chevron {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--text-muted);
    pointer-events: none;
}

.language-select {
    appearance: none;
    -webkit-appearance: none;
    flex: 1 1 auto;
    padding: 0 2px;
    background: transparent;
    border: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.language-select:focus {
    outline: none;
}

/* -------------------------------------------------------------------- hero */

.home-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-5);
}

.hero {
    position: relative;
    padding: var(--space-6) 0 var(--space-5);
}

.hero-copy {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: clamp(30px, 5vw, 50px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.hero-title-accent {
    color: var(--brand);
}

.hero-subtitle {
    margin: var(--space-4) auto 0;
    max-width: 34em;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
}

/* Decorative annotations and phone mockups. */

.hero-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.annotation {
    position: absolute;
    color: var(--annotation);
    font-family: "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive;
    font-size: 17px;
    line-height: 1.3;
}

.annotation-text {
    display: block;
    max-width: 12ch;
}

.annotation-brand {
    top: -4px;
    right: 28px;
    transform: rotate(-6deg);
    text-align: center;
}

.annotation-brand .annotation-text {
    max-width: 14ch;
}

.annotation-underline {
    display: block;
    width: 110px;
    margin-top: 2px;
}

.annotation-form {
    bottom: -28px;
    left: 0;
    width: 190px;
}

.annotation-form .annotation-text {
    max-width: 16ch;
    transform: rotate(-7deg);
}

.annotation-arrow {
    width: 92px;
    margin: 2px 0 0 52px;
}

.phones {
    position: absolute;
    top: 64px;
    right: 30px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.phone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 116px;
    padding: 22px 12px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(52, 40, 120, .14);
}

.phone-left {
    transform: rotate(-8deg);
}

.phone-right {
    margin-top: 26px;
    transform: rotate(7deg);
}

.phone-notch {
    position: absolute;
    top: 9px;
    left: 50%;
    width: 34px;
    height: 5px;
    background: var(--surface-secondary);
    border-radius: var(--radius-pill);
    transform: translateX(-50%);
}

.phone-logo {
    width: 34px;
    height: 34px;
    margin-top: 6px;
    color: var(--text);
}

.phone-title {
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
}

.phone-caption {
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
    line-height: 1.25;
}

/* ------------------------------------------------------------- create card */

.create-card {
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 20px 50px rgba(46, 37, 108, .08);
}

.create-form {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--space-4);
}

.create-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.create-field > label {
    font-size: 13px;
    font-weight: 700;
}

.input-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-shell:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.input-shell:has(.create-input[aria-invalid="true"]) {
    border-color: var(--danger);
}

.input-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    color: var(--text-muted);
}

.create-input {
    width: 100%;
    min-width: 0;
    background: transparent;
    border: 0;
    color: var(--text);
    font-size: 15px;
}

.create-input:focus {
    outline: none;
}

.create-input::placeholder {
    color: var(--text-muted);
    opacity: .85;
}

.create-error {
    color: var(--danger);
    font-size: 13px;
    font-weight: 550;
}

.create-submit-wrap {
    display: flex;
    align-items: flex-end;
    height: 100%;
    padding-top: 21px;
}

.create-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 56px;
    padding: 0 var(--space-5);
    background: var(--brand-gradient);
    border: 0;
    border-radius: 14px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 12px 26px rgba(91, 91, 245, .32);
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.create-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(91, 91, 245, .4);
}

.create-submit:disabled {
    opacity: .75;
}

.create-submit .icon,
.create-submit .submit-arrow {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.create-submit.is-loading .icon,
.create-submit.is-loading .submit-arrow {
    display: none;
}

/* ------------------------------------------------------------- result card */

.result-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 20px 50px rgba(46, 37, 108, .08);
}

.result-banner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--success-bg);
    border: 1px solid var(--success-soft);
    border-radius: 18px;
}

.result-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    background: var(--success);
    border-radius: 50%;
    color: #ffffff;
}

.result-check .icon {
    width: 24px;
    height: 24px;
}

.result-banner-text {
    flex: 1 1 auto;
    min-width: 0;
}

.result-title {
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

/* The heading is focused programmatically for screen readers, not by the mouse. */
.result-title:focus,
.result-title:focus-visible {
    outline: none;
}

.result-subtitle {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 14px;
}

.result-reset {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 var(--space-4);
    flex: 0 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--brand);
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
    transition: border-color var(--transition), background var(--transition);
}

.result-reset:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.result-reset .icon {
    width: 18px;
    height: 18px;
}

.result-body {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    align-items: start;
    gap: var(--space-4);
}

.qr-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.qr-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
    background: #ffffff;
    border-radius: 12px;
}

.qr-frame canvas {
    width: 100%;
    height: auto;
    image-rendering: pixelated;
}

.qr-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    background: var(--brand-soft);
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--brand-strong);
    font-size: 14px;
    font-weight: 650;
    transition: background var(--transition), border-color var(--transition);
}

.qr-download:hover {
    border-color: var(--brand);
}

.qr-download .icon {
    width: 18px;
    height: 18px;
}

.result-rows {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
}

.result-row {
    display: grid;
    grid-template-columns: 28px minmax(120px, 200px) minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
}

.result-row:first-child {
    border-top: 0;
}

.row-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
}

.row-icon {
    width: 22px;
    height: 22px;
}

.row-label {
    font-size: 14px;
    font-weight: 600;
}

.row-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 14px;
}

.row-value-link {
    color: var(--link-value);
}

.row-value-link:hover {
    text-decoration: underline;
}

.row-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 var(--space-3);
    background: var(--brand-soft);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--brand-strong);
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    transition: border-color var(--transition);
}

.row-copy:hover {
    border-color: var(--brand);
}

.row-copy .icon {
    width: 16px;
    height: 16px;
}

/* ------------------------------------------------------------------ footer */

.home-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-link:hover {
    color: var(--brand);
}

.footer-divider {
    width: 1px;
    height: 20px;
    background: var(--border-strong);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: var(--text);
    transition: color var(--transition), background var(--transition);
}

.footer-social-link:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

.footer-social-link .icon {
    width: 20px;
    height: 20px;
}

.footer-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--text-muted);
    font-size: 13px;
    text-align: right;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
    .phones {
        right: 0;
        transform: scale(.88);
        transform-origin: top right;
    }

    .annotation {
        font-size: 16px;
    }
}

@media (max-width: 940px) {
    .hero-decor {
        display: none;
    }

    .hero {
        padding: var(--space-5) 0 var(--space-4);
    }

    .create-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .create-submit-wrap {
        padding-top: 0;
    }

    .create-submit {
        width: 100%;
    }

    .result-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .qr-panel {
        max-width: 320px;
        margin: 0 auto;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .home-shell {
        padding: var(--space-4) var(--space-4) var(--space-4);
    }

    .result-banner {
        flex-wrap: wrap;
        padding: var(--space-4);
    }

    .result-reset {
        width: 100%;
        justify-content: center;
    }

    .result-row {
        grid-template-columns: 24px minmax(0, 1fr) auto;
        grid-template-areas:
            "icon label copy"
            "value value value";
        row-gap: 6px;
    }

    .row-icon-wrap {
        grid-area: icon;
    }

    .row-label {
        grid-area: label;
    }

    .row-copy {
        grid-area: copy;
    }

    .row-value {
        grid-area: value;
        white-space: normal;
        word-break: break-all;
        font-size: 13px;
    }

    .home-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .footer-copy {
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .brand-word {
        font-size: 25px;
    }

    .brand-icon {
        width: 34px;
        height: 34px;
    }

    .home-header {
        gap: var(--space-3);
        padding: 0 var(--space-3);
    }

    .home-header-actions {
        gap: 8px;
    }

    .ghost-icon-btn {
        width: 44px;
        height: 44px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .create-card,
    .result-card {
        padding: var(--space-4) var(--space-3);
        border-radius: 18px;
    }

    .input-shell {
        height: 52px;
        padding: 0 var(--space-3);
    }

    .footer-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}
