/* gabrielgirouard.ca — one bilingual document. Paper, ink, one red. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url("../fonts/archivo.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: italic; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url("../fonts/archivo-italic.woff2") format("woff2"); }

:root {
  --paper: #ffffff;
  --ink: #141414;
  --ink-2: #5a5752;
  --red: #d8232a;
  --rule: #141414;
  --hair: 1px;
  --gutter: 48px;
  --measure: 62ch;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.375rem;
  --step-4: clamp(2.5rem, 1.2rem + 4.2vw, 4.25rem);
  accent-color: var(--red);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font: 400 var(--step-0)/1.55 "Archivo", "Helvetica Neue", Arial, sans-serif; font-stretch: 100%;
  -webkit-text-size-adjust: 100%; }
body { margin: 0 auto; max-width: 1240px; padding: 0 clamp(16px, 4vw, 48px) 48px; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
html { caret-color: var(--red); }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 0.9em; max-width: var(--measure); text-wrap: pretty; }
ul { margin: 0 0 0.9em; padding-left: 1.1em; max-width: var(--measure); }
li { margin: 0 0 0.35em; }
strong { font-weight: 600; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; text-wrap: balance; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header: wordmark, mark, descriptor, identity photo */
.doc-head { display: grid; grid-template-columns: 1fr auto; column-gap: var(--gutter); align-items: end;
  border-top: 3px solid var(--rule); padding: 20px 0 20px; }
.doc-head .ident { display: flex; align-items: center; gap: 18px; }
.mark { flex: none; width: 44px; height: 44px; }
.wordmark { font-size: var(--step-4); font-weight: 700; font-stretch: 78%; letter-spacing: -0.025em; line-height: 1; margin: 0; }
.descriptor { text-align: right; display: grid; grid-template-columns: auto auto; column-gap: 24px; row-gap: 2px; align-items: end; }
.descriptor .lines { font-size: var(--step--1); line-height: 1.45; }
.descriptor .lines p { margin: 0; max-width: none; }
.descriptor .lines .meta { margin-top: 8px; color: var(--ink-2); }
.descriptor .lines .meta a { color: var(--ink); }
.photo { margin: 0; width: 96px; height: 96px; position: relative; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--step--1); color: var(--ink-2);
  border: 1px dashed var(--ink-2); line-height: 1.2; text-align: center; }
.photo.has-img figcaption { display: none; }

/* Page navigation: a rule-bound row, current page underlined in ink */
.doc-nav { border-top: var(--hair) solid var(--rule); border-bottom: var(--hair) solid var(--rule); display: flex; flex-wrap: wrap; gap: 0 28px;
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.02em; }
.doc-nav a { text-decoration: none; padding: 9px 0; display: inline-block; }
.doc-nav a .fr { color: var(--ink-2); font-weight: 400; }
.doc-nav a .fr::before { content: " · "; }
.doc-nav a.same .fr { display: none; }
.doc-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--ink); }
.doc-nav a[aria-current="page"] .fr { color: var(--ink); }

/* Mobile language control */
.lang-switch { display: none; }

/* Two columns, one gutter rule */
.columns { display: grid; grid-template-columns: minmax(0,1fr) var(--gutter) minmax(0,1fr); position: relative; }
.columns::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: var(--hair); background: var(--rule); transform: translateX(-50%); }
.col { display: contents; }
#en > * { grid-column: 1; }
#fr > * { grid-column: 3; }
.col-head { grid-row: 1; }
.col-head { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 12px 0;
  border-bottom: var(--hair) solid var(--rule); margin: 0 0 20px; display: flex; justify-content: space-between; }
.col-head .lang { color: var(--ink-2); font-weight: 400; letter-spacing: 0.02em; text-transform: none; }

/* Clauses: numbered, aligned across the gutter, paired on hover */
.clause { display: grid; grid-template-columns: 2.6rem minmax(0,1fr); column-gap: 8px; padding: 10px 0 14px; margin: 0 0 8px; position: relative; }
.clause .n { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); line-height: 1.4; padding-top: 0.2em; }
.clause.sub { padding-top: 6px; padding-bottom: 8px; margin-bottom: 0; }
.clause.sub .n { font-weight: 400; }
.clause > div { min-width: 0; }
.clause h2 { font-size: var(--step-1); line-height: 1.25; margin-bottom: 0.5em; letter-spacing: -0.01em; }
.clause h3 { font-size: var(--step-0); line-height: 1.4; margin-bottom: 0.3em; }
.clause h3 .org { display: block; font-weight: 400; color: var(--ink-2); }
.clause .when { font-size: var(--step--1); color: var(--ink-2); margin-bottom: 0.5em; }
.clause p:last-child, .clause ul:last-child { margin-bottom: 0; }
/* The memorable moment: a paired clause draws a hairline from its top edge across the gutter to the centre rule. */
.clause.paired .n { color: var(--ink); font-weight: 700; }
.clause.paired::before { content: ""; position: absolute; top: 0; height: var(--hair); width: calc(var(--gutter) / 2 + var(--hair)); background: var(--rule);
  transform-origin: left center; animation: bridge 180ms cubic-bezier(.2,.8,.2,1) both; }
#en > .clause.paired::before { right: calc(-1 * var(--gutter) / 2); }
#fr > .clause.paired::before { left: calc(-1 * var(--gutter) / 2); transform-origin: right center; }
@keyframes bridge { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.clause .todo { color: var(--ink-2); }
/* Project records: the document's own data rows and figures */
.record { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin: 10px 0 12px; padding: 10px 0; border-top: var(--hair) solid var(--rule); border-bottom: var(--hair) solid var(--rule); font-size: var(--step--1); max-width: var(--measure); }
.record div { display: grid; grid-template-columns: 4.2em minmax(0,1fr); gap: 8px; }
.record dt { color: var(--ink-2); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: .75rem; padding-top: .15em; }
.record dd { margin: 0; }
.record a { font-weight: 600; text-decoration: none; }
.record a:hover { text-decoration: underline; }
.fig { margin: 0 0 4px; max-width: var(--measure); }
.fig img { display: block; width: 100%; height: auto; border: var(--hair) solid var(--rule); }
.fig.icon img { width: 160px; border: 0; }
.fig figcaption { font-size: var(--step--1); color: var(--ink-2); margin-top: 6px; }
.clause h3 a { text-decoration: none; }
.clause h3 a:hover { text-decoration: underline; }
/* Contents clause on the résumé: the document's own index */
.toc { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; font-size: var(--step--1); line-height: 1.5; }
.toc li { break-inside: avoid; }
.toc a { text-decoration: none; display: flex; gap: 10px; padding: 2px 0; }
.toc a .n { font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 2.2em; }
.toc a:hover { text-decoration: underline; }
.clause[id] { scroll-margin-top: 16px; }
.clause a.more { font-weight: 600; text-decoration: none; }
.clause a.more::after { content: " \2192"; }
.clause a.more:hover { text-decoration: underline; }

/* Signature block */
.sig { border-top: 3px solid var(--rule); margin-top: 24px; padding-top: 14px; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gutter);
  font-size: var(--step--1); line-height: 1.5; }
.sig p { margin: 0 0 4px; max-width: none; }
.sig .name { font-weight: 700; font-stretch: 90%; font-size: var(--step-0); }
.sig a { text-decoration: none; }
.sig a:hover { text-decoration: underline; }
.sig .links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; }
.sig .right { text-align: right; color: var(--ink-2); }

/* Red mark */
.mark svg { display: block; width: 100%; height: 100%; }

@media (max-width: 760px) {
  body { padding-bottom: 32px; }
  .doc-head { grid-template-columns: 1fr; row-gap: 14px; padding: 14px 0 14px; }
  .doc-head .ident { align-items: flex-start; }
  .mark { width: 34px; height: 34px; margin-top: 0.35em; }
  .descriptor { text-align: left; grid-template-columns: 1fr auto; align-items: start; }
  .doc-nav { gap: 0 16px; }
  /* one language in the nav, the one the control selected; both when there is no script */
  body.js .doc-nav a .fr::before { content: none; }
  body.js .doc-nav a .fr { color: inherit; font-weight: inherit; }
  body.js.show-en .doc-nav a .fr { display: none; }
  body.js.show-fr .doc-nav a .en { display: none; }
  body.js.show-fr .doc-nav a.same .fr { display: inline; }
  .descriptor .lines .meta { margin-top: 4px; }
  .descriptor .sep { display: none; }
  .descriptor .h { display: block; }
  .descriptor .lines .meta { display: none; }               /* email lives in the signature on phones */
  body.js.show-en .descriptor .lines p[lang="fr"] { display: none; }
  body.js.show-fr .descriptor .lines p:not([lang]) { display: none; }
  .toc { columns: 1; }
  .record { grid-template-columns: 1fr; }
  .clause[id] { scroll-margin-top: 56px; }
  .sig .sep { display: none; }
  .sig .h { display: block; }
  .clause.paired::before { display: none; }
  .photo { width: 72px; height: 72px; }
  .lang-switch { display: flex; position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: var(--hair) solid var(--rule);
    margin: 0; }
  .lang-switch button { flex: 1; appearance: none; background: none; border: 0; border-right: var(--hair) solid var(--rule); padding: 10px 0;
    font: inherit; font-size: var(--step--1); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; }
  .lang-switch button:last-child { border-right: 0; }
  .lang-switch button[aria-selected="true"] { color: var(--red); box-shadow: inset 0 -2px 0 var(--red); }
  .columns { grid-template-columns: 1fr; padding-top: 12px; }
  .columns::before { display: none; }
  #en > *, #fr > * { grid-column: 1; }
  .col-head { display: none; }
  body.js.show-en #fr > * { display: none; }
  body.js.show-fr #en > * { display: none; }
  .clause { grid-template-columns: 2.2rem minmax(0,1fr); }
  .sig { grid-template-columns: 1fr; row-gap: 12px; }
  .sig .right { text-align: left; }
}
@media (min-width: 761px) and (max-width: 1040px) {
  :root { --gutter: 32px; }
}
@media print {
  body { padding: 0; }
  .doc-nav, .lang-switch { display: none; }
  .columns { grid-template-columns: 1fr 24px 1fr; }
  body.js.show-en #fr > *, body.js.show-fr #en > * { display: grid; }
  body.js.show-en #fr > .col-head, body.js.show-fr #en > .col-head { display: flex; }
  a { color: inherit; }
}
@media (prefers-reduced-motion: reduce) { .clause.paired::before { animation: none; } }
