/* Yellow #ffd401 is the accent used on paulmartinmarketing.com.
   Type, grid, and section structure here are separate from that site. */

:root {
  --yellow: #ffd401;
  --ink: #161616;
  --paper: #f4f1e8;
  --paper-2: #ebe6da;
  --text: #161616;
  --on-yellow: #161616;
  --on-ink: #f7f4ec;
  --line: rgba(22, 22, 22, 0.16);
  --line-light: rgba(247, 244, 236, 0.28);
  --display: "Segoe UI", "Avenir Next", "Helvetica Neue", sans-serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --max: 1120px;
  --gutter: clamp(1.15rem, 4vw, 2.4rem);
  --nav-h: 4.25rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  color-scheme: light;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
blockquote,
figure {
  margin: 0;
}

h1,
h2,
h3,
.figure,
.brand,
.nav-links a,
.eyebrow,
.card-kicker,
.when,
.read-more,
button,
.phase {
  font-family: var(--display);
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
}

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

.evidence :focus-visible,
.nav :focus-visible {
  outline-color: var(--yellow);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-140%);
  background: var(--yellow);
  color: var(--on-yellow);
  padding: 0.7rem 1rem;
  z-index: 40;
  font-family: var(--display);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  transform: none;
}

.wrap {
  width: min(100%, var(--max));
  max-width: 100%;
  min-width: 0;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow,
.card-kicker,
.phase {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 0.85rem;
}

.prose p + p,
.entry p + p,
.fact p + a,
.cause-panel p {
  margin-top: 0.9rem;
}

.prose a,
.entry a,
.sources a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.prose a:hover:not(.contact-link),
.entry a:hover,
.sources a:hover {
  background: var(--yellow);
  text-decoration: none;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ink);
  color: var(--on-ink);
  border-bottom: 4px solid var(--yellow);
}

.nav-bar {
  width: min(100%, var(--max));
  max-width: 100%;
  min-width: 0;
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}

.brand {
  color: var(--yellow);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: transparent;
  color: var(--on-ink);
  border: 1px solid var(--yellow);
  font: inherit;
  font-family: var(--display);
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.2rem 0.15rem;
  list-style: none;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  color: var(--on-ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 0.55rem;
}

.nav-links a:hover {
  background: var(--yellow);
  color: var(--on-yellow);
}

.opening {
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2.8rem, 6vw, 4.5rem);
}

.opening-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.opening h1 {
  font-size: clamp(2.7rem, 12vw, 7.2rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.86;
}

.opening h1 span {
  display: block;
}

.byline {
  margin-top: 40px;
  max-width: 36rem;
  font-family: var(--display);
  font-size: 0.95rem;
  line-height: 1.45;
}

.byline-name,
.byline time {
  display: block;
}

.byline time {
  margin-top: 0.35rem;
}

.byline a {
  color: inherit;
  font-weight: 700;
}

.definition-card {
  background: var(--yellow);
  color: var(--on-yellow);
  border: 2px solid var(--ink);
  padding: clamp(1.35rem, 3vw, 2.1rem);
}

.definition-card .sharp {
  margin-top: 0.85rem;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.section {
  padding: clamp(3.2rem, 7vw, 5.75rem) 0;
}

.section h2,
.consult h2 {
  font-size: clamp(2.1rem, 4.4vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  max-width: 22ch;
}

.definition-grid {
  display: grid;
  gap: clamp(1.8rem, 4vw, 3.5rem);
}

.prose {
  max-width: 42rem;
}

.prose p,
.entry p,
.fact p,
.caveat,
.consult p {
  font-size: 1.05rem;
}

.cause-panel {
  background: var(--ink);
  color: var(--on-ink);
  padding: clamp(1.25rem, 2.5vw, 1.8rem);
}

.cause-panel h3 {
  font-size: 1.55rem;
  margin-bottom: 1rem;
}

.causes {
  list-style: none;
  padding: 0;
  counter-reset: cause;
}

.causes li {
  counter-increment: cause;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line-light);
}

.causes h4 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.causes h4::before {
  content: counter(cause, decimal-leading-zero);
  display: block;
  color: var(--yellow);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.25rem;
}

.causes p {
  color: var(--on-ink);
  margin-top: 0.35rem;
}

.evidence {
  background: var(--ink);
  color: var(--on-ink);
}

.evidence .eyebrow {
  color: var(--yellow);
}

.evidence .lead,
.caveat {
  max-width: 44rem;
}

.evidence .lead {
  font-size: 1.12rem;
  margin-bottom: 0.5rem;
}

.table-scroll {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  margin-top: 1.6rem;
  border-top: 1px solid rgba(255, 212, 1, 0.45);
  -webkit-overflow-scrolling: touch;
}

.evidence table {
  width: 100%;
  min-width: 58rem;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.45;
}

.evidence caption {
  caption-side: top;
  text-align: left;
  padding: 0.85rem 0;
  color: var(--yellow);
  font-family: var(--display);
  font-weight: 700;
}

.evidence th,
.evidence td {
  text-align: left;
  vertical-align: top;
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid rgba(255, 212, 1, 0.28);
}

.evidence thead th {
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yellow);
}

.evidence tbody th {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.evidence td a {
  color: var(--yellow);
  font-family: var(--display);
  font-weight: 500;
}

.evidence td a:hover {
  background: var(--yellow);
  color: var(--on-yellow);
}

.faq-list {
  margin-top: 0.5rem;
}

.faq-list section {
  padding: 1.25rem 0;
  border-top: 8px solid var(--yellow);
  max-width: 44rem;
}

.faq-list h3 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  margin-bottom: 0.55rem;
}

.caveat {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 212, 1, 0.45);
}

.correction {
  margin: 1.5rem 0 0.5rem;
  padding: 0 0 0 1.1rem;
  border-left: 8px solid var(--yellow);
  max-width: 44rem;
}

.correction p {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 600;
  line-height: 1.45;
}

.timeline {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
}

.entry {
  display: grid;
  gap: 0.7rem;
  padding: 1.5rem 0 1.5rem 1rem;
  border-left: 3px solid var(--yellow);
}

.when {
  position: relative;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 4.75rem;
  margin-bottom: 1.15rem;
  background: var(--yellow);
  color: var(--on-yellow);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.03em;
  padding: 0.3rem 0.5rem;
}

.when::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -16px;
  height: 16px;
  background: var(--yellow);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.entry:last-child .when {
  margin-bottom: 0;
}

.entry:last-child .when::after {
  display: none;
}

.phase {
  margin-bottom: 0.35rem;
}

.entry h3 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  margin-bottom: 0.55rem;
}

.frontier {
  list-style: none;
  padding: 0.4rem 0 0;
}

.frontier li {
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}

.consult {
  background: var(--yellow);
  color: var(--on-yellow);
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.consult h2 {
  max-width: 12ch;
}

.consult p {
  max-width: 36rem;
  font-size: 1.2rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.4rem;
  min-height: 3.2rem;
  padding: 0.8rem 1.2rem;
  background: var(--ink);
  color: var(--yellow);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}

.read-more:hover {
  background: var(--paper);
  color: var(--ink);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.4rem;
  min-height: 3.2rem;
  padding: 0.75rem 1.2rem;
  border: 2px solid var(--ink);
  background: var(--yellow);
  color: var(--on-yellow);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
}

.prose .contact-link:hover {
  background: var(--ink);
  color: var(--yellow);
  text-decoration: none;
}

.authority-list {
  list-style: none;
  padding: 0;
  margin: 1.6rem 0 0;
  display: grid;
  gap: 1.25rem;
}

.authority-list article {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fffdf8;
  border: 2px solid var(--ink);
}

.authority-list img {
  display: block;
  width: 100%;
  height: 240px;
  min-height: 0;
  flex: 0 0 240px;
  object-fit: cover;
  object-position: center 20%;
  background: var(--ink);
}

.authority-list .portrait-paul {
  object-position: center 22%;
}

.authority-list .portrait-lily {
  object-position: center 18%;
}

.authority-list .portrait-tom {
  object-position: 68% 10%;
}

.authority-list article > div {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  padding: 1rem 1rem 1.15rem;
}

.authority-list h3 {
  font-size: 1.55rem;
}

.authority-list .role {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.authority-list a {
  margin-top: auto;
  padding-top: 0.4rem;
  font-family: var(--display);
  font-weight: 700;
  text-underline-offset: 0.18em;
}

.authority-list a:hover {
  background: var(--yellow);
  text-decoration: none;
}

.sources {
  background: var(--paper-2);
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  border-top: 8px solid var(--yellow);
}

.sources h2 {
  font-family: var(--display);
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}

.sources ol {
  margin: 0;
  padding-left: 1.2rem;
  max-width: 52rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.faq .eyebrow {
  text-transform: none;
  letter-spacing: 0.08em;
}

.sources li + li {
  margin-top: 0.55rem;
}

@media (min-width: 800px) {
  .opening-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(16rem, 0.85fr);
  }

  .definition-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
    align-items: start;
  }

  .entry {
    grid-template-columns: 9.5rem minmax(0, 1fr);
    gap: 1.25rem 1.5rem;
    padding-left: 1.25rem;
  }

  .authority-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
}

@media (min-width: 980px) {
  .consult-inner {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 2rem;
  }

  .read-more {
    margin-top: 0;
    flex: 0 0 auto;
  }
}

@media (max-width: 920px) {
  .js .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .js .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 0;
    background: var(--ink);
    border: 1px solid var(--yellow);
    padding: 0.4rem;
  }

  .js .nav-links.is-open {
    display: flex;
  }

  .js .nav-links a {
    padding: 0.75rem 0.7rem;
  }
}

@media (max-width: 700px) {
  .opening-title,
  .definition-card,
  .byline,
  .card-kicker,
  .definition-card .sharp,
  .eyebrow,
  .section h2,
  .consult h2,
  .consult p,
  .sources h2,
  .evidence caption {
    text-align: center;
  }

  .opening h1 {
    font-size: clamp(2.8rem, 16vw, 4.4rem);
  }

  .section h2,
  .consult h2,
  .prose,
  .byline,
  .evidence .lead,
  .caveat,
  .correction,
  .faq-list section,
  .consult p,
  .sources ol {
    max-width: none;
    margin-inline: auto;
  }

  .prose p,
  .evidence .lead,
  .caveat,
  .correction,
  .entry,
  .faq-list section,
  .cause-panel,
  .sources li {
    text-align: left;
  }

  .read-more,
  .contact-link {
    display: flex;
    width: 100%;
    box-sizing: border-box;
  }

  .authority-list img {
    height: 140px;
    flex-basis: 140px;
  }

  .evidence table {
    min-width: 0;
  }

  .evidence thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .evidence tr {
    display: block;
    padding: 1.15rem 0 0.45rem;
    border-bottom: 1px solid rgba(255, 212, 1, 0.45);
  }

  .evidence tbody th,
  .evidence td {
    display: block;
    width: auto;
    padding: 0.35rem 0;
    border: 0;
  }

  .evidence tbody th {
    font-size: 1.2rem;
    text-align: center;
  }

  .evidence td::before {
    display: block;
    margin-bottom: 0.15rem;
    color: var(--yellow);
    font-family: var(--display);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .evidence td:nth-child(2)::before {
    content: "Figure";
  }

  .evidence td:nth-child(3)::before {
    content: "Period";
  }

  .evidence td:nth-child(4)::before {
    content: "Panel";
  }

  .evidence td:nth-child(5)::before {
    content: "Source";
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
