/* 
 * GLITCH - Shared Styles
 * glitch.today
 * 
 * Used by: terms.html, privacy.html, faq.html, contact.html
 */

/* ============================================
   DESIGN SYSTEM VARIABLES
   ============================================ */
:root {
    /* Colors - Refined Dark Palette */
    --void: #050507;
    --abyss: #0a0a0f;
    --shadow: #101016;
    --twilight: #18181f;
    --mist: #252530;
    --fog: #35354a;
    --whisper: #6a6a8a;
    --light: #9999bb;
    --pale: #bbbbdd;
    --white: #eeeef4;
    
    /* Accents */
    --ritual: #a855f7;
    --ritual-dim: #7c3aed;
    --ritual-glow: rgba(168, 85, 247, 0.5);
    --manifest: #10b981;
    --anomaly: #f43f5e;
    --signal: #06b6d4;
    
    /* Typography - Extended fallbacks for reliability */
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', Times, serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', Courier, monospace;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --space-3xl: 96px;
    
    /* Motion */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 150ms;
    --duration-normal: 300ms;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-mono);
    background: var(--void);
    color: var(--whisper);
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--ritual);
    color: var(--white);
}

:focus-visible {
    outline: 2px solid var(--ritual);
    outline-offset: 3px;
}

/* ============================================
   BACKGROUND EFFECTS
   ============================================ */
.bg-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 100%, rgba(168, 85, 247, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 0%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
}

/* ============================================
   NAVIGATION
   ============================================ */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(5, 5, 7, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--twilight);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform var(--duration-normal) var(--ease-out-expo);
}

.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px var(--ritual-glow));
    transition: filter var(--duration-normal), transform var(--duration-normal) var(--ease-out-expo);
}

.logo:hover .logo-img {
    filter: drop-shadow(0 0 20px var(--ritual-glow)) drop-shadow(0 0 40px rgba(168, 85, 247, 0.3));
    transform: rotate(10deg);
}

.nav-back {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--whisper);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: color var(--duration-fast);
}

.nav-back:hover {
    color: var(--ritual);
}


/* ============================================
   PAGE CONTAINER
   ============================================ */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 120px var(--space-xl) var(--space-3xl);
    position: relative;
    z-index: 1;
}

.page-header {
    margin-bottom: var(--space-2xl);
    text-align: center;
}

.page-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--ritual);
    margin-bottom: var(--space-md);
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    font-style: italic;
    color: var(--pale);
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-section {
    margin-bottom: var(--space-xl);
}

.content-section h2 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ritual);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--twilight);
}

.content-section p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.9;
    color: var(--whisper);
    margin-bottom: var(--space-md);
}

.content-section ul,
.content-section ol {
    list-style: none;
    margin-bottom: var(--space-md);
    padding-left: 0;
}

.content-section li {
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.9;
    color: var(--whisper);
    padding-left: var(--space-lg);
    position: relative;
    margin-bottom: var(--space-sm);
}

.content-section li::before {
    content: '◇';
    position: absolute;
    left: 0;
    color: var(--ritual);
    font-size: 0.7rem;
}

.content-section a {
    color: var(--ritual);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--duration-fast);
}

.content-section a:hover {
    border-bottom-color: var(--ritual);
}

/* ============================================
   FAQ STYLES
   ============================================ */
.faq-item {
    margin-bottom: var(--space-lg);
    padding: var(--space-lg);
    background: var(--abyss);
    border: 1px solid var(--twilight);
    transition: border-color var(--duration-fast);
}

.faq-item:hover {
    border-color: var(--fog);
}

.faq-question {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--pale);
    margin-bottom: var(--space-md);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
}

.faq-question::after {
    content: '◇';
    color: var(--ritual);
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: transform var(--duration-normal) var(--ease-out-expo);
}

.faq-item.open .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--whisper);
}

/* ============================================
   CONTACT FORM
   ============================================ */
.contact-form {
    background: var(--abyss);
    border: 1px solid var(--twilight);
    padding: var(--space-xl);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--whisper);
    margin-bottom: var(--space-sm);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: var(--shadow);
    border: 1px solid var(--twilight);
    color: var(--light);
    transition: all var(--duration-fast);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--fog);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--ritual);
    background: var(--twilight);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-button {
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: var(--ritual);
    border: 1px solid var(--ritual);
    color: var(--white);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.submit-button:hover {
    background: var(--ritual-dim);
    box-shadow: 0 0 40px var(--ritual-glow);
}

.submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    padding: var(--space-xl);
    text-align: center;
    border-top: 1px solid var(--twilight);
    margin-top: var(--space-2xl);
}

.footer-logo-link {
    display: inline-block;
    margin-bottom: var(--space-md);
    transition: transform var(--duration-normal) var(--ease-out-expo);
}

.footer-logo-link:hover {
    transform: scale(1.1) rotate(10deg);
}

.footer-logo-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px var(--ritual-glow));
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    list-style: none;
    flex-wrap: wrap;
}

.footer-links a {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--fog);
    text-decoration: none;
    transition: color var(--duration-fast);
}

.footer-links a:hover {
    color: var(--ritual);
}

/* Last Updated */
.last-updated {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--mist);
    margin-top: var(--space-xl);
    text-align: center;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.toast {
    background: var(--abyss);
    border: 1px solid var(--twilight);
    padding: var(--space-md) var(--space-lg);
    max-width: 400px;
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    transform: translateX(calc(100% + var(--space-xl)));
    animation: toastIn 0.5s var(--ease-out-expo) forwards;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.toast.success { border-color: var(--manifest); }
.toast.error { border-color: var(--anomaly); }

.toast-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.toast.success .toast-icon { color: var(--manifest); }
.toast.error .toast-icon { color: var(--anomaly); }

.toast-content h4 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--pale);
    margin-bottom: var(--space-xs);
}

.toast-content p {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--whisper);
    line-height: 1.5;
}

@keyframes toastIn {
    to { transform: translateX(0); }
}

.toast.removing {
    animation: toastOut 0.3s var(--ease-out-expo) forwards;
}

@keyframes toastOut {
    to {
        transform: translateX(calc(100% + var(--space-xl)));
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    nav {
        padding: var(--space-md) var(--space-lg);
    }
    
    .page-container {
        padding: 100px var(--space-lg) var(--space-2xl);
    }
    
    .contact-form {
        padding: var(--space-lg);
    }
    
    .footer-links {
        gap: var(--space-lg);
    }
    
    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
        bottom: var(--space-md);
    }

    .toast {
        max-width: 100%;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}
