/* Denkkappe — shared styles for every page and language.
   Sections: design tokens · base · language switcher · home page · document pages (.doc) */

/* ---------- Design tokens ---------- */

/* Palette taken from the logo: the cap's red and yellow, the ravens' ink, the paper background */
:root {
    --paper: #f7f6f1;
    --paper-deep: #efede5;
    --ink: #1a1825;
    --ink-muted: #5b5866;
    --cap-red: #c23b25;       /* darkened from the logo's #e04a32 so white text passes WCAG AA */
    --cap-red-dark: #a93220;
    --cap-yellow: #fccd49;
    --rule: rgba(26, 24, 37, 0.12);
    --link: var(--cap-red);
    --link-hover: var(--cap-red-dark);
    --band-bg: var(--ink);
    --band-text: var(--paper);
    --glow: 247, 246, 241;    /* the logo's halo is always paper-coloured */
    --glow-strength: 1;
    --night: #1a1825;
    --night-text: #b3b0bc;
    color-scheme: light dark;
}

/* Dark theme: follows the visitor's system setting, no toggle needed */
@media (prefers-color-scheme: dark) {
    :root {
        --paper: #17151f;
        --paper-deep: #1f1d29;
        --ink: #efece4;
        --ink-muted: #b3b0bc;
        --rule: rgba(239, 236, 228, 0.14);
        --link: #ff8a6e;
        --link-hover: #ffb09c;
        --band-bg: #2a2736;
        --band-text: #efece4;
        --glow-strength: 0.6;
        --night: #0e0d14;
    }
}

/* ---------- Base ---------- */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--paper);
    color: var(--ink);
    line-height: 1.6;
}

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

html {
    scroll-behavior: smooth;
}

a {
    color: var(--link);
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--link-hover);
}

a:focus-visible {
    outline: 3px solid var(--cap-yellow);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Language switcher */
.lang-switch {
    display: flex;
    gap: 0.15rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.lang-switch a {
    color: var(--ink);
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    min-width: 2.6rem;   /* IT is narrower than EN/FR: keep all three pills the same shape */
    text-align: center;
}

.lang-switch a:hover {
    color: var(--ink);
    background: var(--paper-deep);
}

.lang-switch a[aria-current="page"] {
    background: var(--ink);
    color: var(--paper);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.doc body,
body.doc {
    line-height: 1.65;
}

/* ---------- Home page ---------- */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--paper);
    color: var(--ink);
    line-height: 1.6;
}

.hero-banner .lang-switch {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}

/* ---------- Banner ---------- */
.hero-banner {
    position: relative;
    height: clamp(250px, 38vw, 480px);
    overflow: hidden;
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 45%;
    display: block;
}

.hero-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 70%, var(--paper));
    pointer-events: none;
}

/* ---------- Intro ---------- */
.intro {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem 1.5rem;
    text-align: center;
}

/* Logo floats over the banner: a soft paper-coloured glow behind it
   keeps contrast without a hard-edged disc */
.logo-badge {
    position: relative;
    z-index: 1;
    width: 260px;
    height: 260px;
    margin: -160px auto -0.5rem;
    border-radius: 50%;
    background: radial-gradient(circle closest-side,
        rgba(var(--glow), calc(0.92 * var(--glow-strength))) 0%,
        rgba(var(--glow), calc(0.82 * var(--glow-strength))) 55%,
        rgba(var(--glow), calc(0.45 * var(--glow-strength))) 78%,
        rgba(var(--glow), 0) 100%);
    display: grid;
    place-items: center;
}

.logo-badge picture {
    display: block;
    width: 76%;
}

.logo-badge img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(26, 24, 37, 0.25));
}

.wordmark {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.intro h1 {
    font-size: clamp(1.6rem, 7vw, 3rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    text-wrap: balance; /* even line lengths instead of a stranded last word */
}

/* Break the headline between its two phrases, never mid-phrase where it fits */
.intro h1 .phrase {
    display: inline-block;
}

.intro .lead {
    font-size: 1.15rem;
    color: var(--ink-muted);
    max-width: 32rem;
    margin: 0 auto 2rem;
}

.cta-button {
    display: inline-block;
    background-color: var(--cap-red);
    color: #fff;
    font-weight: 600;
    padding: 0.8rem 1.9rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.cta-button:hover {
    background-color: var(--cap-red-dark);
    color: #fff;
    transform: translateY(-1px);
}

.noscript-email {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--ink-muted);
}

/* ---------- Sections ---------- */
.section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4.5rem 1.5rem;
}

.section h2 {
    text-wrap: balance;
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 2.25rem;
}

.section h3 {
    font-size: 1.25rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin-bottom: 0.9rem;
}

.section p {
    max-width: 65ch;
}

.section p + p {
    margin-top: 1rem;
}

/* What we do: two distinct offers side by side */
.offers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.75rem;
}

.offer ul {
    margin: 0.6rem 0 1rem 1.1rem;
    color: var(--ink-muted);
}

.offer li + li {
    margin-top: 0.25rem;
}

.offer .fine {
    margin-top: 1rem;
    font-size: 0.85rem;
    font-style: italic;
}

.offer {
    padding-top: 1.25rem;
    border-top: 3px solid var(--ink);
}

.offer p {
    color: var(--ink-muted);
}

.offer .scope-note {
    margin-top: 1.25rem;
    color: var(--ink);
    font-weight: 600;
}

/* Sniff test detail */
.sniff {
    border-top: 1px solid var(--rule);
}

.sniff .section-intro {
    color: var(--ink-muted);
    margin: -1.25rem 0 2.5rem;
}

.questions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.25rem 3rem;
    margin-bottom: 3rem;
}

.questions h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.questions p {
    color: var(--ink-muted);
}

.deliverable {
    background-color: var(--paper-deep);
    border-left: 3px solid var(--cap-red);
    padding: 1.75rem 2rem;
}

.deliverable h3 {
    margin-bottom: 0.6rem;
}

.deliverable p {
    color: var(--ink-muted);
}

.deliverable .cta-button {
    margin-top: 1.5rem;
}

/* The one loud moment: the pull quote */
.quote-band {
    background-color: var(--band-bg);
    color: var(--band-text);
    padding: clamp(4rem, 9vw, 7rem) 1.5rem;
}

.quote-band blockquote {
    max-width: 24ch;
    margin: 0 auto;
    font-size: clamp(1.75rem, 4.2vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    text-align: center;
    text-wrap: balance;
}

/* How we work */
.principles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 3.5rem;
}

.principles h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.principles p {
    color: var(--ink-muted);
}

/* Selected work: title on the left, story on the right */
.work {
    border-top: 1px solid var(--rule);
}

.work .section-intro {
    color: var(--ink-muted);
    margin: -1.25rem 0 2.5rem;
}

.cases {
    list-style: none;
}

.case {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 0.5rem 3rem;
    padding: 1.75rem 0;
    border-top: 1px solid var(--rule);
}

.case:last-child {
    border-bottom: 1px solid var(--rule);
}

.case h3 {
    font-size: 1.1rem;
    margin: 0;
    text-wrap: balance;
}

.case p {
    color: var(--ink-muted);
}

/* About */
.about-wrap {
    background-color: var(--paper-deep);
}

.about {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 3rem;
    align-items: start;
}

.about-photo img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

@media (prefers-color-scheme: dark) {
    /* keep the dark photo background from dissolving into the page */
    .about-photo img {
        box-shadow: 0 0 0 1px var(--rule);
    }
}

.about-text p {
    color: var(--ink-muted);
}

.about-text p:first-of-type {
    color: var(--ink);
    font-size: 1.1rem;
}

.origin-story {
    margin: 2rem 0 1.5rem;
    padding-left: 1.25rem;
    border-left: 3px solid var(--cap-red);
    max-width: 60ch;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--ink);
}

.origin-story cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-style: normal;
    color: var(--ink-muted);
}

/* Contact */
.contact {
    text-align: center;
    padding-top: 5.5rem;
    padding-bottom: 5.5rem;
}

.contact h2 {
    margin-bottom: 1rem;
}

.contact p {
    color: var(--ink-muted);
    margin: 0 auto 2rem;
    max-width: 36rem;
}

/* Footer */
.footer-wrap .footer {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    font-size: 0.85rem;
    color: var(--night-text);
}

.footer-wrap .footer .legal {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.footer-wrap .footer nav {
    display: flex;
    gap: 1.5rem;
}

.footer-wrap .footer a {
    color: var(--night-text);
}

.footer-wrap .footer a:hover {
    color: #fff;
}

.footer-wrap .footer a:focus-visible {
    outline-color: var(--cap-yellow);
}

/* ---------- Page end: the same mountains, after dark ---------- */
/* The scene keeps its own proportions at every width, so the peaks and the
   constellation are never cropped. */
.alps img {
    display: block;
    width: 100%;
    height: auto;
}

.footer-wrap {
    background-color: var(--night);
}

/* ---------- Small screens ---------- */
@media (max-width: 1000px) and (min-width: 761px) {
    .offers {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .questions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    /* On phones the full-width scene would be a sliver, so give it a height and
       crop the sides instead: the peaks and constellation stay visible. */
    .alps {
        height: 110px;
    }

    .alps img {
        height: 100%;
        object-fit: cover;
        object-position: 50% 100%;
    }

    .offers,
    .principles {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .about {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .case {
        grid-template-columns: 1fr;
    }

    .questions {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .deliverable {
        padding: 1.5rem 1.25rem;
    }

    .about-photo img {
        width: 140px;
        height: 140px;
    }

    .section {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }
}

@media (max-width: 480px) {
    .logo-badge {
        width: 200px;
        height: 200px;
        margin-top: -110px;
    }

    .footer-wrap .footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .cta-button {
        transition: none;
    }

    .cta-button:hover {
        transform: none;
    }
}

/* ---------- Document pages (privacy) ---------- */

.doc .page {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.doc .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.doc .home {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
}

.doc .home img {
    width: 44px;
    height: 44px;
}

.doc .home:hover {
    color: var(--ink);
}

.doc h1 {
    font-size: clamp(1.9rem, 5vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.doc .updated {
    color: var(--ink-muted);
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
}

.doc .summary {
    background-color: var(--paper-deep);
    border-left: 3px solid var(--link);
    padding: 1.25rem 1.5rem;
    margin-bottom: 3rem;
}

.doc .summary p + p {
    margin-top: 0.6rem;
}

.doc h2 {
    font-size: 1.2rem;
    letter-spacing: -0.01em;
    margin: 2.5rem 0 0.6rem;
}

.doc p,
.doc li {
    color: var(--ink-muted);
}

.doc .summary p {
    color: var(--ink);
}

.doc p + p {
    margin-top: 0.8rem;
}

.doc ul {
    margin: 0.6rem 0 0.8rem 1.25rem;
}

.doc li + li {
    margin-top: 0.3rem;
}

.doc strong {
    color: var(--ink);
}

.doc .footer {
    max-width: 680px;
    margin: 0 auto;
    padding: 1.5rem;
    border-top: 1px solid var(--rule);
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.doc .legal-line {
    margin-top: 0.4rem;
}

.doc .footer a {
    color: var(--ink-muted);
}
