:root {
    --sky: #DCEAFE;
    --paper: #FFFDF8;
    --ink: #172A45;
    --ink-soft: #50627E;
    --blue: #1E56D6;
    --blue-dark: #1846B0;
    --marker: #FFE27A;
    --rule: rgba(23, 42, 69, .18);
    --trouble: #C2412D;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 clamp(1.05rem, .95rem + .45vw, 1.3rem)/1.5 'Hanken Grotesk', sans-serif;
    letter-spacing: -0.012em;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); font-weight: 600; text-underline-offset: .16em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.button {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    border-radius: 3px;
    padding: .6em 1.1em;
    cursor: pointer;
}
.button:hover { background: var(--blue-dark); }
.button:disabled { opacity: .6; cursor: default; }

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px clamp(16px, 2.2vw, 28px);
    font-size: .82em;
}
.mark { display: inline-flex; align-items: center; gap: .5em; color: var(--ink); font-weight: 800; font-size: 1.25em; text-decoration: none; }
.mark svg { width: 1.3em; height: 1.3em; flex: none; }

.stage {
    background: var(--sky);
    margin: 0 clamp(0px, 2.2vw, 28px);
    padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 56px) clamp(64px, 9vw, 120px);
    overflow: hidden;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
    max-width: 1120px;
    margin: 0 auto;
}

.snapshot {
    margin: 0;
    background: var(--paper);
    padding: 14px 14px 10px;
    box-shadow: 0 1px 2px rgba(23, 42, 69, .16), 0 18px 40px -18px rgba(23, 42, 69, .4);
    transform: rotate(-2.2deg);
}
.snapshot img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.snapshot figcaption { font-family: 'Homemade Apple', cursive; font-size: .8em; padding: 12px 4px 4px; color: var(--ink); }

.links { list-style: none; margin: 0 0 1.4em; padding: 0; line-height: 1.75; }
.links span { color: var(--ink); }

.hero h1 {
    margin: 1.1em 0 .35em;
    font-size: clamp(1.9rem, 1.1rem + 2.9vw, 3.1rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.035em;
}
.hero .sub { margin: 0; font-size: 1.2em; line-height: 1.35; }

.sheets { position: relative; max-width: 720px; margin: clamp(48px, 8vw, 96px) auto 0; }
.sheets::before, .sheets::after {
    content: "";
    position: absolute; inset: 0 0 -40px;
    background: var(--paper);
    box-shadow: 0 1px 3px rgba(23, 42, 69, .14);
}
.sheets::before { transform: rotate(-1.4deg); }
.sheets::after { transform: rotate(1deg); }
.letter {
    position: relative; z-index: 1;
    background: var(--paper);
    padding: clamp(28px, 6vw, 72px) clamp(22px, 6vw, 72px) clamp(40px, 7vw, 88px);
    box-shadow: 0 1px 3px rgba(23, 42, 69, .18);
}
.letter p { margin: 0 0 1.15em; }
.letter mark { background: var(--marker); color: inherit; padding: .04em .12em; }
.signoff { display: flex; align-items: center; gap: 16px; margin-top: 2em; }
.signoff img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.signature { font-family: 'Homemade Apple', cursive; font-size: 1.35em; line-height: 1.2; }
.signoff small { display: block; color: var(--ink-soft); font-size: .8em; }

.block { max-width: 1120px; margin: 0 auto; padding: clamp(56px, 9vw, 112px) clamp(16px, 4vw, 56px) 0; scroll-margin-top: 8px; }
.block h2 { margin: 0 0 .9em; font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }

.reply {
    max-width: 720px;
    margin: clamp(96px, 13vw, 168px) auto 0;
    background: var(--paper);
    padding: clamp(28px, 6vw, 64px) clamp(22px, 6vw, 72px);
    box-shadow: 0 1px 3px rgba(23, 42, 69, .18), 0 14px 30px -18px rgba(23, 42, 69, .35);
    transform: rotate(.5deg);
    scroll-margin-top: 24px;
}
.reply h2 { margin: 0 0 .5em; font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.reply p { margin: 0; }
.contact > * { max-width: 34rem; }
.contact form { display: grid; gap: 14px; margin-top: 1.2em; }
.contact label { display: grid; gap: 6px; font-weight: 600; font-size: .9em; }
.contact input, .contact textarea, .contact select { font: inherit; color: var(--ink); padding: .6em .7em; border: 2px solid var(--ink); border-radius: 3px; background: var(--paper); width: 100%; }
.contact textarea { min-height: 7em; resize: vertical; }
.contact .button { justify-self: start; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-status { margin: 0; font-weight: 600; }
.form-status:empty { display: none; }
.form-status.error { color: #B42318; }

footer { max-width: 1120px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 56px) 32px; color: var(--ink-soft); font-size: .85em; }

@media (max-width: 760px) {
    .hero { grid-template-columns: 1fr; }
    .snapshot { max-width: 300px; }
    .pair { grid-template-columns: 1fr; }
}

/* Work: projects on sheets of paper. data-layout="desk" or "stack" on .work-list. */
.work-band { margin-top: clamp(96px, 13vw, 168px); scroll-margin-top: 24px; }
.work-band > header { max-width: 1120px; margin: 0 auto clamp(28px, 4vw, 48px); }
.work-band h2 { margin: 0 0 .3em; font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.work-band header p { margin: 0; max-width: 34em; }

.sheet {
    background: var(--paper);
    box-shadow: 0 1px 3px rgba(23, 42, 69, .18), 0 14px 30px -18px rgba(23, 42, 69, .35);
    padding: clamp(20px, 4vw, 40px);
}
.sheet .tag { display: inline-block; font-size: .72em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); margin-bottom: .6em; }
.sheet h3 { margin: 0 0 .25em; font-size: clamp(1.25rem, 1rem + 1vw, 1.7rem); font-weight: 800; line-height: 1.12; letter-spacing: -0.025em; }
.sheet .summary { margin: 0 0 1em; color: var(--ink-soft); }
/* Key number on a strip of tractor-feed greenbar printout: mono type, punched edges. */
.readout {
    position: relative;
    margin: 0 0 1.1em;
    padding: .65em 34px .7em;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0;
    background:
        radial-gradient(circle, var(--paper) 3px, rgba(23, 42, 69, .28) 3.6px, transparent 4.2px) left 7px top 4px / 12px 16px repeat-y,
        radial-gradient(circle, var(--paper) 3px, rgba(23, 42, 69, .28) 3.6px, transparent 4.2px) right 7px top 4px / 12px 16px repeat-y,
        repeating-linear-gradient(transparent 0 1.6em, rgba(52, 140, 88, .1) 1.6em 3.2em),
        #F9FBF4;
    box-shadow: 0 1px 2px rgba(23, 42, 69, .16);
    transform: rotate(.7deg);
}
.readout::before {
    content: "";
    position: absolute; inset: 0 26px;
    border: dashed rgba(23, 42, 69, .2);
    border-width: 0 1px;
}
.readout strong { display: block; font-size: 2em; font-weight: 600; line-height: 1.1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.readout span { display: block; margin-top: .3em; font-size: .7em; line-height: 1.4; color: var(--ink-soft); }
.sheet dl { margin: 0; }
.sheet dl div { padding: .6em 0; border-top: 1px solid var(--rule); }
.sheet dt { font-weight: 800; font-size: .85em; }
.sheet dd { margin: .1em 0 0; }

/* Illustration taped to the sheet: ink line drawing on graph paper, one marker-yellow highlight. */
.shot {
    position: relative;
    margin: 0 0 1.2em;
    aspect-ratio: 16 / 10;
    background-color: var(--paper);
    background-image: radial-gradient(rgba(23, 42, 69, .14) 1px, transparent 1.4px);
    background-size: 14px 14px;
    border: 1px solid rgba(23, 42, 69, .12);
    transform: rotate(-.6deg);
}
.shot::before, .shot::after {
    content: "";
    position: absolute; top: -10px;
    width: 72px; height: 22px;
    background: rgba(255, 228, 92, .55);
    box-shadow: 0 1px 1px rgba(23, 42, 69, .08);
}
.shot::before { left: 10%; transform: rotate(-4deg); z-index: 1; }
.shot::after { right: 10%; transform: rotate(5deg); z-index: 1; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot svg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.shot .thin { stroke-width: 1.4; opacity: .55; }
.shot .bold { stroke-width: 4; }
.shot .paper { fill: var(--paper); }
.shot .ink { fill: var(--ink); }
.shot .hl { fill: var(--marker); stroke: none; }
.shot .t { fill: var(--ink); stroke: none; font: 800 17px 'Hanken Grotesk', sans-serif; }
.shot .t.small { font-size: 12px; font-weight: 700; }
.shot .t.big { font-size: 26px; }
.shot .lbl { stroke: none; font: 13px 'Homemade Apple', cursive; }
.shot .bad { stroke: var(--trouble); }
.shot .badfill { fill: var(--trouble); stroke: none; }
.shot .badfill.soft { opacity: .22; }
.shot .badtext { fill: var(--trouble); }
.shot .oktext { fill: var(--blue); }
.shot .okline { stroke: var(--blue); }
.shot .okfill { fill: var(--blue); stroke: none; }
.shot .tick { stroke: #fff; stroke-width: 2.4; }
.shot .heavy { stroke-width: 2.8; }
.shot .dashed { stroke-dasharray: 4 3; }
.shot .dash { stroke-dasharray: 3 5; opacity: .35; }

/* Desk: every sheet laid out at once. Also the layout without JavaScript. */
.work-list[data-layout="desk"] {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 40px);
    max-width: 1120px; margin: 0 auto;
    align-items: start;
}
[data-layout="desk"] .sheet { padding: 18px 18px 22px; transition: transform .25s, box-shadow .25s; }
[data-layout="desk"] .sheet:nth-child(3n + 1) { transform: rotate(-1.6deg); }
[data-layout="desk"] .sheet:nth-child(3n + 2) { transform: rotate(1.1deg) translateY(14px); }
[data-layout="desk"] .sheet:nth-child(3n) { transform: rotate(-.5deg) translateY(-6px); }
[data-layout="desk"] .sheet:hover, [data-layout="desk"] .sheet:focus-within { transform: rotate(0) translateY(-4px); box-shadow: 0 1px 3px rgba(23, 42, 69, .18), 0 24px 40px -20px rgba(23, 42, 69, .45); }
[data-layout="desk"] .sheet h3 { font-size: 1.15em; }
[data-layout="desk"] .sheet .summary { font-size: .9em; margin-bottom: .8em; }
[data-layout="desk"].enhanced .sheet dl { display: none; }
.sheet .more { font: inherit; font-weight: 600; color: var(--blue); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .16em; }

.work-dialog { border: 0; padding: 0; background: none; max-width: min(640px, calc(100vw - 32px)); width: 100%; }
.work-dialog::backdrop { background: rgba(23, 42, 69, .45); }
.work-dialog .sheet { transform: rotate(-.8deg); max-height: calc(100vh - 64px); overflow: auto; }
.work-dialog .close { display: block; margin: 0 0 14px auto; font: inherit; font-size: .85em; font-weight: 600; color: var(--ink); background: none; border: 2px solid var(--ink); border-radius: 999px; padding: .2em .8em; cursor: pointer; }

/* Stack: one sheet on top of a pile, swiped or clicked through. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.2em; }
.chips button {
    font: inherit; font-size: .8em; font-weight: 600;
    color: var(--ink); background: var(--paper);
    border: 2px solid var(--ink); border-radius: 999px;
    padding: .3em .9em; cursor: pointer;
}
.chips button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.work-list[data-layout="stack"] { display: grid; max-width: 980px; margin: 0 auto; touch-action: pan-y; outline: none; }
[data-layout="stack"] .sheet {
    grid-area: 1 / 1;
    transition: transform .35s cubic-bezier(.2, .7, .2, 1), opacity .35s;
    user-select: none;
}
[data-layout="stack"] .sheet.is-top { cursor: grab; }
[data-layout="stack"] .sheet.dragging { transition: none; cursor: grabbing; }
.stack-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: clamp(28px, 4vw, 40px); }
.stack-controls button {
    width: 44px; height: 44px; border-radius: 50%;
    border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
    font: inherit; font-size: 1.1em; cursor: pointer;
}
.stack-controls button:hover { background: var(--ink); color: #fff; }
.stack-count { min-width: 4.5em; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.stack-hint { text-align: center; color: var(--ink-soft); font-size: .8em; margin: .6em 0 0; }

@media (min-width: 761px) {
    [data-layout="stack"] .sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(24px, 3vw, 40px); align-content: start; }
    [data-layout="stack"] .sheet .shot { grid-row: 1 / span 5; margin: 10px 0 0; }
}

@media (max-width: 760px) {
    /* On phones the desk becomes a row you swipe through. */
    .work-list[data-layout="desk"] {
        grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%;
        overflow-x: auto; scroll-snap-type: x mandatory;
        margin: 0 calc(-1 * clamp(16px, 4vw, 56px)); padding: 12px clamp(16px, 4vw, 56px) 28px;
        scrollbar-width: none;
    }
    [data-layout="desk"] .sheet { scroll-snap-align: center; }
    [data-layout="desk"] .sheet:nth-child(3n + 2) { transform: rotate(1.1deg); }
    [data-layout="desk"] .sheet:nth-child(3n) { transform: rotate(-.5deg); }
}

@media (prefers-reduced-motion: reduce) {
    [data-layout] .sheet { transition: none; }
}

/* Headlines and wordmark in Schibsted Grotesk; body stays Hanken Grotesk. */
.hero h1, .block h2, .reply h2, .work-band h2, .sheet h3, .mark { font-family: 'Schibsted Grotesk', sans-serif; }
.hero h1, .block h2, .reply h2, .work-band h2 { font-weight: 800; letter-spacing: -0.04em; }
