/* derekjmcnally.com
   Tokens: ink navy, cool pale paper, a single tea-amber accent.
   Type: Libre Caslon (an English face) for everything. */

:root {
  --ink: #1f2e4a;        /* navy, carried over from the 2012 site */
  --text: #1c2433;
  --muted: #55607a;
  --paper: #e8ecf0;      /* cool blue-grey, like a well-read newspaper in morning light */
  --sheet: #f6f8fa;
  --tea: #9a5f24;        /* strong English breakfast */
  --tea-soft: rgba(154, 95, 36, 0.22);
  --rule: #c3cad4;

  --display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --body: "Libre Caslon Text", Georgia, serif;

  --measure: 64ch;
  --gutter: clamp(16px, 4vw, 48px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: clip;
}

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

a { color: var(--ink); text-decoration-color: var(--tea); text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; }
a:hover { color: var(--tea); }

:focus-visible {
  outline: 3px solid var(--tea);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--sheet); padding: 0.5em 1em;
}
.skip:focus { left: var(--gutter); top: 8px; z-index: 10; }

/* Masthead */
.masthead {
  background: var(--ink);
  color: var(--sheet);
}
.masthead-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
}
.wordmark {
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--sheet);
  text-decoration: none;
}
.wordmark:hover { color: #fff; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 4px 28px;
}
.site-nav a {
  color: #d5dbe5;
  text-decoration: none;
  font-size: 1rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: #fff; border-bottom-color: var(--tea); }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--tea); }
.site-nav a:focus-visible { outline-color: #e2a865; }

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(56px, 8vw, 112px);
}

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.05;
  margin: 0;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

p { margin: 0 0 1.1em; max-width: var(--measure); }

/* Home */
.home {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.portrait {
  position: relative;
  margin: 0;
  justify-self: end;
  width: min(100%, 400px);
}
.portrait img {
  position: relative;
  z-index: 1;
  border: 10px solid var(--sheet);
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgba(31, 46, 74, 0.55);
}
/* The one bold thing: the ring a cup of tea leaves on the morning paper. */
.tea-ring {
  position: absolute;
  z-index: 0;
  width: 66%;
  left: -30%;
  bottom: -18%;
  pointer-events: none;
}
.tea-ring circle { fill: none; stroke: var(--tea); }
.tea-ring .stain { stroke-dasharray: 1000; stroke-dashoffset: 0; }

@media (prefers-reduced-motion: no-preference) {
  .tea-ring .stain { animation: set-down 1.6s 0.3s ease-out both; }
  @keyframes set-down {
    from { stroke-dashoffset: 1000; opacity: 0; }
    to { stroke-dashoffset: 0; opacity: 1; }
  }
}

.roles {
  font-style: italic;
  color: var(--muted);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  margin: 0.5em 0 1.6em;
}
.lede { font-size: 1.2rem; line-height: 1.65; }
.lede cite { font-style: italic; }

.coverage {
  margin-top: 2.2em;
  padding-top: 1.2em;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
}
.coverage h2 { font-size: 1.3rem; margin-bottom: 0.5em; }
.coverage ul { list-style: none; margin: 0; padding: 0; }
.coverage li { padding: 0.2em 0; }
.coverage time { color: var(--muted); font-variant-numeric: oldstyle-nums; }

/* Reading pages */
.page-head { margin-bottom: clamp(28px, 4vw, 48px); }
.page-head h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }

.reading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.reading .text { font-size: 1.125rem; }

.margin-note {
  border-left: 3px solid var(--tea);
  padding: 4px 0 4px 20px;
  font-size: 0.98rem;
}
.margin-note h2 { font-size: 1.25rem; margin-bottom: 0.7em; }
.margin-note ol { list-style: none; margin: 0; padding: 0; }
.margin-note li { margin-bottom: 1em; line-height: 1.45; }
.margin-note .year {
  display: block;
  font-family: var(--display);
  font-size: 1.9rem;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: oldstyle-nums;
}

/* Book */
.book {
  display: grid;
  grid-template-columns: 193px minmax(0, 1fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
}
.cover {
  margin: 0;
  background: var(--sheet);
  padding: 16px;
  box-shadow: 0 1px 0 var(--rule), 0 18px 36px -22px rgba(31, 46, 74, 0.6);
}
.cover img { width: 100%; }
.book h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
.book .subtitle {
  display: block;
  font-size: 0.6em;
  font-style: italic;
  color: var(--muted);
  margin-top: 0.3em;
}
.book .byline { margin: 0.8em 0 1.8em; color: var(--muted); }
.book .text { font-size: 1.125rem; }
.book .byline { margin-bottom: 0.6em; }
.book .buy { margin: 0 0 1.8em; }
.book .buy a {
  display: inline-block;
  padding: 0.55em 1.1em;
  background: var(--ink);
  color: var(--sheet);
  text-decoration: none;
  border-radius: 2px;
}
.book .buy a:hover { background: var(--tea); }
.book-links { display: flex; flex-wrap: wrap; gap: 0.4em 1.6em; }
.reviews { margin-top: 2.4em; padding-top: 1.2em; border-top: 1px solid var(--rule); max-width: var(--measure); }
.reviews h2 { font-size: 1.4rem; margin-bottom: 0.5em; }
.reviews ul { list-style: none; margin: 0; padding: 0; }
.reviews li { padding: 0.25em 0; }
.reviews time { color: var(--muted); font-variant-numeric: oldstyle-nums; }

/* Contact */
.contact { max-width: 760px; }
.contact .address {
  font-family: var(--display);
  font-size: clamp(1.35rem, 4.4vw, 2.6rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
  margin-top: 0.4em;
}

.contact .reveal {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

/* Footer */
.foot {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}
.foot-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px var(--gutter) 40px;
}
.foot p { margin: 0; }

/* Narrow screens */
@media (max-width: 820px) {
  .home, .reading, .book { grid-template-columns: minmax(0, 1fr); }
  .portrait { justify-self: start; width: min(78%, 340px); }
  .tea-ring { left: auto; bottom: auto; right: -40%; top: -4%; width: 56%; }
  .margin-note { order: -1; }
  .margin-note ol { display: flex; gap: 28px; }
  .cover { width: 180px; }
}
@media (max-width: 480px) {
  body { font-size: 1rem; }
  .wordmark { font-size: 1.4rem; }
  .site-nav ul { gap: 4px 22px; }
}
