/* ---------------------------------------------------------------
   André Fonseca — CV
   Monochrome, system fonts only, mobile-first.
   To go pure black/white, set --bg: #000 and --ink: #fff.
   --------------------------------------------------------------- */

:root {
  --bg:        #000000;   /* page background */
  --ink:       #e8e8e8;   /* body text — slightly under pure white to reduce glare */
  --ink-loud:  #ffffff;   /* headings */
  --ink-quiet: #8f8f8f;   /* dates, captions, secondary detail */
  --rule:      #2a2a2a;   /* hairlines */

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 68ch;        /* readable line length */
  --gutter: 1.5rem;
  --max: 60rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- links ---------------------------------------------------- */

a { color: var(--ink-loud); text-decoration: none; border-bottom: 1px solid var(--rule); }
a:hover { border-bottom-color: var(--ink-loud); }
a:focus-visible {
  outline: 2px solid var(--ink-loud);
  outline-offset: 3px;
  border-bottom-color: transparent;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 0.5rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink-loud);
  color: var(--bg);
  border: 0;
}

/* --- hero ----------------------------------------------------- */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem var(--gutter) 2.5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.25rem, 9vw, 4.5rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink-loud);
}

.lede {
  max-width: var(--measure);
  margin: 0 0 1.75rem;
  font-size: clamp(1.0625rem, 2.4vw, 1.1875rem);
  line-height: 1.6;
}

.meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-quiet);
}
.meta a { color: var(--ink); }

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

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

.nav ul {
  display: flex;
  gap: 1.25rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem var(--gutter);
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav ul::-webkit-scrollbar { display: none; }

.nav a {
  border: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-quiet);
}
.nav a:hover { color: var(--ink-loud); }

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

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: 0; }

.section > h2 {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 0 0 2.25rem;
  font-size: clamp(1.25rem, 4vw, 1.625rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-loud);
}

.num {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink-quiet);
}

.sub {
  margin: 0 0 0.875rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

.cols { display: grid; gap: 2.25rem; }

.tags { margin: 0; padding: 0; list-style: none; }
.tags li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.tags li:last-child { border-bottom: 0; }

/* --- experience timeline -------------------------------------- */

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

.role { padding-bottom: 2.75rem; }
.role:last-child { padding-bottom: 0; }

.when {
  margin: 0 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-quiet);
}

.role h3 {
  margin: 0 0 0.375rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-loud);
}

.org {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink-quiet);
}

.client {
  margin: 0 0 0.875rem;
  font-size: 0.875rem;
  color: var(--ink-quiet);
}

.role p { max-width: var(--measure); }

.role ul {
  max-width: var(--measure);
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.role ul li {
  position: relative;
  padding-left: 1.125rem;
  margin-bottom: 0.375rem;
}
.role ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 0.4rem;
  height: 1px;
  background: var(--ink-quiet);
}

.tech {
  margin: 1rem 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--ink-quiet);
}

/* Internal programme codenames — delete this rule and the spans
   in index.html if these should not be published. */
.codename { font-style: italic; }

/* --- simple listings ------------------------------------------ */

.listing { margin: 0; padding: 0; list-style: none; }
.listing li {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.listing li:last-child { border-bottom: 0; }

.year {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-quiet);
  padding-top: 0.2em;
}

.langs {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0;
  margin: 0;
}
.langs dt {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-loud);
}
.langs dd {
  margin: 0;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-quiet);
}

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

.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem var(--gutter) 4rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-quiet);
}
.foot p { margin: 0 0 0.375rem; }
.fine { color: var(--rule); }

/* --- wider screens -------------------------------------------- */

@media (min-width: 40rem) {
  .cols { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

@media (min-width: 52rem) {
  .hero { padding-top: 6rem; padding-bottom: 3.5rem; }
  .section { padding-top: 4.5rem; padding-bottom: 4.5rem; }

  /* date column becomes a true left rail */
  .role {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    gap: 2rem;
  }
  .when { margin-top: 0.25rem; }
  .org { display: inline; margin-left: 0.5rem; }
}

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

@media print {
  :root { --bg: #fff; --ink: #000; --ink-loud: #000; --ink-quiet: #444; --rule: #ccc; }
  .nav, .skip { display: none; }
  body { font-size: 10pt; line-height: 1.4; }
  .hero, .section, .foot { padding: 0.5rem 0; max-width: none; }
  .role { page-break-inside: avoid; }
  a { border: 0; }
}
