/* ==========================================================================
   PSDRAMA — Custom Styles
   Glassmorphism nav, hover wiggle, particle/grain background, PNG mockup,
   store buttons, hero grid layout, and dark mode.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base — smooth theme transition
   -------------------------------------------------------------------------- */
body {
    transition: background-color 300ms ease, color 300ms ease;
}

/* --------------------------------------------------------------------------
   Hero — two-column editorial grid (single column on mobile)
   -------------------------------------------------------------------------- */
.hero-grid {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

/* Let the text and email participate directly in the mobile stacking order,
   so the visual order is: headline → paragraph → phone → email. */
.hero-col-left {
    display: contents;
}

.hero-text  { order: 1; }
.hero-phone { order: 2; }
.hero-email { order: 3; }

@media (min-width: 1024px) {
    .hero-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
        align-items: center;
        gap: 0 4rem;
    }

    /* Group headline, paragraph, and email back into one left column. */
    .hero-col-left {
        display: flex;
        flex-direction: column;
        gap: 2.75rem;
        grid-column: 1;
        grid-row: 1;
    }

    .hero-text,
    .hero-email,
    .hero-phone {
        order: 0;
    }

    .hero-phone {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
    }
}

/* --------------------------------------------------------------------------
   Film grain overlay (subtle static noise)
   -------------------------------------------------------------------------- */
.grain {
    position: fixed;
    inset: 0;
    z-index: -5;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Floating glass navigation
   -------------------------------------------------------------------------- */
.glass {
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(37, 99, 235, 0.08);
    box-shadow: 0 10px 34px rgba(37, 99, 235, 0.08);
}

/* --------------------------------------------------------------------------
   Navigation links + subtle wiggle on hover
   -------------------------------------------------------------------------- */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #525252;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
    animation: wiggle 0.35s ease-in-out;
}

.nav-link-primary {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}

.nav-link-primary:hover {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.12);
}

@keyframes wiggle {
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(-2.5deg); }
    50%  { transform: rotate(2.5deg); }
    75%  { transform: rotate(-1.25deg); }
    100% { transform: rotate(0deg); }
}

/* --------------------------------------------------------------------------
   Theme toggle — small, elegant utility control
   -------------------------------------------------------------------------- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    color: #525252;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}

/* Show moon in light mode, sun in dark mode. */
.icon-sun { display: none; }
.dark .icon-moon { display: none; }
.dark .icon-sun { display: block; }

/* --------------------------------------------------------------------------
   Dark mode overrides
   -------------------------------------------------------------------------- */
.dark .glass {
    background: rgba(10, 15, 30, 0.55);
    border-color: rgba(59, 130, 246, 0.16);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
}

.dark .nav-link {
    color: #cbd5e1;
}

.dark .nav-link:hover {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
}

.dark .nav-link-primary {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.16);
}

.dark .nav-link-primary:hover {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.24);
}

.dark .theme-toggle {
    color: #cbd5e1;
}

.dark .theme-toggle:hover {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
}

.dark .grain {
    opacity: 0.05;
}

/* --------------------------------------------------------------------------
   App mockup — subtle, elegant tilt (straightens gently on hover)
   -------------------------------------------------------------------------- */
.mockup-tilt {
    transform: rotate(2.5deg);
    transition: transform 0.45s ease;
}

.mockup-tilt:hover {
    transform: rotate(0deg);
}

/* --------------------------------------------------------------------------
   Store buttons — minimalist availability indicators
   -------------------------------------------------------------------------- */
.store-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    width: 3.25rem;
    border-radius: 0.9rem;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #171717;
    transition: transform 0.2s ease, box-shadow 0.2s ease,
                border-color 0.2s ease, background-color 0.2s ease,
                color 0.2s ease;
}

.store-btn:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.14);
}

.dark .store-btn {
    background: #171717;
    border-color: #3f3f46;
    color: #f5f5f5;
}

.dark .store-btn:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   Subscription feedback states
   -------------------------------------------------------------------------- */
#subscribe-feedback.is-error {
    color: #dc2626;
}

#subscribe-feedback.is-success {
    color: #16a34a;
}

#subscribe-feedback.is-info {
    color: #2563eb;
}

.dark #subscribe-feedback.is-error {
    color: #f87171;
}

.dark #subscribe-feedback.is-success {
    color: #4ade80;
}

.dark #subscribe-feedback.is-info {
    color: #60a5fa;
}

/* --------------------------------------------------------------------------
   Reduced motion — disable decorative animation
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .nav-link:hover {
        animation: none;
    }
}
