/* GRUNDLÄGGANDE VARIABLER OCH STILAR */
:root {
    --tadero-blue: #1e3a8a;
    --neon-blue: #3bbef8;
    --h1-font-size: 3rem;
    --h2-font-size: 2.5rem;
    --spacing: 1.25rem;
    --border-radius: 12px;
}

/* ALLTID MÖRKT LÄGE */
[data-theme="dark"] {
    --background-color: #050505;
    --card-background-color: #111111;
    --card-border-color: #222;
}

body {
    background-color: var(--background-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    user-select: none;
}

/* Tvingar ALLA element att dölja standardpekaren */
* {
    cursor: none !important;
}

/* Dölj-klass */
.hidden {
    display: none !important;
}

/* COOKIE CONSENT BANNER */
#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--card-background-color);
    border-top: 1px solid var(--card-border-color);
    padding: 1rem;
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    transform: translateY(100%);
    animation: slideUp 0.5s 1s forwards ease-out;
}
@keyframes slideUp {
    to { transform: translateY(0); }
}

#cookie-consent-banner p {
    margin: 0;
    font-size: 0.9rem;
}

/* SPOTLIGHT-MUSPEKARE */
.spotlight-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 190, 248, 0.3) 0%, rgba(59, 190, 248, 0) 50%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s;
    z-index: 99999;
}

/* Synlig mittpunkt för pekaren */
.spotlight-cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px; 
    height: 6px; 
    background-color: var(--neon-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-blue);
}

/* NAVIGERING & HEADER */
header.container {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--card-border-color);
}

header.container nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}
.logo img {
    height: 60px;
    width: auto;
    display: block;
}
header.container nav ul {
    display: flex;
    gap: var(--spacing);
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}
header.container nav a {
    color: var(--color);
    text-decoration: none;
    font-weight: 500;
}

/* Återställer "Kontakta oss"-knappen till en vanlig länk */
header.container nav a[role="button"].contrast {
    background-color: transparent;
    border: none;
    padding: 0;
    color: var(--color);
    box-shadow: none;
}

/* HERO-SEKTION */
.hero {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background-image: url('https://images.unsplash.com/photo-1534723328310-e82dad3ee43f?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
}
.video-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* AI-GRÄNSSNITT */
#ai-interface {
    position: relative;
    z-index: 3;
    width: 90%;
    max-width: 700px;
    background: rgba(17, 17, 17, 0.7);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    backdrop-filter: blur(10px);
    text-align: center;
    overflow: hidden; /* För scanline-effekten */
    animation: glow 4s infinite alternate;
}
@keyframes glow {
    from { box-shadow: 0 0 10px -5px var(--neon-blue); }
    to { box-shadow: 0 0 20px 0px var(--neon-blue); }
}

.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0) 100%);
    background-size: 100% 4px;
    animation: scan 10s linear infinite;
    pointer-events: none;
}
@keyframes scan {
    from { background-position-y: 0; }
    to { background-position-y: 100px; }
}

.ai-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--neon-blue);
    font-weight: 600;
}

#ai-output {
    min-height: 100px;
    margin-bottom: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    line-height: 1.6;
}
#ai-output .quote::before, #ai-output .quote::after {
    content: '"';
    font-size: 2rem;
    color: var(--neon-blue);
    opacity: 0.5;
}
.ai-prompt {
    display: flex;
    gap: 1rem;
}
#ai-input {
    flex-grow: 1;
    background-color: rgba(0,0,0,0.3);
}
#ai-submit {
    background-color: var(--tadero-blue);
    border: none;
}
#ai-submit:hover {
    background-color: var(--neon-blue);
}

#ip-display {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 3;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}
#ip-display span {
    color: rgba(255, 255, 255, 0.6);
}

.scroll-icon {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    animation: bounce 2s infinite ease-in-out;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, -15px); }
    60% { transform: translate(-50%, -7px); }
}

/* INNEHÅLLSSEKTIONER */
section {
    padding-top: 5rem;
    padding-bottom: 5rem;
}
hgroup {
    text-align: center;
    margin-bottom: 4rem;
}
h2 {
    font-size: 2.75rem;
    font-weight: 700;
    min-height: 2.75rem;
}
p {
    max-width: 75ch;
    margin-left: auto;
    margin-right: auto;
}

/* AI-KONST SEKTION */
#ai-art-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    aspect-ratio: 1 / 1;
    background-color: var(--card-background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
#ai-art-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}
#ai-art-loader {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--neon-blue);
}
#ai-art-loader.hidden {
    display: none;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(59, 190, 248, 0.3);
    border-top-color: var(--neon-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
#generate-art-button {
    display: block;
    margin: 2rem auto 0;
    background-color: var(--tadero-blue);
    color: white;
}
#generate-art-button:hover {
    background-color: var(--neon-blue);
    color: black;
}

/* PARTIKEL-SEKTION */
.particle-section {
    position: relative;
    overflow: hidden;
}
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}
#particles-js canvas {
    transition: transform 0.5s ease-out; /* För mjuk rörelse med gyroskop */
}
.content-over-particles {
    position: relative;
    z-index: 2;
}

/* STATISTIK-RÄKNARE */
.stats-container {
    margin-top: 4rem;
    --grid-spacing-vertical: 2rem;
}
.stat {
    text-align: center;
}
.counter {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--neon-blue);
}
.stat-label {
    margin-top: 0.5rem;
    color: var(--muted-color);
    font-size: 1rem;
}

/* TJÄNSTER - KORT */
.grid > article {
    background-color: var(--card-background-color);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius);
    padding: 0;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-style: preserve-3d;
}
.grid > article:hover {
    transform: translateY(-5px) perspective(1000px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.grid > article img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    margin-bottom: 0;
}
.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.project-content, .grid > article > h4, .grid > article > p, .grid > article > .cta {
    padding: 0 var(--spacing) var(--spacing);
}
.grid > article > h4 { padding-top: var(--spacing); }
.grid > article > p { flex-grow: 1; }

/* PROJEKT-KORT & GLITCH-EFFEKT (Endast för enheter med hover) */
@media (hover: hover) {
    .glitch-wrapper { position: relative; overflow: hidden; }
    .glitch-wrapper::before, .glitch-wrapper::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: inherit; opacity: 0; transition: opacity 0.3s ease; }
    .project-card:hover .glitch-wrapper::before { animation: glitch 0.3s linear infinite; opacity: 0.8; }
    .project-card:hover .glitch-wrapper::after { animation: glitch 0.3s linear infinite reverse; opacity: 0.8; }
    @keyframes glitch { 0% { transform: translate(0); } 25% { transform: translate(5px, 5px); } 50% { transform: translate(-5px, -5px); } 75% { transform: translate(5px, -5px); } 100% { transform: translate(-5px, 5px); } }
}

.project-tags {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.project-tags span {
    background-color: rgba(59, 190, 248, 0.1);
    color: var(--neon-blue);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* KUNDCITAT */
.testimonial-card {
    max-width: 80ch;
    margin: 0 auto;
    text-align: center;
}
.testimonial-card blockquote {
    font-size: 1.5rem;
    font-style: italic;
    font-weight: 300;
    border: none;
    padding: 0;
    margin: 0;
}
.testimonial-author {
    margin-top: 1.5rem;
    font-weight: 500;
    color: var(--neon-blue);
}

/* KONTAKTFORMULÄR */
#kontakt form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 75ch;
    margin: auto;
}

/* ANIMATIONER */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* EASTER EGG */
#easter-egg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--neon-blue);
    font-family: 'Courier New', Courier, monospace;
    text-align: center;
}
#easter-egg.hidden {
    display: none;
}
#ascii-logo {
    font-size: 1rem;
    line-height: 1;
    margin-bottom: 1rem;
}

/* --- MOBILANPASSNING --- */
@media (max-width: 768px) {
    * {
        cursor: pointer !important; /* Återställer pekaren på mobilen */
    }
    .spotlight-cursor { display: none; }
    .video-overlay { background: linear-gradient(to top, var(--background-color) 5%, rgba(0,0,0,0.1) 30%, rgba(0,0,0,0.2) 100%); }
    #ai-interface { padding: 1.5rem; }
    .ai-title { font-size: 1.5rem; }
    #ai-output { font-size: 1rem; min-height: 80px; }
    .ai-prompt {
        flex-direction: column; /* Stapla input och knapp vertikalt */
    }

    header.container { padding: 1rem; }
    .logo img { height: 45px; }
    header.container nav a { font-size: 0.9rem; }
    header.container nav ul { gap: 0.8rem; }
    section { padding: 3rem 1rem; }
    h2 { font-size: 2rem; min-height: 2rem; }
    .counter { font-size: 2.5rem; }
    .stats-container.grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
    .testimonial-card blockquote { font-size: 1.2rem; }
}
