/* Payton Labs site styles, brand guidelines v5.0.
   One type family (the reader's system font), hierarchy from weight and size,
   ink on white, deep teal used at most twice a page. */

:root {
  --ink: #111111;
  --ink-2: #3D3D3F;          /* secondary text */
  --ink-3: #6E6E70;          /* captions, metadata */
  --teal: #0B6373;
  --teal-dark: #06414C;      /* teal as text on white */
  --paper: #F7F7F5;          /* alternate section ground */
  --hairline: rgba(0, 0, 0, 0.1);
  --white: #FFFFFF;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mark: "Source Serif 4", Georgia, serif;   /* the wordmark only */

  --measure: 40rem;          /* comfortable line length for prose */
  --page: 67.5rem;           /* 1080px */
  --gutter: 2.5rem;
  --radius: 1.125rem;        /* photos and panels */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font: 400 1.0625rem/1.6 var(--font);
  letter-spacing: -0.003em;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
::selection { background: var(--teal); color: #fff; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

.page { max-width: var(--page); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding-top: 7.5rem; padding-bottom: 7.5rem; }
.section.tight { padding-top: 5rem; padding-bottom: 5rem; }
.ground-paper { background: var(--paper); }

/* Type. Tracking tightens as size grows; leading tightens with it. */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 1.03;
  letter-spacing: -0.032em;
  text-wrap: pretty;
}
.h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  line-height: 1.07;
  letter-spacing: -0.026em;
  text-wrap: pretty;
}
.h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.016em;
}
.lead {
  font-size: clamp(1.1875rem, 2vw, 1.5rem);
  line-height: 1.42;
  letter-spacing: -0.01em;
  color: var(--ink-2);
  max-width: 36em;
  text-wrap: pretty;
}
.prose { max-width: var(--measure); color: var(--ink-2); }
.prose p { text-wrap: pretty; }
.prose p + p { margin-top: 1.05em; }
.kicker {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 0.75rem;
}
.muted { color: var(--ink-3); }
.small { font-size: 0.875rem; line-height: 1.5; letter-spacing: 0; }

/* Figures: tabular, set large in the same family rather than a mono face. */
.figure {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.figure.accent { color: var(--teal); }

/* Nav: a translucent layer the page scrolls under. */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.nav .page { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; height: 3.5rem; }
.wordmark {
  font-family: var(--font-mark); font-weight: 700; font-size: 1.3125rem;
  letter-spacing: -0.01em; color: var(--ink); white-space: nowrap;
}
.wordmark:hover { text-decoration: none; color: var(--ink); }
.wordmark span { color: var(--teal); }
.nav-links { display: flex; align-items: center; gap: 1.75rem; }
.nav-links a:not(.btn) { color: var(--ink-2); font-size: 0.875rem; white-space: nowrap; }
.nav-links a:not(.btn):hover { color: var(--ink); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* Buttons: pill shaped, feedback on press rather than on release. */
.btn {
  display: inline-block;
  font: 600 1.0625rem/1 var(--font);
  letter-spacing: -0.01em;
  padding: 0.95rem 1.6rem;
  border-radius: 980px;
  background: var(--ink); color: var(--white);
  white-space: nowrap;
  transition: background-color 160ms var(--ease), transform 100ms ease-out;
}
.btn:hover { background: #2B2B2D; color: var(--white); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn.accent { background: var(--teal); }
.btn.accent:hover { background: var(--teal-dark); }
.btn.small { font-size: 0.8125rem; padding: 0.5rem 0.95rem; }

.more { font-size: 1.0625rem; font-weight: 500; white-space: nowrap; }
.more::after { content: " \203A"; display: inline-block; transition: transform 160ms var(--ease); }
.more:hover { text-decoration: none; }
.more:hover::after { transform: translateX(3px); }

/* Rows: label on the left, content on the right, separated by hairlines. */
.rows { border-top: 1px solid var(--hairline); }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 2.5rem;
  padding: 2rem 0; border-bottom: 1px solid var(--hairline);
}
.row .prose { max-width: none; }

/* Photos and panels share one continuous radius. */
.photo { border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

.avatars { display: flex; align-items: center; gap: 0.875rem; }
.avatars img { width: 2.5rem; height: 2.5rem; border-radius: 50%; object-fit: cover; border: 2px solid var(--white); }
.avatars img + img { margin-left: -1.25rem; }

.footer { border-top: 1px solid var(--hairline); padding: 2.5rem 0; color: var(--ink-3); font-size: 0.875rem; }
.footer .page { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer a { color: var(--ink-2); }

/* Case study cards and their graphics: homepage, /work and the end of each case study. */
.cases { margin-top: 3.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem 2rem; }
.case-card { display: block; color: inherit; }
.case-card:hover { text-decoration: none; color: inherit; }
.case-card .viz { background: var(--white); border-radius: var(--radius); aspect-ratio: 16 / 10; padding: 2rem 2.5rem; display: grid; place-items: center; transition: transform 200ms var(--ease); }
.case-card:hover .viz { transform: scale(1.015); }
.case-card:active .viz { transform: scale(0.99); }
.case-card svg { width: 100%; height: 100%; overflow: visible; }
.case-card .kicker { margin: 1.25rem 0 0.3rem; font-size: 0.9375rem; }
.case-card .h3 { font-size: clamp(1.375rem, 2.2vw, 1.75rem); letter-spacing: -0.02em; text-wrap: pretty; }
.case-card:hover .h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.viz text { font-family: var(--font); font-size: 14px; font-weight: 600; fill: var(--ink); letter-spacing: -0.01em; }
.viz .lbl { fill: var(--ink-3); font-weight: 500; font-size: 13px; }
.viz .soft { fill: #E2E2DE; }
.viz .ink { fill: var(--ink); }
.viz .on-ink { fill: #FFFFFF; }
.viz .outline { fill: #FFFFFF; stroke: var(--ink); stroke-width: 1.5; }
.viz .wire { stroke: #C9C9C4; stroke-width: 1.25; fill: none; }

@media (max-width: 760px) {
  :root { --gutter: 1rem; }
  .section { padding-top: 4.5rem; padding-bottom: 4.5rem; }
  .section.tight { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .row { grid-template-columns: 1fr; gap: 0.5rem; padding: 1.5rem 0; }
  .nav-links { gap: 1.1rem; }
  .nav-hide-sm { display: none; }
  .cases { grid-template-columns: 1fr; }
  .case-card .viz { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; }
  .btn:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--white); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --ink-2: #111111; --ink-3: #3D3D3F; --hairline: rgba(0, 0, 0, 0.45); }
}
