/* Adam Lewis — adamlewis.me */

@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #FAFAF8;
  --ink: #1A1D21;
  --ink-soft: #5A6169;
  --accent: #0E6E62;
  --rule: #E3E4E0;
  --wash: rgb(14 110 98 / 0.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161A;
    --ink: #E8E8E4;
    --ink-soft: #9BA1A8;
    --accent: #3FB8A5;
    --rule: #2A2D33;
    --wash: rgb(63 184 165 / 0.14);
  }
}

* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.page {
  max-width: 72ch;
  margin-inline: auto;
  padding: clamp(2.5rem, 7vh, 5rem) 1.25rem 3rem;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.sep { color: var(--ink-soft); margin-inline: 0.4em; }
.plain { list-style: none; padding: 0; }
[id] { scroll-margin-top: 4.5rem; }

/* ---------- anchor nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  backdrop-filter: blur(8px);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.nav a { color: var(--ink-soft); text-decoration: none; }
.nav a:hover { color: var(--accent); }
@media (max-width: 420px) {
  .nav { gap: 1rem; font-size: 0.64rem; letter-spacing: 0.08em; padding-inline: 1rem; }
}

/* ---------- button ---------- */
.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--paper);
  font-size: 0.95rem;
  text-decoration: none;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 85%, var(--ink)); }
@media (prefers-color-scheme: dark) {
  .btn { color: #10221F; font-weight: 500; }
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 1.25rem;
  margin-inline: -1.25rem;
  border-radius: 18px;
  background: radial-gradient(120% 160% at 85% 0%, var(--wash), transparent 60%);
}
.hero__photo {
  width: clamp(138px, 20.5vw, 193px);
  height: auto;
  border-radius: 50%;
  border: 3px solid var(--rule);
  order: 2;
}
.hero__name {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.hero__lede {
  margin-top: 1.1rem;
  font-size: 1.2rem;
  max-width: 34ch;
}
.hero__lede em {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.15em;
  color: var(--accent);
}
.hero__where {
  margin-top: 0.9rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hero__cta {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.hero__cv {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
}
@media (max-width: 620px) {
  .hero { grid-template-columns: 1fr; text-align: left; gap: 1.25rem; }
  .hero__photo { order: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise 600ms cubic-bezier(0.2, 0.7, 0.3, 1) both; }
  .hero__photo { animation-delay: 120ms; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- sections ---------- */
.section { margin-top: 5rem; }
.section__title {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  font-size: 1.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.6rem;
}

.highlights li { margin-bottom: 0.85rem; padding-left: 1.4rem; position: relative; }
.highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
}
.highlights strong { color: var(--ink); font-weight: 600; }

/* ---------- timeline rail ---------- */
.rail {
  border-left: 1px solid var(--rule);
  padding-left: 1.75rem;
  margin-left: 0.35rem;
}
.entry { position: relative; margin-bottom: 2.6rem; }
.entry:last-child { margin-bottom: 0; }
.entry::before {
  content: '';
  position: absolute;
  left: calc(-1.75rem - 0.35rem - 4.5px);
  top: 0.45em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--paper);
}
.entry__when {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.entry__until { color: var(--ink-soft); }
.entry__title {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.2;
}
.entry__role {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0.25rem 0 0.6rem;
}
.entry__body { max-width: 62ch; }
.entry__points {
  margin: 0.7rem 0 0;
  padding-left: 1.2rem;
  max-width: 62ch;
}
.entry__points li { margin-bottom: 0.45rem; }
.entry__points li::marker { color: var(--accent); }

@media (min-width: 900px) {
  .rail { margin-left: 7.5rem; }
  .entry__when {
    position: absolute;
    right: calc(100% + 1.75rem + 1rem);
    top: 0.2em;
    text-align: right;
    white-space: nowrap;
  }
}

/* ---------- definition blocks ---------- */
.defs dt {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-top: 1.4rem;
}
.defs dt:first-child { margin-top: 0; }
.defs dd { margin: 0.3rem 0 0; max-width: 62ch; }

.offclock { max-width: 62ch; }

/* ---------- footer ---------- */
.footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ---------- print / PDF ---------- */
@media print {
  @page { size: A4; margin: 13mm 14mm; }

  /* backgrounds are not printed — colour comes from text, borders and rules */
  :root {
    --paper: #fff;
    --ink: #000;
    --ink-soft: #444;
    --accent: #000;
    --rule: #999;
    --wash: transparent;
  }
  html { font-size: 13px; }
  body { background: #fff; color: #000; line-height: 1.38; }
  .nav, .noprint, .hero__cv { display: none; }
  .page { max-width: none; padding: 0; }

  .hero {
    padding: 0;
    margin-inline: 0;
    background: none;
    gap: 1.5rem;
    page-break-after: avoid;
  }
  .hero > * { animation: none; }
  .hero__photo { border: 1px solid #999; width: 110px; }
  .hero__name { font-size: 2.6rem; }
  .hero__lede { margin-top: 0.5rem; font-size: 1.05rem; max-width: none; }
  .hero__lede em { color: #000; }
  .hero__where, .hero__cta { margin-top: 0.4rem; }
  .btn {
    padding: 0.15rem 0.6rem;
    background: none;
    color: #000;
    border: 1px solid #000;
    font-size: 0.85rem;
  }

  .section { margin-top: 1.3rem; }
  .section__title {
    font-size: 1.3rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.25rem;
    page-break-after: avoid;
  }

  .highlights li { margin-bottom: 0.3rem; }
  /* backgrounds don't print — a zero-size box with a thick border is a filled dot */
  .highlights li::before {
    background: none;
    width: 0;
    height: 0;
    border: 3px solid #000;
    top: 0.6em;
  }
  .highlights strong { color: #000; }

  .rail { border-color: #999; }
  .entry { margin-bottom: 0.9rem; page-break-inside: avoid; }
  .entry::before { background: none; width: 0; height: 0; border: 3.5px solid #000; }
  .entry__body, .entry__points, .defs dd, .offclock { max-width: none; }
  .entry__points { margin-top: 0.3rem; }
  .entry__points li { margin-bottom: 0.2rem; }

  .defs dt { margin-top: 0.7rem; color: #000; page-break-after: avoid; }
  .defs dd { page-break-before: avoid; }
  .footer { margin-top: 1.6rem; padding-top: 0.6rem; }
  a { color: #000; }
}
