:root {
    --paper: #f4f7f9;
    --ink: #15233b;
    --muted: #55657a;
    --grid: #d3dce4;
    --series: #2b6f86;
    --redpen: #c42f2f;

    --font: "Schibsted Grotesk", system-ui, sans-serif;
    --measure: 64ch;
    --gutter: clamp(16px, 4vw, 48px);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

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

.wrap {
    width: 100%;
    max-width: 1080px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* Header */

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-block: 28px;
}

.wordmark {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.header-link {
    color: var(--muted);
    text-decoration: none;
}

.header-link:hover {
    color: var(--ink);
}

/* Hero */

.hero {
    padding-block: clamp(40px, 8vw, 96px) 40px;
}

.hero h1 {
    max-width: 14ch;
    margin: 0 0 28px;
    font-size: clamp(2.6rem, 7vw, 5.25rem);
    font-weight: 750;
    line-height: 1.02;
    letter-spacing: -0.035em;
}

.lede {
    max-width: var(--measure);
    margin: 0 0 32px;
    color: var(--muted);
    font-size: 1.1875rem;
}

.button {
    display: inline-block;
    padding: 14px 22px;
    border-radius: 6px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 600;
    text-decoration: none;
}

.button:hover {
    background: var(--series);
}

/* Chart */

.chart {
    margin-block: 24px 0;
}

.chart svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.chart .grid line {
    stroke: var(--grid);
    stroke-width: 1;
}

.chart .axis text {
    fill: var(--muted);
    font-family: var(--font);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.chart .gap {
    fill: var(--redpen);
    opacity: 0.07;
}

.chart .series {
    fill: none;
    stroke: var(--series);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}

.chart .note line {
    stroke: var(--redpen);
    stroke-width: 1.5;
}

.chart .note circle {
    fill: var(--paper);
    stroke: var(--redpen);
    stroke-width: 2;
}

.chart .note text {
    fill: var(--redpen);
    font-family: var(--font);
    font-size: 17px;
    font-style: italic;
    font-weight: 500;
}

.notes {
    display: none;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    color: var(--redpen);
    font-style: italic;
}

.chart figcaption {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.875rem;
}

/* The one orchestrated moment: the line draws, then the red-pen notes appear. */
@media (prefers-reduced-motion: no-preference) {
    .chart .series {
        stroke-dashoffset: 1;
        animation: draw 1.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
    }

    .chart .note {
        opacity: 0;
        animation: appear 0.4s ease-out 1.3s forwards;
    }

    .chart .note-late {
        animation-delay: 1.8s;
    }
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes appear {
    to {
        opacity: 1;
    }
}

/* Sections */

.services,
.process,
.contact {
    padding-block: clamp(64px, 10vw, 120px) 0;
}

h2 {
    margin: 0 0 32px;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

/* Services: term / description rows */

.services dl {
    margin: 0;
    border-top: 1px solid var(--grid);
}

.service {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 8px 48px;
    padding-block: 24px;
    border-bottom: 1px solid var(--grid);
}

.service dt {
    font-size: 1.1875rem;
    font-weight: 650;
}

.service dd {
    max-width: var(--measure);
    margin: 0;
    color: var(--muted);
}

/* Process: a real sequence, so it is numbered */

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps li {
    counter-increment: step;
    padding-top: 20px;
    border-top: 2px solid var(--ink);
}

.steps li::before {
    content: counter(step);
    display: block;
    margin-bottom: 8px;
    color: var(--series);
    font-size: 2.25rem;
    font-weight: 750;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.steps h3 {
    margin: 0 0 8px;
    font-size: 1.1875rem;
    font-weight: 650;
}

.steps p {
    margin: 0;
    color: var(--muted);
}

/* Contact */

.contact h2 + p {
    max-width: var(--measure);
    margin: -16px 0 24px;
    color: var(--muted);
}

.contact-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
    max-width: 760px;
}

.field-wide {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.field input,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #b7c3cf;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.field textarea {
    resize: vertical;
    min-height: 9rem;
}

.field input:focus-visible,
.field textarea:focus-visible,
.button:focus-visible {
    outline: 2px solid var(--series);
    outline-offset: 2px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
}

.form-actions .button {
    border: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.form-actions .button:disabled {
    opacity: 0.6;
    cursor: progress;
}

.form-status {
    margin: 0;
    color: var(--muted);
}

.form-status[data-state="ok"] {
    color: var(--series);
    font-weight: 600;
}

.form-status[data-state="error"] {
    color: var(--redpen);
}

.contact-alt {
    margin: 32px 0 0;
    color: var(--muted);
}

/* Footer */

.site-footer {
    padding-block: clamp(64px, 10vw, 120px) 40px;
    color: var(--muted);
    font-size: 0.875rem;
}

.site-footer p {
    margin: 0;
}

/* Small screens: the SVG annotations would be unreadably small, so show them as a list instead. */
@media (max-width: 640px) {
    .chart .note text,
    .chart .axis text {
        display: none;
    }

    .notes {
        display: block;
    }

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

    .steps {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .contact-form {
        grid-template-columns: minmax(0, 1fr);
    }
}
