@charset "UTF-8";
/* ==========================================================================
   Krzysztof Piotrowski: CV website
   Design: "Editorial", minimalism, earth tones, olive accent (Phase 2).
   Order: fonts → colour tokens → base → layout → sections → components.
   ========================================================================== */


/* ---------- 1. Fonts: self-hosted (nothing is loaded from Google: GDPR) ----------
   Each family is split into two files: "latin" (basic letters) and "latin-ext"
   (Polish ł, ó, ę…). unicode-range tells the browser which file holds which
   characters, so it only downloads what the page actually uses.            */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap;
  src: url(../fonts/inter-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap;
  src: url(../fonts/inter-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap;
  src: url(../fonts/inter-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap;
  src: url(../fonts/inter-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF; }

@font-face { font-family: "Source Serif"; font-weight: 400; font-display: swap;
  src: url(../fonts/source-serif-4-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: "Source Serif"; font-weight: 400; font-display: swap;
  src: url(../fonts/source-serif-4-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Source Serif"; font-weight: 600; font-display: swap;
  src: url(../fonts/source-serif-4-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: "Source Serif"; font-weight: 600; font-display: swap;
  src: url(../fonts/source-serif-4-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF; }


@font-face { font-family: "Source Serif"; font-weight: 400; font-style: italic; font-display: swap;
  src: url(../fonts/source-serif-4-latin-400-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: "Source Serif"; font-weight: 400; font-style: italic; font-display: swap;
  src: url(../fonts/source-serif-4-latin-ext-400-italic.woff2) format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF; }


/* ---------- 2. Colour tokens (CSS variables) ----------
   Every colour lives here once. The rest of the file only says var(--text) etc.,
   so dark mode is just "swap the values".
   Contrast on the background (WCAG AA needs 4.5:1 for text):
     text 13.3:1 · muted 5.0:1 · accent 5.5:1                                   */

:root {
  --bg:     #F5F1EA;   /* sand */
  --text:   #2B2622;   /* brown-charcoal */
  --muted:  #6F665B;   /* stone: dates, captions */
  --line:   #D9D0C3;   /* hairline dividers (decoration, not text) */
  --accent: #5C6446;   /* olive: links, job title, button */

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Source Serif", Georgia, "Times New Roman", serif;

  --measure: 760px;    /* max width of the text column */
  --gutter: 16px;      /* side padding on phones */

  color-scheme: light dark;   /* also gives native scrollbars/forms a dark look */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #1F1B17;   /* espresso */
    --text:   #EDE6DA;   /* warm cream   13.8:1 */
    --muted:  #A39888;   /*               6.0:1 */
    --line:   #3A332C;
    --accent: #9AA07F;   /* sage          6.3:1 */
  }
}


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

*, *::before, *::after { box-sizing: border-box; }   /* width includes padding + border */

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-body);   /* 1rem = the user's browser setting, usually 16px */
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.25;
}

p { margin: 0; }
p + p { margin-top: 1em; }

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

/* Visible keyboard focus. :focus-visible only shows it for keyboard users, not mouse clicks. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

ul { margin: .5rem 0 0; padding-left: 1.1rem; }
li { margin: .3rem 0; }
li::marker { color: var(--muted); }


/* ---------- 4. Layout: one centred column ----------
   header, main and footer share the same width and side padding.
   min() keeps the column at 760px on desktop and full width on phones.     */

body > header,
body > main,
body > footer {
  width: min(100%, var(--measure));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

body > header { padding-top: clamp(16px, 4vw, 40px); }
body > footer { padding-bottom: 48px; }


/* ---------- 5. Hero ---------- */

/* Language switcher (EN · PL · DE), top right of the header */
.lang {
  display: flex;
  justify-content: flex-end;
  gap: .9rem;
  margin-bottom: clamp(16px, 5vw, 48px);
  font-size: .85rem;
  letter-spacing: .06em;
}
.lang a { color: var(--muted); text-decoration: none; }
.lang a:hover { color: var(--text); text-decoration: underline; }
.lang a[aria-current="page"] {          /* the language you are reading now */
  color: var(--accent);
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2.2rem, 7vw, 3.2rem);   /* fluid: grows with screen width, within limits */
  letter-spacing: -.01em;
}

.role  { margin-top: .4rem; font-size: 1.15rem; color: var(--accent); }
.meta  { margin-top: .3rem; color: var(--muted); }
.pitch { margin-top: 1.4rem; max-width: 60ch; }   /* ch = width of "0": ~60 characters per line reads best */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1.6rem;
}

.btn {
  display: inline-block;
  padding: .55rem 1.1rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font: inherit;
  font-size: .95rem;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--bg); }
.btn:hover   { text-decoration: underline; }



/* ---------- 5b. AI portrait (a wink, not the centre of the page) ----------
   Phones: small photo + caption in a row above the name.
   Wider screens: the hero becomes a 2-column grid, photo on the right.       */

.portrait {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 1.4rem;
}
.portrait img {
  width: 88px;
  height: 88px;
  border-radius: 50%;          /* round crop of a square image */
  flex: none;                  /* never squeeze the photo */
}
.portrait figcaption {
  max-width: 16rem;
  font-family: var(--font-head);
  font-style: italic;
  font-size: .9rem;
  line-height: 1.4;
  color: var(--muted);
}
.portrait figcaption span {
  font-family: var(--font-body);
  font-style: normal;
  font-size: .75rem;
  letter-spacing: .04em;
}

@media (min-width: 640px) {
  .hero {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 2.5rem;
  }
  .hero > * { grid-column: 1; }          /* everything in the text column… */
  .hero > .lang { grid-column: 1 / -1; } /* …except the switcher (full width, on top) */
  .portrait {                             /* …and the photo */
    grid-column: 2;
    grid-row: 2 / span 4;
    flex-direction: column;
    align-items: center;
    margin: .4rem 0 0;
    text-align: center;
  }
  .portrait img { width: 112px; height: 112px; }
  .portrait figcaption { max-width: 9.5rem; }
}


/* ---------- 6. Sections ---------- */

main section {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);   /* thin divider instead of boxes */
}

h2 {
  margin-bottom: 1.4rem;
  font-size: 1.5rem;
}

h3 { font-size: 1.1rem; }

/* Two small sections side by side on wide screens, stacked on phones.
   auto-fit + minmax: "as many 240px+ columns as fit". No media query needed. */
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  column-gap: 3rem;
}


/* ---------- 7. Experience ---------- */

.job + .job { margin-top: 2.2rem; }

.where   { margin-top: .15rem; font-size: .92rem; color: var(--muted); }
.steps   { margin-top: .1rem;  font-size: .92rem; color: var(--muted); }
.project { margin-top: .5rem;  font-size: .95rem; }


/* ---------- 8. Certifications ----------
   Guidewire rules: badge ≥ 94 px wide, ratio locked, max 4 per row,
   nothing on or next to the badge, caption below.                          */

.cert-group + .cert-group { margin-top: 2rem; }
.cert-group h3 { margin-bottom: 1rem; font-size: 1rem; }
.cert-group.minor h3 { font-weight: 400; color: var(--muted); }   /* lowest value: quieter heading */

.badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, 150px);   /* 4 × 150 + gaps fits 760px: never more than 4 */
  gap: 28px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.badge { margin: 0; text-align: center; }

.badge img {
  display: block;
  width: 94px;        /* official minimum display size */
  height: auto;       /* keeps the aspect ratio locked */
  margin: 0 auto;
}

.badge p {
  margin-top: .7rem;
  font-size: .82rem;
  line-height: 1.4;
}

.releases { color: var(--muted); }

.note {
  margin-top: 2rem;
  max-width: 62ch;
  font-size: .9rem;
  color: var(--muted);
}


/* ---------- 9. Description lists (skills, languages, education) ---------- */

dl { margin: 0; }
dt { font-weight: 600; }
dd { margin: .1rem 0 0; color: var(--muted); }
dd + dt { margin-top: .9rem; }

/* Skills: label on the left, details on the right, on wide screens */
@media (min-width: 640px) {
  .skills {
    display: grid;
    grid-template-columns: 13rem 1fr;
    gap: .9rem 1.5rem;
  }
  .skills dd, .skills dd + dt { margin: 0; }
}


/* ---------- 10. Footer ---------- */

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
}
footer p + p { margin-top: .3rem; }


/* ---------- 11. Print: "Save as PDF" gives the downloadable CV ----------
   Same HTML, different rules: A4, light colours whatever the screen theme,
   smaller type, no buttons, and no job split across two pages.           */

@media print {
  @page { size: A4; margin: 14mm 16mm; }

  :root {                                   /* always light on paper, even if the screen is dark */
    --bg: #FFFFFF;
    --text: #1A1714;
    --muted: #555049;
    --line: #CFC6B8;
    --accent: #4A5238;
    color-scheme: light;
  }

  html { font-size: 9.5pt; }               /* rem now means 9.5pt, so every rem-based size shrinks with it */
  body { line-height: 1.45; }

  body > header,
  body > main,
  body > footer { width: auto; padding: 0; }   /* the page margins do the job */

  body > header { padding-top: 0; }
  .hero h1 { font-size: 24pt; }
  .role    { font-size: 12pt; }
  .pitch   { margin-top: .6rem; max-width: none; }

  /* Buttons make no sense on paper: hide the print button, turn LinkedIn into plain text + URL */
  #print-btn, .portrait, .lang { display: none; }   /* the joke doesn't work on paper */
  .hero { display: block; }
  .actions { margin-top: .5rem; }
  .btn, .btn.primary { padding: 0; border: 0; background: none; color: var(--text); font-size: inherit; }
  .btn[href*="linkedin.com"]::after { content: ": linkedin.com/in/krzysztof-piotrowski-22235b139"; color: var(--muted); }

  main section { margin-top: 1.1rem; padding-top: .6rem; }
  h2 { margin-bottom: .5rem; font-size: 13pt; }
  h3 { font-size: 10.5pt; }
  ul { margin-top: .2rem; }
  li { margin: .1rem 0; }
  .job + .job { margin-top: .8rem; }

  /* Keep things together where a split would look broken */
  /* A long job may continue on the next page, but its title + dates stay with the first bullet */
  li, .cert-group, .badge, .cols > section, .skills dt, .skills dd { break-inside: avoid; }
  h2, h3, .where, .steps, .project { break-after: avoid; }

  .cert-group + .cert-group { margin-top: .8rem; }
  .cert-group h3 { margin-bottom: .4rem; }
  .badges { gap: 10px 24px; }              /* badges stay 94px: never smaller (Guidewire rule) */
  .badge p { margin-top: .3rem; font-size: 8pt; }
  .note { margin-top: .8rem; font-size: 8.5pt; }

  footer { margin-top: 1.2rem; padding-top: .5rem; font-size: 7.5pt; }

  a { color: inherit; text-decoration: none; }   /* links stay clickable in the PDF, but look like text */
}
