/* thibaultc.com: one face, two tones, no motion.
   The home page is a company record (the name, then labelled facts) set on a page-margin canon
   (left to right margin 1:2, top to bottom 1:2), so it holds its
   place at any screen size. */

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

/* Georgia scaled to EB Garamond's size, so the swap barely moves the text. */
@font-face {
  font-family: "Garamond fallback";
  src: local("Georgia");
  size-adjust: 88%;
  ascent-override: 100%;
  descent-override: 30%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light dark;

  --paper: oklch(97.6% 0.004 255);
  --ink: oklch(25% 0.035 262);
  --ink-quiet: oklch(47% 0.03 262);
  --rule: oklch(25% 0.035 262 / 0.32);

  --font: "EB Garamond", "Garamond fallback", "Iowan Old Style", Palatino, Georgia, serif;
  --size: clamp(1.25rem, 1rem + 0.5vw, 1.5625rem);
  --size-small: 0.84em;
  --leading: 1.42;
  --measure: calc(29 * var(--size));
  --measure-wide: calc(35 * var(--size));
  --gutter: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(18.5% 0.02 262);
    --ink: oklch(91% 0.012 255);
    --ink-quiet: oklch(70% 0.022 258);
    --rule: oklch(91% 0.012 255 / 0.34);
  }
}

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

html,
body {
  overflow-x: clip;
}

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-columns:
    minmax(var(--gutter), 1fr)
    minmax(0, var(--measure-wide))
    minmax(var(--gutter), 2fr);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--size);
  line-height: var(--leading);
  font-weight: 400;
  font-synthesis: none;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body > * {
  grid-column: 2;
}

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

h1,
h2,
h3,
p,
ul,
address {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  font-style: normal;
}

p,
li {
  text-wrap: pretty;
  hanging-punctuation: first;
}

/* Abbreviations in true small capitals, as a book would set them. */
.sc {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.035em;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
  border-radius: 1px;
}

a:hover {
  text-decoration-color: currentColor;
}

a:active {
  color: var(--ink-quiet);
}

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

/* The foot of every page: two quiet links. */
.foot {
  padding-block: 2.5rem 2rem;
  font-size: var(--size-small);
  color: var(--ink-quiet);
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75em;
  padding: 0;
  list-style: none;
}

.foot a {
  display: inline-block;
  padding-block: 0.5em;
  text-decoration-color: transparent;
}

.foot a:hover,
.foot a[aria-current="page"] {
  color: var(--ink);
}

.foot a:hover {
  text-decoration-color: currentColor;
}

.foot a:focus-visible {
  outline-color: var(--ink);
}

/* Home: the statement sits one third down, the foot at the bottom. */
.home {
  grid-template-rows: 1fr auto 2fr auto;
}

.home main {
  grid-row: 2;
  padding-block: 3rem 0;
}

.home .foot {
  grid-row: 4;
}

/* Reading pages: support, privacy, not found. */
.page {
  grid-template-rows: auto 1fr auto;
  line-height: 1.48;
  font-variant-numeric: lining-nums proportional-nums;
}

.page .head {
  padding-block: 2.5rem 0;
}

.page .head a {
  display: inline-block;
  padding-block: 0.5em;
  text-decoration-color: transparent;
}

.page .head a:hover {
  text-decoration-color: currentColor;
}

.page main {
  padding-block: clamp(3rem, 12svh, 7rem) 4rem;
}

.page main > * {
  max-width: var(--measure);
}

.page h1 {
  font-size: 1.7em;
  line-height: 1.15;
  letter-spacing: -0.005em;
  font-variant-numeric: lining-nums;
  text-wrap: balance;
}

.page h2 {
  margin-top: 2.6em;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  font-size: 1.08em;
  text-wrap: balance;
}

.page h3 {
  margin-top: 1.9em;
  font-style: italic;
  text-wrap: balance;
}

.page h4 {
  margin: 1.5em 0 0;
  font-size: inherit;
  font-weight: 600;
}

.page main p,
.page main ul,
.page main address {
  margin-top: 0.75em;
}

.page main h1 + p {
  margin-top: 1.5em;
}

.page main ul {
  padding-left: 1.1em;
}

.page main li + li {
  margin-top: 0.4em;
}

.page main li::marker {
  color: var(--ink-quiet);
}

.page strong {
  font-weight: 600;
}

.page .quiet {
  color: var(--ink-quiet);
}

.page main address {
  margin-top: 2.25em;
}

@media print {
  :root {
    --paper: white;
    --ink: black;
    --ink-quiet: black;
  }
}

/* Home as a company record: the name as a letterhead, then labelled facts. */
.record {
  font-variant-numeric: lining-nums proportional-nums;
}

.record h1 {
  font-size: 1.75em;
  line-height: 1.1;
  letter-spacing: -0.008em;
}

.record h1 .sc {
  letter-spacing: 0.015em;
}

.record .lead {
  margin-top: 0.35em;
}

.record dl {
  margin: 2.4lh 0 0;
  display: grid;
  row-gap: 1.05lh;
}

.record dl > div {
  display: grid;
  grid-template-columns: 8.25em minmax(0, 1fr);
  column-gap: 1.25em;
}

.record dt {
  color: var(--ink-quiet);
  font-style: italic;
}

.record dd {
  margin: 0;
  max-width: 25.5em;
  text-wrap: pretty;
}

.ln {
  font-variant-numeric: lining-nums proportional-nums;
}

@media (max-width: 40rem) {
  .record dl > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .record dl {
    row-gap: 0.9lh;
  }
}
