/* Gemensam stil för case-sidorna – samma formspråk som startsidan */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --ink: #0a1020;
    --navy: #0f2a5e;
    --cyan: #3fd3ea;
    --paper: #f3efe6;
    --paper-2: #e9e3d6;
    --line-dark: rgba(255,255,255,0.12);
    --line-light: rgba(10,16,32,0.14);
    --muted-dark: rgba(243,239,230,0.62);
    --muted-light: #545a66;
    --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --pad: clamp(20px, 5vw, 64px);
    --ease: cubic-bezier(.2,.7,.1,1);
}

html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
    font-family: var(--sans);
    background: var(--ink);
    color: var(--paper);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--cyan); color: var(--ink); }
img { max-width: 100%; display: block; }

.eyebrow {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.05rem;
    letter-spacing: 0;
}

/* ---------- Toppmeny ---------- */
.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px var(--pad);
    transition: background .4s, padding .4s, border-color .4s;
    border-bottom: 1px solid transparent;
}
.topbar.scrolled {
    background: rgba(10,16,32,0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding-top: 12px; padding-bottom: 12px;
    border-bottom-color: var(--line-dark);
}
.topbar .brand img { height: 34px; width: auto; }
.topbar-right { display: flex; align-items: center; gap: clamp(8px, 2vw, 18px); font-size: 0.85rem; }
.lang-toggle { display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 0.78rem; }
.lang-toggle a { text-decoration: none; color: var(--muted-dark); padding: 6px 8px; transition: color .2s; }
.lang-toggle a:hover, .lang-toggle a.active { color: var(--cyan); }
.lang-toggle span { opacity: .3; }
.back-link {
    color: var(--paper);
    font-weight: 500;
    padding: 8px 2px;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
    text-decoration-color: rgba(243, 239, 230, 0.35);
    transition: color .25s, text-decoration-color .25s;
    white-space: nowrap;
}
.back-link:hover { color: var(--cyan); text-decoration-color: var(--cyan); }

/* ---------- Knappar ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.98rem;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    min-height: 52px;
    padding: 0 0 0 22px;
    border-radius: 3px;
    overflow: hidden;
    color: var(--ink);
    background: linear-gradient(var(--ink), var(--ink)) no-repeat bottom / 100% 0%, var(--cyan);
    transition: background-size .45s var(--ease), color .35s;
}
.btn-primary::after {
    content: '→';
    display: flex;
    align-items: center;
    align-self: stretch;
    margin-left: 20px;
    padding: 0 18px;
    border-left: 1px solid rgba(10, 16, 32, 0.18);
    transition: transform .45s var(--ease), border-color .35s;
}
.btn-primary:hover { background-size: 100% 100%, auto; color: var(--paper); }
.btn-primary:hover::after { transform: translateX(3px); border-color: rgba(243, 239, 230, 0.2); }
.case-hero .btn-primary { background: linear-gradient(var(--paper), var(--paper)) no-repeat bottom / 100% 0%, var(--cyan); }
.case-hero .btn-primary:hover { background-size: 100% 100%, auto; color: var(--ink); }
.case-hero .btn-primary:hover::after { border-color: rgba(10, 16, 32, 0.18); }
.btn-secondary {
    color: var(--paper);
    padding: 14px 2px;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 7px;
    text-decoration-color: rgba(243, 239, 230, 0.35);
    transition: color .3s, text-decoration-color .3s, text-underline-offset .3s;
}
.btn-secondary:hover { color: var(--cyan); text-decoration-color: var(--cyan); text-underline-offset: 4px; }

/* ---------- Hero ---------- */
.case-hero {
    position: relative;
    padding: clamp(130px, 16vw, 190px) var(--pad) clamp(50px, 7vw, 90px);
    overflow: hidden;
    isolation: isolate;
}
.case-hero::before {
    content: '';
    position: absolute; inset: -20%;
    z-index: -2;
    background:
        radial-gradient(700px circle at 80% 10%, rgba(63,211,234,0.14), transparent 60%),
        radial-gradient(900px circle at 0% 100%, rgba(15,42,94,0.9), transparent 60%);
}
.case-hero::after {
    content: '';
    position: absolute; inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--line-dark) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-dark) 1px, transparent 1px);
    background-size: 96px 96px;
    mask-image: radial-gradient(ellipse at 70% 20%, #000 10%, transparent 65%);
    -webkit-mask-image: radial-gradient(ellipse at 70% 20%, #000 10%, transparent 65%);
    opacity: .4;
}
.case-hero-inner { max-width: 1320px; margin: 0 auto; }
.case-kicker { display: flex; align-items: center; gap: 14px; color: var(--cyan); margin-bottom: 28px; }
.case-kicker::before { content: ''; width: 40px; height: 1px; background: currentColor; }
.case-hero h1 {
    font-family: var(--serif);
    font-weight: 340;
    font-variation-settings: 'opsz' 144;
    font-size: clamp(2.8rem, 7.5vw, 7.2rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
    margin: 0 0 30px;
    max-width: 18ch;
}
.case-hero h1 em { font-style: italic; color: var(--cyan); font-weight: 300; }
.case-lead { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--muted-dark); max-width: 56ch; margin: 0 0 40px; }

.case-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    padding-top: 26px;
    border-top: 1px solid var(--line-dark);
    margin-bottom: 36px;
}
.case-meta dt { font-family: var(--mono); font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-dark); margin-bottom: 6px; }
.case-meta dd { margin: 0; font-size: 1rem; }
.case-meta dd.result { color: var(--cyan); }
.case-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Stor bild ---------- */
.case-showcase { padding: 0 var(--pad); margin-top: clamp(10px, 2vw, 20px); }
.case-showcase figure {
    max-width: 1320px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    background: #f7f7f7;
    box-shadow: 0 50px 120px rgba(0,0,0,0.5);
}
.case-showcase figure img { width: 100%; height: auto; }
.case-plate {
    aspect-ratio: 16 / 7;
    background: var(--paper) !important;
    color: var(--ink);
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.case-plate span {
    font-family: var(--serif); font-style: italic; font-weight: 300;
    font-size: clamp(8rem, 22vw, 20rem); line-height: 1; letter-spacing: -0.05em;
}
.case-plate small {
    position: absolute; left: 22px; bottom: 18px;
    font-family: var(--mono); font-size: 0.75rem; letter-spacing: .12em; color: var(--muted-light);
}

/* ---------- Ljus sektion ---------- */
.case-body {
    background: var(--paper);
    color: var(--ink);
    padding: clamp(80px, 11vw, 150px) var(--pad);
    margin-top: calc(-1 * clamp(80px, 14vw, 220px));
    padding-top: calc(clamp(80px, 14vw, 220px) + clamp(70px, 9vw, 120px));
}
.case-body-inner { max-width: 1320px; margin: 0 auto; }
.block {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px 6%;
    padding: clamp(40px, 5vw, 64px) 0;
    border-top: 1px solid var(--line-light);
}
.block:first-child { border-top: none; padding-top: 0; }
@media (min-width: 900px) { .block { grid-template-columns: 4fr 8fr; } }
.block-label .eyebrow { color: var(--navy); display: block; margin-bottom: 14px; }
.block-label h2 {
    font-family: var(--serif);
    font-weight: 380;
    font-size: clamp(1.9rem, 3.4vw, 2.9rem);
    line-height: 1;
    letter-spacing: -0.025em;
    margin: 0;
}
.block-text p { font-size: 1.12rem; color: var(--muted-light); margin: 0 0 1em; max-width: 62ch; }
.block-text p:last-child { margin-bottom: 0; }

.two-col { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 700px) { .two-col { grid-template-columns: 1fr 1fr; gap: 48px; } }
.two-col h3 {
    font-family: var(--mono); font-weight: 500; font-size: 0.78rem;
    letter-spacing: .12em; text-transform: uppercase; color: var(--navy);
    margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line-light);
}
.two-col p { font-size: 1.08rem; color: var(--muted-light); margin: 0; }

.features { list-style: none; margin: 0; padding: 0; counter-reset: f; border-top: 1px solid var(--line-light); }
.features li {
    counter-increment: f;
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 4px 16px;
    padding: 22px 0;
    border-bottom: 1px solid var(--line-light);
    font-size: 1.04rem;
    color: var(--muted-light);
}
.features li::before { content: counter(f, decimal-leading-zero); font-family: var(--mono); font-size: 0.78rem; color: var(--navy); padding-top: 4px; }
.features li strong {
    display: block;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 4px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chips span {
    font-family: var(--mono);
    font-size: 0.8rem;
    padding: 8px 14px;
    border: 1px solid var(--line-light);
    border-radius: 999px;
    background: rgba(255,255,255,0.5);
}
.spec { margin: 0; border-top: 1px solid var(--line-light); }
.spec div { display: grid; grid-template-columns: 1fr; gap: 2px 20px; padding: 14px 0; border-bottom: 1px solid var(--line-light); }
@media (min-width: 600px) { .spec div { grid-template-columns: 200px 1fr; } }
.spec dt { font-family: var(--mono); font-size: 0.78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-light); padding-top: 3px; }
.spec dd { margin: 0; font-size: 1.04rem; }

/* ---------- Galleri ---------- */
.gallery { padding: clamp(80px, 11vw, 150px) var(--pad); }
.gallery-inner { max-width: 1320px; margin: 0 auto; }
.gallery-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: clamp(36px, 5vw, 60px); flex-wrap: wrap; }
.gallery-head .eyebrow { color: var(--cyan); display: block; margin-bottom: 14px; }
.gallery-head h2 {
    font-family: var(--serif); font-weight: 340; font-variation-settings: 'opsz' 144;
    font-size: clamp(2.4rem, 5.5vw, 4.8rem); line-height: 0.95; letter-spacing: -0.03em; margin: 0;
}
.gallery-grid { display: grid; grid-template-columns: 1fr; gap: clamp(16px, 2vw, 28px); }
@media (min-width: 800px) { .gallery-grid { grid-template-columns: 1fr 1fr; } }
.gallery-grid figure {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f7f7f7;
}
.gallery-grid figure.wide { grid-column: 1 / -1; }
.gallery-grid img { width: 100%; height: auto; transition: transform 1.1s var(--ease); }
.gallery-grid figure:hover img { transform: scale(1.03); }

/* ---------- Nästa case ---------- */
.next-case {
    display: block;
    text-decoration: none;
    padding: clamp(70px, 10vw, 140px) var(--pad);
    border-top: 1px solid var(--line-dark);
    position: relative;
    overflow: hidden;
}
.next-case::before {
    content: '';
    position: absolute; inset: 0;
    background: var(--cyan);
    transform: translateY(101%);
    transition: transform .8s var(--ease);
    z-index: 0;
}
.next-case:hover::before { transform: none; }
.next-case-inner { max-width: 1320px; margin: 0 auto; position: relative; z-index: 1; }
.next-case .eyebrow { color: var(--cyan); display: block; margin-bottom: 18px; transition: color .5s; }
.next-case-title {
    font-family: var(--serif); font-weight: 330; font-variation-settings: 'opsz' 144;
    font-size: clamp(2.6rem, 8vw, 8rem); line-height: 0.95; letter-spacing: -0.04em;
    display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
    transition: color .5s;
}
.next-case-title i { font-style: normal; font-family: var(--sans); font-weight: 300; transition: transform .6s var(--ease); }
.next-case:hover .eyebrow, .next-case:hover .next-case-title { color: var(--ink); }
.next-case:hover .next-case-title i { transform: translateX(12px); }

/* ---------- Avslutning ---------- */
.case-footer { padding: 0 var(--pad) 96px; }
.case-footer .credit { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
.case-footer .credit img { height: 20px; width: auto; display: block; }
.case-footer .credit:hover span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.case-footer-inner {
    max-width: 1320px; margin: 0 auto;
    padding-top: 26px;
    border-top: 1px solid var(--line-dark);
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    font-family: var(--sans); font-size: 0.9rem; color: var(--muted-dark);
}
.case-footer a { color: var(--muted-dark); }
.case-footer a:hover { color: var(--paper); }

/* ---------- Animationer ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .case-hero h1 { animation: rise 1.1s var(--ease) both; }
.js .case-lead, .js .case-meta, .js .case-hero .case-actions { animation: rise 1.1s var(--ease) .15s both; }
.js .case-showcase figure { animation: rise 1.3s var(--ease) .3s both; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js .reveal { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
    .topbar .brand img { height: 26px; }
    .back-link { padding: 8px 2px; }
    .back-link .long { display: none; }
}

@media print {
    .topbar, .next-case, .case-actions { display: none !important; }
    body, .case-body, .gallery { background: #fff !important; color: #000 !important; }
    .case-hero::before, .case-hero::after { display: none; }
    .js .reveal, .js .case-hero h1, .js .case-kicker, .js .case-lead, .js .case-meta, .js .case-showcase figure { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* ---------- Undersidor utan stor bild (Webbdesign, Tjänster, Case, Kontakt) ---------- */
.case-body.plain { margin-top: 0; padding-top: clamp(56px, 6vw, 96px); }
.page-kicker { display: flex; align-items: center; gap: 14px; color: var(--cyan); margin-bottom: 26px; }
.page-kicker::before { content: ''; width: 40px; height: 1px; background: currentColor; }
.text-link {
    color: var(--navy);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
    text-decoration-color: rgba(15, 42, 94, 0.35);
    transition: text-decoration-color .3s, text-underline-offset .3s;
}
.text-link:hover { text-decoration-color: var(--navy); text-underline-offset: 3px; }

/* Lista med case */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-light); }
.rows a {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 24px;
    align-items: center;
    padding: 28px 0;
    border-bottom: 1px solid var(--line-light);
    text-decoration: none;
    color: var(--ink);
}
.rows h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin: 0 0 6px;
    transition: transform .5s var(--ease);
}
.rows p { margin: 0; color: var(--muted-light); font-size: 1.02rem; max-width: 62ch; }
.rows .arrow { font-size: 1.4rem; transition: transform .45s var(--ease); }
.rows a:hover h3 { transform: translateX(8px); }
.rows a:hover .arrow { transform: translateX(6px); color: var(--navy); }

/* Kontakt */
.contact-options { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid var(--line-light); }
.contact-options li { padding: 20px 0; border-bottom: 1px solid var(--line-light); }
.contact-options .label { display: block; font-size: 0.82rem; color: var(--muted-light); margin-bottom: 4px; }
.contact-options .value { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); text-decoration: none; }
.contact-options a.value:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

.cform { display: grid; gap: 14px; }
.cform label.f { font-size: 0.85rem; color: var(--muted-light); display: grid; gap: 6px; }
.cform input[type=text], .cform input[type=email], .cform select, .cform textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #d8d2c4;
    border-radius: 3px;
    background: #fff;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1rem;
}
.cform input:focus, .cform select:focus, .cform textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15, 42, 94, 0.1); }
.cform .consent { display: flex; gap: 12px; align-items: flex-start; font-size: 0.88rem; color: var(--muted-light); }
.cform .consent input { margin-top: 4px; }
.cform .consent a { color: var(--navy); }
.cform button {
    justify-self: start;
    border: none;
    cursor: pointer;
    font-family: var(--sans);
}
.cform button:disabled { opacity: .5; cursor: not-allowed; }

/* Exempelkort */
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 24px; }
@media (max-width: 640px) { .ex-grid { grid-template-columns: 1fr; gap: 28px; } }
.ex-card { display: grid; grid-template-columns: 1fr; text-decoration: none; color: var(--ink); padding-bottom: 26px; border-bottom: 1px solid var(--line-light); }
.ex-card figure { margin: 0 0 18px; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-2); border-radius: 6px; }
.ex-card img { width: 100%; height: 100%; object-fit: cover; color: transparent; transition: transform 1.1s var(--ease); }
.ex-card:hover img { transform: scale(1.04); }
.ex-type { font-size: 0.82rem; color: var(--navy); font-weight: 600; letter-spacing: .04em; }
.ex-card h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.4rem, 2.2vw, 1.8rem); letter-spacing: -0.02em; margin: 4px 0 8px; }
.ex-card p { margin: 0 0 14px; color: var(--muted-light); max-width: 56ch; }
.ex-open { font-weight: 600; color: var(--navy); }
.ex-card:hover .ex-open { text-decoration: underline; text-underline-offset: 5px; }
