@charset "UTF-8";
/* ==========================================================================
   Petr Kolařík · CV
   1. Fonts  2. Tokens  3. Base  4. Layout  5. Components
   6. Dark mode  7. Motion  8. Print
   @charset: the file holds non-ASCII characters (ř, ·, →), and the rule counts
   only at the very start of the file, so nothing may come before it.
   ========================================================================== */

/* 1. Fonts -----------------------------------------------------------------
   Inter for prose: one variable file per alphabet (weight and optical size
   axes); the browser downloads latin-ext only for letters such as ř, ě, š.
   Commit Mono for facts: one file holds Czech letters and the → arrow. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-opsz-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  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: "Inter";
  src: url("fonts/inter-latin-ext-opsz-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    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;
}

@font-face {
  font-family: "Commit Mono";
  src: url("fonts/commit-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* 2. Tokens ----------------------------------------------------------------
   Contrast on --paper (WCAG): ink 15.9, muted 5.7, accent 4.9. */

:root {
  color-scheme: light;
  --paper: #f8f6f1;        /* warm off-white page */
  --ink: #1d1b18;          /* warm near-black text */
  --ink-soft: #3b3732;     /* primary button on hover */
  --muted: #67615a;        /* secondary text, dates, stacks */
  --rule: #1d1b18;         /* the rule over each section, the stroke over each project */
  --line: #e3ded5;         /* hairlines between rows, the footer rule */
  --line-strong: #cdc6ba;  /* button borders, the tag */
  --accent: #b84716;       /* the orange of the PDF CV, a shade deeper */
  --accent-line: #d89e84;  /* link underline: the accent at 50 % */
  --selection: #ecdccd;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Commit Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-mono: 0.84375rem;  /* 13.5px: dates, places, stacks */
  --text-small: 0.9375rem;  /* 15px */
  --text-title: 1.0625rem;  /* 17px: entry titles */
  --text-role: 1.125rem;    /* 18px: the role line */
  --text-heading: 1.25rem;  /* 20px: section headings */

  --page-width: 48rem;      /* the whole column */
  --gutter: 1.25rem;        /* space at the screen edge on phones */
  --side: 10rem;            /* the date column on wider screens */
  --gap: 2rem;              /* between the date column and the text */
}

/* 3. Base ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
p, li { text-wrap: pretty; } /* avoids one-word last lines where supported */

/* Links: ink text with a tinted underline; the underline turns orange on hover.
   The orange stays rare: link hover, the focus ring, nothing else on the page. */
a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 0.22em;
}

a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--selection); color: var(--ink); }
.nowrap { white-space: nowrap; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 4. Layout ----------------------------------------------------------------
   One centred column. From 42rem up a side column holds the dates, the row
   labels and the intro's location, so every title and paragraph starts in
   the same second column. */

.page { width: min(var(--page-width), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { margin-top: 4.5rem; }

/* On phones an entry is a simple stack, with the date moved above the title */
.entry { display: flex; flex-direction: column; }

.entry + .entry {
  margin-top: 2.25rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line);
}

.entry-date { order: -1; margin-bottom: 0.375rem; }

/* Label and value rows (skills, languages): two columns even on phones */
.row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  column-gap: 1rem;
  align-items: baseline;
  padding-block: 0.75rem;
  border-top: 1px solid var(--line);
}

/* Phones only: a skills row puts its label above the value, so the long lists
   get the full width. The short language rows keep their two columns. */
@media (width < 42rem) {
  .skills .row { grid-template-columns: minmax(0, 1fr); }
}

/* Enlarged text on a phone (20rem is 320px at the default text size): the
   language rows stack too, so no word runs off the screen. */
@media (width < 20rem) {
  .row { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 42rem) {
  :root { --gutter: 2rem; }
  .section { margin-top: 6rem; }
  .entry + .entry { margin-top: 2.5rem; padding-top: 2.5rem; }

  /* The ledger: side column + text column, lined up on the first baseline */
  .intro, .entry, .row, .site-footer {
    display: grid;
    grid-template-columns: var(--side) minmax(0, 1fr);
    column-gap: var(--gap);
    align-items: baseline;
  }

  .entry > * { grid-column: 2; }
  .entry > .entry-date { grid-column: 1; grid-row: 1; margin-bottom: 0; }
}

/* 5. Components ------------------------------------------------------------ */

/* Skip link: off screen until it receives keyboard focus */
.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1;
  padding: 0.5rem 0.875rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

/* Top bar: language switch and theme button, both with 44px tap areas */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
}

.lang {
  display: flex;
  align-items: center;
  margin-left: -0.375rem; /* puts the text, not the tap area, on the edge */
  font-family: var(--mono);
  font-size: var(--text-mono);
  color: var(--muted);
}

.lang a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.375rem;
  color: var(--muted);
  text-decoration-line: none; /* not the shorthand, which would also reset
                                 the 1px tinted underline that "a" sets */
}

/* The current language: ink and underlined, so not marked by colour alone */
.lang a[aria-current="page"] { color: var(--ink); text-decoration-line: underline; }
.lang a:hover { color: var(--ink); }

.theme-toggle {
  display: none; /* shown by the "js" class: it needs JavaScript */
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.8125rem; /* lines the icon up with the right edge */
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.js .theme-toggle { display: inline-flex; }
.theme-toggle:hover { color: var(--ink); }

/* In the dark theme the icon is turned half a circle. The rules follow the
   theme itself, in the two cases of section 6, not aria-pressed: script.js
   sets that only once the page has been read, often after the first frame,
   so the icon would turn while the page loads. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle svg { transform: rotate(180deg); }
}
:root[data-theme="dark"] .theme-toggle svg { transform: rotate(180deg); }

/* Intro */
.intro { padding-top: 3.5rem; }
.intro-head { grid-column: 1 / -1; }

h1 {
  font-size: 2.25rem;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.role { margin-top: 0.75rem; font-size: var(--text-role); font-weight: 500; }
.location { margin-top: 0.25rem; }
.lead { font-size: 1.125rem; line-height: 1.55; letter-spacing: -0.006em; }
.lead-quiet { margin-top: 1rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }

/* The four buttons need about 29rem on one row, in either language. In a
   narrower box they wrap, and the last one (the PDF) fills the rest of its
   row, so it is never left half-empty on a row of its own. The box is
   .intro-body, measured as a container. */
.intro-body { margin-top: 2.25rem; container-type: inline-size; }

@container (width < 29rem) {
  .actions li:last-child { flex-grow: 1; }
  .actions li:last-child .button { width: 100%; justify-content: center; }
}

/* Buttons: the primary one is filled with ink, the others are outlined */
.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.125rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--ink);
  font-size: var(--text-small);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

.button:hover { border-color: var(--ink); }
.button-primary { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.button-primary:hover { border-color: var(--ink-soft); background: var(--ink-soft); }

@media (min-width: 42rem) {
  .intro { padding-top: 5.5rem; }
  h1 { font-size: 2.75rem; }
  .lead { font-size: 1.1875rem; }
  .location, .intro-body { margin-top: 2.75rem; }
  .intro-body { grid-column: 2; }
}

/* Section heading: a full rule, then the heading on the left edge */
h2 {
  margin-bottom: 2rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--rule);
  font-size: var(--text-heading);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* Entry: date, title, place, text */
h3 {
  font-size: var(--text-title);
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.006em;
  text-wrap: balance;
}

.title-sub { font-weight: 400; }
/* Facts are set in mono and muted */
.location, .entry-date, .place, .org, .address, .stack, .pipeline, .row dt {
  font-family: var(--mono);
  font-size: var(--text-mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.entry-current .entry-date { color: var(--ink); } /* "now": ink, not muted */
.place, .org { margin-top: 0.25rem; }
.entry-text { margin-top: 0.875rem; }
.entry-link { margin-top: 0.75rem; }

/* A title with a tag beside it (fgg): the tag is not part of the heading */
.entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; }

.tag {
  padding: 0.125rem 0.4375rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Projects under a job: each block opens with a short stroke and keeps the
   text axis of the entry */
.projects { display: grid; gap: 2rem; margin-top: 2rem; }

.project::before {
  content: "";
  display: block;
  width: 1.5rem;
  margin-bottom: 1rem;
  border-top: 1px solid var(--rule);
}

.project-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.75rem; }
h4 { font-size: 1rem; font-weight: 600; }
.project-head + p { margin-top: 0.25rem; }

/* What was delivered: short items after an en dash. The second content line
   hides the dash from screen readers, as for the separators below. */
.dash-list { margin-top: 0.75rem; }
.dash-list li { position: relative; padding-left: 1.25rem; }
.dash-list li + li { margin-top: 0.375rem; }

.dash-list li::before {
  content: "–";
  content: "–" / "";
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* Stack line and the fgg pipeline: each item is one unbreakable box, and
   "balance" evens out the lines when the list wraps. */
.stack, .pipeline { margin-top: 0.875rem; line-height: 1.75; text-wrap: balance; }
.pipeline { color: var(--ink); }
.stack li, .pipeline li { display: inline-block; }

/* The second content line hides the separator from screen readers */
.stack li:not(:last-child)::after {
  content: "·";
  content: "·" / "";
  margin-left: 0.5rem;
}

.pipeline li:not(:last-child)::after {
  content: "→";
  content: "→" / "";
  margin-left: 0.5rem;
  color: var(--muted);
}

/* Skills and languages: "Core" stands apart without lines */
.rows { border-bottom: 1px solid var(--line); }
.rows-core { border: 0; }
.rows-core .row { padding: 0; border: 0; }
.rows-core dd { font-size: var(--text-title); font-weight: 600; }
.caption { margin: 2.5rem 0 0.75rem; font-size: var(--text-small); color: var(--muted); }

/* Footer: a hairline above it, lighter than the rules that open sections */
.site-footer {
  margin-top: 6rem;
  padding: 1rem 0 4rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.875rem;
}

.footer-grid { display: flex; flex-wrap: wrap; gap: 0.75rem 3rem; grid-column: 2; }

.footer-list a {
  display: inline-block;
  padding-block: 0.3125rem;
  overflow-wrap: anywhere;
}

.footer-end {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 2rem;
  grid-column: 1 / -1;
  margin-top: 2.5rem;
  color: var(--muted);
}

/* The visits note (analytics.js): on phones a row of its own under "Back to
   top" and "HTML · CSS", from 42rem on the text column between them. Without
   the note, delete these two rules too: the footer goes back to the flex row. */
@media (width < 42rem) {
  .visits-note { order: 1; flex-basis: 100%; }
}

@media (min-width: 42rem) {
  .footer-end {
    display: grid;
    grid-template-columns: var(--side) minmax(0, 1fr) auto;
    justify-items: start; /* each item as wide as its text, as in the flex row */
  }
}

/* The 404 page (404.html): the English text, then the Czech under a section rule */
.not-found { padding-block: 5rem; }
.not-found-code { font-family: var(--mono); font-size: var(--text-mono); color: var(--muted); }
.not-found h1 { margin-top: 0.75rem; }
.not-found p:not(.not-found-code) { margin-top: 1rem; }
.not-found section { margin-top: 3.5rem; }
.not-found h2 { margin-bottom: 0; }

/* 6. Dark mode -------------------------------------------------------------
   Follows the system unless the theme button has set data-theme on <html>.
   The values appear twice: once for the system setting, once for the
   button. Change both blocks together (the theme icon's two rules in
   section 5 use the same two cases). Both are for screens only, so a
   printout keeps the black-on-white palette of section 8. Contrast on
   --paper: ink 14.7, muted 6.6, accent 7.2; the rule (5.1) is softer than
   the ink, so the section rules do not glare. */

@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #171513;
    --ink: #ebe6de;
    --ink-soft: #cdc6bb;
    --muted: #a39b90;
    --rule: #8f877c;
    --line: #2e2a26;
    --line-strong: #48423b;
    --accent: #e98a5d;
    --accent-line: #805038;
    --selection: #4a3427;
  }
}

@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #171513;
    --ink: #ebe6de;
    --ink-soft: #cdc6bb;
    --muted: #a39b90;
    --rule: #8f877c;
    --line: #2e2a26;
    --line-strong: #48423b;
    --accent: #e98a5d;
    --accent-line: #805038;
    --selection: #4a3427;
  }
}

/* 7. Motion ----------------------------------------------------------------
   Smooth scrolling, soft colour changes and the theme icon's half turn, only
   for people who have not asked their system for reduced motion. Nothing
   moves when the page loads: the theme is settled before the first frame
   (script.js applies a saved choice in the <head>), and the colours and the
   icon follow the theme itself (sections 5 and 6). */

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

  a, .button, .theme-toggle, .theme-toggle svg {
    transition: color 0.15s, background-color 0.15s, border-color 0.15s,
      text-decoration-color 0.15s, transform 0.3s ease;
  }
}

/* 8. Print -----------------------------------------------------------------
   Black on white, no controls; headings stay with what follows them. */

@media print {
  :root {
    --paper: #fff;
    --ink: #000;
    --muted: #444;
    --rule: #000;
    --line: #ccc;
    --line-strong: #999;
    --accent: #000;
    --accent-line: #999;
  }

  @page { margin: 14mm 12mm; }
  html { font-size: 10pt; }
  .skip-link, .topbar, .actions, .footer-end { display: none; }
  .intro, .section { padding-top: 0; margin-top: 2rem; }
  h2 { margin-bottom: 1.25rem; }
  .entry + .entry { margin-top: 1.25rem; padding-top: 1.25rem; }

  h2, h3, .caption, .project-head { break-after: avoid; }
  .entry-text, .project, .row, .dash-list li, .site-footer { break-inside: avoid; }

  .site-footer { margin-top: 2rem; padding-bottom: 0; }
}
