/* Base Styles */
:root { --transition: all 0.3s ease; }

/* Background video for hero */
.hero .hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2; /* below gradient/texture overlays (-1) */
    opacity: 0;
    transition: opacity .6s ease;
    background: #000; /* brief flash guard */
}
.hero.video-on .hero-bg { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .hero .hero-bg { display: none !important; }
}

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

body {
    font-family: 'Kalam', cursive;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

/* Theme variables come from css/colors.css */

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    height: 100svh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light-text);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--hero-grad-1), var(--hero-grad-2));
    z-index: -1;
}

/* Light mode: show video without extra dimming */
[data-theme="light"] .hero::before { background: none; }
/* Dark mode: subtle neutral dimming */
[data-theme="dark"] .hero::before {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.20), rgba(0, 0, 0, 0.35));
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/pattern.svg') repeat;
    opacity: 0.03;
    z-index: -1;
    animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
    0% { background-position: 0 0; }
    100% { background-position: 1000px 1000px; }
}

.hero-content {
    max-width: 800px;
    padding: 0 20px;
    transform: translateY(0);
    position: relative;
    z-index: 2;
}



.hero h1 {
    font-size: clamp(2.25rem, 4vw + 1rem, 4rem);
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out;
}

.hero p {
    font-size: clamp(1rem, 1.2vw + 0.5rem, 1.5rem);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.2s;
    animation-fill-mode: both;
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    animation: fadeInUp 1s ease-out 0.4s;
    animation-fill-mode: both;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.35);
}

/* Dark mode variant for CTA to match social buttons */
[data-theme="dark"] .cta-button {
    background: var(--primary-color);
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.35);
}

/* Social links under hero CTA */
.social-links { display:flex; gap:12px; justify-content:center; margin-top:14px; animation: fadeInUp 1s ease-out 0.5s; animation-fill-mode: both; }
.social-btn { width:48px; height:48px; border-radius:9999px; display:inline-flex; align-items:center; justify-content:center; line-height: 0;
  background: var(--light-text); color: var(--primary-color); border:1px solid var(--border-color); box-shadow: 0 8px 18px rgba(0,0,0,.15); transition: var(--transition); }
.social-btn:hover { transform: translateY(-3px); }
.social-btn svg { width:24px; height:24px; display:block; }
.social-btn img { width:24px; height:24px; display:block; }
.social-btn.github { color:#111827; }
.social-btn.youtube { color:#dc2626; }
.social-btn.steam { color:#0ea5e9; }
[data-theme="dark"] .social-btn { background: var(--surface-color); color: var(--light-text); }
[data-theme="dark"] .social-btn.github { color:#e5e7eb; }
[data-theme="dark"] .social-btn.youtube { color:#f87171; }
[data-theme="dark"] .social-btn.steam { color:#67e8f9; }

/* YouTube button hover-elongation and subscriber label */
.social-btn.youtube { position: relative; overflow: hidden; padding-inline: 0; width: auto !important; min-width: 48px; box-sizing: content-box; }
.social-btn.youtube .yt-subs { display: inline-block; white-space: nowrap; font-weight: 700; opacity: 0; max-width: 0; margin-left: 0; transition: max-width .3s ease, opacity .3s ease, margin-left .3s ease; color: currentColor; line-height: 1; }
.social-btn.youtube:hover { padding-inline: 14px; }
.social-btn.youtube:hover .yt-subs { opacity: 1; max-width: 180px; margin-left: 8px; }

/* Generic hover expansion for buttons with labels (GitHub, Steam) */
.social-btn.has-label { position: relative; overflow: hidden; padding-inline: 0; width: auto !important; min-width: 48px; box-sizing: content-box; }
.social-btn.has-label .btn-label { display: inline-block; white-space: nowrap; font-weight: 700; opacity: 0; max-width: 0; margin-left: 0; transition: max-width .3s ease, opacity .3s ease, margin-left .3s ease; color: currentColor; line-height: 1; }
.social-btn.has-label:hover { padding-inline: 14px; }
.social-btn.has-label:hover .btn-label { opacity: 1; max-width: 220px; margin-left: 8px; }

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.scroll-indicator span {
    display: block;
    width: 10px;
    height: 10px;
    background-color: var(--light-text);
    border-radius: 50%;
    animation: bounce 2s infinite;
}

.scroll-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.scroll-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Projects Section */
.projects {
    padding: 100px 20px;
    width: 100%;
    text-align: left;
    background-color: var(--section-bg);
}

.projects h2 {
    text-align: center;
    font-size: clamp(1.75rem, 1.5vw + 1rem, 2.5rem);
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.projects h2::after { content: none; }

/* Center H1 on Projekte overview page */
.projects h1 {
    text-align: center;
    font-size: clamp(1.9rem, 1.7vw + 1rem, 2.6rem);
    margin: 0 0 24px 0;
    color: var(--text-color);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(16px, 2vw, 30px);
    padding: clamp(10px, 2vw, 20px);
    max-width: 1280px;
    margin: 0 auto;
}

.project-card {
    background: var(--surface-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.project-info p {
    color: var(--muted-text);
    margin-bottom: 15px;
}

/* Monospace font for code */
pre, code, kbd, samp, pre code {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.project-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--secondary-color);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content { transform: none; padding: 0 16px; }
    .cta-button { padding: 12px 20px; }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-image { height: 180px; }
}

@media (max-width: 480px) {
    .projects { padding: 64px 16px; }
    .scroll-indicator { bottom: 16px; }
}

/* Add a simple pattern for the background */
@keyframes backgroundMove {
    0% { background-position: 0 0; }
    100% { background-position: 1000px 1000px; }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: auto;
    right: calc(14px + env(safe-area-inset-right, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    width: clamp(40px, 6vw, 48px);
    height: clamp(40px, 6vw, 48px);
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    color: var(--text-color);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: var(--transition);
    line-height: 0;
}

.theme-toggle:hover { transform: translateY(-2px); }
.theme-toggle svg { width: clamp(18px, 4.5vw, 24px); height: clamp(18px, 4.5vw, 24px); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* Generic icon utility for future icons */
.icon { width: 1em; height: 1em; display: inline-block; }

/* No viewport-specific positioning needed; bottom-right works best universally */

/* Global dark footer strip */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 28px 20px;
}
.site-footer .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
}
.site-footer a { color: var(--footer-link); text-decoration: none; }
.site-footer a:hover { color: var(--footer-link-hover); }
.site-footer small { opacity: 0.9; }

/* Page surface with site gradient/pattern for simple pages (login/admin/legal) */
.page-surface {
    position: relative;
    min-height: 100svh;
    background: var(--section-bg);
    overflow: clip;
    display: flex;
    flex-direction: column;
}
.page-surface::after {
    content: '';
    position: absolute;
    inset: 0;
    background: none;
    opacity: 0;
    pointer-events: none;
}

/* Stick footer to bottom when content is short */
.page-surface > footer.site-footer { margin-top: auto; }

body.hide-scrollbar { scrollbar-width: none; }
body.hide-scrollbar::-webkit-scrollbar { width: 0; height: 0; }
