/* tuukka.pomeranssi.fi — "Modernist" tokens from the Claude Design export,
   page styles below. Flat, zero radius, 2px rules, Archivo throughout. */

/* ── Fonts ─────────────────────────────────────────────────────────────── */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Tokens ────────────────────────────────────────────────────────────── */
:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  --color-accent: #d02a10;        /* 4.67:1 against --color-bg, AA for normal text */
  --color-divider: color-mix(in srgb, #201e1d 40%, transparent);
  --color-rule: color-mix(in srgb, #201e1d 16%, transparent);
  --color-chip: color-mix(in srgb, #201e1d 8%, #f3f2f2);

  --color-neutral-100: #f8f4f4;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;

  --color-accent-600: #b8230c;
  --color-accent-700: #ae1800;

  --font-heading: "Archivo", system-ui, sans-serif;
  --font-heading-weight: 800;
  --font-body: "Archivo", system-ui, sans-serif;

  --gutter: 24px;
  --content-width: 1056px; /* inner width; padding sits outside it */
  --col-left: 200px;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 26px;
  text-wrap: pretty;
}
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
}
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: var(--color-accent-700); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--color-accent); }
img { display: block; max-width: 100%; height: auto; }
address { font-style: normal; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

.grayscale { filter: grayscale(1) contrast(1.08); }
.print-only { display: none; }

/* Shared text roles */
.period {
  font-size: 13px;
  line-height: 20px;
  letter-spacing: 0.04em;
  font-feature-settings: "tnum" 1;
  color: var(--color-neutral-700);
}
.note { font-size: 14px; line-height: 22px; color: var(--color-neutral-700); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 14px;
  line-height: 18px;
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 14px;
}
.btn-print { min-width: 132px; justify-content: center; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-inverse {
  color: var(--color-bg);
  border-color: var(--color-bg);
  font-size: 15px;
}
.btn-inverse:hover { color: var(--color-bg); background: color-mix(in srgb, var(--color-bg) 14%, transparent); }

/* ── Skip link ─────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 8px 14px;
  background: var(--color-text);
  color: var(--color-bg);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
}
.skip-link:focus { top: 8px; }

/* ── Header / nav ──────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-divider);
}
.nav {
  box-sizing: content-box;
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px 16px;
  padding: 12px var(--gutter);
}
@media (max-width: 640px) {
  .site-header { position: static; }
}
.nav-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-right: auto; }
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--color-accent); }

.lang-switch { display: inline-flex; border: 1px solid var(--color-text); }
.lang-switch li + li { border-left: 1px solid var(--color-text); }
.lang-switch a {
  display: block;
  width: 42px;
  padding: 8px 0;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 13px;
  line-height: 18px;
}
.lang-switch a:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: inherit; }
.lang-switch a[aria-current="page"] { background: var(--color-accent); color: var(--color-bg); }

/* ── Layout ────────────────────────────────────────────────────────────── */
main { box-sizing: content-box; max-width: var(--content-width); margin: 0 auto; padding: 0 var(--gutter); }

.cv-section {
  padding: 52px 0 60px;
  border-top: 2px solid var(--color-divider);
  scroll-margin-top: 72px;
}
.section-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  line-height: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-700);
  margin-bottom: 26px;
}

.section-intro { max-width: 64ch; margin: -8px 0 30px; }

/* Two-column row: period left, content right */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 48px;
  padding: 20px 0;
  border-top: 1px solid var(--color-rule);
}
.row > .period { flex: 0 0 var(--col-left); line-height: 24px; }
.row-body { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-body h3 { font-size: 18px; line-height: 24px; letter-spacing: -0.01em; }
.row-body p { font-size: 15px; line-height: 24px; }
.row-body .note { font-size: 14px; line-height: 22px; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 52px 48px;
  align-items: flex-start;
  padding: 88px 0 78px;
}
.hero-text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 34px; }
.hero-name {
  font-weight: 600;
  font-size: 22px;
  line-height: 28px;
  letter-spacing: 0;
  margin-bottom: -14px;
}
.display {
  font-size: clamp(28px, 8vw, 70px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-left: -0.058em;
}
.display span { display: block; }
.lede { font-size: 17px; line-height: 28px; max-width: 58ch; }
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 600px; /* three chips on the first line, the rest wrap */
  font-size: 14px;
  line-height: 20px;
  font-feature-settings: "tnum" 1;
}
.contact a, .contact span:not(.print-only) {
  display: inline-flex;
  padding: 6px 12px;
  background: var(--color-chip);
  color: var(--color-text);
  text-decoration: none;
}
.contact a:hover { background: var(--color-accent); color: var(--color-bg); }
.portrait {
  flex: 0 1 260px;
  width: 260px;
  max-width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* ── How I work ────────────────────────────────────────────────────────── */
.approach { border-top: 0; padding-top: 0; }
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 34px 40px;
}
.principles > li {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--color-rule);
  padding-top: 14px;
}
.principles h3 { font-size: 18px; line-height: 24px; letter-spacing: -0.01em; }
.principles p { font-size: 15px; line-height: 24px; max-width: 44ch; }

/* ── Work ──────────────────────────────────────────────────────────────── */
#work { border-top: 0; padding-bottom: 26px; }
.role {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 48px;
  padding: 34px 0 40px;
  border-top: 2px solid var(--color-divider);
}
.role-head { flex: 0 0 var(--col-left); display: flex; flex-direction: column; gap: 4px; }
.org {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  line-height: 22px;
  letter-spacing: 0;
}
.role-body { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.role-body > h3 { font-size: 26px; line-height: 30px; }
.intro { max-width: 64ch; }

.project {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 32px;
  padding: 20px 0 22px;
  border-top: 1px solid var(--color-rule);
}
.project > .period { flex: 0 0 96px; line-height: 24px; letter-spacing: 0; }
.project-body { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.project-body h4 { font-size: 18px; line-height: 24px; letter-spacing: -0.01em; }
.project-body p { max-width: 64ch; font-size: 15.5px; line-height: 25px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  background: var(--color-chip);
  color: var(--color-text);
}

.earlier {
  flex: 1 1 480px;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 22px 40px;
}
.earlier li { display: flex; flex-direction: column; gap: 2px; }
.earlier .period { letter-spacing: 0; }
.earlier h4 { font-weight: 600; font-size: 15px; line-height: 22px; letter-spacing: 0; }
.earlier p:last-child { font-size: 14px; line-height: 22px; color: var(--color-neutral-800); }

/* ── Skills ────────────────────────────────────────────────────────────── */
#skills .section-label { margin-bottom: 34px; }
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 34px 40px;
}
.skill-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--color-rule);
  padding-top: 14px;
}
.skill-group h3 { font-size: 16px; line-height: 22px; }
.skill-group ul { display: flex; flex-direction: column; gap: 2px; font-size: 15px; line-height: 24px; }
.skill-group li { display: flex; gap: 10px; align-items: baseline; }
.skill-group li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--color-accent);
  position: relative;
  top: -1px;
}
.skill-group .note { max-width: 34ch; }

/* ── Own projects ──────────────────────────────────────────────────────── */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 34px 40px;
}
.projects > li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--color-rule);
  padding-top: 14px;
}
.projects h3 { font-size: 18px; line-height: 24px; letter-spacing: -0.01em; }
.projects h3 a { color: var(--color-text); text-decoration: none; }
.projects h3 a:hover { color: var(--color-accent); }
.projects > li > p { font-size: 15px; line-height: 24px; }
.projects .tags { margin-top: 2px; }

/* ── Publications ──────────────────────────────────────────────────────── */
#publications { padding-bottom: 78px; }
#publications .row { gap: 4px 48px; padding: 18px 0; }
.pub-title { font-weight: 600; font-size: 16px; line-height: 24px; letter-spacing: 0; }
.pub-title a { color: var(--color-text); text-decoration: none; }
.pub-title a:hover { color: var(--color-accent); }
#publications .row-body p { font-size: 14px; line-height: 22px; }

/* ── Call to action + footer ───────────────────────────────────────────── */
.cta { background: var(--color-accent); color: var(--color-bg); }
.cta-inner {
  box-sizing: content-box;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 78px var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 30px;
}
.cta h2 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.06; margin-left: -0.058em; }

.site-footer {
  box-sizing: content-box;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px var(--gutter);
  font-size: 13px;
  line-height: 20px;
  color: var(--color-neutral-700);
}

/* ── Print ─────────────────────────────────────────────────────────────
   A different document from the web page: the timeline and the facts,
   compact, two-ish A4 pages. The web-only pitch, chips and links go. */
@media print {
  @page { size: A4; margin: 14mm 16mm; }
  body { background: #fff; font-size: 11.5px; line-height: 16px; }
  .skip-link, .site-header, .cta, .approach, .section-intro, .tags,
  .pub-authors, .pub-doi, .site-footer { display: none !important; }
  a { color: inherit; text-decoration: none; }
  main { max-width: none; padding: 0; }
  .period { font-size: 10px; line-height: 15px; letter-spacing: 0.02em; }
  .note { font-size: 10.5px; line-height: 15px; }

  .hero { padding: 0 0 14px; gap: 12px 24px; }
  .hero-text { gap: 10px; }
  .hero-name { font-size: 14px; line-height: 18px; margin-bottom: 0; }
  .display { font-size: 24px; line-height: 26px; margin-left: 0; }
  .lede { font-size: 11.5px; line-height: 16px; max-width: none; }
  .contact { gap: 2px 14px; max-width: none; font-size: 10px; }
  .contact a, .contact span:not(.print-only) { padding: 0; background: none; }
  .contact .print-only { display: inline; color: var(--color-neutral-700); }
  /* Sized so the bottom lands on the contact line; tune the width if the
     intro text changes length (height = width * 5/4). */
  .portrait { flex-basis: 112px; width: 112px; }

  /* Rule below each section instead of above the next: a bottom border only
     draws where the box ends, so a page never opens with a stray line. */
  .cv-section { padding: 10px 0 14px; border-top: 0; border-bottom: 1px solid var(--color-divider); }
  #publications { border-bottom: 0; }
  .section-label { margin-bottom: 10px; break-after: avoid; }
  /* Chrome ignores break-after on its own; keep the small sections whole so
     a label never ends a page by itself. */
  #projects, #education { break-inside: avoid; }
  .print-only { display: block; font-size: 10.5px; line-height: 15px; margin: -4px 0 8px; }
  #skills .section-label { margin-bottom: 10px; }

  /* Roles: period and company on one line above the title, no side column. */
  .role { flex-direction: column; gap: 3px; padding: 10px 0 6px; border-top: 1px solid var(--color-rule); }
  .role-head { flex: none; flex-direction: row; align-items: baseline; gap: 8px; break-after: avoid; }
  .role-head .org { font-size: 11px; line-height: 14px; }
  .role-body { flex: none; gap: 6px; }
  .role-body > h3 { font-size: 13px; line-height: 16px; break-after: avoid; }
  .intro { max-width: none; }
  .project { padding: 6px 0; gap: 0 10px; border-top: 0; break-inside: avoid; }
  .project > .period { flex: 0 0 64px; line-height: 16px; }
  .project-body { flex-basis: 0; gap: 3px; }
  .project-body h4 { font-size: 12px; line-height: 16px; }
  .project-body p { font-size: 11.5px; line-height: 16px; max-width: none; }
  .earlier { flex: none; grid-template-columns: repeat(3, 1fr); gap: 8px 14px; }
  .earlier li { break-inside: avoid; }
  .earlier h4, .earlier p:last-child { font-size: 10.5px; line-height: 15px; }

  .row { padding: 5px 0; gap: 0 12px; border-top: 0; break-inside: avoid; }
  .row > .period { flex-basis: 48px; line-height: 15px; }
  .row-body { flex-basis: 0; gap: 1px; }
  .row-body h3, .row-body .pub-title { font-size: 12px; line-height: 16px; }
  .row-body p, .row-body .note, #publications .row-body p { font-size: 10.5px; line-height: 15px; }
  #publications .row { padding: 5px 0; gap: 0 12px; }

  .skills { grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
  .skill-group { gap: 4px; padding-top: 0; border-top: 0; break-inside: avoid; }
  .skill-group h3 { font-size: 11.5px; line-height: 15px; }
  .skill-group ul { gap: 0; font-size: 10.5px; line-height: 15px; }
  .skill-group li { gap: 6px; }
  .skill-group li::before { content: "–"; width: auto; height: auto; background: none; top: 0; }
  .skill-group .note { max-width: none; }

  .projects { grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
  .projects > li { gap: 2px; padding-top: 0; border-top: 0; break-inside: avoid; }
  .projects h3 { font-size: 11.5px; line-height: 15px; }
  .projects > li > p { font-size: 10.5px; line-height: 15px; }

}
