/* Small Caps Media — tokens and page styles. Values documented in DESIGN.md. */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-roman.woff2") format("woff2-variations"),
       url("../fonts/source-serif-4-roman.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-italic.woff2") format("woff2-variations"),
       url("../fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 300 600;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --paper: #F5F1E8;
  --paper-2: #ECE6DA;
  --ink: #1A1714;
  --ink-2: #5A534A;
  --rule: #CFC6B6;
  --accent: #9E2A1F;

  --font: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --t-display: clamp(2.75rem, 1.6rem + 5.2vw, 6rem);
  --t-h2: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --t-h3: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  --t-lede: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --t-body: 1.125rem;
  --t-label: 1rem;
  --t-fine: 0.9375rem;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  --page: 76rem;
  --gutter: var(--s-5);
  --measure: 34rem;
  --section: var(--s-9);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14120F;
    --paper-2: #1C1915;
    --ink: #EDE7DB;
    --ink-2: #A9A194;
    --rule: #3A352E;
    --accent: #E27A68;
  }
}

@media (max-width: 40rem) {
  :root {
    --gutter: var(--s-4);
    --section: var(--s-8);
  }
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--s-5);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.6;
  font-optical-sizing: auto;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, dl, dd, address, figure { margin: 0; }
h1, h2, h3 {
  font-weight: 400;
  font-variant-numeric: lining-nums;
  text-wrap: balance;
}
p, li, dd { text-wrap: pretty; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
address { font-style: normal; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness 120ms ease;
}
a:hover { text-decoration-thickness: 2px; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.label {
  font-size: var(--t-label);
  line-height: 1.3;
  font-variant-caps: all-small-caps;
  font-variant-numeric: lining-nums;
  letter-spacing: 0.06em;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: var(--s-2) var(--s-3);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  z-index: 10;
}
.skip:focus { top: var(--s-3); }

/* Masthead */

.masthead {
  border-bottom: 2px solid var(--ink);
}
.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2) var(--s-6);
  padding-block: var(--s-5) var(--s-4);
}
.wordmark {
  font-size: 1.625rem;
  line-height: 1;
  font-weight: 500;
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.wordmark:hover { text-decoration: none; }
.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-5);
}
.nav a {
  text-decoration-color: transparent;
}
.nav a:hover { text-decoration-color: var(--accent); }

/* Opening */

.opening {
  padding-block: var(--section) var(--s-8);
}
.opening .kicker {
  color: var(--ink-2);
  margin-bottom: var(--s-5);
}
.opening h1 {
  font-size: var(--t-display);
  line-height: 1.0;
  font-weight: 380;
  letter-spacing: -0.02em;
  max-width: 11.5em;
}
.opening h1 em {
  font-weight: 340;
}
.opening .lede {
  margin-top: var(--s-7);
  font-size: var(--t-lede);
  line-height: 1.45;
  max-width: var(--measure);
}

/* Contents strip: the three practices, like a front page's index */

.contents {
  margin-top: var(--s-8);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}
.contents li + li { border-left: 1px solid var(--rule); }
.contents a {
  display: block;
  height: 100%;
  padding: var(--s-5) var(--s-5) var(--s-5) 0;
  text-decoration: none;
}
.contents li + li a { padding-left: var(--s-5); }
.contents .num {
  color: var(--accent);
  margin-right: var(--s-2);
}
.contents .line {
  display: block;
  margin-top: var(--s-2);
  font-size: var(--t-h3);
  line-height: 1.25;
}
.contents a:hover .line {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

@media (max-width: 48rem) {
  .contents { grid-template-columns: 1fr; }
  .contents li + li { border-left: 0; border-top: 1px solid var(--rule); }
  .contents a,
  .contents li + li a { padding: var(--s-4) 0; }
}

/* Practice sections */

.practice {
  padding-block: var(--section);
  border-top: 1px solid var(--rule);
}
.practice .wrap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--s-5);
}
.practice header {
  grid-column: 1 / span 5;
  align-self: start;
  position: sticky;
  top: var(--s-6);
}
.practice .kicker {
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
  margin-bottom: var(--s-4);
}
.practice .kicker .num { color: var(--accent); }
.practice h2 {
  font-size: var(--t-h2);
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.practice .body {
  grid-column: 7 / span 6;
  max-width: var(--measure);
}
.practice .body > p {
  font-size: var(--t-lede);
  line-height: 1.45;
}

.offers {
  margin-top: var(--s-7);
  border-top: 1px solid var(--rule);
}
.offers .offers-label {
  color: var(--ink-2);
  padding-top: var(--s-4);
}
.offers dl > div {
  padding-block: var(--s-5);
  border-bottom: 1px solid var(--rule);
}
.offers dt {
  font-size: var(--t-h3);
  line-height: 1.25;
}
.offers dd {
  margin-top: var(--s-2);
  color: var(--ink-2);
}

@media (max-width: 56rem) {
  .practice header,
  .practice .body { grid-column: 1 / -1; }
  .practice header { position: static; }
  .practice .body { margin-top: var(--s-6); }
}

/* Contact */

.contact {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  padding-block: var(--section);
}
.contact .wrap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--s-5);
  row-gap: var(--s-7);
}
.contact header { grid-column: 1 / span 6; }
.contact .kicker {
  color: var(--ink-2);
  margin-bottom: var(--s-4);
}
.contact h2 {
  font-size: var(--t-h2);
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.contact .email {
  display: inline-block;
  margin-top: var(--s-5);
  font-size: var(--t-h2);
  line-height: 1.15;
  font-weight: 380;
  overflow-wrap: anywhere;
}
.contact address {
  grid-column: 8 / span 5;
  align-self: end;
  font-variant-numeric: lining-nums;
}
.contact address .label {
  display: block;
  color: var(--ink-2);
  margin-bottom: var(--s-2);
}

@media (max-width: 56rem) {
  .contact header,
  .contact address { grid-column: 1 / -1; }
}
@media (max-width: 40rem) {
  .contact .email { font-size: var(--t-h3); }
}

/* Footer */

.footer {
  border-top: 1px solid var(--rule);
  padding-block: var(--s-6) var(--s-7);
  color: var(--ink-2);
  font-size: var(--t-fine);
  line-height: 1.5;
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-4) var(--s-7);
}
.footer p { max-width: 44rem; }
.footer .wordmark-small {
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* 404 */

.notfound {
  padding-block: var(--s-10);
  min-height: 60vh;
}
.notfound h1 {
  font-size: var(--t-h2);
  line-height: 1.08;
  margin-block: var(--s-4) var(--s-5);
}

main:focus { outline: none; }
