/* ==========================================================================
   marcinwadas.com

   One typeface (Geist / Geist Mono), one type size, no accent colour.
   Hierarchy comes from weight, space and rules — nothing else.
   A single column: a narrow gutter for dates and labels, prose to its right.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --bg:      #ffffff;
  --fg:      #111111;
  --fg-2:    #565656;
  --fg-3:    #767676;
  --line:    #e8e8e8;
  --line-2:  #cfcfcf;
  --surface: #f7f7f7;

  --font:      "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 50rem;   /* masthead, main and footer all share this width */
  --aside:   6rem;    /* the dates / labels gutter */
  --gap:     1.75rem;
  --pad:     1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #0b0b0b;
    --fg:      #ededed;
    --fg-2:    #a2a2a2;
    --fg-3:    #7d7d7d;
    --line:    #212121;
    --line-2:  #363636;
    --surface: #151515;
  }
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* one size, everywhere — hierarchy is weight and space only */
h1, h2, h3, h4, h5, h6,
p, li, dt, dd, figcaption, blockquote, small, time, th, td,
button, input, textarea, select, code, pre, samp, kbd {
  font-size: 1rem;
}
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.4; letter-spacing: -0.006em; }

img { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--line-2);
  transition: text-decoration-color .15s ease, color .15s ease;
}
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--fg); color: var(--bg); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 20;
  background: var(--fg); color: var(--bg);
  padding: .55rem 1rem; text-decoration: none;
}
.skip-link:focus { left: 0; }

.mono { font-family: var(--font-mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-3); }

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--pad);
}
main { flex: 1 0 auto; }

/* ---------- masthead — same width as the content ---------- */
.masthead {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 3.5rem;
  flex-wrap: wrap;
}
.wordmark { font-weight: 600; text-decoration: none; margin-right: auto; }

.nav { display: flex; align-items: center; gap: clamp(.7rem, 2.1vw, 1.2rem); }
.nav a { color: var(--fg-2); text-decoration: none; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { color: var(--fg); font-weight: 500; }

/* contact stays visible in the pinned bar, as an action rather than a link */
.nav a.nav__contact {
  color: var(--fg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: .05rem .7rem;
}
.nav a.nav__contact:hover { border-color: var(--fg); }

/* ---------- page head ---------- */
.page-head { padding-block: clamp(2.25rem, 6vw, 3.5rem) .25rem; }
.page-head h1 { max-width: 38rem; }
.page-head .lead { color: var(--fg-2); margin-top: .8rem; max-width: 40rem; }
.page-head .lead + .lead { margin-top: .6rem; }
.page-head + .rows { margin-top: 1.75rem; }

/* ---------- sections ---------- */
.section { padding-top: 2.5rem; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding-bottom: .7rem;
}
.section__note { color: var(--fg-3); }
.more { color: var(--fg-3); text-decoration: none; white-space: nowrap; }
.more::after { content: " \2192"; }
.more:hover { color: var(--fg); }

/* ---------- the row primitive: label gutter + body ---------- */
.rows { border-top: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: var(--aside) 1fr;
  gap: 0 var(--gap);
  padding-block: 1.15rem;
}
.rows > * + * { border-top: 1px solid var(--line); }
.rows--open { border-top: 0; }

.row__aside {
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.row__body > * + * { margin-top: .65rem; }
.row__body p, .row__body dd { color: var(--fg-2); }
.row__title, .row__body p.row__title { font-weight: 600; color: var(--fg); }
.row__where, .row__body p.row__where { color: var(--fg-2); }

/* clickable rows */
a.row { text-decoration: none; color: inherit; }
a.row .row__title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--line-2);
  transition: text-decoration-color .15s ease;
}
a.row:hover .row__title { text-decoration-color: currentColor; }

/* bullets inside a row */
.row__body ul { list-style: none; padding-left: 1rem; }
.row__body ul li { color: var(--fg-2); margin-top: .4rem; position: relative; }
.row__body ul li::before {
  content: ""; position: absolute; left: -1rem; top: .68em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--line-2);
}
.row__body b, .row__body strong { color: var(--fg); font-weight: 500; }

/* ---------- prose ---------- */
.prose { padding-bottom: 1rem; }
.prose > * + * { margin-top: 1rem; }
.prose p, .prose li { color: var(--fg-2); }
.prose h2 { margin-top: 2.25rem; }
.prose h3 { margin-top: 1.75rem; }
.prose strong, .prose b { color: var(--fg); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.15rem; }
.prose li { margin-top: .4rem; }
.prose li::marker { color: var(--fg-3); }
.prose blockquote { border-left: 1px solid var(--line-2); padding-left: 1.1rem; color: var(--fg-2); }
.prose code { font-family: var(--font-mono); background: var(--surface); padding: .05em .35em; border-radius: 4px; }
.prose pre {
  font-family: var(--font-mono);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 1rem 1.1rem; overflow-x: auto;
}
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.25rem; }

/* ---------- figures & photos ---------- */
figure { margin: 0; }
.figure { margin-block: 1.75rem; }
.figure img { border: 1px solid var(--line); border-radius: 8px; }
.figure figcaption { color: var(--fg-3); margin-top: .6rem; }
.figure--portrait img { max-width: 21rem; }

/* let a figure or a gallery span the gutter as well as the body */
.row > .figure, .row > .gallery { grid-column: 1 / -1; }

.gallery {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .85rem;
}
.shot img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border: 1px solid var(--line); border-radius: 8px;
}
.shot figcaption { color: var(--fg-3); margin-top: .5rem; }

/* a picture that hasn't been taken yet — swap the .ph div for an <img> */
.ph {
  display: grid; place-items: center;
  border: 1px dashed var(--line-2); border-radius: 8px;
  background: var(--surface); color: var(--fg-3);
  font-family: var(--font-mono); letter-spacing: -0.02em;
  text-align: center; padding: 1rem;
}
.ph--portrait { aspect-ratio: 3 / 4; }
.ph--wide { aspect-ratio: 16 / 9; }

/* ---------- back link ---------- */
.backlink { display: inline-block; margin-top: 2.75rem; color: var(--fg-3); text-decoration: none; }
.backlink::before { content: "\2190\00a0"; }
.backlink:hover { color: var(--fg); }

/* ---------- footer — same width as the content ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3.5rem;
  padding-block: 1.75rem;
  flex-shrink: 0;
}
.site-footer__inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  color: var(--fg-3);
}
.site-footer__contact { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.site-footer a { color: var(--fg-2); text-decoration: none; }
.site-footer a:hover { color: var(--fg); text-decoration: underline; }
.site-footer .dot { color: var(--line-2); }

/* ---------- responsive ---------- */
@media (max-width: 40rem) {
  .row { grid-template-columns: 1fr; gap: .3rem; }
  .row__aside { order: -1; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .figure--portrait img { max-width: 100%; }
}

@media (max-width: 34rem) {
  .masthead__inner { min-height: auto; padding-block: .7rem; gap: .55rem; }
  .wordmark { margin-right: 0; width: 100%; }
  .nav { width: 100%; flex-wrap: wrap; gap: .85rem; }
  .nav a.nav__contact { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- print ---------- */
@media print {
  :root { --bg: #fff; --fg: #000; --fg-2: #222; --fg-3: #555; --line: #ccc; --line-2: #999; --surface: #fff; }
  .masthead, .site-footer, .skip-link, .backlink, .more, .gallery { display: none !important; }
  body { font-size: 10.5pt; }
  .wrap { max-width: 100%; padding: 0; }
  a { text-decoration: none; }
  .section, .row { break-inside: avoid; }
}
