/* =============================================
   front-page.css - home page styles
   Loaded only on the front page via functions.php
   ============================================= */


/* =============================================
   HERO
   ============================================= */
.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(5rem, 12vw, 10rem) 0 clamp(4rem, 8vw, 7rem);
    min-height: 70vh;
    display: flex;
    align-items: center;
}

/* Background grid */
.hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--color-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 100%);
    opacity: 0.5;
    pointer-events: none;
}

/* Glow effects */
.hero__glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
    opacity: 0.12;
}

.hero__glow--1 {
    width: 600px;
    height: 600px;
    background: var(--color-accent);
    top: -200px;
    left: -100px;
    animation: glowPulse 6s ease-in-out infinite;
}

.hero__glow--2 {
    width: 400px;
    height: 400px;
    background: #4f9eff;
    top: 50%;
    right: -150px;
    animation: glowPulse 8s ease-in-out infinite reverse;
}

@keyframes glowPulse {
    0%, 100% { transform: scale(1);   opacity: 0.12; }
    50%       { transform: scale(1.1); opacity: 0.18; }
}

.hero__inner {
    position: relative;
    z-index: 1;
    max-width: 740px;
    animation: heroFadeIn 0.8s ease both;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Badge */
.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-6);
    animation: heroFadeIn 0.8s 0.1s ease both;
}

.hero__badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-accent);
    animation: dotBlink 2s ease infinite;
}

@keyframes dotBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* Heading */
.hero__title {
    font-size: clamp(var(--text-3xl), 7vw, var(--text-4xl));
    font-weight: var(--weight-black);
    /* letter-spacing: -0.03em; */
    line-height: 1.1;
    margin-bottom: var(--space-6);
    animation: heroFadeIn 0.8s 0.2s ease both;
}

.hero__title-accent {
    color: var(--color-accent);
    position: relative;
    display: inline-block;
}

/* Underline under accent word */
.hero__title-accent::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--color-accent);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    animation: underlineReveal 0.6s 0.9s ease forwards;
}

@keyframes underlineReveal {
    to { transform: scaleX(1); }
}

/* Description */
.hero__desc {
    font-size: clamp(var(--text-base), 2vw, var(--text-md));
    color: var(--color-text-muted);
    line-height: var(--leading-loose);
    max-width: 560px;
    margin-bottom: var(--space-8);
    animation: heroFadeIn 0.8s 0.3s ease both;
}

/* CTA */
.hero__cta {
    animation: heroFadeIn 0.8s 0.4s ease both;
}


/* =============================================
   CHECKER - general layout
   ============================================= */
.checker {
    padding: var(--space-16) 0 var(--space-24);
}

.checker__header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.checker__title {
    font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
    font-weight: var(--weight-black);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-3);
}

.checker__subtitle {
    font-size: var(--text-md);
    color: var(--color-text-muted);
}


/* =============================================
   CHECKER - URL input
   ============================================= */
.checker__form-wrap {
    max-width: 720px;
    margin: 0 auto var(--space-10);
}

.checker__input-row {
    display: flex;
    gap: var(--space-3);
    align-items: stretch;
    margin-bottom: var(--space-4);
}

.checker__input-group {
    position: relative;
    flex: 1;
}

.checker__input-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-faint);
    display: flex;
    pointer-events: none;
}

.checker__input {
    width: 100%;
    height: 52px;
    padding: 0 var(--space-4) 0 calc(var(--space-4) + 26px);
    background: var(--color-bg-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--text-base);
    font-family: var(--font-body);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.checker__input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
    outline: none;
}

.checker__input--error {
    border-color: #e85555 !important;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}

.checker__btn {
    height: 52px;
    padding-inline: var(--space-6);
    white-space: nowrap;
    flex-shrink: 0;
}

.checker__btn-clear {
    height: 52px;
    width: 52px;
    padding: 0;
    justify-content: center;
    flex-shrink: 0;
}

/* Example buttons */
.checker__examples {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.checker__examples-label {
    font-size: var(--text-sm);
    color: var(--color-text-faint);
}

.checker__example-btn {
    padding: var(--space-1) var(--space-3);
    background: var(--color-bg-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.checker__example-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-accent-glow);
}


/* =============================================
   CHECKER - device panel
   ============================================= */
.checker__controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: space-between;
    margin-bottom: var(--space-6);
    padding: var(--space-4) var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.checker__devices {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.device-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.device-btn:hover {
    border-color: var(--color-accent-dim);
    color: var(--color-text);
}

.device-btn.active {
    border-color: var(--color-accent);
    background: var(--color-accent-glow);
    color: var(--color-accent);
}

.device-btn__label { font-weight: var(--weight-medium); }
.device-btn__size  { font-size: var(--text-xs); opacity: 0.7; }

.device-btn__icon {
    display: flex;
    align-items: center;
    opacity: 0.8;
}

/* Custom width */
.checker__custom {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.checker__custom-label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.checker__custom-input {
    width: 80px;
    height: 38px;
    padding: 0 var(--space-3);
    background: var(--color-bg-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--text-sm);
    text-align: center;
    transition: border-color var(--transition-fast);
}

.checker__custom-input:focus {
    border-color: var(--color-accent);
    outline: none;
}

/* Remove arrows from number input */
.checker__custom-input::-webkit-inner-spin-button,
.checker__custom-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.checker__custom-unit {
    font-size: var(--text-sm);
    color: var(--color-text-faint);
}

.checker__custom-apply {
    height: 38px;
    padding-inline: var(--space-4);
    font-size: var(--text-sm);
}


/* =============================================
   CHECKER - stage (browser + iframe)
   ============================================= */
.checker__stage {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
}

/* Decorative browser bar */
.browser-bar {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-5);
    background: var(--color-bg-3);
    border-bottom: 1px solid var(--color-border);
}

.browser-bar__dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.browser-bar__dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-border);
}

.browser-bar__dots span:nth-child(1) { background: #ff5f57; }
.browser-bar__dots span:nth-child(2) { background: #febc2e; }
.browser-bar__dots span:nth-child(3) { background: #28c840; }

.browser-bar__url {
    flex: 1;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    background: var(--color-bg);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.browser-bar__info {
    font-size: var(--text-xs);
    color: var(--color-text-faint);
    white-space: nowrap;
    flex-shrink: 0;
}

/* iframe wrapper */
.iframe-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #fff;
    min-height: 300px;
    transition: height 0.3s ease;
}

/* Loading spinner */
.iframe-wrap.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.iframe-wrap.is-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 11;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.iframe-scaler {
    display: block;
    transform-origin: top left;
}

.checker-iframe {
    display: block;
    border: none;
}

/* Error state */
.checker__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-16) var(--space-8);
    text-align: center;
    min-height: 300px;
}

.checker__error-icon {
    color: var(--color-text-faint);
    opacity: 0.6;
}

.checker__error-title {
    font-size: var(--text-lg);
    font-weight: var(--weight-semi);
    color: var(--color-text);
}

.checker__error-text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    max-width: 400px;
    line-height: var(--leading-normal);
}


/* =============================================
   BLOG - section on home page
   ============================================= */
.home-blog {
    padding: var(--space-16) 0;
    border-top: 1px solid var(--color-border);
}

.home-blog__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-6);
    margin-bottom: var(--space-10);
    flex-wrap: wrap;
}

.home-blog__title {
    font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
    font-weight: var(--weight-black);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-2);
}

.home-blog__sub {
    font-size: var(--text-base);
    color: var(--color-text-muted);
}

.home-blog__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: var(--space-6);
}


/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .checker__controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .checker__input-row {
        flex-wrap: wrap;
    }

    .checker__input-group {
        flex: 1 1 100%;
    }

    .checker__btn {
        flex: 1;
    }

    .device-btn__size { display: none; }

    .home-blog__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero { min-height: 60vh; }
}

@media (max-width: 480px) {
    .checker__custom {
        flex-wrap: wrap;
    }

    .browser-bar__info { display: none; }
}
