/* Literata, SIL Open Font License 1.1 (TypeTogether, via Fontsource). Self-hosted: no third-party requests. */
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-latin-var.woff2") format("woff2-variations"), url("fonts/literata-latin-var.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}

/* Palette: cool clinical white, deep teal ink. One accent, used for the path. */
:root {
  --paper: #f3f5f4;
  --paper-deep: #e4ebe9;
  --ink: #15202b;
  --ink-soft: #46535e;
  --line: #d2dbd8;
  --accent: #0e5a5e;
  --accent-deep: #0a4043;
  --serif: "Literata", "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-optical-sizing: auto;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.contact :focus-visible { outline-color: #fff; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 20;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 780px; }
.center { text-align: center; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(243, 245, 244, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.header-row { display: flex; justify-content: space-between; align-items: center; height: 68px; }
.name { font-family: var(--serif); font-size: 21px; color: var(--ink); text-decoration: none; padding: 10px 0; }
.header-link {
  font-size: 15px; color: var(--ink); padding: 12px 0;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px;
  transition: color 0.15s ease-out;
}
.header-link:hover { color: var(--accent); }

/* A hairline under the header appears only once the page scrolls */
.site-header { border-bottom: 1px solid transparent; }
@supports (animation-timeline: scroll()) {
  .site-header { animation: header-line linear both; animation-timeline: scroll(); animation-range: 0 80px; }
  @keyframes header-line { to { border-bottom-color: var(--line); } }
}

/* Hero */
.hero { padding: 72px 0 104px; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 72px; align-items: center;
}
h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(36px, 4.4vw, 58px); line-height: 1.08;
  letter-spacing: -0.02em; margin: 0 0 32px; max-width: 18ch;
  text-wrap: balance;
}
.lead { text-wrap: pretty; font-size: 20px; line-height: 1.55; color: var(--ink-soft); max-width: 34em; margin: 0 0 40px; }

.portrait { margin: 0; }
.portrait img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%;
  border-radius: 6px;
  outline: 1px solid rgba(0, 0, 0, 0.1); outline-offset: -1px;
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cta-row.center { justify-content: center; }
.btn {
  display: inline-block; padding: 14px 26px; border-radius: 999px;
  font-size: 16px; font-weight: 600; text-decoration: none; line-height: 1.2;
  transition-property: background-color, color, border-color, transform;
  transition-duration: 0.15s;
  transition-timing-function: ease-out;
}
.btn:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) { .btn:active { transform: none; } }
.btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-quiet { color: var(--ink); border: 1px solid #bcc7c3; }
.btn-quiet:hover { border-color: var(--ink); }
.btn-light { background: #fff; color: var(--accent-deep); border-color: #fff; }
.btn-light:hover { background: var(--paper); color: var(--accent-deep); border-color: var(--paper); }
.btn-outline-light { color: #fff; border: 1px solid rgba(255, 255, 255, 0.55); }
.btn-outline-light:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }

/* Sections */
.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section.tinted { background: var(--paper-deep); border-top: none; }
.section-label {
  font-family: var(--sans); font-size: 16px; font-weight: 600;
  color: var(--accent); margin: 0 0 20px;
}
.statement {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3.4vw, 42px); line-height: 1.18; letter-spacing: -0.012em;
  margin: 0 0 28px; text-wrap: balance;
}
.statement.small { font-size: clamp(24px, 2.6vw, 31px); }
.problem .narrow { max-width: var(--wrap); }
.problem .statement { max-width: 19em; }
.problem p:not(.statement), .services p, .fit-list li, .timeline p, .based, .aside-note { text-wrap: pretty; }
.problem p:not(.statement) { color: var(--ink-soft); margin: 0 0 16px; max-width: 36em; }

/* What I do: the path from CE mark to routine use */
.path { margin-top: 12px; }
.path-end {
  font-family: var(--serif); font-size: 19px; color: var(--ink); margin: 0;
}
.path-start { margin-bottom: 18px; }
.path-finish { text-align: right; margin-top: 18px; }
.services {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px;
  position: relative;
}
.services::before {
  content: ""; position: absolute; left: 0; right: 0; top: 6px;
  height: 2px; background: var(--accent);
}
.services::after {
  content: ""; position: absolute; right: -2px; top: 1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--accent);
}
.services li { position: relative; padding-top: 40px; }
.services li::before {
  content: ""; position: absolute; left: 0; top: 0;
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
}
.services h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 12px; line-height: 1.2; }
.services p { font-size: 16.5px; color: var(--ink-soft); margin: 0; }
.aside-note { margin: 56px 0 0; padding-top: 24px; border-top: 1px solid var(--line); font-size: 16.5px; color: var(--ink-soft); max-width: 46em; }

/* Two columns */
.two-col { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; align-items: start; }
.fit-list { list-style: none; margin: 0; padding: 0; }
.fit-list li { padding: 18px 0; border-bottom: 1px solid #c9d4d0; color: var(--ink-soft); }
.fit-list li:first-child { padding-top: 0; }
.fit-list strong { color: var(--ink); font-weight: 600; }

/* Experience */
.based { font-family: var(--serif); font-size: 22px; line-height: 1.45; color: var(--ink); margin: 0; max-width: 22em; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 44px 32px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 8px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent);
}
.timeline li:first-child::before { background: var(--accent); }
.when { font-size: 15px; color: var(--accent); margin: 0 0 4px; font-weight: 600; }
.timeline h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 8px; line-height: 1.25; }
.timeline p:not(.when) { color: var(--ink-soft); margin: 0; }
.timeline strong { color: var(--ink); font-weight: 600; }

/* Contact */
.section.contact { background: var(--accent-deep); color: #fff; border-top: none; padding: 112px 0; }
.contact .statement { color: #fff; margin-bottom: 16px; }
.contact .lead { color: rgba(255, 255, 255, 0.78); margin: 0 auto 36px; }

/* Footer */
.site-footer { padding: 28px 0; font-size: 14px; color: var(--ink-soft); }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }
.footer-row p { margin: 0; }
.site-footer a { color: var(--ink-soft); display: inline-block; padding: 10px 0; margin: -10px 0; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--accent); }

/* Tablet */
@media (max-width: 900px) {
  .hero { padding: 48px 0 80px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .portrait { max-width: 340px; }
  .two-col { grid-template-columns: 1fr; gap: 36px; }

  /* Path turns vertical */
  .path-finish { text-align: left; }
  .services { grid-template-columns: 1fr; gap: 36px; padding-left: 36px; }
  .services::before { left: 6px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .services::after { left: 1px; right: auto; top: auto; bottom: -14px; }
  .services li { padding-top: 0; }
  .services li::before { left: -36px; top: 8px; }
  .path-start { margin-bottom: 20px; }
  .path-finish { margin-top: 24px; }
}

/* Phone */
@media (max-width: 560px) {
  body { font-size: 17px; }
  .wrap { padding: 0 20px; }
  .hero { padding: 36px 0 64px; }
  .lead { font-size: 18.5px; margin-bottom: 32px; }
  .section { padding: 64px 0; }
  .section.contact { padding: 80px 0; }
  .portrait { max-width: 100%; }
  .portrait img { aspect-ratio: 1 / 1; }
  .btn { width: 100%; text-align: center; }
  .based { font-size: 20px; }
}
