/* Law Testimony
   Palette sampled from the cover of Jok, Animism of the Nilotics (Sidestone 2011):
   silhouettes for ink, the sun for the one accent, the sky highlight lightened
   for the page. One text face (Alegreya) with true small caps (Alegreya SC). */

:root {
  --paper: #f4ede0;
  --paper-2: #ebe3d3;
  --ink: #0e0e09;
  --ink-2: #1b1811;
  --text: #1f1b12;
  --muted: #5a4e3c;
  --line: #d6c9b1;
  --ochre: #9b7046;
  --ochre-deep: #7e5a35;
  --sun: #c0905a;
  --sun-light: #d2a86f;
  --on-dark: #f4ede0;
  --on-dark-muted: rgba(244, 237, 224, 0.78);

  --serif: "Alegreya", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sc: "Alegreya SC", "Alegreya", Georgia, serif;

  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s6: 1.5rem;
  --s8: 2rem; --s12: 3rem; --s16: 4rem; --s20: 5rem; --s24: 6rem;

  --measure: 64ch;
  --page: 74rem;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); background: var(--paper);
  font-family: var(--serif); font-size: 1.0625rem; line-height: 1.55;
  font-kerning: normal; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--ochre); text-underline-offset: 0.18em; transition: color 120ms linear; }
a:hover { color: var(--ochre-deep); }
.on-dark a:hover { color: var(--sun-light); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }

h1, h2, h3 { font-weight: 500; color: var(--ink); margin: 0; }
h1 { font-size: clamp(2.4rem, 4.6vw, 3.8rem); line-height: 1.02; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.25rem); line-height: 1.12; letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; line-height: 1.25; }
.on-dark h1, .on-dark h2, .on-dark h3 { color: var(--on-dark); }
p { margin: 0 0 var(--s4); }
p:last-child { margin-bottom: 0; }
.measure { max-width: var(--measure); }
.lead { font-size: 1.2rem; line-height: 1.45; }
.muted { color: var(--muted); }
.on-dark .muted { color: var(--on-dark-muted); }
.small { font-size: 0.92rem; line-height: 1.45; }

.overline { display: block; font-family: var(--sc); letter-spacing: 0.05em; font-size: 0.95rem; color: var(--ochre-deep); margin-bottom: var(--s3); }
.on-dark .overline { color: var(--sun-light); }

.skip { position: absolute; left: var(--s4); top: -3rem; padding: var(--s2) var(--s3); background: var(--ink); color: var(--paper); z-index: 20; }
.skip:focus { top: var(--s4); }

.page { width: min(var(--page), 100% - 3rem); margin-inline: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 0.85rem 1.4rem; border: 1px solid transparent; border-radius: 2px;
  font-family: var(--sc); letter-spacing: 0.05em; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color 140ms linear, color 140ms linear, border-color 140ms linear;
}
.btn-primary { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.btn-primary:hover { background: var(--sun-light); border-color: var(--sun-light); color: var(--ink); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-2); color: var(--paper); }
.btn-outline { background: transparent; border-color: currentColor; color: inherit; }
.btn-outline:hover { background: rgba(14, 14, 9, 0.06); color: inherit; }
.on-dark .btn-outline:hover { background: rgba(244, 237, 224, 0.1); }
.btn-small { padding: 0.55rem 1rem; font-size: 0.92rem; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: center; margin-top: var(--s6); }
.actions .aside { font-size: 0.95rem; color: var(--muted); }
.on-dark .actions .aside { color: var(--on-dark-muted); }

/* Navigation: a solid ink bar that runs into the dark photo headers,
   so the Contact button is always one tap away */
.nav { position: sticky; top: 0; z-index: 10; background: var(--ink); color: var(--on-dark); border-bottom: 1px solid rgba(244, 237, 224, 0.12); }
.nav-inner { display: flex; align-items: center; gap: var(--s8); min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--on-dark); margin-right: auto; }
.brand:hover { color: var(--on-dark); }
.monogram { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border: 1px solid var(--sun); color: var(--sun-light); font-family: var(--sc); font-size: 0.95rem; letter-spacing: 0.06em; }
.brand-name { font-family: var(--sc); font-size: 1.25rem; letter-spacing: 0.1em; }
.menu ul { display: flex; gap: var(--s8); list-style: none; margin: 0; padding: 0; }
.menu a { font-family: var(--sc); letter-spacing: 0.09em; font-size: 0.95rem; color: var(--on-dark); text-decoration: none; padding: 0.35rem 0; border-bottom: 1px solid transparent; transition: color 120ms linear, border-color 120ms linear; }
.menu a:hover { color: var(--sun-light); }
.menu a[aria-current="page"] { color: var(--sun-light); border-bottom-color: var(--sun); }
.nav-cta { white-space: nowrap; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(244, 237, 224, 0.3); color: var(--on-dark); padding: 0.45rem 0.55rem; border-radius: 2px; cursor: pointer; }
.nav-toggle svg { display: block; }

/* Footer brand keeps the older two-line wordmark */
.wordmark { font-family: var(--sc); font-size: 1.2rem; letter-spacing: 0.08em; text-decoration: none; white-space: nowrap; }
.wordmark small { display: block; font-family: var(--serif); font-size: 0.8rem; letter-spacing: 0.01em; color: var(--muted); margin-top: 0.1rem; }

/* Trust row in the hero */
.trust-row { list-style: none; margin: 0 0 var(--s6); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); font-family: var(--sc); letter-spacing: 0.04em; font-size: 0.95rem; color: var(--on-dark-muted); }
.trust-row li { display: inline-flex; align-items: center; gap: var(--s2); }
.trust-row svg { width: 1.3rem; height: 1.3rem; color: var(--sun-light); flex: none; }

/* Hero */
.hero { position: relative; isolation: isolate; background: var(--ink); color: var(--on-dark); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: 0.5; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 14, 9, 0.9) 0%, rgba(14, 14, 9, 0.72) 48%, rgba(14, 14, 9, 0.3) 100%); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--s12); align-items: center; padding: var(--s20) 0 var(--s16); }
.hero .lead { color: var(--on-dark-muted); max-width: 36em; margin-top: var(--s6); }
.hero-portrait { margin: 0; justify-self: end; width: min(100%, 28rem); }
.hero-portrait img { width: 100%; border: 1px solid rgba(244, 237, 224, 0.4); }
.hero-portrait figcaption { font-size: 0.95rem; color: var(--on-dark-muted); margin-top: var(--s3); line-height: 1.4; }
.hero-portrait figcaption b { font-weight: 500; color: var(--on-dark); display: block; font-size: 1.05rem; }

/* Credentials row */
.trust { border-bottom: 1px solid var(--line); background: var(--paper-2); }
.trust .page { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.trust div { padding: var(--s6) var(--s6) var(--s6) 0; border-right: 1px solid var(--line); margin-right: var(--s6); }
.trust div:last-child { border-right: 0; margin-right: 0; }
.trust b { display: block; font-weight: 500; font-size: 1.6rem; line-height: 1.05; color: var(--ink); margin-bottom: var(--s1); }
.trust span { font-size: 0.92rem; color: var(--muted); line-height: 1.35; display: block; }

/* Photo and text sections */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.split-media { position: relative; min-height: 32rem; }
.split-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.split-body { padding: var(--s16) var(--s12); display: flex; flex-direction: column; justify-content: center; }
.split-body .inner { max-width: 36rem; }
.split.text-left .split-body .inner { margin-left: auto; }
.split-body h2 { margin-bottom: var(--s4); }
.split-body h3 { margin: var(--s8) 0 var(--s2); }

/* Writing */
.writing { padding: var(--s16) 0; border-top: 1px solid var(--line); }
.writing .grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s12); align-items: start; }
.writing h2 { margin-bottom: var(--s2); }
.writing .lead { margin-bottom: var(--s8); }
table.cases { width: 100%; border-collapse: collapse; }
.cases th { text-align: left; font-family: var(--sc); font-weight: 400; letter-spacing: 0.04em; font-size: 0.9rem; color: var(--muted); padding: 0 var(--s4) var(--s2) 0; border-bottom: 1px solid var(--ink); }
.cases td { vertical-align: top; padding: var(--s3) var(--s4) var(--s3) 0; border-bottom: 1px solid var(--line); }
.cases td:last-child, .cases th:last-child { padding-right: 0; }
.cases .year { width: 3.5rem; font-variant-numeric: tabular-nums; color: var(--ochre-deep); white-space: nowrap; }
.cases .venue { display: block; font-style: italic; color: var(--muted); font-size: 0.95rem; margin-top: var(--s1); }
.cases .kind { font-family: var(--sc); letter-spacing: 0.04em; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

/* Plates */
.plate { margin: 0; }
.plate img { width: 100%; border: 1px solid var(--ink); background: #fff; }
.plate figcaption { font-style: italic; font-size: 0.9rem; line-height: 1.4; color: var(--muted); margin-top: var(--s2); }
.plate.cover img { width: auto; max-width: 100%; max-height: 26rem; }

/* Call to action band */
.band { position: relative; isolation: isolate; color: var(--on-dark); background: var(--ink); padding: var(--s20) 0; }
.band-bg { position: absolute; inset: 0; z-index: -1; }
.band-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.45; }
.band-bg::after { content: ""; position: absolute; inset: 0; background: rgba(14, 14, 9, 0.55); }
.band .inner { max-width: 44rem; }
.band .lead { color: var(--on-dark-muted); margin-top: var(--s4); }
.band .mail-link { font-size: 1.15rem; }

/* Sub-page header */
.page-hero { position: relative; isolation: isolate; background: var(--ink); color: var(--on-dark); padding: var(--s20) 0 var(--s12); }
.page-hero .bg { position: absolute; inset: 0; z-index: -1; }
.page-hero .bg img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, center); opacity: 0.45; }
.page-hero .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 14, 9, 0.55), rgba(14, 14, 9, 0.85)); }
.page-hero .lead { color: var(--on-dark-muted); margin-top: var(--s4); max-width: 38em; }
.page-hero h1 { max-width: 16ch; }

/* Content sections on sub-pages */
.content { padding: var(--s16) 0; }
.content + .content { border-top: 1px solid var(--line); }
.cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s12); align-items: start; }
.cols h2 { margin-bottom: var(--s4); }
.facts-title { font-family: var(--sc); letter-spacing: 0.05em; font-size: 0.95rem; color: var(--ochre-deep); margin: 0 0 var(--s3); }

/* Article and book entries */
.entry { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: var(--s12); padding: var(--s12) 0; border-top: 1px solid var(--line); align-items: start; }
.entry.no-plate { grid-template-columns: minmax(0, 1fr); }
.entry h2 { max-width: 30ch; margin-bottom: var(--s3); }
.cite { font-size: 0.95rem; color: var(--muted); margin-bottom: var(--s6); max-width: var(--measure); }
.cite i { font-style: italic; }
.entry .body { max-width: var(--measure); }
.entry .link { margin-top: var(--s4); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s12); align-items: start; }
.mail-big { font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.2; letter-spacing: -0.01em; word-break: break-all; margin: var(--s4) 0 var(--s8); }
ol.include { margin: 0; padding-left: 1.25rem; }
ol.include li { margin-bottom: var(--s2); }
form { display: grid; gap: var(--s4); background: var(--paper-2); padding: var(--s8); border: 1px solid var(--line); }
form h2 { font-size: 1.5rem; margin-bottom: var(--s2); }
.field { display: grid; gap: var(--s1); font-family: var(--sc); letter-spacing: 0.04em; font-size: 0.95rem; color: var(--muted); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
input, textarea, select { font: inherit; font-family: var(--serif); letter-spacing: 0; font-size: 1.05rem; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 2px; padding: 0.7rem 0.85rem; width: 100%; }
input:focus, textarea:focus, select:focus { border-color: var(--ochre); outline: none; box-shadow: 0 0 0 3px rgba(192, 144, 90, 0.25); }
textarea { min-height: 9rem; resize: vertical; }
.form-note { font-size: 0.9rem; color: var(--muted); }

/* Footer */
footer { border-top: 1px solid var(--ink); padding: var(--s12) 0 var(--s8); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--s8); }
footer h3 { font-family: var(--sc); letter-spacing: 0.05em; font-size: 0.95rem; color: var(--ochre-deep); font-weight: 400; margin-bottom: var(--s3); }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s2) var(--s8); margin-top: var(--s8); padding-top: var(--s4); border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.foot-bottom.bare { border-top: 0; margin-top: 0; }
.foot-blurb { margin-top: var(--s4); max-width: 34ch; }
.actions.tight { margin-top: var(--s2); }
.page-hero .bg img.pos-high { object-position: center 30%; }

/* Where the two-column hero stops working */
@media (max-width: 56rem) {
  .hero-inner { grid-template-columns: 1fr; gap: var(--s8); padding: var(--s12) 0; }
  .hero-portrait { justify-self: start; width: min(100%, 22rem); }
  .trust .page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust div:nth-child(2) { border-right: 0; }
  .trust div { padding: var(--s4) var(--s4) var(--s4) 0; margin-right: var(--s4); }
  .split { grid-template-columns: 1fr; }
  .split-media { min-height: 0; aspect-ratio: 16 / 10; }
  .split-body { padding: var(--s12) 0; width: min(var(--page), 100% - 3rem); margin-inline: auto; }
  .split.text-left .split-media { order: -1; }
  .writing .grid, .cols, .contact-grid { grid-template-columns: 1fr; gap: var(--s8); }
  .entry { grid-template-columns: 1fr; gap: var(--s6); }
  .entry .plate { max-width: 14rem; }
  .foot-grid { grid-template-columns: 1fr; }
}

@media (max-width: 36rem) {
  body { font-size: 1rem; }
  .page { width: min(var(--page), 100% - 2rem); }
  .split-body { width: min(var(--page), 100% - 2rem); }
  .row-2 { grid-template-columns: 1fr; }
  form { padding: var(--s6); }
  .trust .page { grid-template-columns: 1fr; }
  .trust div { border-right: 0; border-bottom: 1px solid var(--line); margin-right: 0; }
  .trust div:last-child { border-bottom: 0; }
  .cases .year { width: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a, .btn { transition: none; }
}


/* Phones: links fold behind the menu button; Contact stays visible */
@media (max-width: 36rem) {
  .nav-inner { gap: var(--s3); min-height: 3.75rem; }
  .brand-name { font-size: 0.95rem; letter-spacing: 0.06em; white-space: nowrap; }
  .nav-cta { padding: 0.5rem 0.8rem; }
  .nav-cta { order: 2; }
  .nav-toggle { display: inline-flex; order: 3; }
  .menu { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); border-bottom: 1px solid rgba(244, 237, 224, 0.12); padding: var(--s2) 1rem var(--s4); }
  .menu.open { display: block; }
  .menu ul { flex-direction: column; gap: 0; }
  .menu a { display: block; padding: var(--s3) 0; border-bottom: 1px solid rgba(244, 237, 224, 0.1); }
  .menu a[aria-current="page"] { border-bottom-color: rgba(244, 237, 224, 0.1); }
  .trust-row { gap: var(--s2) var(--s4); font-size: 0.9rem; }
}
