/* dominici.dev — affiche typographique : papier, encre, un rouge pour le présent. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/fonts/archivo-latin.woff2") format("woff2");
}

:root {
  --paper: #f3f4f5;
  --ink: #111111;
  --ink-2: #4a4a46;
  --red: #d42a1c;
  --on-red: #ffffff;
  --rule: 2px solid var(--ink);
  --gutter: clamp(16px, 3vw, 40px);
  --masthead: 3.75rem;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--ink) var(--paper);
  scroll-padding-top: calc(var(--masthead) + 1rem);
}

body {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.5;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--red);
}

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

ul,
ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

::selection {
  background: var(--red);
  color: var(--on-red);
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

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

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.field :focus-visible,
.band :focus-visible {
  outline-color: var(--on-red);
}

main:focus {
  outline: none;
}

.arrow {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.18em;
  vertical-align: 0.02em;
}

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

.skip {
  position: absolute;
  top: 0.5rem;
  left: var(--gutter);
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

/* Bandeau ------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem 2rem;
  min-height: var(--masthead);
  padding: 0.5rem var(--gutter);
  background: var(--paper);
  border-bottom: var(--rule);
}

.wordmark {
  font-size: 1.375rem;
  font-stretch: 75%;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark span {
  font-weight: 400;
}

.nav ul,
.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.nav a,
.social a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 600;
  font-stretch: 88%;
  text-decoration: none;
}

.nav a:hover,
.social a:hover {
  text-decoration: underline;
  text-decoration-color: var(--red);
}

.nav a[aria-current="page"]::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.45em;
  background: var(--red);
}

/* Accueil : champ rouge + chronologie --------------------------------- */

.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  min-height: min(calc(100svh - var(--masthead)), 58rem);
}

.field {
  grid-column: 1 / span 7;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  gap: 1.5rem var(--gutter);
  padding: clamp(24px, 4vw, 64px) var(--gutter);
  background: var(--red);
  color: var(--on-red);
}

.field h1 {
  grid-column: 1 / -1;
  font-size: clamp(3.5rem, 8.6vw, 6rem);
  font-stretch: 78%;
  font-weight: 850;
  line-height: 0.88;
  letter-spacing: -0.035em;
}

.field-foot {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
}

.role {
  max-width: 22ch;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-stretch: 90%;
  font-weight: 650;
  line-height: 1.15;
}

.motto {
  margin-top: 0.75rem;
  font-size: 1rem;
}

.portrait {
  grid-column: 2;
  grid-row: 2 / span 2;
  align-self: end;
  width: clamp(140px, 17vw, 260px);
}

.portrait img {
  width: 100%;
  mix-blend-mode: multiply;
  filter: contrast(1.15);
}

.chart {
  grid-column: 8 / span 5;
  padding: clamp(24px, 4vw, 64px) var(--gutter);
}

.chart h2 {
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  font-stretch: 80%;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.lanes {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  align-items: center;
  margin-top: 1.5rem;
}

.chart-axis {
  position: relative;
  height: 1.75rem;
  border-bottom: var(--rule);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tick {
  position: absolute;
  left: var(--x);
  bottom: 0;
  height: 100%;
  padding-left: 3px;
  border-left: 1px solid var(--ink);
  line-height: 1.2;
}

.lane-label {
  padding-block: 0.875rem;
  border-bottom: 1px solid var(--ink);
  font-size: 0.875rem;
  font-stretch: 88%;
  font-weight: 700;
}

.lane-track {
  position: relative;
  align-self: stretch;
  border-bottom: 1px solid var(--ink);
}

.lane-bar {
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  left: var(--s);
  width: max(4px, calc(var(--w) - 2px));
  background: var(--ink);
  transform-origin: left center;
  transition: opacity 200ms var(--ease-out);
}

.lane-bar.is-current {
  background: var(--red);
}

.chart-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--gutter);
  margin-top: 2rem;
}

.chart-lines h3 {
  padding-bottom: 0.375rem;
  border-bottom: var(--rule);
  font-size: 0.875rem;
  font-stretch: 88%;
  font-weight: 700;
}

.line {
  border-bottom: 1px solid var(--ink);
}

.line a {
  display: grid;
  margin-inline: -0.375rem;
  padding: 0.5rem 0.375rem;
  text-decoration: none;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.line-title {
  font-weight: 650;
  font-stretch: 92%;
  line-height: 1.2;
}

.line-period {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.line.is-current .line-period {
  color: var(--red);
  font-weight: 600;
}

.line-meta {
  font-size: 0.875rem;
  color: var(--ink-2);
}

.line a:hover,
.line a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.line a:hover .line-meta,
.line a:focus-visible .line-meta,
.line.is-current a:hover .line-period,
.line.is-current a:focus-visible .line-period {
  color: var(--paper);
}

@media (prefers-reduced-motion: no-preference) {
  .chart .lane-bar {
    animation: draw 1100ms var(--ease-out) both;
    animation-delay: calc(var(--i) * 80ms + 150ms);
  }

  @keyframes draw {
    from {
      transform: scaleX(0);
    }
  }
}

/* Stack ---------------------------------------------------------------- */

.stack {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 2rem;
  padding: clamp(48px, 7vw, 112px) var(--gutter);
  border-top: var(--rule);
}

.stack > h2,
.page-head h1 {
  font-size: clamp(3rem, 7vw, 6rem);
  font-stretch: 78%;
  font-weight: 850;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.stack > h2 {
  grid-column: 1 / span 4;
}

.stack-groups {
  grid-column: 5 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem var(--gutter);
}

.stack-group h3 {
  padding-top: 0.5rem;
  margin-bottom: 1rem;
  border-top: var(--rule);
  font-size: 0.875rem;
  font-stretch: 88%;
  font-weight: 700;
}

.stack-group li {
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  font-stretch: 90%;
  font-weight: 500;
  line-height: 1.3;
}

/* Bande de contact ------------------------------------------------------ */

.band {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 1rem;
  align-items: end;
  padding: clamp(48px, 7vw, 112px) var(--gutter);
  background: var(--ink);
  color: var(--paper);
}

.band h2 {
  grid-column: 1 / span 4;
  font-size: 1rem;
  font-weight: 700;
  font-stretch: 88%;
}

.band-mail {
  grid-column: 5 / -1;
  font-size: clamp(1.375rem, 4.6vw, 4.25rem);
  font-stretch: 78%;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-decoration-color: var(--paper);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

.band-mail:hover {
  text-decoration-color: var(--red);
}

.band ::selection {
  background: var(--paper);
  color: var(--ink);
}

/* Pages Expériences / Formations / Contact ------------------------------ */

.page-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 1.5rem;
  align-items: end;
  padding: clamp(40px, 7vw, 112px) var(--gutter) clamp(24px, 3vw, 40px);
  border-bottom: var(--rule);
}

.page-head h1 {
  grid-column: 1 / span 7;
}

.lede {
  grid-column: 8 / -1;
  max-width: 42ch;
  font-size: 1.125rem;
  line-height: 1.45;
}

.lede p + p {
  margin-top: 0.5rem;
}

.entries {
  padding-inline: var(--gutter);
}

.entry {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 0.5rem;
  padding-block: clamp(20px, 2.6vw, 36px);
  border-bottom: 1px solid var(--ink);
  scroll-margin-top: calc(var(--masthead) + 1rem);
}

.entry:target {
  box-shadow: inset 6px 0 0 var(--red);
  padding-left: 1.25rem;
}

.entry-period {
  grid-column: 1 / span 3;
  font-size: clamp(1.125rem, 1.8vw, 1.5rem);
  font-stretch: 85%;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.entry.is-current .entry-period {
  color: var(--red);
}

.entry-body {
  grid-column: 4 / span 7;
}

.entry-body h2 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-stretch: 85%;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.entry-org {
  margin-top: 0.5rem;
  color: var(--ink-2);
}

.entry-org a {
  color: var(--ink);
  font-weight: 600;
}

.entry-desc {
  margin-top: 1rem;
  columns: 2 18rem;
  column-gap: var(--gutter);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.entry-aside {
  grid-column: 11 / -1;
  display: grid;
  align-content: start;
  gap: 0.625rem;
}

.entry-duration {
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mini-track {
  position: relative;
  display: block;
  height: 0.875rem;
  border-bottom: var(--rule);
}

.mini-track .lane-bar {
  top: 0;
  bottom: 0;
}

.mini-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.channels {
  padding-inline: var(--gutter);
  padding-bottom: clamp(48px, 7vw, 112px);
}

.channels li {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 0.25rem;
  align-items: baseline;
  padding-block: clamp(20px, 2.6vw, 36px);
  border-bottom: 1px solid var(--ink);
}

.channel-label {
  grid-column: 1 / span 3;
  font-size: 0.875rem;
  font-weight: 700;
  font-stretch: 88%;
}

.channel-link {
  grid-column: 4 / -1;
  font-size: clamp(1.5rem, 4.4vw, 4rem);
  font-stretch: 80%;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.channel-link a,
a.channel-link {
  text-decoration-thickness: 0.07em;
}

.channel-link a:hover,
a.channel-link:hover {
  text-decoration-color: var(--red);
}

/* 404 ------------------------------------------------------------------- */

.field-404 {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  min-height: calc(100svh - var(--masthead) - 8rem);
}

.field-404 h1 {
  font-size: 6rem;
  font-stretch: 78%;
  font-weight: 900;
}

.back {
  font-weight: 700;
  font-size: 1.25rem;
}

/* Colophon ------------------------------------------------------------- */

.colophon {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem var(--gutter);
  padding: 1.25rem var(--gutter) 2rem;
  font-size: 0.875rem;
}

.colophon p:nth-child(2) {
  text-align: center;
}

.colophon p:last-child {
  text-align: right;
}

/* Adaptation ------------------------------------------------------------ */

@media (max-width: 1100px) {
  .hero {
    min-height: 0;
  }

  .field,
  .chart {
    grid-column: 1 / -1;
  }

  .field {
    min-height: min(calc(100svh - var(--masthead) - 6rem), 40rem);
  }

  .stack > h2,
  .stack-groups,
  .page-head h1,
  .lede {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  :root {
    --masthead: 0rem;
  }

  .masthead {
    position: static;
    grid-template-columns: 1fr auto;
    gap: 0 1rem;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .nav ul {
    flex-wrap: nowrap;
    gap: 0 1rem;
    font-size: 0.9375rem;
  }

  .nav a,
  .social a {
    min-height: 2.5rem;
  }

  .social {
    gap: 0 1rem;
    font-size: 0.9375rem;
  }

  .field {
    grid-template-columns: minmax(0, 1fr) 38%;
    min-height: 0;
  }

  .field h1 {
    font-size: clamp(3.25rem, 17vw, 5rem);
  }

  .portrait {
    width: 100%;
  }

  .tick.is-odd {
    visibility: hidden;
  }

  .stack-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .band h2,
  .band-mail {
    grid-column: 1 / -1;
  }

  .entry-period,
  .entry-body,
  .entry-aside,
  .channel-label,
  .channel-link {
    grid-column: 1 / -1;
  }

  .entry-aside {
    max-width: 16rem;
  }

  .entry-duration {
    text-align: left;
  }

  .lanes {
    grid-template-columns: 4.75rem minmax(0, 1fr);
  }

  .chart-lines {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .colophon {
    grid-template-columns: 1fr;
  }

  .colophon p:nth-child(n) {
    text-align: left;
  }
}
