/* Unslop direction: practical, dry, personable. Portrait, not decoration.
   Design pass informed by unslop by Damir Sokolovsky (@heydamir), CC BY 4.0:
   https://heydamir.design/unslop */
body { margin: 0; font: 17px/1.6 var(--sans); }
a { color: var(--acc); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration: none; }
main, footer { max-width: 1152px; margin: 0 auto; padding: 0 32px; }
section { margin: 112px 0; }
h1, h2, h3 { font-weight: 500; }
h2 { margin: 0 0 40px; font-size: 32px; line-height: 1.2; letter-spacing: -.02em; }
h3 { margin: 0 0 16px; font-size: 24px; line-height: 1.25; }
p { margin: 0; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon.fill { fill: currentColor; stroke: none; }

/* Hero: the existing portrait supplies the color; the name gets the space. */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: center;
  gap: 64px; margin: 64px 0 112px;
}
.avatar { grid-column: 2; grid-row: 1; display: block; width: 320px; height: 320px; }
.avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.intro { grid-column: 1; grid-row: 1; }
h1 { margin: 0 0 32px; font-size: clamp(48px, 6.4vw, 88px); line-height: 1; letter-spacing: -.045em; }
.lead { max-width: 32rem; font-size: 20px; line-height: 1.5; color: var(--dim); }
/* The place only shows in print, where a CV expects it. */
.where { display: none; }
.buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin: 32px 0 0; padding: 0; list-style: none; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px;
  color: var(--fg); background: var(--card); border: 0; border-radius: 8px;
  text-decoration: none; font-weight: 500;
}
.button.primary { color: var(--on-acc); background: var(--acc); }
.social { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; color: var(--dim); text-decoration: none; }
.social:hover { color: var(--fg); }

/* Two columns of work, without a box around every paragraph. */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 48px 64px; }
.card p { max-width: 34rem; }
.cards .card:first-child h3, .cards .card:nth-child(2) h3 { font-size: 36px; letter-spacing: -.02em; }
/* Tech lists are metadata, not buttons. */
.stack { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 4px; margin: 20px 0 0; padding: 0; list-style: none; }
.stack li { color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Experience reads as a chronological record at every width. */
.timeline { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.timeline .entry {
  display: grid; grid-template-columns: 136px 264px 1fr; column-gap: 32px;
  grid-template-areas: "when stop note" ". role note";
  align-items: start; padding: 24px;
}
.timeline .when { grid-area: when; color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; }
.timeline .stop { grid-area: stop; font-size: 20px; font-weight: 500; line-height: 1.4; }
.timeline .role { grid-area: role; color: var(--dim); font-size: 16px; }
.timeline .note { grid-area: note; color: var(--dim); font-size: 16px; }
.timeline .now .entry { padding: 24px; border-radius: 12px; background: var(--card); }
.timeline .now .when { color: var(--acc); }

/* Off the keyboard: short notes, with room for the dry humor. */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 48px; margin: 0; padding: 0; list-style: none; }
.tile h3 { font-size: 20px; margin-bottom: 8px; }
.tile p { font-size: 16px; color: var(--dim); }

/* The end: one offer, the mail address as a button.
   GitHub and LinkedIn stay at the top. */
footer { margin-bottom: 40px; }
.closing {
  display: flex; align-items: center; gap: 40px;
  margin-bottom: 32px;
  padding: 48px; border-radius: 16px; background: var(--card);
}
.closing .face { flex: none; width: 96px; height: 96px; border-radius: 50%; }
.closing h2 { margin-bottom: 16px; font-size: 48px; }
.closing .lead { font-size: 18px; }
.closing .cta { margin-top: 24px; }
footer .small { margin-top: 32px; color: var(--muted); font-size: 14px; line-height: 1.8; }
footer .small a { color: inherit; }
/* Back to top: only on phones, where the page is long. */
.top-link { display: none; margin-top: 24px; font-size: 16px; }
.top-link a { color: var(--dim); }

/* Keyboard focus: one green ring for everything you can tab to. */
a:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; border-radius: 4px; }
.button:hover { background: var(--ctl-hover); }
.button.primary:hover { background: color-mix(in srgb, var(--acc) 88%, var(--on-acc)); }
@media (prefers-reduced-motion: no-preference) {
  .button, .social, .lang a { transition: color 160ms var(--ease), background-color 160ms var(--ease); }
}

@media (max-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1fr) 240px; gap: 40px; }
  .avatar { width: 240px; height: 240px; }
  .cards { column-gap: 40px; }
  .timeline .entry { grid-template-columns: 120px 1fr; grid-template-areas: "when stop" ". role" ". note"; column-gap: 32px; }
  .timeline .note { margin-top: 12px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 40rem) {
  main, footer { padding: 0 20px; }
  section { margin: 80px 0; }
  h2 { font-size: 28px; margin-bottom: 32px; }
  .hero { grid-template-columns: 1fr; gap: 32px; margin: 32px 0 80px; }
  .avatar { grid-column: 1; grid-row: 1; width: 160px; height: 160px; }
  .intro { grid-column: 1; grid-row: 2; }
  h1 { font-size: clamp(40px, 10.5vw, 64px); letter-spacing: -.035em; margin-bottom: 24px; }
  .lead { font-size: 18px; }
  .buttons { gap: 20px; margin-top: 24px; }
  .cards { grid-template-columns: 1fr; gap: 40px; }
  .cards .card:first-child h3, .cards .card:nth-child(2) h3 { font-size: 32px; }
  .timeline { gap: 16px; }
  .timeline .entry { grid-template-columns: 1fr; grid-template-areas: "when" "stop" "role" "note"; padding: 16px; }
  .timeline .when { margin-bottom: 8px; }
  .timeline .now .entry { padding: 16px; }
  .tiles { grid-template-columns: 1fr; gap: 32px; }
  .closing { display: block; padding: 32px 24px; }
  .closing .face { width: 64px; height: 64px; margin-bottom: 24px; }
  .closing h2 { font-size: 36px; }
  .top-link { display: block; }
}

/* Text pages such as the privacy notice: one readable column. */
.prose { max-width: 768px; }
.prose .back { margin: 32px 0 24px; font-size: 16px; }
.prose .back a { color: var(--dim); text-decoration: none; }
.prose .back a:hover { color: var(--fg); }
.prose h1 { margin-bottom: 24px; font-size: 48px; }
.prose .lead { max-width: none; margin: 0 0 32px; font-size: 20px; }
.prose h2 { margin: 32px 0 8px; font-size: 20px; letter-spacing: 0; }
.prose .updated { margin-top: 40px; color: var(--muted); font-size: 14px; }
.prose + footer { max-width: 768px; }
/* Print: the page becomes a CV. "Print → Save as PDF" in the browser gives
   a clean, light document whatever the theme: no glows, shadows, effects or
   buttons, links printed with their addresses, nothing split across pages. */
@media print {
  :root, :root[data-theme] {
    color-scheme: light;
    --fg: #111; --dim: #555; --acc: #24603f; --on-acc: #fff; --rule: #bbb;
    --desk: #fff; --card: #fff; --card-edge: #ccc; --shadow: transparent;
  }
  @page { margin: 14mm 14mm 16mm; }
  html { background: #fff; }
  body { font-size: 10pt; line-height: 1.45; }
  body::before { display: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }

  /* Header, theme switch, phone-only links and the decorative bits go. */
  .top, .top-link, .closing .face, .closing .lead, .button.primary:not([data-mail-text]) { display: none; }
  main, footer { max-width: none; padding: 0; }
  section { margin: 1.4rem 0; }
  h2 { margin-bottom: .6rem; font-size: 13pt; }
  h3 { font-size: 10.5pt; }

  /* Hero: photo, name, one line, place; GitHub and LinkedIn with addresses. */
  .hero { margin-top: 0; }
  .where { display: block; margin-top: .2rem; color: var(--dim); font-size: 10pt; }
  .avatar { width: 5.5rem; height: 5.5rem; margin-bottom: .75rem; border-width: 2px; }
  h1 { font-size: 20pt; margin-bottom: .3rem; }
  .lead { font-size: 11pt; }
  .buttons { margin-top: .8rem; gap: .25rem 1.25rem; }
  .button { padding: 0; border: 0; background: none; color: var(--fg); font-weight: 500; }
  .button::before, .button::after { display: none; }
  .buttons a[href^="http"]::after { display: inline; content: " " attr(href); color: var(--dim); font-weight: 400; position: static; }

  /* Cards, tiles and timeline entries stay whole on a page. */
  .card, .tile, .timeline .entry { break-inside: avoid; border-color: #ccc; }
  .card, .tile { padding: .8rem 1rem; }
  .cards { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .tiles { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .stack li { padding: .05rem .5rem; background: none; font-size: 8pt; }
  a { color: var(--fg); }
  a::before, a::after { display: none; }

  /* Timeline: the same text sizes as the rest. */
  .timeline .entry { padding: .7rem 1rem; }
  .timeline .when { font-size: 8.5pt; margin-bottom: .15rem; }
  .timeline .stop { font-size: 10.5pt; }
  .timeline .role { font-size: 10pt; }
  .timeline .note { font-size: 9.5pt; }
  .timeline { --gap: .6rem; }

  /* The end: just the address. */
  .closing { display: block; padding: .8rem 1rem; text-align: left; break-inside: avoid; }
  .closing h2 { font-size: 11pt; }
  .closing .cta { margin-top: .3rem; }
  .closing .button { font-size: 10.5pt; color: var(--fg); background: none; }
  .closing .button .icon { display: none; }
  footer .small { margin-top: .8rem; text-align: left; }
}

@media print {
  .hero { display: block; text-align: center; margin-bottom: 1.4rem; }
  .avatar { margin: 0 auto .75rem; }
  .avatar img { border-radius: 50%; }
  .intro { display: block; }
  .lead { margin: 0 auto; color: var(--fg); }
  .buttons { justify-content: center; }
  .social { min-height: 0; color: var(--fg); font-size: 10pt; }
  .button { min-height: 0; }
  .cards .card:first-child h3, .cards .card:nth-child(2) h3 { font-size: 10.5pt; letter-spacing: 0; }
  .stack { margin-top: .5rem; gap: .2rem .5rem; }
  .stack li { padding: 0; border: 0; color: var(--dim); }
  .timeline { gap: .3rem; }
  .timeline .entry, .timeline .now .entry {
    display: grid; grid-template-columns: 80px 180px 1fr; grid-template-areas: "when stop note" ". role note";
    gap: 0 16px; padding: .5rem 0; background: none;
  }
  .timeline .when, .timeline .note { margin: 0; }
  .timeline .now .when { color: var(--dim); }
  .closing { border-radius: 0; }
  .closing h2 { font-size: 11pt; }
  .closing .lead { margin: 0; }
}
