.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    /* Fill screen nicely */
    text-align: center;
    position: relative;
    padding: 6rem 0;
    overflow: hidden;
    /* Ensure grid doesn't leak */
}

/* Premium Apple-style Technical Grid */
.hero-cyber-grid {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* Behind content but above some ambient */
    pointer-events: none;
    /* Non-obvious optimization: no mouse events */
    contain: strict;
    /* Non-obvious optimization: limits repaint area */

    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;

    /* Fade out the grid at the edges using an elliptical mask */
    -webkit-mask-image: radial-gradient(ellipse at 50% 20%, rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 0) 70%);
    mask-image: radial-gradient(ellipse at 50% 20%, rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 0) 70%);

    /* Hardware acceleration for smooth movement */
    transform: translateZ(0) perspective(500px) rotateX(20deg);
    transform-origin: top;
    will-change: transform;
    animation: driftGrid 20s linear infinite;
}

body.light-theme .hero-cyber-grid {
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

@keyframes driftGrid {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 500px;
    }

    /* Move by multiples of background-size */
}

.hero-inner {
    max-width: 900px;
    z-index: 2;
    padding: 0 1.5rem;
}

.hero-title {
    font-size: clamp(3rem, 7vw, 5.5rem);
    letter-spacing: -0.04em;
    font-weight: 800;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s var(--ease-out-expo) forwards;
    opacity: 0;
    transform: translateY(30px);
    line-height: 1.1;
}

.text-gradient {
    /* Gold Gradient like Apple Pro models */
    background: linear-gradient(90deg, #F0D57A 0%, var(--clr-accent-1) 50%, #B89326 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: var(--clr-text-muted);
    margin: 0 auto 3.5rem auto;
    line-height: 1.6;
    max-width: 600px;
    font-weight: 400;
    animation: fadeInUp 0.8s var(--ease-out-expo) 0.2s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.audit-widget {
    animation: scaleIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
    opacity: 0;
    transform: scale(0.97) translateY(20px);
    margin: 0 auto;
    max-width: 720px;
}

.audit-form {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

@media (max-width: 640px) {
    .audit-form {
        flex-direction: column;
    }
}

.audit-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.5);
    /* Deep slate */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    color: var(--clr-text-main);
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-base);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.audit-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
    font-weight: 400;
}

body.light-theme .audit-input {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    color: var(--clr-text-main);
}

body.light-theme .audit-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.audit-input:focus {
    border-color: var(--clr-accent-1);
    background: rgba(15, 23, 42, 0.8);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 0 2px rgba(212, 175, 55, 0.2);
}

body.light-theme .audit-input:focus {
    background: #FFFFFF;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.05),
        0 0 0 2px rgba(212, 175, 55, 0.2);
}

.audit-btn {
    padding: 1.25rem 2.5rem;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
}

/* Detailed Audit Result styling */
.audit-result {
    margin-top: 2.5rem;
    text-align: left;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.8s var(--ease-out-expo) forwards;
}

.audit-detailed {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .audit-detailed {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.audit-detailed-header {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .audit-detailed-header {
        flex-direction: column;
        text-align: center;
    }
}

.score-circle-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.score-circle-large span {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.score-circle-large small {
    font-size: 0.75rem;
    opacity: 0.5;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-circle-large.bad {
    background: conic-gradient(var(--clr-error) 42%, rgba(255, 255, 255, 0.05) 0);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.2);
}

.score-circle-large.bad::after {
    content: '';
    position: absolute;
    inset: 8px;
    /* inner hole */
    background: #11141D;
    border-radius: 50%;
    z-index: -1;
}

.audit-detailed-title h4 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--clr-text-main);
}

.audit-verdict {
    color: var(--clr-error);
    font-size: 1.05rem;
    line-height: 1.5;
    background: rgba(239, 68, 68, 0.1);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--clr-error);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.metric-box {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-base);
}

.metric-box:hover {
    background: rgba(255, 255, 255, 0.04);
}

.metric-box.bad {
    border-top: 2px solid var(--clr-error);
}

.metric-box.bad .metric-value {
    color: var(--clr-error);
}

.metric-box.warning {
    border-top: 2px solid var(--clr-warning);
}

.metric-box.warning .metric-value {
    color: var(--clr-warning);
}

.metric-name {
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.metric-desc {
    font-size: 0.85rem;
    color: var(--clr-text-muted);
    line-height: 1.5;
}

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner loader */
.spinner {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-right: 0.75rem;
}

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