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

:root {
    /* Ljust tema (dis/dimma) */
    --bg-primary: #EBE7E0;
    --bg-secondary: #EBE7E0;
    --text-primary: #2F353B;
    --text-secondary: #5C6268;
    --border: #D1C9C0;
    --shadow: rgba(47, 53, 59, 0.08);
    --hero-bg-1: #EBE7E0;
    --hero-bg-2: #D1C9C0;
    --hero-bg-3: #B5ADA4;
    --btn-bg: transparent;
    --btn-border: transparent;
    --btn-text: #5C6268;
    --footer-bg: #EBE7E0;
}

[data-theme="dark"] {
    --bg-primary: #1A1E22;
    --bg-secondary: #3A4046;
    --text-primary: #B5ADA4;
    --text-secondary: #8A8279;
    --border: #3A4046;
    --shadow: rgba(0, 0, 0, 0.3);
    --hero-bg-1: #1A1E22;
    --hero-bg-2: #2C2824;
    --hero-bg-3: #3A4046;
    --btn-bg: transparent;
    --btn-border: transparent;
    --btn-text: #8A8279;
    --footer-bg: #3A4046;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
    transition: background 0.4s ease, color 0.4s ease;
    display: flex;
    flex-direction: column;
}

/* ----- HERO BAKGRUND (dynamisk med parallax + dimma) ----- */
.hero {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4.5rem 1.5rem 1.5rem;
    overflow: hidden;
    min-height: 0;

    /* Bakgrund – med parallax */
    background:
        radial-gradient(ellipse at 30% 20%, var(--hero-bg-2) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, var(--hero-bg-3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, var(--hero-bg-2) 0%, transparent 40%),
        var(--hero-bg-1);
    background-size: 150% 150%;
    background-position: 0% 0%;
    transition: background 0.6s ease;
    animation: bgParallax 20s ease-in-out infinite alternate;
}

/* Dimlager 1 – rör sig + pulserar */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 70%, rgba(200, 195, 185, 0.06) 0%, transparent 60%);
    animation:
        dimmaMove 12s ease-in-out infinite alternate,
        dimmaPulse 10s ease-in-out infinite alternate;
}

/* Dimlager 2 – extra djup, motsatt riktning */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 60% 40%, rgba(180, 175, 165, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 30% 70%, rgba(200, 195, 185, 0.05) 0%, transparent 50%);
    animation: dimmaMove2 16s ease-in-out infinite alternate;
}

/* ----- KEYFRAMES – Dynamisk bakgrund ----- */

/* Parallax – gradienterna förskjuts */
@keyframes bgParallax {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 20% 12%;
    }
}

/* Dimma – rör sig i sidled + skalar */
@keyframes dimmaMove {
    0% {
        transform: translateX(-12%) scale(1);
    }
    100% {
        transform: translateX(12%) scale(1.15);
    }
}

/* Dimma – pulserar i opacitet */
@keyframes dimmaPulse {
    0% {
        opacity: 0.4;
    }
    100% {
        opacity: 1;
    }
}

/* Andra dimlagret – långsammare och annan riktning */
@keyframes dimmaMove2 {
    0% {
        transform: translateX(8%) translateY(-4%) scale(1.05);
    }
    100% {
        transform: translateX(-8%) translateY(4%) scale(1.2);
    }
}

/* ----- HEADER ----- */
.header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.5rem;
    background: rgba(235, 231, 224, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background 0.4s ease, border-color 0.4s ease;
    z-index: 10;
    position: relative;
}

[data-theme="dark"] .header {
    background: rgba(26, 30, 34, 0.9);
}

.header-logo {
    font-size: 1.1rem;
    letter-spacing: 0.3em;
    font-weight: 400;
    color: var(--text-secondary);
    opacity: 0.25;
    text-decoration: none;
    transition: color 0.3s ease, opacity 0.3s ease;
    text-transform: uppercase;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-logo:hover {
    opacity: 0.5;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.header-btn {
    background: var(--btn-bg);
    border: none;
    border-radius: 0;
    padding: 0.2rem 0.4rem;
    font-size: 1rem;
    cursor: pointer;
    color: var(--btn-text);
    transition: opacity 0.2s ease;
    font-family: inherit;
    line-height: 1;
    min-width: 2.2rem;
    min-height: 1.8rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.header-btn:hover {
    opacity: 1;
}

.header-btn.lang-btn {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    min-width: 2.2rem;
    min-height: 1.8rem;
}

/* ----- HERO INNEHÅLL ----- */
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 950px;
    width: 100%;
}

.hero-title-wrapper {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-bottom: 0.1rem;
}

.hero-title-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.hero-title-main {
    font-size: clamp(3.5rem, 12vw, 7rem);
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    text-shadow: 0 2px 20px var(--shadow);
    transition: color 0.4s ease;
    line-height: 1;
}

.hero-title-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: clamp(0.5rem, 1.2vw, 0.85rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    line-height: 1.2;
    transition: color 0.4s ease;
    margin-top: 0.05rem;
}

.hero-title-stack span {
    display: block;
}

.hero-divider {
    width: 50px;
    height: 1.5px;
    background: var(--text-secondary);
    margin: 0.4rem auto;
    opacity: 0.3;
    transition: background 0.4s ease;
}

.hero-sub {
    font-size: clamp(0.8rem, 1.6vw, 1.1rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    font-weight: 300;
    transition: color 0.4s ease;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* ----- FOOTER – FÄRGPALETT + CITAT ----- */
.footer {
    flex-shrink: 0;
    padding: 0.4rem 1.5rem 0.6rem;
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    transition: background 0.4s ease, border-color 0.4s ease;
    position: relative;
    z-index: 2;
}

.footer-title {
    text-align: center;
    font-size: 0.5rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    font-weight: 400;
}

/* Rad 1 – Full storlek (alla 10) */
.palette-full {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    max-width: 900px;
    margin: 0 auto 0.3rem;
}

.palette-full .palette-item {
    flex: 1 1 65px;
    min-width: 55px;
    max-width: 100px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.palette-full .palette-item:hover {
    transform: scale(1.04);
}

.palette-full .palette-item:active {
    transform: scale(0.96);
}

.palette-full .palette-swatch {
    width: 100%;
    aspect-ratio: 3/1.5;
    border-radius: 3px;
    border: 1px solid var(--border);
    margin-bottom: 0.1rem;
}

.palette-full .palette-name {
    font-size: 0.45rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: block;
    line-height: 1.2;
}

.palette-full .palette-hex {
    font-size: 0.4rem;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    opacity: 0.7;
    display: block;
    font-family: monospace;
    line-height: 1.2;
}

/* Rad 2 – Enkel storlek (5 utvalda) */
.palette-simple {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
    max-width: 600px;
    margin: 0 auto 0.3rem;
}

.palette-simple .palette-item {
    flex: 1 1 40px;
    min-width: 35px;
    max-width: 60px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.palette-simple .palette-item:hover {
    transform: scale(1.04);
}

.palette-simple .palette-item:active {
    transform: scale(0.96);
}

.palette-simple .palette-swatch {
    width: 100%;
    aspect-ratio: 3/1.5;
    border-radius: 3px;
    border: 1px solid var(--border);
    margin-bottom: 0.05rem;
}

.palette-simple .palette-name {
    font-size: 0.35rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: block;
    line-height: 1.1;
}

.palette-simple .palette-hex {
    font-size: 0.3rem;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    opacity: 0.7;
    display: block;
    font-family: monospace;
    line-height: 1.1;
}

/* ----- CITAT under färgpaletten ----- */
.footer-quote {
    text-align: center;
    max-width: 750px;
    margin: 0.3rem auto 0;
    padding-top: 0.3rem;
    border-top: 1px solid var(--border);
}

.footer-quote-text {
    font-size: clamp(0.6rem, 1vw, 0.8rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 300;
    transition: color 0.4s ease;
}

/* ----- COPY-TOAST ----- */
.copy-toast {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 0.4rem 1.2rem;
    border-radius: 6px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 1000;
    font-weight: 500;
    box-shadow: 0 4px 16px var(--shadow);
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ----- RESPONSIV ----- */
@media (max-width: 800px) {
    .palette-full .palette-item {
        flex: 1 1 45px;
        min-width: 40px;
    }
    .palette-simple .palette-item {
        flex: 1 1 30px;
        min-width: 28px;
    }
    .hero-title-stack {
        font-size: clamp(0.4rem, 1vw, 0.7rem);
    }
}

@media (max-width: 600px) {
    .header {
        padding: 0.4rem 1rem;
    }
    .header-logo {
        font-size: 0.9rem;
        letter-spacing: 0.2em;
    }
    .header-btn {
        font-size: 0.85rem;
        padding: 0.15rem 0.3rem;
        min-width: 1.8rem;
        min-height: 1.6rem;
    }
    .header-btn.lang-btn {
        font-size: 0.6rem;
        min-width: 1.8rem;
        min-height: 1.6rem;
    }
    .hero {
        padding: 3.5rem 0.8rem 1rem;
    }
    .hero-title-main {
        font-size: clamp(2.5rem, 9vw, 4.2rem);
    }
    .hero-title-wrapper {
        gap: 0.15rem;
    }
    .hero-title-stack {
        font-size: clamp(0.35rem, 0.9vw, 0.55rem);
    }
    .hero-sub {
        font-size: 0.65rem;
    }
    .palette-full .palette-item {
        flex: 1 1 35px;
        min-width: 30px;
    }
    .palette-full .palette-name {
        font-size: 0.35rem;
    }
    .palette-full .palette-hex {
        font-size: 0.3rem;
    }
    .palette-simple .palette-item {
        flex: 1 1 25px;
        min-width: 22px;
    }
    .palette-simple .palette-name {
        font-size: 0.28rem;
    }
    .palette-simple .palette-hex {
        font-size: 0.25rem;
    }
    .footer-title {
        font-size: 0.4rem;
    }
    .footer-quote-text {
        font-size: 0.5rem;
    }
    .copy-toast {
        font-size: 0.55rem;
        padding: 0.35rem 0.8rem;
        bottom: 55px;
    }
}

@media (max-width: 450px) {
    .hero-title-wrapper {
        gap: 0.1rem;
    }
    .hero-title-main {
        font-size: clamp(2rem, 7vw, 3.2rem);
    }
    .hero-title-stack {
        font-size: clamp(0.3rem, 0.7vw, 0.45rem);
    }
    .palette-full .palette-item {
        flex: 1 1 28px;
        min-width: 24px;
    }
    .palette-simple .palette-item {
        flex: 1 1 20px;
        min-width: 18px;
    }
}

/* ----- TILLGÄNGLIGHET – reducerad rörelse ----- */
@media (prefers-reduced-motion: reduce) {
    .hero,
    .hero::before,
    .hero::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.header-btn:focus-visible,
.palette-item:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 2px;
}
