/* cv.saphid.app — buildless, system fonts only, no third-party assets. */

:root {
  color-scheme: light dark;

  --paper: #f8f5ee;
  --paper-2: #f1ece1;
  --ink: #1b1d1f;
  --ink-2: #3c3e40;
  --muted: #615d55;
  --rule: #dcd4c4;
  --rule-strong: #c4b9a4;
  --accent: #2b6a4e;
  --accent-ink: #ffffff;
  --accent-soft: #e2ece5;
  --focus: #1f5fbf;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Charter, "Bitstream Charter", Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 66ch;
  --wrap: 68rem;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --when-col: 10.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141617;
    --paper-2: #1b1e1f;
    --ink: #ece7dc;
    --ink-2: #d6d0c4;
    --muted: #a59f93;
    --rule: #2e3233;
    --rule-strong: #454a4b;
    --accent: #8fc9a8;
    --accent-ink: #0f1a14;
    --accent-soft: #1d2b24;
    --focus: #9cc1ff;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 4.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

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

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 20;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* ---------- Masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
}
.masthead__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem 3rem;
  align-items: end;
  padding-block: clamp(1.75rem, 5vw, 3.25rem) clamp(1.25rem, 3vw, 2rem);
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.role {
  margin: 0.65rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  color: var(--ink-2);
}

.masthead__aside {
  display: grid;
  gap: 1rem;
  justify-items: end;
}

.contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
  text-align: right;
  font-size: 0.95rem;
}
.contact a { text-decoration-color: var(--rule-strong); }
.contact__label {
  display: inline-block;
  min-width: 3.6em;
  margin-right: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.download {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.55rem 1.05rem 0.55rem 0.85rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.download:hover {
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 86%, var(--ink));
}
.download__icon { width: 1.15rem; height: 1.15rem; flex: none; }
.download__meta {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
}

/* ---------- Section nav ---------- */

.sitenav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom: 1px solid var(--rule);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .sitenav { background: var(--paper); }
}
.sitenav__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.sitenav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem 1.6rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.sitenav ul::-webkit-scrollbar { display: none; }
.sitenav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink-2);
  text-decoration: none;
}
.sitenav ul a:hover { color: var(--accent); }
.sitenav__pdf {
  padding-inline: 0.9rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  min-height: 36px !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.06em;
  font-weight: 600 !important;
  color: var(--accent) !important;
}
.sitenav__pdf:hover { border-color: var(--accent); }

/* ---------- Main ---------- */

main { padding-bottom: 3rem; }

.lede {
  max-width: 44rem;
  margin: clamp(1.75rem, 4vw, 2.75rem) 0 0;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.3vw, 1.45rem);
  line-height: 1.45;
  color: var(--ink-2);
}
.lede strong { font-weight: 600; color: var(--ink); }

.section {
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.section__title {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.section__num {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ---------- Entries & timeline ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry {
  display: grid;
  grid-template-columns: var(--when-col) minmax(0, 1fr);
  gap: 0 2rem;
  padding-block: 1.5rem;
}
.timeline > .entry + .entry { border-top: 1px solid var(--rule); }

.entry__when {
  position: relative;
  padding-top: 0.3rem;
}
.when {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.01em;
}

.entry__body {
  position: relative;
  padding-left: 1.6rem;
  border-left: 1px solid var(--rule-strong);
}
.entry__body::before {
  /* Timeline marker */
  content: "";
  position: absolute;
  left: -5px;
  top: 0.62rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent);
}
.timeline > .entry:first-child .entry__body::before,
.entry--feature .entry__body::before { background: var(--accent); }

.entry__org {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.4rem;
  line-height: 1.25;
}
.entry__org a { text-decoration: none; }
.entry__org a:hover { text-decoration: underline; }

.entry__title {
  margin: 0.15rem 0 0.75rem;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink-2);
}
a.quiet {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85em;
}

.points {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: var(--measure);
}
.points li {
  position: relative;
  padding-left: 1.1rem;
  margin-top: 0.4rem;
}
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 0.45rem;
  height: 1px;
  background: var(--muted);
}
.points strong { font-weight: 650; color: var(--ink); }

.entry__note {
  margin: 1rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.entry--feature {
  padding-block: 0.5rem 0.25rem;
}

/* ---------- Skills ---------- */

.skills {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2.5rem;
}
.skill {
  padding-block: 1.1rem;
  border-top: 1px solid var(--rule);
}
.skill:first-child { border-top: 0; }
.skill--wide { grid-column: 1 / -1; }
.skill dt {
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.skill dd {
  margin: 0;
  max-width: var(--measure);
  color: var(--ink-2);
}

/* ---------- Qualifications ---------- */

.quals {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 44rem;
}
.quals li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 0.7rem;
  border-top: 1px solid var(--rule);
}
.quals li:first-child { border-top: 0; padding-top: 0.2rem; }
.quals__what { font-weight: 500; }
.quals__when {
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Closing CTA ---------- */

.cta {
  margin-top: clamp(2.75rem, 6vw, 4rem);
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.cta__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
}
.cta__text { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.95rem; }
.cta > .cta__title, .cta > .cta__text { flex-basis: 100%; }
@media (min-width: 46rem) {
  .cta { display: grid; grid-template-columns: 1fr auto; }
  .cta > .cta__title { grid-column: 1; }
  .cta > .cta__text { grid-column: 1; }
  .cta > .download { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
  font-size: 0.9rem;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.75rem;
  padding-block: 1.75rem 2.25rem;
}
.footer__name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
}
.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
}
.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.footer__meta {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 52rem) {
  .masthead__inner { grid-template-columns: 1fr; align-items: start; }
  .masthead__aside { justify-items: start; }
  .contact { text-align: left; }
}

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  /* Single column: the rule runs down the whole entry, marker sits by the date. */
  .entry {
    grid-template-columns: 1fr;
    position: relative;
    padding: 1.25rem 0 1.25rem 1.35rem;
    border-left: 1px solid var(--rule-strong);
  }
  .entry--feature { padding-block: 0.25rem 0.5rem; }
  .entry__when { position: static; padding: 0 0 0.3rem; }
  .entry__body { position: static; padding-left: 0; border-left: 0; }
  .entry__body::before { top: 1.62rem; }
  .entry--feature .entry__body::before { top: 0.62rem; }
  .skills { grid-template-columns: 1fr; }
  .sitenav__pdf { display: none !important; }
  .sitenav ul { gap: 0.25rem 1.15rem; }
  .download { width: 100%; justify-content: center; }
  .masthead__aside { justify-items: stretch; width: 100%; }
}

/* ---------- Print ---------- */

@media print {
  :root {
    --paper: #fff; --paper-2: #fff; --ink: #000; --ink-2: #222;
    --muted: #444; --rule: #ccc; --rule-strong: #999; --accent: #1f4f3a;
  }
  body { font-size: 10.5pt; line-height: 1.45; }
  .skip-link, .sitenav, .cta, .download, .footer__links { display: none !important; }
  .masthead__inner { padding-block: 0 0.75rem; }
  .section { margin-top: 1.25rem; break-inside: auto; }
  .entry { break-inside: avoid; padding-block: 0.6rem; }
  a { text-decoration: none; }
  .footer { background: none; }
}
