/* consulting.dzema.name — plain HTML + CSS, system fonts only. */

:root {
  --bg: #fff;
  --fg: #111;
  --muted: #595959;
  --rule: #d6d6d6;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L", P052, Charter, Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  --gap: 24px;
  --space: 40px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --fg: #ececec;
    --muted: #a6a6a6;
    --rule: #383838;
  }
}

/* Apple-style breakpoints: 1 column → 2 columns at 735px → 3 columns at 1069px. */
@media (min-width: 735px) {
  :root { --gutter: 32px; --gap: 32px; --space: 44px; }
}

@media (min-width: 1069px) {
  :root { --gutter: 48px; --gap: 40px; --space: 40px; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.55 var(--serif);
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 1069px) {
  body { font-size: 18px; }
}

::selection { background: var(--fg); color: var(--bg); }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: 2px; }

a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

p, li { text-wrap: pretty; }

h1, h2, h3 { text-wrap: balance; }

.wrap {
  max-width: calc(1200px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
  font-family: var(--sans);
  font-size: 0.875rem;
}

.brand { margin: 0; }

.brand a {
  font-weight: 600;
  text-decoration: none;
}

.brand span {
  color: var(--muted);
  margin-left: 0.4em;
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.masthead nav a { text-decoration: none; }

.masthead nav a:hover { text-decoration: underline; }

/* Asymmetric split: a narrow side rail and a wide main column. */

.split {
  display: grid;
  gap: 12px var(--gap);
}

@media (min-width: 735px) {
  .split { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .split > .side { grid-column: 1 / span 3; }
  .split > .main { grid-column: 4 / -1; }
}

/* Type */

h1 {
  margin: 0;
  max-width: 21em;
  font-size: clamp(2rem, 1.3rem + 2.2vw, 2.875rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
}

h2 {
  margin: 0;
  padding-top: 0.45em;
  font: 600 0.75rem/1.4 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h3 {
  margin: 0 0 6px;
  padding-left: 2.2em;
  text-indent: -2.2em;
  font: 600 1rem/1.3 var(--sans);
}

.lede {
  margin: 0;
  max-width: 36em;
  font-size: 1.25rem;
  line-height: 1.4;
}

@media (min-width: 1069px) {
  .lede { font-size: 1.3rem; }
}

.num {
  display: inline-block;
  min-width: 2.2em;
  text-indent: 0;
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* Hero */

.hero { padding: calc(var(--space) * 0.5) 0 0; }

.hero .split { margin-top: 24px; }

.facts {
  order: 2;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.7;
}

@media (min-width: 735px) {
  .facts { order: 0; padding-top: 0.35em; }
}

.cta {
  margin: 16px 0 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
}

.cta a::after { content: " →"; }

/* Sections */

.section {
  margin-top: var(--space);
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 16px;
}

.grid {
  display: grid;
  gap: 24px var(--gap);
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 735px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1069px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.grid li {
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.grid p { margin: 0; }

@media (min-width: 1069px) {
  .grid p { font-size: 0.9444em; }
}

/* About */

.portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  aspect-ratio: 4 / 5;
  margin: 16px 0 0;
  border: 1px solid var(--rule);
  color: var(--muted);
  font: 0.6875rem var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}

.portrait:has(img) { border: 0; }

/* Experience: company and role on the left, what it brings on the right.
   On desktop the 9 columns line up with the page grid. */

.cv {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cv li {
  display: grid;
  gap: 4px var(--gap);
}

@media (min-width: 1069px) {
  .cv li { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .cv .who { grid-column: 1 / span 3; }
  .cv .what { grid-column: 4 / -1; }
}

.cv h3 {
  margin: 0;
  padding-left: 0;
  text-indent: 0;
}

.cv .who p {
  margin: 0;
  color: var(--muted);
  font: 0.8125rem/1.45 var(--sans);
}

.cv .what p {
  max-width: 38em;
  margin: 0;
}

@media (min-width: 1069px) {
  .cv .what p { font-size: 0.9444em; }
}

.cv .what .brings {
  max-width: none;
  margin-top: 4px;
  font: 0.8125rem/1.5 var(--sans);
}

.brings span { color: var(--muted); }

/* Contact */

.email {
  margin: 0 0 8px;
  font-size: clamp(1.625rem, 1.1rem + 1.8vw, 2.25rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

#contact p:last-child { max-width: 38em; margin: 0; }

/* Footer */

.legal {
  margin-top: var(--space);
  padding-bottom: 24px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.75rem;
  line-height: 1.6;
}

.legal::before {
  content: "";
  display: block;
  margin-bottom: 16px;
  border-top: 1px solid var(--rule);
}

.legal p { margin: 0; }

@media print {
  .masthead nav { display: none; }
  a { text-decoration: none; }
}
