/* ==========================================================================
   m-node
   Black, light ink and one red. Set in Schibsted Grotesk and IBM Plex Mono.
   ========================================================================== */

:root {
    --paper: #171614;
    --paper-2: #221f1c;
    --ink: #ece8df;
    --ink-2: #b3ada2;
    --ink-3: #8b857a;
    --rule: #34312c;
    --rule-strong: #615b52;
    --red: #e4532b;

    --serif: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --sans: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;

    --wrap: 1320px;
    --pad: clamp(18px, 4vw, 48px);
    --space: clamp(80px, 11vw, 168px);
}

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

html {
    background: var(--paper);
    color-scheme: dark;
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink);
    background: transparent;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

::selection { background: var(--red); color: var(--paper); }

:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
}

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.02;
}

/* Emphasis is colour, not a script italic */
em { font-style: normal; }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--pad);
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -80px;
    z-index: 100;
    padding: 8px 14px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Small uppercase mono used for all metadata */
.meta {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* Underlined text links with an arrow */
.link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4em;
    font-weight: 600;
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
    padding-bottom: 2px;
    transition: color 0.2s;
}
.link:hover { color: var(--red); }
.link .arr { transition: transform 0.25s; }
.link:hover .arr { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   Masthead
   -------------------------------------------------------------------------- */

.dateline { border-bottom: 1px solid var(--rule); }
.dateline .wrap {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 9px;
    padding-bottom: 9px;
}

.masthead {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--paper);
    border-bottom: 1px solid var(--rule-strong);
}
.masthead .wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 68px;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--serif);
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    text-decoration: none;
    white-space: nowrap;
}
.wordmark svg { width: 24px; height: 24px; }

.nav {
    display: flex;
    align-items: center;
    gap: clamp(18px, 3vw, 40px);
}
.nav a {
    position: relative;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}
.nav a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -4px;
    height: 1px;
    background: currentColor;
    transition: right 0.25s;
}
.nav a:hover::after, .nav a[aria-current="page"]::after { right: 0; }
.nav a[aria-current="page"] { color: var(--red); }

.nav-end { display: flex; align-items: center; gap: 20px; }

.lang {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-decoration: none;
    color: var(--ink-3);
}
.lang b { color: var(--ink); font-weight: 600; }
.lang:hover { color: var(--red); }

.menu-toggle {
    display: none;
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 0;
    border-bottom: 1px solid var(--rule-strong);
}

/* --------------------------------------------------------------------------
   Home — lede
   -------------------------------------------------------------------------- */

.lede { padding: clamp(56px, 8vw, 120px) 0 clamp(64px, 8vw, 120px); }

.lede h1 {
    font-size: clamp(3.1rem, 9.4vw, 9.2rem);
    line-height: 0.94;
    letter-spacing: -0.035em;
    max-width: 13ch;
}
.lede h1 em { color: var(--red); }

.lede-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    margin-top: clamp(48px, 6vw, 88px);
    padding-top: 16px;
    border-top: 1px solid var(--rule-strong);
}
.lede-grid > .meta { grid-column: 1 / span 3; padding-top: 6px; }
.lede-text { grid-column: 4 / span 5; }
.lede-text p {
    font-family: var(--serif);
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    line-height: 1.35;
}
.lede-text .links { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 28px; }
.lede-list { grid-column: 10 / span 3; }
.lede-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.95rem;
}
.lede-list li:first-child { border-top: 1px solid var(--rule); }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section { padding: 0 0 var(--space); }

.section-head {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    align-items: end;
    padding-top: 16px;
    border-top: 1px solid var(--rule-strong);
    margin-bottom: clamp(36px, 5vw, 64px);
}
.section-head .meta { grid-column: 1 / span 3; align-self: start; padding-top: 6px; }
.section-head h2 {
    grid-column: 4 / span 9;
    font-size: clamp(2.4rem, 5.4vw, 4.8rem);
    letter-spacing: -0.03em;
}
.section-head h2 em { color: var(--red); }

/* --------------------------------------------------------------------------
   Work index
   -------------------------------------------------------------------------- */

.index { border-top: 1px solid var(--rule-strong); }

.index-row {
    display: grid;
    grid-template-columns: 1fr 5fr 5fr 2fr 1fr;
    gap: 24px;
    align-items: baseline;
    padding: 26px 0 28px;
    border-bottom: 1px solid var(--rule);
    text-decoration: none;
}
.index-row .num { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); }
.index-row h3 {
    font-size: clamp(1.9rem, 3.4vw, 3rem);
    letter-spacing: -0.03em;
    transition: color 0.2s;
}
.index-row p { color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.index-row .kind { font-size: 0.9rem; }
.index-row .go {
    font-family: var(--serif);
    font-size: 1.8rem;
    line-height: 1;
    text-align: right;
    transition: transform 0.25s, color 0.2s;
}
.index-row:hover h3, .index-row:hover .go { color: var(--red); }
.index-row:hover .go { transform: translateX(4px); }

/* Floating preview that follows the cursor over the index */
.peek {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    width: 360px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    border: 1px solid var(--rule-strong);
    background: var(--paper);
    box-shadow: 8px 8px 0 var(--rule-strong);
}
.peek.is-on { opacity: 1; }
.peek img { width: 100%; height: auto; filter: invert(1) hue-rotate(180deg); }

/* --------------------------------------------------------------------------
   Services — numbered text columns
   -------------------------------------------------------------------------- */

.services {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 40px;
}
.service {
    padding: 24px 0 44px;
    border-top: 1px solid var(--rule);
}
.service:nth-child(-n+3) { border-top: 0; padding-top: 0; }
.service .n {
    display: block;
    margin-bottom: 14px;
    font-family: var(--serif);
    font-size: 3.2rem;
    line-height: 1;
    color: var(--red);
}
.service h3 { font-size: 1.7rem; letter-spacing: -0.02em; margin-bottom: 12px; }
.service p { color: var(--ink-2); max-width: 36ch; }
.service.other h3 a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.service.other h3 a:hover { color: var(--red); }

/* --------------------------------------------------------------------------
   Pull quote
   -------------------------------------------------------------------------- */

.pull {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    padding: clamp(40px, 5vw, 72px) 0 0;
    border-top: 1px solid var(--rule-strong);
}
.pull blockquote {
    grid-column: 3 / span 9;
    font-family: var(--serif);
    font-size: clamp(1.9rem, 4vw, 3.6rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    text-indent: -0.42em;
}
.pull blockquote em { color: var(--red); }
.pull .meta { grid-column: 3 / span 9; margin-top: 8px; }

/* --------------------------------------------------------------------------
   Process
   -------------------------------------------------------------------------- */

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--rule-strong);
}
.step { padding: 16px 24px 8px 0; }
.step + .step { padding-left: 24px; border-left: 1px solid var(--rule); }
.step .meta { display: block; margin-bottom: 40px; }
.step h3 { font-size: 1.55rem; margin-bottom: 10px; }
.step p { color: var(--ink-2); font-size: 0.97rem; }

/* --------------------------------------------------------------------------
   Partners line
   -------------------------------------------------------------------------- */

.partners {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px 40px;
    padding: 20px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.partners span:not(.meta) { font-family: var(--serif); font-size: 1.6rem; }

/* --------------------------------------------------------------------------
   Closing call to action
   -------------------------------------------------------------------------- */

.closing { padding: 0 0 var(--space); }
.closing > .wrap { position: relative; padding-top: clamp(48px, 7vw, 104px); }
.closing > .wrap::before { content: ''; position: absolute; top: 0; left: var(--pad); right: var(--pad); border-top: 1px solid var(--rule-strong); }
.closing > .wrap > .meta { display: block; margin-bottom: 24px; }
.closing h2 {
    font-size: clamp(3rem, 10vw, 9.6rem);
    line-height: 0.92;
    letter-spacing: -0.04em;
    max-width: 12ch;
}
.closing h2 em { color: var(--red); }
.closing .big-link {
    display: inline-block;
    margin-top: clamp(32px, 4vw, 56px);
    font-family: var(--serif);
    font-size: clamp(1.5rem, 3.4vw, 2.8rem);
    letter-spacing: -0.02em;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    word-break: break-word;
}
.closing .big-link:hover { color: var(--red); }
.closing .sub { margin-top: 20px; color: var(--ink-2); }
.closing .sub a:hover { color: var(--red); }

/* --------------------------------------------------------------------------
   Page head (sub pages)
   -------------------------------------------------------------------------- */

.page-head { padding: clamp(48px, 7vw, 104px) 0 clamp(48px, 6vw, 88px); }
.page-head .meta { display: block; margin-bottom: 20px; }
.page-head h1 {
    font-size: clamp(3rem, 8.4vw, 8rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
    max-width: 15ch;
}
.page-head h1 em { color: var(--red); }
.page-head .standfirst {
    margin-top: 32px;
    max-width: 38ch;
    font-family: var(--serif);
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    line-height: 1.35;
    color: var(--ink-2);
}
.contents {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin-top: 40px;
    padding-top: 12px;
    border-top: 1px solid var(--rule);
}
.contents a { text-decoration: none; font-size: 0.95rem; }
.contents a span { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); margin-right: 6px; }
.contents a:hover { color: var(--red); }

/* --------------------------------------------------------------------------
   Case studies
   -------------------------------------------------------------------------- */

.case {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 24px;
    padding: 16px 0 var(--space);
    border-top: 1px solid var(--rule-strong);
}
.case-meta { grid-column: 1 / span 3; display: flex; flex-direction: column; gap: 4px; }
.case-meta .no {
    font-family: var(--serif);
    font-size: 4.4rem;
    line-height: 1;
    color: var(--red);
    margin-bottom: 12px;
}
.case-main { grid-column: 4 / span 9; }
.case h2 { font-size: clamp(2.8rem, 6vw, 5.6rem); letter-spacing: -0.035em; }
.case .standfirst {
    margin: 14px 0 36px;
    font-family: var(--serif);
    font-size: clamp(1.3rem, 2.2vw, 1.75rem);
    line-height: 1.3;
    color: var(--ink-2);
    max-width: 34ch;
}

.figure { margin: 0 0 40px; }
.figure img { width: 100%; height: auto; border: 1px solid var(--rule-strong); filter: invert(1) hue-rotate(180deg); }
.figure figcaption { margin-top: 10px; font-size: 0.85rem; color: var(--ink-3); }
.figure figcaption b {
    margin-right: 8px;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
}

.case-cols {
    display: grid;
    grid-template-columns: 5fr 4fr;
    gap: 48px;
}
.case-body p { font-size: 1.06rem; line-height: 1.65; }
.case-body > p:first-child::first-letter {
    float: left;
    font-family: var(--serif);
    font-size: 4.3em;
    line-height: 0.8;
    padding: 7px 8px 0 0;
    color: var(--red);
}
.note {
    margin-top: 20px;
    padding-left: 14px;
    border-left: 2px solid var(--red);
    font-size: 0.95rem;
    color: var(--ink-2);
}

.features > .meta { display: block; margin-bottom: 8px; }
.features ol { counter-reset: f; }
.features li {
    counter-increment: f;
    position: relative;
    padding: 10px 0 10px 34px;
    border-top: 1px solid var(--rule);
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--ink-2);
}
.features li::before {
    content: counter(f, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 12px;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-3);
}

.stack {
    margin-top: 28px;
    padding-top: 12px;
    border-top: 1px solid var(--rule-strong);
    font-size: 0.92rem;
}
.stack .meta { margin-right: 10px; }

code {
    font-family: var(--mono);
    font-size: 0.86em;
    padding: 0 0.3em;
    background: var(--paper-2);
}

/* --------------------------------------------------------------------------
   Skills — set like a book index
   -------------------------------------------------------------------------- */

.skill-index {
    columns: 3;
    column-gap: 40px;
    column-rule: 1px solid var(--rule);
    border-top: 1px solid var(--rule-strong);
    padding-top: 8px;
}
.skill-group {
    break-inside: avoid;
    padding: 16px 0 32px;
}
.skill-group h2 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}
.skill-group h2 .meta { font-size: 0.68rem; letter-spacing: 0.04em; }
.skill-group li {
    padding: 5px 0;
    border-bottom: 1px dotted var(--rule);
    font-size: 0.97rem;
}

.scores {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--rule-strong);
}
.score { padding: 16px 24px 0 0; }
.score + .score { padding-left: 24px; border-left: 1px solid var(--rule); }
.score strong {
    display: block;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(4rem, 9vw, 8rem);
    line-height: 1;
    letter-spacing: -0.04em;
}
.score .meta { display: block; margin-top: 8px; }
.scores-note { margin-top: 28px; max-width: 56ch; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    border-top: 1px solid var(--rule-strong);
    padding-top: 20px;
}
.direct { grid-column: 1 / span 5; }
.direct dt { padding-top: 16px; border-top: 1px solid var(--rule); }
.direct dt:first-child { border-top: 0; padding-top: 0; }
.direct dd {
    padding: 4px 0 18px;
    font-family: var(--serif);
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    letter-spacing: -0.015em;
    word-break: break-word;
}
.direct dd a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.direct dd a:hover { color: var(--red); }

.form-wrap { grid-column: 7 / span 6; }
.form-wrap h2 { font-size: clamp(2rem, 3.6vw, 3rem); margin-bottom: 8px; }
.form-wrap > p { color: var(--ink-2); margin-bottom: 28px; }

.field { margin-bottom: 22px; }
.field label { display: block; margin-bottom: 2px; }
.field input, .field textarea {
    width: 100%;
    padding: 8px 0 10px;
    border: 0;
    border-bottom: 1px solid var(--rule-strong);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.3rem;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus { outline: none; border-bottom: 2px solid var(--red); padding-bottom: 9px; }
.field .is-invalid { border-bottom-color: var(--red); }
.invalid-feedback { margin-top: 6px; font-size: 0.85rem; color: var(--red); }

.form-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}
.form-foot small { color: var(--ink-3); font-size: 0.85rem; max-width: 30ch; }

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 16px 26px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 600;
    transition: background 0.2s;
}
.submit-btn:hover { background: var(--red); }
.submit-btn:disabled { opacity: 0.6; cursor: progress; }

.alert { margin-top: 20px; padding: 6px 0 6px 14px; border-left: 2px solid currentColor; font-size: 0.97rem; }
.alert-success { color: #1d6b3b; }
.alert-error { color: var(--red); }

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.missing { padding: clamp(40px, 6vw, 96px) 0 var(--space); }
.missing .big {
    font-family: var(--serif);
    font-size: clamp(9rem, 32vw, 26rem);
    line-height: 0.8;
    letter-spacing: -0.06em;
    color: var(--red);
}
.missing h1 { margin-top: 32px; font-size: clamp(2.2rem, 5vw, 4rem); max-width: 18ch; }
.missing p { margin-top: 16px; max-width: 48ch; color: var(--ink-2); }
.missing .links { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 32px; }

/* --------------------------------------------------------------------------
   Footer / colophon
   -------------------------------------------------------------------------- */

.colophon { background: #0f0e0d; color: var(--ink); border-top: 1px solid var(--rule-strong); }
.colophon .wrap {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    padding-top: 56px;
    padding-bottom: 32px;
}
.colophon .meta { color: #a39d91; display: block; margin-bottom: 14px; }
.colophon .sig { grid-column: 1 / span 4; }
.colophon .sig p { font-family: var(--serif); font-size: 1.5rem; line-height: 1.25; max-width: 22ch; }
.colophon .col { grid-column: span 2; }
.colophon .col:first-of-type { grid-column: 6 / span 2; }
.colophon .col.wide { grid-column: 10 / span 3; }
.colophon .col.wide p { font-size: 0.9rem; color: #c9c3b6; max-width: 34ch; }
.colophon li + li { margin-top: 6px; }
.colophon a { text-decoration: none; }
.colophon a:hover { color: #ff8a66; text-decoration: underline; }
.colophon .base {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-top: 40px;
    padding-top: 14px;
    border-top: 1px solid #3a3731;
    font-size: 0.85rem;
    color: #a39d91;
}

/* --------------------------------------------------------------------------
   Chat widget (third-party) — keep site resets out of it
   -------------------------------------------------------------------------- */

#cb-window ul { list-style: disc; }
#cb-window ol { list-style: decimal; }

/* --------------------------------------------------------------------------
   Gentle entrance
   -------------------------------------------------------------------------- */

.js [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
    .lede-grid > .meta { grid-column: 1 / -1; }
    .lede-text { grid-column: 1 / span 7; }
    .lede-list { grid-column: 9 / span 4; }
    .index-row { grid-template-columns: 1fr 5fr 5fr 1fr; }
    .index-row .kind { display: none; }
    .services { grid-template-columns: repeat(2, 1fr); }
    .service:nth-child(3) { border-top: 1px solid var(--rule); padding-top: 24px; }
    .steps { grid-template-columns: repeat(2, 1fr); }
    .step:nth-child(3) { padding-left: 0; border-left: 0; }
    .step:nth-child(n+3) { border-top: 1px solid var(--rule); }
    .case-meta { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin-bottom: 20px; }
    .case-meta .no { font-size: 3rem; margin: 0; }
    .case-main { grid-column: 1 / -1; }
    .case-cols { grid-template-columns: 1fr; gap: 32px; }
    .skill-index { columns: 2; }
    .direct, .form-wrap { grid-column: 1 / -1; }
    .form-wrap { margin-top: 40px; }
    .colophon .sig { grid-column: 1 / -1; }
    .colophon .col, .colophon .col:first-of-type, .colophon .col.wide { grid-column: 10 / span 3; }
    .pull blockquote, .pull .meta { grid-column: 2 / -1; }
}

@media (max-width: 760px) {
    body { font-size: 16px; }
    .dateline .meta:last-child { display: none; }
    .menu-toggle { display: block; }
    .masthead .wrap { height: 60px; position: static; }
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 var(--pad) 16px;
        background: var(--paper);
        border-bottom: 1px solid var(--rule-strong);
    }
    .nav.is-open { display: flex; }
    .nav a {
        padding: 12px 0;
        border-top: 1px solid var(--rule);
        font-family: var(--serif);
        font-size: 1.9rem;
    }
    .nav a:first-child { border-top: 0; }
    .nav a::after { display: none; }

    .lede-text, .lede-list { grid-column: 1 / -1; }
    .section-head .meta, .section-head h2 { grid-column: 1 / -1; }
    .index-row { grid-template-columns: 1fr auto; gap: 6px 16px; padding: 20px 0 22px; }
    .index-row .num { grid-column: 1 / -1; }
    .index-row h3 { grid-column: 1; }
    .index-row .go { grid-column: 2; grid-row: 2; }
    .index-row p { grid-column: 1 / -1; }
    .services, .steps, .scores { grid-template-columns: 1fr; }
    .service, .service:nth-child(-n+3) { border-top: 1px solid var(--rule); padding-top: 20px; padding-bottom: 32px; }
    .service:first-child { border-top: 0; padding-top: 0; }
    .step, .step + .step, .score + .score { padding-left: 0; border-left: 0; }
    .step + .step, .score + .score { border-top: 1px solid var(--rule); }
    .step { padding-bottom: 24px; }
    .step .meta { margin-bottom: 12px; }
    .pull blockquote, .pull .meta { grid-column: 1 / -1; }
    .pull blockquote { text-indent: 0; }
    .skill-index { columns: 1; }
    .colophon .col, .colophon .col:first-of-type, .colophon .col.wide { grid-column: 1 / -1; }
    .peek { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    .js [data-reveal] { opacity: 1; transform: none; }
}

/* Chat widget in the site's own colours */
#cb-bubble, #cb-header, #cb-send, .cb-msg.user { background: #151412 !important; }
#cb-bubble { outline: 1px solid var(--rule-strong); }
#cb-bubble { box-shadow: 4px 4px 0 var(--red) !important; }
#cb-window { border-radius: 0 !important; border: 1px solid var(--rule-strong); }

/* ==========================================================================
   Finishing touches
   ========================================================================== */

/* Charcoal stock: a faint grain behind everything */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 0.97  0 0 0 0 0.92  0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* Type details */
h1, h2, h3, .service .n, .case-meta .no, .score strong, .lede-text p { font-variant-numeric: oldstyle-nums; font-kerning: normal; }
.score strong { font-variant-numeric: lining-nums; }
p, li { hanging-punctuation: first; text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

/* A hand-drawn stroke under the emphasised word */
.scribble { position: relative; white-space: nowrap; }
.scribble svg {
    position: absolute;
    left: -2%;
    bottom: 0.02em;
    width: 104%;
    height: 0.2em;
    overflow: visible;
}
.scribble path {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.1;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: scribble 1.1s 0.5s cubic-bezier(.6, .1, .3, 1) forwards;
}
@keyframes scribble { to { stroke-dashoffset: 0; } }

/* Ornament between movements of the page */
.ornament {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 auto var(--space);
    max-width: 280px;
    color: var(--red);
}
.ornament::before, .ornament::after { content: ''; flex: 1; border-top: 1px solid var(--rule-strong); }
.ornament svg { width: 22px; height: 22px; }

/* Reading progress, drawn by the scroll itself */
@supports (animation-timeline: scroll()) {
    .masthead::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: -1px;
        height: 2px;
        background: var(--red);
        transform-origin: 0 50%;
        transform: scaleX(0);
        animation: progress linear both;
        animation-timeline: scroll(root);
    }
    @keyframes progress { to { transform: scaleX(1); } }
}

/* Soft page turns between pages */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 0.25s ease both fade-out; }
::view-transition-new(root) { animation: 0.35s ease both fade-in; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .scribble path { animation: none; stroke-dashoffset: 0; }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Printed, it should look like the magazine it pretends to be */
@media print {
    .dateline, .nav, .nav-end, #cb-bubble, #cb-window, .peek { display: none !important; }
    .masthead { position: static; }
    .colophon { background: none; color: var(--ink); border-top: 1px solid var(--rule-strong); }
    .colophon .meta, .colophon .base { color: var(--ink-3); }
    .case, .service, .step, .figure { break-inside: avoid; }
    .js [data-reveal] { opacity: 1; transform: none; }
    a[href^="http"]::after, a[href^="mailto"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: var(--ink-3); }
}

/* --------------------------------------------------------------------------
   Studio journal
   -------------------------------------------------------------------------- */

.entries {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--rule-strong);
}
.entry { padding: 16px 24px 0 0; }
.entry + .entry { padding-left: 24px; border-left: 1px solid var(--rule); }
.entry h3 { margin: 22px 0 10px; font-size: 1.6rem; letter-spacing: -0.02em; }
.entry p { color: var(--ink-2); font-size: 0.97rem; }

@media (max-width: 1000px) {
    .entries { grid-template-columns: 1fr; }
    .entry, .entry + .entry { padding: 16px 0 24px; border-left: 0; }
    .entry + .entry { border-top: 1px solid var(--rule); }
}

/* --------------------------------------------------------------------------
   Agent desk — our own chatbot, set into the page like an interview
   -------------------------------------------------------------------------- */

.agent {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    align-items: start;
    padding-top: 16px;
    border-top: 1px solid var(--rule-strong);
}
.agent-intro { grid-column: 1 / span 4; }
.agent-intro .meta { display: block; margin-bottom: 20px; }
.agent-intro h2 {
    font-size: clamp(2.4rem, 4.6vw, 4.2rem);
    line-height: 0.98;
    letter-spacing: -0.035em;
}
.agent-intro h2 em { color: var(--red); }
.agent-intro p { margin-top: 20px; color: var(--ink-2); max-width: 38ch; }
.agent-intro .product {
    margin-top: 28px;
    padding-top: 12px;
    border-top: 1px solid var(--rule);
    font-size: 0.9rem;
}
.agent-intro .product a { font-weight: 600; }
.agent-intro .product a:hover { color: var(--red); }

.desk {
    grid-column: 5 / span 8;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--rule-strong);
    background: var(--paper);
    box-shadow: 10px 10px 0 var(--rule-strong);
}
.desk-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--rule-strong);
}
.desk-bar .live { display: inline-flex; align-items: center; gap: 8px; }
.desk-bar .live::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
    animation: live 2.4s ease-in-out infinite;
}
@keyframes live { 50% { opacity: 0.25; } }

.transcript {
    height: clamp(260px, 40vh, 440px);
    overflow-y: auto;
    padding: 22px clamp(18px, 3vw, 32px) 8px;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}
.turn { display: grid; grid-template-columns: 88px 1fr; gap: 14px; margin-bottom: 20px; }
.turn .who { padding-top: 6px; }
.turn .said { max-width: 60ch; }
.turn.agent-turn .said { font-family: var(--serif); font-size: 1.22rem; line-height: 1.45; }
.turn.user-turn .who { color: var(--red); }
.turn.user-turn .said { font-weight: 500; }
.turn .said p + p { margin-top: 0.6em; }
.turn .said ul { list-style: disc; padding-left: 1.2em; margin: 0.4em 0; }
.turn .said li + li { margin-top: 0.2em; }
.turn .said a { text-decoration: underline; text-underline-offset: 0.15em; }
.turn .said.error { font-family: var(--sans); font-size: 0.95rem; color: var(--red); }
.cursor-blink::after {
    content: '▍';
    margin-left: 2px;
    color: var(--red);
    animation: live 1s steps(1) infinite;
}

.starters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 clamp(18px, 3vw, 32px) 14px;
}
.starters button {
    padding: 7px 12px;
    border: 1px solid var(--rule-strong);
    font-size: 0.88rem;
    transition: background 0.2s, color 0.2s;
}
.starters button:hover { background: var(--ink); color: var(--paper); }
.starters[hidden] { display: none; }

.desk-input {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 12px clamp(18px, 3vw, 32px) 16px;
    border-top: 1px solid var(--rule-strong);
}
.desk-input textarea {
    flex: 1;
    min-height: 44px;
    max-height: 140px;
    padding: 10px 0;
    border: 0;
    background: transparent;
    font-family: var(--serif);
    font-size: 1.2rem;
    line-height: 1.35;
    color: var(--ink);
    resize: none;
}
.desk-input textarea:focus { outline: none; }
.desk-input:focus-within { box-shadow: inset 0 -2px 0 var(--red); }
.desk-input .submit-btn { padding: 12px 18px; flex-shrink: 0; }

.handoff {
    padding: 14px clamp(18px, 3vw, 32px) 16px;
    border-top: 1px dashed var(--ink-3);
    background: var(--paper-2);
}
.handoff[hidden] { display: none; }
.handoff p { font-size: 0.92rem; color: var(--ink-2); margin-bottom: 10px; }
.handoff form { display: flex; flex-wrap: wrap; gap: 10px; }
.handoff input {
    flex: 1 1 220px;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid var(--rule-strong);
    background: transparent;
    font: inherit;
    font-size: 1rem;
}
.handoff input:focus { outline: none; border-bottom: 2px solid var(--red); }
.handoff .submit-btn { padding: 11px 18px; }
.handoff .status { flex-basis: 100%; font-size: 0.9rem; }

.desk-fine { padding: 0 2px; margin-top: 12px; grid-column: 5 / span 8; font-size: 0.8rem; color: var(--ink-3); }

.also { margin-top: 48px; color: var(--ink-2); }
.also a { text-decoration: underline; text-underline-offset: 0.15em; }
.also a:hover { color: var(--red); }

/* The corner bubble is redundant where the agent lives in the page */
.has-agent #cb-bubble, .has-agent #cb-window { display: none !important; }

@media (max-width: 1000px) {
    .agent-intro, .desk, .desk-fine { grid-column: 1 / -1; }
    .desk { box-shadow: 6px 6px 0 var(--rule-strong); }
}
@media (max-width: 560px) {
    .turn { grid-template-columns: 1fr; gap: 2px; }
    .turn .who { padding-top: 0; }
}
.section-head + .contact-grid { border-top: 0; padding-top: 0; }
.note a { text-decoration: underline; text-underline-offset: 0.15em; }
.note a:hover { color: var(--red); }

/* --------------------------------------------------------------------------
   Websites showcase (verkkosivut.html)
   Photography-led cards; the colour inversion used for the SVG banners is not applied here.
   -------------------------------------------------------------------------- */

.peek img[src$=".jpg"], .peek img[src$=".webp"] { filter: none; }

.showcase {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 24px;
    align-items: center;
    padding: 32px 0 var(--space);
    border-top: 1px solid var(--rule-strong);
}
.showcase-media {
    grid-column: 1 / span 5;
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid var(--rule-strong);
    background: #0a0f14;
}
.showcase-media video, .showcase-media img { display: block; width: 100%; height: auto; transition: transform 0.9s cubic-bezier(.2,.7,.1,1); }
.showcase-media:hover video, .showcase-media:hover img { transform: scale(1.025); }
.showcase-badge {
    position: absolute; left: 16px; bottom: 16px;
    font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 8px 12px; background: var(--paper); color: var(--ink); border: 1px solid var(--rule-strong);
    transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.showcase-media:hover .showcase-badge { background: var(--red); border-color: var(--red); color: var(--paper); }

.showcase-body { grid-column: 7 / span 6; }
.showcase .no { display: block; font-family: var(--serif); font-size: 4.4rem; line-height: 1; color: var(--red); margin-bottom: 12px; }
.showcase .meta { display: block; margin-bottom: 10px; }
.showcase h2 { font-size: clamp(3rem, 7vw, 6.4rem); letter-spacing: -0.04em; line-height: 0.95; }
.showcase h2 em { color: var(--red); font-style: normal; }
.showcase .standfirst { margin: 16px 0 22px; font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.3; color: var(--ink-2); max-width: 30ch; }
.showcase-body > p { max-width: 52ch; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 32px; }
.tags li { font-family: var(--mono); font-size: 0.74rem; padding: 6px 11px; border: 1px solid var(--rule-strong); color: var(--ink-2); }
.showcase-links { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }
.btn-line {
    display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px;
    border: 1px solid var(--red); color: var(--ink); text-decoration: none; font-weight: 500;
    transition: background 0.25s, color 0.25s;
}
.btn-line:hover { background: var(--red); color: var(--paper); }
.btn-line .arr { transition: transform 0.25s; }
.btn-line:hover .arr { transform: translate(2px, -2px); }
.showcase .fine { margin-top: 26px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); }

.showcase--next { padding-top: 32px; }
.next-box { grid-column: 1 / -1; border: 1px dashed var(--rule-strong); padding: clamp(28px, 5vw, 64px); }
.next-box h2 { font-size: clamp(2rem, 4.4vw, 3.8rem); margin-bottom: 18px; max-width: 18ch; }
.next-box p { max-width: 56ch; color: var(--ink-2); margin-bottom: 22px; }

/* Home teaser */
.web-teaser { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 24px; align-items: center; }
.web-teaser .showcase-media { grid-column: 1 / span 5; }
.web-teaser .showcase-body { grid-column: 7 / span 6; }

@media (max-width: 1000px) {
    .showcase, .web-teaser { grid-template-columns: 1fr; gap: 32px; }
    .showcase-media, .showcase-body, .web-teaser .showcase-media, .web-teaser .showcase-body, .next-box { grid-column: 1 / -1; }
    .showcase-media { max-width: 520px; }
    .showcase .no { font-size: 3rem; }
}
