/* --- Globala Inställningar & CSS-Variabler --- */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --navy: #1e293b;
    --dark: #0f0f11;
    --card-bg: #18181b;
    --card-hover-bg: rgba(24, 24, 27, 0.8);
    --border-color: #27272a;
    --text-white: #e4e4e7;
    --text-muted: #a1a1aa;
    --text-muted-dark: #52525b;
    --hero-text-color: rgba(228, 228, 231, 0.8);
    --logo-tagline-color: #71717a;
    --font-display: 'Fraunces', serif;
    --font-body: 'DM Sans', sans-serif;
    --bg-trust: rgba(24, 24, 27, 0.5);
    --bg-light: rgba(24, 24, 27, 0.3);
    --bg-light-section: rgba(15, 15, 17, 0.9);
    --header-scrolled-bg: rgba(15, 15, 17, 0.85);
    --hero-overlay: rgba(15, 15, 17, 0.7);
    --logo-letter-color: #ffffff;
    --form-label-color: rgba(255, 255, 255, 0.5);
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--dark);
    color: var(--text-white);
    font-family: var(--font-body);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header & Navigation --- */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px 0;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 1px 0 0 rgba(59, 130, 246, 0.05);
}

.main-header.scrolled {
    background: var(--header-scrolled-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 
        0 1px 0 0 rgba(59, 130, 246, 0.15),
        0 4px 20px rgba(59, 130, 246, 0.08);
    padding: 12px 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-wordmark {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
}

.logo-i { color: var(--logo-letter-color); }
.logo-s { color: var(--primary); }
.logo-a { color: var(--logo-letter-color); }

.logo-tagline {
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 10px;
    font-weight: 500;
    color: var(--logo-tagline-color);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
    border-left: 1px solid #27272a;
    padding-left: 10px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    opacity: 0.7;
}

.cta-nav {
    background: var(--primary);
    padding: 8px 18px;
    border-radius: 6px;
}

.cta-nav:hover {
    background: var(--primary-hover);
    opacity: 1 !important;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 24px;
}

/* --- Hero Sektion --- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    background-image: url('../assets/hero.jpg');
    background-size: cover;
    background-position: center;
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, var(--hero-overlay), var(--dark));
}

.hero-content {
    position: relative;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    z-index: 10;
    padding: 0 20px;
}

.hero-eyebrow {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    font-weight: 600;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 4.5vw, 56px);
    font-weight: 900;
    margin: 15px 0 25px;
    line-height: 1.1;
    white-space: nowrap;
}

.hero-text {
    font-size: 18px;
    margin-bottom: 35px;
    color: var(--hero-text-color);
}

.cta-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* --- Knappar --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 15px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
}

.full-width {
    width: 100%;
    justify-content: center;
}

.interactive-theme-pill {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    user-select: none;
    border: none;
    outline: none;
}
.interactive-theme-pill:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.interactive-theme-pill:active {
    transform: scale(0.95);
}

/* --- Trust Band & Grid --- */
.trust-band {
    border-top: 1px solid rgba(59, 130, 246, 0.3);
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    padding: 30px 0;
    background: var(--bg-trust);
    box-shadow: 
        0 -1px 0 0 rgba(59, 130, 246, 0.1),
        0 1px 0 0 rgba(59, 130, 246, 0.1);
    position: relative;
}

.trust-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--text-white);
}

.trust-item i {
    color: var(--primary);
}

/* --- Layout Grids --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 60px 0;
}

.grid-2-text {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 60px;
    align-items: center;
    padding: 80px 0;
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

/* --- Sektioner & Kort --- */
.values-section, .story-section, #tjanster, #faq {
    padding: 40px 0;
}

.bg-light {
    background: var(--bg-light);
}

.bg-light-section {
    background: var(--bg-light-section);
}

.section-title {
    font-family: var(--font-display);
    font-size: 36px;
    margin-bottom: 20px;
}

.section-subtitle {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
}

.center-text {
    text-align: center;
}

.value-card, .service-card, .faq-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 35px;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.value-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.value-card:hover, .service-card:hover, .faq-card:hover {
    transform: translateY(-6px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 
        0 12px 32px rgba(59, 130, 246, 0.15),
        0 0 0 1px rgba(59, 130, 246, 0.1);
    background: var(--card-hover-bg);
}

.value-card .card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.value-card .card-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.value-card > i, .value-card .card-content > i, .service-card > i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 20px;
    display: inline-block;
}

.value-card h3, .service-card h3, .faq-card h4 {
    font-family: var(--font-display);
    font-size: 22px;
    margin-bottom: 12px;
}

.rounded-shadow {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* --- Kontakt & API Testare Sektion --- */
.contact-section {
    background: var(--navy);
    border-top: 1px solid var(--border-color);
}

.text-white-opacity {
    color: rgba(255,255,255,0.7);
    margin-top: 15px;
    font-size: 16px;
}

.direct-contact {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.dc-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dc-item i {
    font-size: 20px;
    color: var(--primary);
}

.contact-card-dark {
    background: var(--dark);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* --- Formulärfält --- */
.form-group {
    position: relative;
    margin-bottom: 25px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    font-family: var(--font-body);
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
}

/* Labels visas ovanför fältet, inte som floating overlay */
.form-group label {
    display: block;
    font-size: 12px;
    color: var(--form-label-color);
    margin-bottom: 6px;
    pointer-events: none;
}

/* Kort med alltid-mörk bakgrund — tvinga vit text oavsett tema */
.dark-card, .dark-card h3, .dark-card h4, .dark-card p {
    color: #e2e8f0 !important;
}
.dark-card .form-group label {
    color: rgba(255,255,255,0.5) !important;
}

/* --- Animations & Footer --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation för grid-element */
.grid-3 .fade-in:nth-child(1) { transition-delay: 0.1s; }
.grid-3 .fade-in:nth-child(2) { transition-delay: 0.2s; }
.grid-3 .fade-in:nth-child(3) { transition-delay: 0.3s; }
.grid-3 .fade-in:nth-child(4) { transition-delay: 0.4s; }
.grid-3 .fade-in:nth-child(5) { transition-delay: 0.5s; }
.grid-3 .fade-in:nth-child(6) { transition-delay: 0.6s; }

/* Slide-in från vänster för text-innehåll */
.text-content.fade-in {
    transform: translateX(-30px);
}

.text-content.fade-in.visible {
    transform: translateX(0);
}

/* Slide-in från höger för bild-innehåll */
.image-content.fade-in {
    transform: translateX(30px);
}

.image-content.fade-in.visible {
    transform: translateX(0);
}

/* Scale-in för kort */
.value-card.fade-in,
.service-card.fade-in,
.faq-card.fade-in {
    transform: scale(0.95) translateY(20px);
}

.value-card.fade-in.visible,
.service-card.fade-in.visible,
.faq-card.fade-in.visible {
    transform: scale(1) translateY(0);
}

/* Trust items fade-in */
.trust-item {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.trust-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.trust-item:nth-child(1) { transition-delay: 0.1s; }
.trust-item:nth-child(2) { transition-delay: 0.2s; }
.trust-item:nth-child(3) { transition-delay: 0.3s; }
.trust-item:nth-child(4) { transition-delay: 0.4s; }

.main-footer {
    background: #09090b;
    padding: 50px 0;
    border-top: 1px solid var(--border-color);
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 14px;
}


.footer-logo-tagline {
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #71717a;
    white-space: nowrap;
    border-left: 1px solid #27272a;
    padding-left: 10px;
}

.footer-tagline {
    font-size: 15px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 20px;
    line-height: 1.6;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.social-link {
    color: rgba(255,255,255,0.6);
    font-size: 18px;
    transition: color 0.2s;
}

.social-link:hover {
    color: var(--primary);
}

.footer-copy {
    font-size: 13px;
    color: rgba(255,255,255,0.3);
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    z-index: 10;
}

.scroll-dot {
    display: block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin: 8px auto 0;
    animation: scrollAnim 1.5s infinite;
}

@keyframes scrollAnim {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}

/* --- Interaktiv AI-Materialskapare Mockup --- */
.mockup-window {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.3s ease;
}

.mockup-window:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

.demo-tabs-wrap {
    display: flex;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    white-space: nowrap;
    padding: 8px 12px;
    gap: 6px;
    scrollbar-width: none; /* Firefox */
}

.demo-tabs-wrap::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.demo-tab {
    padding: 8px 14px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.demo-tab:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.05);
}

.demo-tab.active {
    background: var(--primary) !important;
    color: #ffffff !important;
}

.demo-prompt-box, .demo-result-box {
    background: var(--dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-white);
    font-family: monospace;
    font-size: 13px;
    transition: border-color 0.2s ease;
}

/* Blinka skrivmaskinscursor */
.typewriter-cursor::after {
    content: '|';
    animation: cursorBlink 0.8s infinite;
    color: var(--primary);
    font-weight: bold;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.materialskapare-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 60px;
    align-items: center;
}

.materialskapare-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .materialskapare-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }
}

/* --- Responsivitet --- */
@media (max-width: 768px) {
    .grid-2-text {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }
    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
    .hero h1 {
        font-size: clamp(22px, 7vw, 38px);
        white-space: normal;
    }
    .menu-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--dark);
        padding: 1.5rem 2.25rem;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
        border-bottom: 1px solid var(--border-color);
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links li {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding-bottom: 0.4rem;
    }
    .nav-links li:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    .nav-links a {
        display: block;
        width: 100%;
        font-size: 1.05rem;
        font-weight: 500;
        padding: 0.4rem 0;
    }
    .nav-links a.cta-nav {
        display: inline-block;
        width: auto;
        padding: 0.6rem 1.5rem;
        margin-top: 0.6rem;
        text-align: center;
    }
}

/* --- Temabundna ikoner och bockar --- */
.service-card i, .story-section i {
    color: var(--primary) !important;
}

/* --- Smidig temaväxling --- */
body, header, .card, .btn, .interactive-theme-pill, .value-card, .service-card, .faq-card, .mockup-window, .demo-prompt-box, .demo-result-box {
    transition: background-color 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}