/* Enko Media Group: shared system, "The Founder's Update".
   Every page loads this. Page-specific layout lives in home.css (homepage)
   and pages.css (pricing, quote, case studies, legal). */

:root {
    color-scheme: light;
    --paper: #F6F6F3;
    --paper-deep: #ECECE6;
    --ink: #121418;
    --ink-soft: #3E434C;
    --rule: #D3D3CB;
    --sheet: #FFFFFF;
    --blue: #2340FF;
    --blue-deep: #1A30C9;
    --blue-ink: #0E1A8A;
    --on-blue: #FFFFFF;
    --on-blue-soft: #D3D9FF;
    --mark: #FFE14D;
    --blue-wash: #E3E7FF;
    --ink-faint: #6A6F78;
    --error: #B42318;

    --font-letter: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --font-meta: 'Martian Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    --gutter: clamp(16px, 4vw, 56px);
    --section: clamp(72px, 9vw, 136px);
    --col-gap: clamp(32px, 5vw, 96px);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    --lift: 0 0 0 1px var(--rule), 0 6px 16px -10px rgb(18 20 24 / 0.35);

    /* chatbot.css reads these */
    --color-primary: var(--blue);
    --color-light: var(--paper-deep);
    --color-dark: var(--ink);
    --border-radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    background: var(--paper);
    -webkit-text-size-adjust: 100%;
    scrollbar-color: var(--blue) var(--paper-deep);
}
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-letter);
    font-size: clamp(1.0625rem, 0.98rem + 0.3vw, 1.1875rem);
    line-height: 1.55;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
    caret-color: var(--blue);
}

::selection { background: var(--mark); color: var(--ink); }

img, svg { display: block; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure, blockquote, fieldset { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

a {
    color: var(--blue);
    text-decoration-line: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
}
a:hover { color: var(--blue-ink); text-decoration-thickness: 0.14em; }

:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
    border-radius: 2px;
}

.wrap {
    width: 100%;
    max-width: 1360px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.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;
}
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: lining-nums; }

.skip {
    position: absolute; left: var(--gutter); top: -100px; z-index: 2000;
    background: var(--mark); color: var(--ink); padding: 10px 16px; font-weight: 700;
    text-decoration: none; border-radius: 6px;
}
.skip:focus { top: 12px; }

/* ---------- Highlighter: the authored motion ---------- */

mark {
    color: inherit;
    background-color: transparent;
    background-image: linear-gradient(transparent 12%, var(--mark) 12%, var(--mark) 92%, transparent 92%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    padding-inline: 0.08em;
    margin-inline: -0.08em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
@media (prefers-reduced-motion: no-preference) {
    .js mark { transition: background-size 900ms var(--ease-out) 150ms; }
    .js mark:not(.is-marked) { background-size: 0% 100%; }
}

/* ---------- To-confirm placeholders: designed absence ---------- */

.tbc {
    color: var(--ink);
    background: var(--paper-deep);
    outline: 1.5px dashed var(--ink-soft);
    outline-offset: 1px;
    border-radius: 3px;
    padding-inline: 0.12em;
    font-style: normal;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
.tbc--block { display: inline-block; margin-top: 0.5em; padding: 0.15em 0.4em; }
.tbc--note { display: inline-block; padding: 0.1em 0.4em; font-size: 0.875rem; font-weight: 600; line-height: 1.45; }
.mast .tbc, .ask .tbc { color: var(--on-blue); background: rgb(255 255 255 / 0.14); outline-color: var(--on-blue-soft); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 56px;
    padding: 14px 20px 14px 22px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.0625rem;
    line-height: 1.2;
    letter-spacing: -0.005em;
    text-decoration: none;
    cursor: pointer;
    border: 0;
    transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.btn svg { transition: transform 300ms var(--ease-out); flex: none; }
.btn:hover svg { transform: translateX(4px); }

.btn--book {
    background: var(--blue);
    color: var(--on-blue);
    box-shadow: 0 1px 0 rgb(18 20 24 / 0.2), 0 10px 24px -12px rgb(35 64 255 / 0.7);
}
.btn--book:hover { background: var(--blue-deep); color: var(--on-blue); }
.btn--book:active { background: var(--blue-ink); }
.btn--book[aria-busy="true"] { cursor: progress; opacity: 0.85; }
.btn--book[aria-busy="true"] svg { animation: nudge 900ms ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(5px); } }

/* Buttons whose label is rewritten by page scripts (pricing.js, quote.js) carry
   their arrow as a mask, so textContent changes can't strip it. */
.btn--arrow::after {
    content: "";
    flex: none;
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h13M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h13M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 300ms var(--ease-out);
}
.btn--arrow:hover::after { transform: translateX(4px); }
.btn:disabled { cursor: progress; opacity: 0.7; }
.btn:disabled::after { animation: nudge 900ms ease-in-out infinite; }

/* Quiet button: secondary action on paper. */
.btn--plain {
    background: var(--sheet);
    color: var(--ink);
    box-shadow: inset 0 0 0 1.5px var(--ink);
}
.btn--plain:hover { background: var(--ink); color: var(--paper); }
.btn--plain:active { background: var(--blue-ink); }

.btn--onblue {
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 12px 28px -14px rgb(5 10 60 / 0.8);
}
.btn--onblue:hover { background: var(--mark); color: var(--ink); }
.btn--onblue:active { background: #F5D21F; }

/* ---------- Masthead: the envelope ---------- */

.mast {
    background: var(--blue);
    color: var(--on-blue);
    position: relative;
    z-index: 10;
}
.mast a { color: var(--on-blue); }
.mast :focus-visible { outline-color: var(--mark); }

.mast__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 64px;
    border-bottom: 1px solid rgb(255 255 255 / 0.22);
}

.wordmark {
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.mast__nav {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.4vw, 36px);
    font-size: 0.9375rem;
    font-weight: 500;
}
.mast__nav a { text-decoration: none; }
.mast__nav a:hover,
.mast__nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.3em; color: var(--on-blue); }
.mast__nav a[aria-current="page"] { text-decoration-thickness: 2px; font-weight: 700; }
.mast__nav .direct {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.12);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.3);
    font-weight: 600;
}
.mast__nav .direct:hover { background: var(--paper); color: var(--ink); text-decoration: none; }

.menu-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 8px;
    background: rgb(255 255 255 / 0.12);
    border: 0;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.3);
    color: var(--on-blue);
    font-weight: 600;
    cursor: pointer;
}

.envelope {
    display: grid;
    grid-template-columns: repeat(3, auto) 1fr;
    gap: 6px clamp(24px, 4vw, 64px);
    padding-block: clamp(18px, 2.4vw, 28px) clamp(22px, 3vw, 36px);
    font-size: 0.9375rem;
}
.envelope__row { display: flex; gap: 12px; align-items: baseline; min-width: 0; }
.envelope dt {
    font-family: var(--font-meta);
    font-size: 0.75rem;
    color: var(--on-blue-soft);
    flex: none;
}
.envelope dt::after { content: ":"; }
.envelope dd { font-weight: 500; }
.envelope__row--subject dd { font-weight: 700; }

/* ---------- The sheet ---------- */

.sheet { position: relative; }

/* Back to the inbox: "← All client stories" */
.back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    font-size: 0.9375rem;
    font-weight: 600;
}
.back svg { transition: transform 300ms var(--ease-out); }
.back:hover svg { transform: translateX(-4px); }

/* A page opening: the letter's first lines, smaller than the homepage salutation. */
.lead {
    padding-block: clamp(32px, 4vw, 56px) calc(var(--section) * 0.7);
}
.lead__title {
    font-size: clamp(2.35rem, 1.2rem + 3.6vw, 4.75rem);
    line-height: 1.02;
    font-weight: 650;
    letter-spacing: -0.035em;
    text-wrap: balance;
    max-width: 18ch;
}
.lead__lede {
    margin-top: clamp(20px, 2.6vw, 36px);
    font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.5rem);
    line-height: 1.45;
    color: var(--ink-soft);
    max-width: 46ch;
    text-wrap: pretty;
}
.tldr {
    margin-top: clamp(28px, 3.4vw, 48px);
    padding-top: 18px;
    border-top: 1px solid var(--rule);
    max-width: 62ch;
    color: var(--ink-soft);
    text-wrap: pretty;
}
.tldr strong {
    font-weight: 800;
    color: var(--ink);
    margin-right: 0.6em;
}

/* ---------- Letter sections ---------- */

.block {
    position: relative;
    padding-block: calc(var(--section) * 0.8);
}
.block::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--gutter);
    right: var(--gutter);
    height: 1px;
    background: var(--rule);
}
.block--tight { padding-block: calc(var(--section) * 0.55); }

.block__head { max-width: 46ch; }
.block__head h2, .ask__title {
    font-size: clamp(1.85rem, 1.1rem + 2.2vw, 3.25rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-wrap: balance;
}
.block__intro { margin-top: 14px; color: var(--ink-soft); text-wrap: pretty; }

.block--split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--col-gap);
    align-items: start;
}

/* Reading prose inside a block */
.prose { max-width: 64ch; text-wrap: pretty; }
.prose p + p { margin-top: 1em; }
.prose strong { font-weight: 700; }

/* Story entries (homepage Highlights, case-study index) */
.entries { margin-top: clamp(40px, 5vw, 72px); }
.entry {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr);
    gap: clamp(20px, 3vw, 48px);
    padding-block: clamp(32px, 4vw, 56px);
    border-top: 1px solid var(--rule);
}
.entry__who h2, .entry__who h3 {
    font-size: clamp(1.5rem, 1.1rem + 1.1vw, 2.125rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.025em;
}
.meta {
    margin-top: 8px;
    font-size: 0.9375rem;
    color: var(--ink-soft);
}

.entry__story { max-width: 62ch; }
.entry__story p {
    display: grid;
    grid-template-columns: 3.2em minmax(0, 1fr);
    text-wrap: pretty;
}
.entry__story p + p { margin-top: 0.75em; }
.entry__story b { font-weight: 800; color: var(--ink); }
.entry__story .more { margin-left: 3.2em; }
.more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    font-weight: 600;
    min-height: 44px;
}
.more svg { transition: transform 300ms var(--ease-out); }
.more:hover svg { transform: translateX(4px); }

/* Attachments: the proof */
.attachments {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 10px;
    align-content: start;
    align-items: start;
}
.attach {
    background: var(--sheet);
    border-radius: 8px;
    box-shadow: var(--lift);
    padding: 6px;
    min-width: 0;
}
.attach img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 4px;
    background: var(--sheet);
}
.attach:only-child { grid-column: 2; }
.attach--photo img { aspect-ratio: 4 / 3; object-fit: cover; }
.attach--tall img { aspect-ratio: 4 / 3; object-position: 50% 30%; }

/* Lowlights: honest statements */
.lowlights { display: grid; gap: 28px; padding-top: 8px; }
.lowlight {
    font-size: clamp(1.25rem, 1rem + 0.9vw, 1.75rem);
    line-height: 1.32;
    font-weight: 500;
    letter-spacing: -0.015em;
    max-width: 34ch;
    text-wrap: pretty;
}
.lowlight + .lowlight { padding-top: 28px; border-top: 1px solid var(--rule); }
.lowlight .tbc--block { font-size: 1rem; font-weight: 600; letter-spacing: 0; }

/* Steps: titled rows, no numbers */
.steps { display: grid; padding-top: 8px; }
.steps li {
    display: grid;
    grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
    gap: 24px;
    padding-block: 22px;
    border-top: 1px solid var(--rule);
}
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps h3 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; }
.steps p { color: var(--ink-soft); max-width: 50ch; text-wrap: pretty; }

/* ---------- The ask: drenched ---------- */

.ask {
    background: var(--blue);
    color: var(--on-blue);
    padding-block: var(--section);
}
.ask__inner {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--col-gap);
    align-items: end;
}
.ask__title {
    font-size: clamp(2.6rem, 1.2rem + 4.6vw, 6rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    max-width: 11ch;
}
.ask__title--long { font-size: clamp(2.35rem, 1.2rem + 3.6vw, 4.75rem); max-width: 14ch; line-height: 1.02; letter-spacing: -0.035em; }
.ask__title mark { color: var(--ink); }
.ask__body p { font-size: 1.1875rem; line-height: 1.5; max-width: 40ch; }
.ask__body .btn { margin-top: 28px; width: min(100%, 360px); }
.ask a:not(.btn) { color: var(--on-blue); }
.ask a:not(.btn):hover { color: var(--mark); }
.ask :focus-visible { outline-color: var(--mark); }
.ask__alts { margin-top: 28px; display: grid; gap: 8px; color: var(--on-blue-soft); font-size: 0.9375rem; }
.ask__alts a { font-weight: 600; }

/* ---------- Sign-off ---------- */

.close {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--col-gap);
    padding-block: clamp(56px, 7vw, 104px);
    align-items: end;
}
.close__valediction {
    font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}
.sig {
    display: grid;
    gap: 2px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    max-width: 22rem;
    color: var(--ink-soft);
    font-size: 0.9375rem;
}
.sig__name { color: var(--ink); font-weight: 700; font-size: 1.125rem; }
.sig .tbc { white-space: nowrap; }
.close__ps { max-width: 56ch; color: var(--ink-soft); text-wrap: pretty; }
.close__ps b { color: var(--ink); margin-right: 0.3em; }
.close__ps a { overflow-wrap: anywhere; }

/* ---------- Footer ---------- */

.foot { border-top: 1px solid var(--rule); background: var(--paper-deep); }
.foot__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 32px;
    padding-block: 28px;
    padding-right: calc(var(--gutter) + 72px);
    font-size: 0.875rem;
    color: var(--ink-soft);
}
.foot__name { font-weight: 700; color: var(--ink); }
.foot__name span { font-weight: 400; color: var(--ink-soft); margin-left: 0.6em; }
.foot__nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot__nav a { color: var(--ink-soft); text-decoration: none; padding-block: 6px; }
.foot__nav a:hover { color: var(--blue); text-decoration: underline; }
.foot__nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- Mobile reply bar ---------- */

.replybar { display: none; }

/* ---------- Chat (overrides chatbot.css) ---------- */

.chat-bubble {
    border: 0;
    width: 56px;
    height: 56px;
    background: var(--ink);
    color: var(--paper);
    box-shadow: 0 10px 24px -10px rgb(18 20 24 / 0.6);
    transition: transform 200ms var(--ease-out), background-color 200ms var(--ease-out);
}
.chat-bubble:hover { transform: translateY(-2px); background: var(--blue); }
.chat-window { font-size: 0.9375rem; right: 25px; }
.chat-header { background: var(--ink); }
.chat-header h3 { font-size: 1rem; font-weight: 700; }
.chat-header #closeChatBtn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 6px; }
.chat-header #closeChatBtn:focus-visible { outline-color: var(--mark); }
.chat-footer #chatInput { font-size: 1rem; border-color: var(--rule); }
.chat-footer #chatInput:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.chat-footer button { min-height: 44px; }
.chat-message.user { background: var(--blue-wash); }
.chat-message.typing { color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
    .entry { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
    .entry__who { grid-column: 1 / -1; }
    .envelope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .envelope__row--subject { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
    .menu-toggle { display: inline-flex; }
    .mast__bar { flex-wrap: wrap; min-height: 60px; padding-block: 8px; }
    .mast__nav {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-bottom: 12px;
    }
    .mast__nav.is-open { display: flex; }
    .mast__nav a { padding: 12px 0; border-top: 1px solid rgb(255 255 255 / 0.18); font-size: 1.0625rem; }
    .mast__nav .direct { margin-top: 10px; justify-content: center; border-top: 0; padding: 12px 14px; }
    html:not(.js) .mast__nav { display: flex; }
    html:not(.js) .menu-toggle { display: none; }

    .envelope { grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: 0.875rem; }
    .envelope__row--date { display: none; }

    .lead__title { max-width: none; }

    .block--split, .ask__inner, .close { grid-template-columns: minmax(0, 1fr); }
    .entry { grid-template-columns: minmax(0, 1fr); }
    .entry__story p { grid-template-columns: 3em minmax(0, 1fr); }
    .entry__story .more { margin-left: 3em; }
    .attachments { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); max-width: 420px; }
    .steps li { grid-template-columns: minmax(0, 1fr); gap: 6px; }

    .replybar {
        display: flex;
        gap: 8px;
        position: fixed;
        inset: auto 0 0 0;
        z-index: 900;
        padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
        background: rgb(246 246 243 / 0.94);
        -webkit-backdrop-filter: saturate(1.4) blur(10px);
        backdrop-filter: saturate(1.4) blur(10px);
        box-shadow: 0 -1px 0 var(--rule);
        transform: translateY(110%);
        transition: transform 350ms var(--ease-out);
    }
    .replybar.is-shown { transform: none; }
    .replybar .btn { flex: 1; min-width: 0; min-height: 52px; justify-content: center; padding-inline: 12px; font-size: 1rem; white-space: nowrap; }
    .replybar__chat {
        flex: none; display: inline-grid; place-items: center;
        width: 52px; min-height: 52px; border-radius: 8px; border: 0;
        background: var(--ink); color: var(--paper); cursor: pointer;
    }
    .replybar__text {
        display: inline-flex; align-items: center; justify-content: center;
        min-height: 52px; padding: 0 14px; border-radius: 8px; white-space: nowrap;
        font-weight: 700; text-decoration: none;
        box-shadow: inset 0 0 0 1.5px var(--blue);
    }
    body.has-replybar .chat-bubble { display: none; }
    body.has-replybar .chat-window { bottom: calc(146px + env(safe-area-inset-bottom)); }
    .chat-window { right: 16px; left: 16px; width: auto; max-width: none; }
    .foot__inner { padding-bottom: 96px; padding-right: var(--gutter); }
}
