/* ==========================================================================
   williamstoica - Static Site Styles
   ========================================================================== */

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-bg: #0f172a;
    --color-bg-light: #1e293b;
    --color-text: #f8fafc;
    --color-text-muted: #94a3b8;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Hero Section */
.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-light) 100%);
}

.container {
    max-width: 800px;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.cta {
    margin-top: 2rem;
}

.cta p {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    background: var(--color-primary);
    color: var(--color-text);
}

.btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
}

/* Error Page */
.error-page h1 {
    font-size: clamp(4rem, 15vw, 10rem);
}

/* Footer */
footer {
    padding: 1.5rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--color-bg-light);
}

.footer-nav {
    margin-top: 0.5rem;
}

.footer-nav a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--color-primary);
}

/* ==========================================================================
   Cookie Consent Banner
   ========================================================================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-bg-light);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    padding: 1.25rem 1.5rem;
    z-index: 9999;
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-banner-content p {
    flex: 1;
    min-width: 280px;
    margin: 0;
    color: var(--color-text);
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-banner-content p a {
    color: var(--color-primary);
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--color-text-muted);
    color: var(--color-text-muted);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-text);
    color: var(--color-text);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
}

/* ==========================================================================
   Static Pages (Privacy Policy, etc.)
   ========================================================================== */
.static-page {
    flex: 1;
    padding: 3rem 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.static-page h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.static-page h2 {
    font-size: 1.25rem;
    margin: 2rem 0 1rem;
    color: var(--color-text);
}

.static-page p {
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.static-page ul {
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.static-page a {
    color: var(--color-primary);
}

/* Responsive */
@media (max-width: 640px) {
    .hero {
        padding: 1rem;
    }
    
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-banner-content p {
        min-width: auto;
    }
    
    .cookie-banner-actions {
        width: 100%;
        justify-content: center;
    }
    
    .static-page {
        padding: 2rem 1rem;
    }
}

/* ==========================================================================
   Interactive Playground
   ========================================================================== */
body.home {
    --color-primary: #1654d1;
    --color-primary-dark: #0f3fb7;
    --color-bg: #f5f7ff;
    --color-bg-light: #ffffff;
    --color-text: #1d1d1d;
    --color-text-muted: #555;
    overflow: hidden;
}

#title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    user-select: none;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--color-text);
}
  
  .char {
    display: inline-block;
    will-change: transform;
    transform: translate3d(0, 0, 0);
  }
  
  #william {
    position: relative;
    z-index: 0;
    display: inline-block;
    color: #1654d1;
    padding: 0.18em 0.3em;
    transition: transform 120ms ease, color 120ms ease;
    cursor: pointer;
    touch-action: manipulation;
  }
  
  #william::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(100% + 1.1em);
    height: calc(100% + 1.1em);
    transform: translate(-50%, -50%);
    border: 3px solid #1654d1;
    border-radius: 50%;
    opacity: 0.65;
    pointer-events: none;
    z-index: -1;
  }
  
  #william.pressed {
    transform: scale(1.45);
    color: #cf1010;
  }
  
  #william.pressed::before,
  #william.hit::before {
    border-color: #cf1010;
  }
  
  #william.hit {
    animation: hitPulse 260ms ease;
    color: #cf1010;
  }
  
  #ball {
    position: fixed;
    top: 0;
    left: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ff7a00;
    border: 2px solid #c85100;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 10px 20px rgba(200, 81, 0, 0.45);
    cursor: pointer;
    will-change: transform;
    z-index: 5;
  }
  
  #paddle {
    position: fixed;
    top: 0;
    left: 0;
    width: 120px;
    height: 16px;
    border-radius: 10px;
    border: 2px solid #1d1d1d;
    background: linear-gradient(180deg, #ffe2bf 0%, #ff9d45 100%);
    box-shadow: 0 8px 16px rgba(29, 29, 29, 0.18);
    pointer-events: none;
    will-change: transform;
    z-index: 8;
  }
  
  @keyframes hitPulse {
    0% { transform: translateX(0) scale(1); }
    20% { transform: translateX(-8px) scale(1.15); }
    40% { transform: translateX(7px) scale(0.96); }
    60% { transform: translateX(-4px) scale(1.1); }
    100% { transform: translateX(0) scale(1); }
  }
  
  .hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.95rem;
    color: #555;
    user-select: none;
  }
  
  .controls {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: min(300px, calc(100vw - 24px));
    padding: 10px 12px 12px;
    border: 2px solid #1d1d1d;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    z-index: 12;
    user-select: none;
  }
  
  .control-head {
    margin: 0 0 8px;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #333;
  }
  
  .control-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
  }
  
  .control-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #222;
  }
  
  .control-value {
    min-width: 40px;
    text-align: right;
    font-size: 0.9rem;
    color: #444;
    font-variant-numeric: tabular-nums;
  }
  
  .controls input[type="range"] {
    width: 100%;
    margin-top: 4px;
    accent-color: #ff7a00;
  }
  
  #stop-toggle {
    width: 100%;
    margin-top: 12px;
    padding: 8px 10px;
    border: 2px solid #1d1d1d;
    border-radius: 8px;
    background: #fff;
    color: #1d1d1d;
    font-weight: 700;
    cursor: pointer;
  }
  
  #stop-toggle:hover {
    background: #fff4e9;
  }
  
  #paddle-toggle {
    width: 100%;
    margin-top: 8px;
    padding: 8px 10px;
    border: 2px solid #1d1d1d;
    border-radius: 8px;
    background: #fff;
    color: #1d1d1d;
    font-weight: 700;
    cursor: pointer;
  }
  
  #paddle-toggle:hover {
    background: #fff4e9;
  }
  
  #this-t {
    color: #ff7a00;
  }
  
  #site-t {
    display: inline-block;
    line-height: 1;
  }
  
  #site-t .char {
    padding: 0 0.15em;
    border: 2px solid #1d1d1d;
    border-radius: 2px;
  }

@media (max-width: 720px) {
    #title {
        font-size: clamp(1.5rem, 7vw, 2.5rem);
    }

    #ball {
        width: 26px;
        height: 26px;
        border-width: 1px;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8), 0 6px 12px rgba(200, 81, 0, 0.35);
    }

    #paddle {
        width: 96px;
        height: 14px;
    }

    .hint {
        bottom: calc(118px + env(safe-area-inset-bottom));
        font-size: 0.85rem;
    }

    .controls {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: calc(10px + env(safe-area-inset-bottom));
        width: min(92vw, 320px);
        padding: 10px;
    }
}

@media (max-height: 680px) {
    .controls {
        padding: 8px 10px;
    }

    .control-head {
        font-size: 0.7rem;
    }
}
