/* Same palette and type as the CV: teal accent, Familjen Grotesk for headings, IBM Plex Sans for text.
   Fonts are self-hosted, so the page makes no third-party requests. */
@font-face { font-family: "Familjen Grotesk"; font-weight: 600; font-display: swap; src: url(fonts/familjen-grotesk-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Familjen Grotesk"; font-weight: 700; font-display: swap; src: url(fonts/familjen-grotesk-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }

:root {
  --ink: #15202b;
  --muted: #5a6672;
  --rule: #d5dfdd;
  --accent: #0b6e64;
  --accent-soft: #e4f1ee;
  --hero: #f1f6f4;
  --bg: #ffffff;
  --display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* One language at a time; Swedish is the no-JS default. */
html[data-l="sv"] [lang="en"], html[data-l="en"] [lang="sv"] { display: none; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top { background: var(--hero); border-bottom: 1.5px solid var(--accent); padding: 20px 0 32px; }
.top .wrap { position: relative; }
.lang { display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 20px; }
.lang a { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-decoration: none; color: var(--muted); padding: 4px 9px; border-radius: 6px; }
html[data-l="sv"] .lang [data-set="sv"], html[data-l="en"] .lang [data-set="en"] { color: var(--accent); background: var(--accent-soft); }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 9vw, 52px); line-height: 1; letter-spacing: -0.025em; margin: 0; }
.role { font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--accent); margin: 10px 0 18px; line-height: 1.35; }
.intro { margin: 0 0 14px; max-width: 62ch; }
.mail { margin: 0; font-weight: 600; }

/* Projects */
.project { padding: 40px 0 8px; border-bottom: 1px solid var(--rule); }
.project:last-child { border-bottom: 0; }
h2 { font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.1; letter-spacing: -0.015em; margin: 0; }
.meta { color: var(--muted); font-size: 15px; margin: 4px 0 18px; }
figure { margin: 0 0 18px; }
figure img, .shot img { border-radius: 8px; border: 1px solid var(--rule); background: #f3f5f6; }
.shot { display: block; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.pair { display: grid; gap: 0 16px; }
@media (min-width: 600px) { .pair { grid-template-columns: 1fr 1fr; } }
.project > p { margin: 0 0 14px; max-width: 66ch; }

.stack { list-style: none; padding: 0; margin: 4px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.stack li { font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; }
.link { font-weight: 600; }

/* Ads per source: bar width on a square-root scale so the small sources stay visible next to Platsbanken. */
.sources { margin: 6px 0 18px; padding: 16px; background: var(--hero); border-radius: 8px; }
.sources-head { margin: 0 0 10px; font-size: 15px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.bars li { display: grid; grid-template-columns: 9.5em 1fr 4.2em; align-items: center; gap: 10px; font-size: 14px; }
.bars li::after { content: ""; grid-column: 2; grid-row: 1; height: 10px; border-radius: 3px; background: var(--accent); width: calc(sqrt(var(--n)) / sqrt(42049) * 100%); min-width: 2px; }
.bars li > span { grid-column: 1; }
.bars li > b { grid-column: 3; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.foot { padding: 28px 16px 48px; color: var(--muted); }

@media (max-width: 420px) {
  .bars li { grid-template-columns: 7.8em 1fr 3.8em; font-size: 13px; }
}

/* Phone screenshot beside its text on wider screens; stacked and centred on a phone. */
.split { display: grid; gap: 0 24px; }
.split > div > p { margin: 0 0 14px; max-width: 66ch; }
.phone { max-width: 260px; margin: 0 auto 18px; }
@media (min-width: 640px) { .split { grid-template-columns: 240px 1fr; align-items: start; } .phone { margin: 0; } }

/* A4 print (the PDF versions, built by build-pdf.mjs): text on the left, screenshots floated right,
   one project never split across pages. The URL and e-mail sit in the page footer the build script adds. */
@media print {
  @page { size: A4; margin: 12mm 13mm 15mm; }
  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 9.4pt; line-height: 1.45; }
  .wrap { max-width: none; padding: 0; }
  .lang { display: none; }
  .top { padding: 7mm 6mm 6mm; border-radius: 3mm; border-bottom-width: 1.2pt; }
  h1 { font-size: 26pt; }
  .role { font-size: 11pt; margin: 2mm 0 3mm; }
  .intro { margin: 0 0 2mm; max-width: none; }
  .mail { font-size: 9.4pt; }
  .project { padding: 5mm 0 2mm; display: flow-root; break-inside: avoid; }
  h2 { font-size: 16pt; }
  .meta { font-size: 9pt; margin: 0.5mm 0 3mm; }
  figure, .pair { float: right; clear: right; width: 74mm; margin: 0 0 3mm 6mm; }
  .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3mm; }
  .pair figure { float: none; width: auto; margin: 0; }
  figure img, .shot img { border-radius: 2mm; }
  figcaption { font-size: 7.6pt; margin-top: 1.2mm; line-height: 1.35; }
  #job-index figure img { max-height: 54mm; width: 100%; object-fit: cover; object-position: top; }
  .split { display: block; }
  .split .phone { float: right; clear: none; width: 26mm; margin: 0 0 3mm 4mm; }
  .split .phone figcaption { display: none; }
  .project > p, .split > div > p { margin: 0 0 2.4mm; max-width: none; }
  .stack { margin: 1.5mm 0 2mm; gap: 1.2mm; }
  .stack li { font-size: 7.4pt; padding: 0.4mm 2.2mm; }
  .sources { padding: 2.2mm 3.5mm; margin: 0.5mm 0 1.5mm; border-radius: 2mm; clear: both; }
  .sources-head { font-size: 8.2pt; margin-bottom: 1mm; }
  .bars { gap: 0.2mm 8mm; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(6, auto); grid-auto-flow: column; }
  .bars li { grid-template-columns: 22mm 1fr 12mm; font-size: 7.4pt; gap: 2.5mm; line-height: 1.35; }
  .bars li::after { height: 2.2mm; }
  .link { margin: 0 0 2mm; }
  .foot { display: none; }
  a { text-decoration: none; }
}
