/* Atkinson Hyperlegible Next, the typeface of Terrain (SIL Open Font License, fonts/OFL.txt). */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* A field book: paper, ink, and survey flagging tape. */
:root {
  --paper: #f6f4ee;
  --sheet: #fffdf8;
  --ink: #15171a;
  --graphite: #565b53;
  --rule: #d8d3c6;
  --tape: #f26a1b;
  --tape-ink: #15171a;
  --feature: #15171a;
  --feature-ink: #f6f4ee;
  --feature-muted: #c9c5b9;
  --feature-line: #3a3d38;
  --space: 20px;
  --max: 48rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121412;
    --sheet: #1a1d1a;
    --ink: #eceae3;
    --graphite: #a9ada3;
    --rule: #30342f;
    --feature: #1d211d;
    --feature-ink: #eceae3;
    --feature-muted: #b3b6ad;
    --feature-line: #3d423c;
    color-scheme: dark;
  }
}

/* English or French (main.js sets the page's language): the other one stays hidden. */
:root[lang='en'] [lang='fr'],
:root[lang='fr'] [lang='en'] {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--tape);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  top: 12px;
  left: -999px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

.skip:focus {
  left: 12px;
}

/* Top bar: monogram, then the language switch. */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px var(--space);
}

.monogram {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.lang-switch {
  display: inline-flex;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 999px;
}

.lang-switch button {
  min-width: 56px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lang-switch button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space) 48px;
}

/* Who I am. */
.hero {
  padding: 28px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--graphite);
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0 0 22px;
  font-size: clamp(3.2rem, 14vw, 6rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.lead {
  max-width: 36em;
  margin: 0 0 26px;
  font-size: 1.2rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.button.primary {
  background: var(--ink);
  color: var(--paper);
}

a.button:hover {
  transform: translateY(-1px);
}

/* The numbers. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 12px;
  margin: 0 0 44px;
  padding: 0;
  list-style: none;
}

.stats li {
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--sheet);
  color: var(--graphite);
}

.stats strong {
  display: block;
  color: var(--ink);
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Terrain. */
.project {
  margin: 0 0 52px;
  padding: 28px 24px 26px;
  border: 1px solid var(--feature-line);
  border-radius: 18px;
  background: var(--feature);
  color: var(--feature-ink);
}

.tape {
  display: inline-block;
  margin: 0;
  padding: 4px 18px 4px 12px;
  background: var(--tape);
  color: var(--tape-ink);
  font-weight: 800;
  clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%);
  transform: rotate(-2deg);
}

.project h2 {
  margin: 14px 0 0;
  font-size: clamp(2.4rem, 9vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.tagline {
  display: block;
  margin-top: 6px;
  color: var(--feature-muted);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0;
}

/* Terrain's status rail, in small: strips of flagging tape. */
.rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 26rem;
  margin: 22px 0 18px;
}

.flag {
  padding: 8px 4px 16px;
  border-radius: 3px 3px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}

.given {
  background: #0f9d58;
  color: #000;
}

.door {
  background: #ffea00;
  color: #000;
}

.research {
  background: #ff5252;
  color: #000;
}

.skipped {
  background: #9c27b0;
  color: #fff;
}

.project p {
  max-width: 36em;
}

.ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 14px 0 24px;
  padding: 0;
  list-style: none;
  font-weight: 700;
}

.ticks li {
  display: flex;
  gap: 8px;
}

.ticks li::before {
  content: '✓';
  color: var(--tape);
}

.project .button {
  border-color: var(--feature-ink);
  color: var(--feature-ink);
}

.project .button.primary {
  border-color: var(--tape);
  background: var(--tape);
  color: var(--tape-ink);
}

/* Blure: the same card on paper, so Terrain stays the feature. */
.project.light {
  border-color: var(--rule);
  background: var(--sheet);
  color: var(--ink);
}

.project.light .tagline {
  color: var(--graphite);
}

/* Sections. */
.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--ink);
}

.jobs {
  margin: 0 0 44px;
  padding: 0;
  list-style: none;
}

.job {
  padding: 16px 0 18px;
  border-top: 1px solid var(--rule);
}

.job:first-child {
  border-top: 0;
}

.job-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
}

.job h3 {
  margin: 0;
  font-size: 1.25rem;
}

.when {
  margin: 0;
  color: var(--graphite);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.role {
  margin: 2px 0 8px;
  color: var(--graphite);
}

.job ul {
  margin: 0;
  padding-left: 1.1em;
  list-style: disc;
}

.job li {
  margin: 4px 0;
}

.job li::marker {
  color: var(--tape);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 36px 44px;
  margin-bottom: 52px;
}

.plain {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain li {
  margin: 0 0 12px;
  color: var(--graphite);
}

.plain strong {
  display: block;
  color: var(--ink);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 4px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--sheet);
  font-size: 0.95rem;
}

.facts p {
  margin: 0;
}

/* Contact. */
.contact {
  padding-top: 26px;
  border-top: 2px solid var(--ink);
}

.contact h2 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 8vw, 2.6rem);
  letter-spacing: -0.02em;
}

.email {
  font-size: clamp(1.25rem, 5.4vw, 1.9rem);
  font-weight: 800;
  text-decoration-color: var(--tape);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--graphite);
}

.bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px var(--space) 40px;
  color: var(--graphite);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  a.button:hover {
    transform: none;
  }
}

/* Printed, it is a one-column CV in black on white. */
@media print {
  :root {
    --paper: #fff;
    --sheet: #fff;
    --ink: #000;
    --graphite: #333;
    --rule: #bbb;
    --feature: #fff;
    --feature-ink: #000;
    --feature-muted: #333;
    --feature-line: #bbb;
  }

  body {
    font-size: 10.5pt;
  }

  .top,
  .skip,
  .actions,
  .rail,
  .bottom {
    display: none !important;
  }

  .hero {
    padding-top: 0;
  }

  h1 {
    font-size: 30pt;
  }

  .project,
  .job {
    break-inside: avoid;
  }
}
