/* cestarte.com — resume
   Plain CSS, no dependencies. Palette in OKLCH; every text/background pair
   verified ≥ 4.5:1 (body ≥ 6.8:1) in both schemes. */

:root {
  color-scheme: light dark;

  /* palette — light */
  --bg: oklch(1 0 0);
  --surface: oklch(0.955 0.004 20);
  --ink: oklch(0.235 0.015 20);
  --muted: oklch(0.47 0.02 20);
  --primary: oklch(0.45 0.15 15);      /* oxblood */
  --accent: oklch(0.285 0.05 250);     /* dark steel blue */
  --rule: oklch(0.87 0.006 20);
  --badge: oklch(0.45 0.15 15);        /* fixed oxblood, both schemes */

  /* type */
  --serif: 'Charter', 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  /* layout */
  --page-max: 62rem;
  --rail: 10.5rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --nav-height: 3rem;

  /* z scale */
  --z-sticky: 10;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.14 0 0);
    --surface: oklch(0.205 0.006 20);
    --ink: oklch(0.9 0.008 20);
    --muted: oklch(0.7 0.015 20);
    --primary: oklch(0.72 0.115 20);   /* soft brick */
    --accent: oklch(0.865 0.042 240);  /* pale steel */
    --rule: oklch(0.32 0.008 20);
  }
}

/* ---------- reset-lite ---------- */

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

body, h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }

img, svg { max-width: 100%; display: block; }

/* ---------- base ---------- */

html {
  scroll-padding-top: calc(var(--nav-height) + 1.5rem);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  body { line-height: 1.72; } /* light-on-dark type needs more air */
}

::selection {
  background: var(--primary);
  color: oklch(1 0 0);
}

h1, h2, h3 {
  font-family: var(--sans);
  line-height: 1.2;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in oklch, var(--primary) 45%, transparent);
  text-underline-offset: 0.18em;
  transition: text-decoration-color 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

a:hover { text-decoration-color: var(--primary); }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0.5rem;
  z-index: calc(var(--z-sticky) + 1);
  padding: 0.4em 0.8em;
  background: var(--bg);
  font-family: var(--sans);
  font-size: 0.85rem;
  transform: translateY(-300%);
}

.skip-link:focus { transform: none; }

/* shared page column */
.masthead, .site-nav > ul, main, .site-footer {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- masthead ---------- */

.masthead {
  padding-block: clamp(2.5rem, 7vw, 5rem) 2.5rem;
  position: relative;
}

/* ledger double rule */
.masthead::after {
  content: "";
  display: block;
  margin-top: 2.5rem;
  border-block-start: 1px solid var(--rule);
  border-block-end: 1px solid var(--rule);
  height: 4px;
}

.stub-note {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px dashed var(--rule);
  border-radius: 4px;
  padding: 0.35em 0.75em;
  display: inline-block;
  margin-block-end: 2.25rem;
}

.identity {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

/* let the name wrap instead of forcing the row wider than the viewport */
.identity > div { min-width: 0; }

.monogram {
  flex: none;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 6px;
  background: var(--badge);
  color: oklch(1 0 0);
  font-family: var(--serif);
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  display: grid;
  place-items: center;
  user-select: none;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.role {
  font-family: var(--sans);
  font-size: clamp(0.98rem, 1.8vw, 1.1rem);
  color: var(--muted);
  margin-top: 0.35rem;
}

.summary {
  font-size: 1.15rem;
  line-height: 1.7;
  max-width: 62ch;
  margin-block-start: 1.75rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin-block-start: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.75rem;
  font-family: var(--sans);
  font-size: 0.92rem;
}

.contact-list li { color: var(--muted); }

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

.site-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg);
  border-block-end: 1px solid var(--rule);
}

.site-nav > ul {
  list-style: none;
  display: flex;
  gap: 1.6rem;
  overflow-x: auto;
  min-height: var(--nav-height);
  align-items: stretch;
}

.site-nav a {
  display: flex;
  align-items: center;
  height: var(--nav-height);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-block-end: 2px solid transparent;
  transition: color 150ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-nav a:hover { color: var(--ink); }

.site-nav a[aria-current="true"] {
  color: var(--primary);
  border-block-end-color: var(--primary);
}

/* ---------- sections ---------- */

main { padding-block: 1rem 3rem; }

section { padding-block: 2.25rem; }

section + section { border-block-start: 1px solid var(--rule); }

h2 {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.015em;
  color: var(--ink);
  margin-block-end: 1.5rem;
}

@media (min-width: 62rem) {
  section {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    column-gap: 3rem;
  }

  section > h2 {
    position: sticky;
    top: calc(var(--nav-height) + 1.5rem);
    align-self: start;
    margin: 0;
    color: var(--muted);
  }
}

.section-body > * + * { margin-block-start: 1.1rem; }

.section-body > .entry + .entry {
  margin-block-start: 2.25rem;
}

/* ---------- entries ---------- */

.entry h3 {
  font-size: 1.08rem;
  font-weight: 650;
}

.entry-meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-block-start: 0.25rem;
}

.entry > p { margin-block-start: 0.7rem; max-width: 66ch; }

.entry ul {
  margin-block-start: 0.7rem;
  padding-inline-start: 1.2rem;
  max-width: 64ch;
}

.entry li + li { margin-block-start: 0.45rem; }

.entry li::marker { color: var(--primary); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-start: 0.9rem !important;
}

.tags span {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.12em 0.5em;
}

/* ---------- facts (at a glance, skills) ---------- */

.facts {
  display: grid;
  gap: 0.9rem;
}

.facts > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  column-gap: 1.25rem;
}

@media (max-width: 34rem) {
  .facts > div { grid-template-columns: 1fr; row-gap: 0.15rem; }
}

.facts dt {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--muted);
  padding-block-start: 0.15em; /* optical align with serif dd */
}

.facts dd { max-width: 62ch; }

/* ---------- footer ---------- */

.site-footer {
  padding-block: 2rem 3rem;
  position: relative;
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
}

.site-footer::before {
  content: "";
  display: block;
  border-block-start: 1px solid var(--rule);
  border-block-end: 1px solid var(--rule);
  height: 4px;
  margin-block-end: 1.75rem;
}

.site-footer p + p { margin-block-start: 0.4rem; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- print ---------- */

@page { margin: 1.6cm; }

@media print {
  :root {
    --bg: #ffffff;
    --ink: #000000;
    --muted: #333333;
    --primary: #000000;
    --accent: #000000;
    --rule: #999999;
    --surface: #ffffff;
  }

  body { font-size: 10.5pt; line-height: 1.5; }

  .site-nav, .skip-link, .stub-note, .monogram { display: none; }

  .masthead { padding-block: 0 1rem; }

  section { display: block; padding-block: 1.1rem; }

  h2 { margin-block-end: 0.8rem; color: #000000; }

  .entry, .facts > div { break-inside: avoid; }

  a { text-decoration: none; color: #000000; }

  /* print the destination for external links */
  main a[href^="http"]::after,
  .contact-list a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #333333;
  }
}
