/* scottluntz.com
   Tokens are the paper's own, so moving from this page to the paper or the
   dashboard reads as one site rather than three. */

:root {
  color-scheme: light;
  --ground: #F5F6F8;
  --sheet: #FFFFFF;
  --ink: #11161C;
  --ink-2: #4A5563;
  --ink-3: #6E7A88;
  --rule: #DCE1E7;
  --rule-strong: #B7C0CB;
  --accent: #0E7250;
  --s-shape: #1baf7a;
  --s-comp: #2a78d6;
  /* Darker twins of the series colours for text, which needs more contrast
     than a 3px line does. */
  --s-shape-ink: #0E7250;
  --s-comp-ink: #1d5fb0;
  --on-accent: #FFFFFF;

  --font-serif: ui-serif, "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, serif;
  /* The page uses the screen: 84rem across on desktop, one column on a phone.
     Running text is still held to a readable measure inside its column. */
  --page: 84rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --column: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #0E1216;
    --sheet: #161B21;
    --ink: #E7EDF3;
    --ink-2: #A9B5C1;
    --ink-3: #8593A1;
    --rule: #28313A;
    --rule-strong: #3B4653;
    --accent: #3FD09A;
    --s-shape: #199e70;
    --s-comp: #3987e5;
    --s-shape-ink: #3FD09A;
    --s-comp-ink: #7DB2F2;
    --on-accent: #0E1216;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.6;
}

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(2.25rem, 5vw, 4rem) var(--gutter) 3rem;
}

/* The narrow single column, used by the 404 page. */
.wrap {
  max-width: var(--column);
  margin: 0 auto;
  padding: clamp(2.25rem, 6vw, 3.75rem) 1rem 3rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Site bar: name on the left, three destinations on the right. */

.bar { border-bottom: 1px solid var(--rule); background: var(--sheet); }
.bar-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0.85rem var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  color: var(--ink);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.bar nav { display: flex; gap: 1.4rem; font-size: 1rem; }
.bar nav a { color: var(--ink-2); text-decoration: none; }
.bar nav a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; }

/* Opening: who, what, and the finding, side by side on a wide screen. */

.opening {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.75rem 4.5rem;
}

h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(2.9rem, 7vw, 4.4rem);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.role {
  margin: 0 0 1.25rem;
  font-size: clamp(1.15rem, 2.4vw, 1.3rem);
  font-style: italic;
  color: var(--accent);
}

.lede {
  margin: 0;
  max-width: 40ch;
  font-size: clamp(1.2rem, 2.4vw, 1.4rem);
  line-height: 1.45;
  color: var(--ink-2);
}

/* Buttons. One solid button per block for the main action; the rest are
   outlined or plain links, so the page never asks for two things at once. */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.75rem;
}
.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--sheet);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
  text-decoration: none;
}
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn:focus-visible { outline-offset: 2px; border-radius: 6px; }
.actions .quiet { font-size: 1rem; }

/* The one figure on the page: the crossover */

.hero { margin: 0; }
.hero .finding {
  margin: 0 0 1.25rem;
  max-width: 34ch;
  font-size: clamp(1.35rem, 2.6vw, 1.65rem);
  line-height: 1.25;
  font-weight: 600;
}
.hero svg { display: block; width: 100%; height: auto; overflow: visible; }
.hero figcaption {
  margin-top: 1rem;
  max-width: 64ch;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.chart text {
  font-family: var(--font-serif);
  font-size: 14px;
  fill: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .baseline { stroke: var(--rule-strong); stroke-width: 1; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .line { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .shape { stroke: var(--s-shape); }
.chart .results { stroke: var(--s-comp); }
.chart .dot-shape { fill: var(--s-shape); }
.chart .dot-results { fill: var(--s-comp); }
.chart .lbl { font-size: 16px; font-weight: 600; }
.chart .lbl-shape { fill: var(--s-shape-ink); }
.chart .lbl-results { fill: var(--s-comp-ink); }
.chart .lbl-cross { fill: var(--ink-2); }

/* At phone width the 600-unit chart shrinks by almost half, so its text is
   set larger in chart units to land at a readable size on screen. */
@media (max-width: 560px) {
  .chart text { font-size: 21px; }
  .chart .lbl { font-size: 23px; }
  .chart .tick-mid { display: none; }
}

/* One orchestrated moment: the two lines draw in, then the labels arrive.
   Only when the page's script has run (html.anim), so a reader view, crawler
   or link-preview renderer that skips script still gets the finished chart
   rather than empty axes. */
@media (prefers-reduced-motion: no-preference) {
  .anim .chart .line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 1.4s cubic-bezier(.3, .7, .2, 1) .25s forwards;
  }
  .anim .chart .results { animation-delay: .6s; }
  .anim .chart .late { opacity: 0; animation: arrive .5s ease 1.8s forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes arrive { to { opacity: 1; } }

/* Sections */

section { margin-top: clamp(3.5rem, 7vw, 5.5rem); }

h2 {
  margin: 0 0 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-strong);
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 600;
}

/* Work: one panel per project, side by side from tablet width up. */

.projects {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.project {
  display: flex;
  flex-direction: column;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}
.project .thumb { display: block; border-bottom: 1px solid var(--rule); }
.project .thumb img { display: block; width: 100%; height: auto; }
.project .body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.5rem clamp(1.25rem, 2.5vw, 1.75rem) 1.75rem;
}
.project .body > p { margin: 0 0 0.9rem; }
/* Buttons sit on a common line at the foot of both panels. */
.project .actions { margin-top: auto; padding-top: 1.5rem; }

h3 {
  margin: 0 0 0.2rem;
  font-size: 1.4rem;
  line-height: 1.2;
  font-weight: 600;
}
h3 a { color: var(--ink); text-decoration: none; }
h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }

.kind {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-style: italic;
  color: var(--ink-3);
}

/* Key results: the numbers a reader should leave with. */
.results {
  margin: 0;
  padding-left: 1.15rem;
}
.results li { margin: 0.4rem 0; padding-left: 0.2rem; }
.results li::marker { color: var(--accent); }
.results strong { font-weight: 600; }

/* About: the text, and beside it what the work is built with. */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem 4.5rem;
  align-items: start;
}
.about-text p { margin: 0 0 1rem; max-width: 64ch; }

.toolkit {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.5rem clamp(1.25rem, 2.5vw, 1.75rem);
}
.toolkit h3 { font-size: 1.2rem; margin: 0 0 1rem; }
.toolkit dl { margin: 0; display: grid; gap: 1rem; }
.toolkit dt { font-weight: 600; font-size: 1rem; }
.toolkit dd { margin: 0.15rem 0 0; font-size: 1rem; line-height: 1.5; color: var(--ink-2); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
}

footer {
  margin-top: clamp(3.5rem, 7vw, 5rem);
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--ink-3);
}
footer p { margin: 0; }

/* Tablet up: the two projects side by side, with the preview images cropped
   to a strip from the top so each panel leads with its text, not a poster. */
@media (min-width: 760px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project .thumb img { aspect-ratio: 2.5 / 1; object-fit: cover; object-position: top center; }
}

/* Desktop: intro beside the chart, About text beside the toolkit, and a type
   scale set for a wide screen. The sizes above suit a single phone column;
   kept at full width they read as zoomed in. */
@media (min-width: 1024px) {
  body { font-size: 1.0625rem; }
  .page { padding-top: clamp(2rem, 3.5vw, 3rem); }
  .opening { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
  .about-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

  .wordmark { font-size: 1rem; }
  .bar nav { font-size: 0.95rem; }
  h1 { font-size: 3.4rem; }
  .role { font-size: 1.15rem; margin-bottom: 1rem; }
  .lede { font-size: 1.2rem; }
  .actions { margin-top: 1.5rem; }
  .btn, .actions .quiet { font-size: 0.95rem; }
  .hero .finding { font-size: 1.35rem; margin-bottom: 0.75rem; }
  .hero figcaption { font-size: 0.95rem; }

  section { margin-top: 4.5rem; }
  h2 { font-size: 1.35rem; margin-bottom: 1.5rem; }
  h3 { font-size: 1.25rem; }
  .project .body { font-size: 1rem; }
  .kind { font-size: 0.95rem; }
  .toolkit dt, .toolkit dd { font-size: 0.95rem; }
  footer { margin-top: 4rem; }
}
