/* Benjy Stone portfolio
   Light, readable system: deep-green brand panels, sage and lilac tinted
   surfaces, EB Garamond headlines over Figtree body copy. Static site, no
   build step. Every motion collapses under prefers-reduced-motion. */

/* ================= tokens ================= */

:root {
  color-scheme: light;

  /* colour */
  --bg: oklch(0.982 0.008 150);
  --surface: oklch(0.947 0.022 150);        /* sage panel */
  --surface-lilac: oklch(0.93 0.038 310);   /* lilac panel */
  --ink: oklch(0.21 0.02 165);
  --ink-2: oklch(0.42 0.02 165);
  --line: oklch(0.21 0.02 165 / 0.14);
  --line-strong: oklch(0.21 0.02 165 / 0.3);
  --brand: oklch(0.36 0.07 168);
  --brand-deep: oklch(0.3 0.062 168);
  --on-brand: oklch(0.975 0.012 150);
  --on-brand-2: oklch(0.86 0.035 160);
  --on-brand-line: oklch(0.975 0.012 150 / 0.2);
  --white: oklch(1 0 0);

  /* type */
  --font-display: 'EB Garamond', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --text-sm: 0.9375rem;   /* 15 */
  --text-base: 1.125rem;  /* 18 */
  --text-lg: 1.3125rem;   /* 21 */
  --text-h3: clamp(1.625rem, 1.3rem + 1.2vw, 2rem);
  --text-h2: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  --text-h1: clamp(3.25rem, 1.9rem + 5.6vw, 6rem);
  --text-stat: clamp(3rem, 2.2rem + 3.4vw, 4.75rem);

  /* space + shape */
  --gutter: clamp(16px, 4vw, 40px);
  --edge: clamp(8px, 1.4vw, 16px);
  --max: 1200px;
  --section: clamp(72px, 9vw, 128px);
  --radius-panel: 24px;
  --radius-feature: 20px;
  --radius-card: 12px;
  --radius-full: 999px;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* layers */
  --z-nav: 100;
  --z-overlay: 200;
}

/* ================= base ================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul {
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
}

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

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

.on-brand :focus-visible {
  outline-color: var(--on-brand);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: var(--z-overlay);
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section);
}

.section--flush {
  padding-top: 0;
}

.section--tight {
  padding-block: clamp(40px, 5vw, 64px);
}

.section__head {
  display: grid;
  gap: 16px;
  max-width: 44rem;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section__title {
  font-size: var(--text-h2);
}

.section__intro {
  color: var(--ink-2);
  font-size: var(--text-lg);
  line-height: 1.5;
}

.meta {
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
}

.prose {
  max-width: 68ch;
  color: var(--ink);
}
.prose p + p {
  margin-top: 1em;
}
.prose--muted {
  color: var(--ink-2);
}

/* ================= buttons + links ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font: 600 1rem/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease-out),
    color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    transform 0.2s var(--ease-out);
}
.btn:active {
  transform: scale(0.97);
}

.btn--sm {
  min-height: 40px;
  padding: 0 18px;
  font-size: var(--text-sm);
}

.btn--ink {
  background: var(--ink);
  color: var(--bg);
}
.btn--ink:hover {
  background: var(--brand);
}

.btn--outline {
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn--outline:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.btn--light {
  background: var(--on-brand);
  color: var(--brand-deep);
}
.btn--light:hover {
  background: var(--white);
}

.btn--ghost-light {
  border-color: var(--on-brand-line);
  color: var(--on-brand);
}
.btn--ghost-light:hover {
  border-color: var(--on-brand);
  background: oklch(0.975 0.012 150 / 0.08);
}

.link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: currentColor;
  transition: text-decoration-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.link:hover {
  color: var(--brand);
}
.on-brand .link:hover {
  color: var(--white);
}

.arrow {
  display: inline-block;
  transition: transform 0.25s var(--ease-out);
}
a:hover .arrow {
  transform: translateX(4px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

/* ================= nav ================= */

.site-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease-out);
}
.site-nav.scrolled {
  border-bottom-color: var(--line);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.site-nav__wordmark {
  font-family: var(--font-display);
  font-size: 1.625rem;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-nav__right {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav__links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.site-nav__links a {
  position: relative;
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}
.site-nav__links a:hover,
.site-nav__links a[aria-current='page'] {
  color: var(--ink);
}
.site-nav__links a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

.nav-toggle {
  display: none;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--ink);
  font: 600 var(--text-sm) / 1 var(--font-body);
  cursor: pointer;
}

/* ================= hero (home) ================= */

.hero {
  margin-inline: var(--edge);
  border-radius: var(--radius-panel);
  background: var(--brand);
  color: var(--on-brand);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
  padding-block: clamp(48px, 8vw, 112px) clamp(40px, 6vw, 80px);
}

.hero__tagline {
  margin-bottom: clamp(20px, 3vw, 32px);
  color: var(--on-brand-2);
  font-size: var(--text-sm);
  font-weight: 500;
}

.hero__title {
  font-size: var(--text-h1);
  line-height: 0.92;
  letter-spacing: -0.02em;
}

.hero__title .row {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}
.hero__title .row > span {
  display: inline-block;
}

.hero__lede {
  max-width: 34em;
  margin-top: clamp(24px, 3vw, 36px);
  color: var(--on-brand-2);
  font-size: var(--text-lg);
  line-height: 1.55;
}

.hero .actions {
  margin-top: clamp(28px, 3.5vw, 40px);
}

.glance {
  border-top: 1px solid var(--on-brand-line);
}

.glance__title {
  padding-block: 20px 8px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  line-height: 1.15;
}

.glance__list {
  margin: 0;
}

.glance__row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) 20px;
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--on-brand-line);
}

.glance__row dt {
  color: var(--on-brand-2);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.glance__row dd {
  margin: 0;
  grid-column: 2;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

/* ================= track record strip ================= */

.strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 40px;
}

.strip__label {
  flex-basis: 100%;
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 500;
}

.strip__list {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  list-style: none;
}

.strip__list li {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem);
  line-height: 1.2;
  color: var(--ink-2);
}

/* ================= feature panels (projects) ================= */

.features {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding: clamp(24px, 4.5vw, 64px);
  border-radius: var(--radius-feature);
  background: var(--surface);
}

.feature--lilac {
  background: var(--surface-lilac);
}

.feature--reverse .feature__media {
  order: -1;
}

.feature__body {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.feature__title {
  font-size: var(--text-h3);
  line-height: 1.1;
}

.feature__stat {
  margin-top: 8px;
}

.feature__body .prose {
  margin-top: 4px;
}

.feature__body .actions {
  margin-top: 12px;
}

.stat {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--text-stat);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--brand);
  font-variant-numeric: lining-nums tabular-nums;
}

.stat__caption {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.shot {
  overflow: hidden;
  border-radius: var(--radius-card);
  background: oklch(0.16 0.01 250);
  outline: 1px solid var(--line);
}

.shot img {
  width: 100%;
  transition: transform 0.6s var(--ease-out);
}

a.shot:hover img {
  transform: scale(1.02);
}

.paper {
  justify-self: center;
  width: min(100%, 440px);
  overflow: hidden;
  border-radius: 6px;
  background: var(--white);
  box-shadow: 0 2px 8px oklch(0.21 0.02 165 / 0.12);
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

.paper--link {
  transition: transform 0.35s var(--ease-out);
}
.paper--link:hover {
  transform: translateY(-4px);
}

/* ================= page index list ================= */

.index-list {
  list-style: none;
  border-bottom: 1px solid var(--line-strong);
}

.index-list a {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr) auto;
  gap: 16px 40px;
  align-items: baseline;
  position: relative;
  padding-block: clamp(24px, 3vw, 36px);
  text-decoration: none;
}

/* ledger rule: drawn as a pseudo-element so it can be ruled in on scroll */
.index-list a::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--line-strong);
  transform-origin: 0 50%;
}

.index-list__name {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  line-height: 1.1;
}

.index-list__desc {
  max-width: 52ch;
  color: var(--ink-2);
}

.index-list .arrow {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--brand);
}

.index-list a:hover .index-list__name {
  color: var(--brand);
}

/* ================= contact panel ================= */

.contact {
  margin-inline: var(--edge);
  margin-bottom: var(--edge);
  border-radius: var(--radius-panel);
  background: var(--brand);
  color: var(--on-brand);
}

.contact__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: end;
  padding-block: clamp(56px, 8vw, 104px);
}

.contact__title {
  font-size: var(--text-h2);
}

.contact__text {
  max-width: 36em;
  margin-top: 20px;
  color: var(--on-brand-2);
  font-size: var(--text-lg);
  line-height: 1.55;
}

.contact .actions {
  margin-top: 32px;
}

.contact__details {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--on-brand-line);
}

.contact__details div {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--on-brand-line);
}

.contact__details dt {
  color: var(--on-brand-2);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.contact__details dd {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.contact__details a {
  text-decoration: none;
}
.contact__details a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ================= footer ================= */

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 32px 40px;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.site-footer__name {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
}

.site-footer__links a {
  text-decoration: none;
}
.site-footer__links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ================= interior page head ================= */

.page-head {
  padding-block: clamp(56px, 9vw, 120px) clamp(32px, 5vw, 64px);
}

.page-head__title {
  font-size: var(--text-h1);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.page-head__lede {
  max-width: 40em;
  margin-top: clamp(20px, 3vw, 32px);
  color: var(--ink-2);
  font-size: var(--text-lg);
  line-height: 1.55;
}

.jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: clamp(28px, 4vw, 40px);
  list-style: none;
}

.jump__label {
  margin-right: 6px;
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 500;
}

.jump a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.jump a:hover {
  background: var(--brand);
  color: var(--on-brand);
}

/* ================= experience entries ================= */

.group + .group {
  margin-top: var(--section);
}

.group__title {
  margin-bottom: clamp(24px, 3vw, 40px);
  font-size: var(--text-h2);
}

.entry {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 12px clamp(24px, 5vw, 72px);
  padding-block: clamp(28px, 3.5vw, 44px);
  border-top: 1px solid var(--line);
}
.entry:last-child {
  border-bottom: 1px solid var(--line);
}

.entry__when {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
}

.entry__where {
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.entry__org {
  font-size: var(--text-h3);
  line-height: 1.1;
}

.entry__role {
  margin-top: 6px;
  color: var(--brand);
  font-weight: 600;
}

.points {
  display: grid;
  gap: 12px;
  max-width: 68ch;
  margin-top: 20px;
  list-style: none;
}

.points li {
  position: relative;
  padding-left: 24px;
}

.points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.68em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.75;
}

/* ================= tags ================= */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}

.tags li {
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}

/* ================= projects: research ================= */

.research {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.research__title {
  margin-top: 12px;
  font-size: var(--text-h2);
}

.research .prose {
  margin-top: 24px;
}

.research .actions {
  margin-top: 32px;
}

.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 clamp(24px, 4vw, 48px);
  margin-block: clamp(48px, 6vw, 80px) clamp(32px, 4vw, 48px);
  list-style: none;
}

.figures li {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-block: 24px 28px;
  border-top: 1px solid var(--line-strong);
}

.figures__value {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums tabular-nums;
}

.figures__label {
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.5;
}

/* ================= projects: LWX ================= */

.lwx {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(32px, 5vw, 72px);
  padding: clamp(24px, 4.5vw, 64px);
  border-radius: var(--radius-feature);
  background: var(--surface);
}

.lwx__title {
  margin-top: 12px;
  font-size: var(--text-h2);
}

.lwx__stat {
  margin-top: clamp(24px, 3vw, 40px);
}

.lwx__media {
  display: grid;
  gap: clamp(24px, 3vw, 32px);
  align-content: start;
}

.lwx .actions {
  margin-top: 8px;
}

/* live clock: watches keep time, so the index does too */
.analog-clock {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(28px, 3vw, 40px);
}

.analog-clock__face {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--white);
  outline: 1px solid var(--line-strong);
}

.analog-clock__tick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 50%;
  transform-origin: top center;
}
.analog-clock__tick::after {
  content: '';
  position: absolute;
  top: 8%;
  left: 0;
  width: 2px;
  height: 10%;
  margin-left: -0.5px;
  background: var(--ink);
  opacity: 0.45;
}

.analog-clock__hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: bottom center;
  border-radius: 2px;
  background: var(--ink);
}
.analog-clock__hand--hour { width: 3px; height: 22%; }
.analog-clock__hand--minute { width: 2px; height: 32%; }
.analog-clock__hand--second {
  width: 1px;
  height: 36%;
  background: var(--brand);
}

.analog-clock__pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--ink);
}

/* ================= beyond finance ================= */

.trophy {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding: clamp(32px, 5.5vw, 80px);
  border-radius: var(--radius-feature);
  background: var(--surface-lilac);
}

.trophy__title {
  margin-top: 12px;
  font-size: var(--text-h2);
}

.trophy .prose {
  margin-top: 24px;
}

.cricket-ball {
  position: relative;
  justify-self: center;
  width: min(280px, 62vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, oklch(0.72 0.14 30 / 0.9) 0%, transparent 32%),
    radial-gradient(circle at 50% 50%, oklch(0.5 0.17 27) 0%, oklch(0.4 0.15 25) 60%, oklch(0.27 0.1 22) 100%);
  box-shadow: inset -18px -22px 40px oklch(0.15 0.05 25 / 0.45);
  transform: rotate(-24deg);
}

/* the seam: a stitched band of two curved rows either side of a raised ridge */
.cricket-ball::before,
.cricket-ball::after {
  content: '';
  position: absolute;
  top: -1%;
  bottom: -1%;
  left: 50%;
  border-radius: 50%;
}
.cricket-ball::before {
  width: 22%;
  transform: translateX(-50%);
  border-left: 2px dashed oklch(0.95 0.03 85 / 0.8);
  border-right: 2px dashed oklch(0.95 0.03 85 / 0.8);
}
.cricket-ball::after {
  width: 11%;
  transform: translateX(-50%);
  border-left: 1px solid oklch(0.2 0.06 25 / 0.55);
  border-right: 1px solid oklch(0.2 0.06 25 / 0.55);
}

/* ================= auditor's ticks (home hero) ================= */

.tick {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--on-brand-2);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tick path {
  stroke-dasharray: 20;
  stroke-dashoffset: 0;
}

/* ================= figures tape (home) ================= */

.tape {
  position: relative;
  margin: clamp(16px, 2vw, 24px) var(--edge) 0;
  overflow: hidden;
  border-block: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}

.tape__track {
  display: flex;
  width: max-content;
}

.tape__list {
  display: flex;
  flex-shrink: 0;
  list-style: none;
}

.tape__list li {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 28px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

.tape__sym {
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tape__val {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tape__chg {
  color: var(--brand);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ================= accounting double rule under a total ================= */

.stat--total {
  padding-bottom: 12px;
}

.stat--total::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform-origin: 0 50%;
}

/* ================= LWX chart (home) ================= */

.chart {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin: 0;
}

.chart__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 500;
}

.chart__plot {
  position: relative;
  height: clamp(220px, 24vw, 300px);
  margin-left: 40px;
  touch-action: pan-y;
  border-radius: 4px;
}

.chart__plot svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart__grid line {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart__grid .chart__base {
  stroke: var(--line-strong);
  stroke-dasharray: 4 5;
}

.chart__line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.chart__area {
  fill: url(#lwx-fill);
}

.chart__guide {
  stroke: var(--ink);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity 0.15s var(--ease-out);
}

.chart__ylabel {
  position: absolute;
  left: -40px;
  width: 30px;
  text-align: right;
  transform: translateY(-50%);
  color: var(--ink-2);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.chart__dot,
.chart__cursor {
  position: absolute;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--surface);
  pointer-events: none;
}

.chart__ping {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  opacity: 0;
}

.chart__cursor {
  background: var(--ink);
  opacity: 0;
  transition: opacity 0.15s var(--ease-out);
}

.chart__end {
  position: absolute;
  transform: translate(-100%, calc(-100% - 12px));
  color: var(--brand);
  font-size: var(--text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.chart__tip {
  position: absolute;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 14px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease-out);
}

.chart__plot.is-hover .chart__guide,
.chart__plot.is-hover .chart__cursor,
.chart__plot.is-hover .chart__tip {
  opacity: 1;
}
.chart__plot.is-hover .chart__end {
  opacity: 0.25;
}

.chart__x {
  display: flex;
  justify-content: space-between;
  margin-left: 40px;
  color: var(--ink-2);
  font-size: 0.8125rem;
}

.chart__source {
  color: var(--ink-2);
  font-size: 0.8125rem;
}

/* ================= plane flyover ================= */

.plane-flyover {
  position: fixed;
  top: 18%;
  left: 0;
  z-index: var(--z-overlay);
  color: var(--brand);
  pointer-events: none;
}
.plane-flyover::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 52%;
  width: 140px;
  height: 1px;
  background: linear-gradient(to left, oklch(0.36 0.07 168 / 0.4), transparent);
}

/* ================= motion ================= */

@media (prefers-reduced-motion: no-preference) {
  /* hero: the name rises out of its line, then the proof list settles in */
  .hero__title .row > span {
    animation: rise 1s var(--ease-out) both;
  }
  .hero__title .row:nth-child(2) > span {
    animation-delay: 0.08s;
  }
  .hero__lede,
  .hero .actions {
    animation: fade-up 0.8s var(--ease-out) 0.25s both;
  }
  .glance__title,
  .glance__row {
    animation: fade-up 0.7s var(--ease-out) both;
  }
  .glance__title { animation-delay: 0.35s; }
  .glance__row:nth-child(1) { animation-delay: 0.42s; }
  .glance__row:nth-child(2) { animation-delay: 0.48s; }
  .glance__row:nth-child(3) { animation-delay: 0.54s; }
  .glance__row:nth-child(4) { animation-delay: 0.6s; }
  .glance__row:nth-child(5) { animation-delay: 0.66s; }

  .page-head__title {
    animation: fade-up 0.9s var(--ease-out) both;
  }
  .page-head__lede,
  .page-head .jump {
    animation: fade-up 0.8s var(--ease-out) 0.12s both;
  }

  /* scroll reveals: only armed once JS confirms it can fire them */
  .js-reveal .reveal {
    transition:
      opacity 0.8s var(--ease-out),
      transform 0.8s var(--ease-out);
  }
  .js-reveal .reveal:not(.in-view) {
    opacity: 0;
    transform: translateY(24px);
  }


  /* auditor's ticks: each fact gets checked off once the list has landed */
  .tick path {
    animation: tick-draw 0.45s var(--ease-out) both;
  }
  .glance__row:nth-child(1) .tick path { animation-delay: 1s; }
  .glance__row:nth-child(2) .tick path { animation-delay: 1.14s; }
  .glance__row:nth-child(3) .tick path { animation-delay: 1.28s; }
  .glance__row:nth-child(4) .tick path { animation-delay: 1.42s; }
  .glance__row:nth-child(5) .tick path { animation-delay: 1.56s; }

  /* hero recedes as you scroll past it (--hero-p set by JS, 0 to 1) */
  .hero {
    transform-origin: 50% 0;
    transform: scale(calc(1 - var(--hero-p, 0) * 0.04));
  }
  .hero__inner {
    transform: translateY(calc(var(--hero-p, 0) * 72px));
    opacity: calc(1 - var(--hero-p, 0) * 0.55);
  }

  /* figures tape: slow crawl, pauses when you point at it */
  .tape__track {
    animation: tape 80s linear infinite;
  }
  .tape:hover .tape__track,
  .tape:focus-within .tape__track {
    animation-play-state: paused;
  }

  /* home scroll language: everything is ruled in left to right, like a ledger */
  .js-reveal .reveal-wipe .section__title {
    clip-path: inset(0 0 -0.25em 0);
    transition: clip-path 1.1s var(--ease-out-expo);
  }
  .js-reveal .reveal-wipe:not(.in-view) .section__title {
    clip-path: inset(0 100% -0.25em 0);
  }
  .js-reveal .reveal-wipe .section__intro {
    transition:
      opacity 0.8s var(--ease-out) 0.25s,
      transform 0.8s var(--ease-out) 0.25s;
  }
  .js-reveal .reveal-wipe:not(.in-view) .section__intro {
    opacity: 0;
    transform: translateY(12px);
  }

  .js-reveal .strip__list li {
    transition:
      opacity 0.7s var(--ease-out) calc(var(--i, 0) * 80ms),
      transform 0.7s var(--ease-out) calc(var(--i, 0) * 80ms);
  }
  .js-reveal .strip:not(.in-view) .strip__list li {
    opacity: 0;
    transform: translateY(12px);
  }

  .js-reveal .index-list a::before {
    transition: transform 1s var(--ease-out-expo) calc(var(--i, 0) * 140ms);
  }
  .js-reveal .index-list:not(.in-view) a::before {
    transform: scaleX(0);
  }
  .js-reveal .index-list a > span {
    transition:
      opacity 0.7s var(--ease-out) calc(var(--i, 0) * 140ms + 0.2s),
      transform 0.7s var(--ease-out) calc(var(--i, 0) * 140ms + 0.2s);
  }
  .js-reveal .index-list:not(.in-view) a > span {
    opacity: 0;
    transform: translateX(-10px);
  }
  .index-list a:hover .arrow {
    transform: translateX(6px);
  }

  .js-reveal .stat--total::after {
    transition: transform 0.9s var(--ease-out-expo);
  }
  .js-reveal .stat--total:not(.is-ruled)::after {
    transform: scaleX(0);
  }

  .paper[data-parallax] {
    translate: 0 calc(var(--par, 0) * 1px);
  }

  .cricket-ball {
    animation: ball-spin 36s linear infinite;
  }
}

@keyframes rise {
  from { transform: translateY(105%); }
  to { transform: translateY(0); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tick-draw {
  from { stroke-dashoffset: 20; }
  to { stroke-dashoffset: 0; }
}

@keyframes tape {
  to { transform: translateX(-50%); }
}

@keyframes ball-spin {
  from { transform: rotate(-24deg); }
  to { transform: rotate(336deg); }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .tape {
    overflow-x: auto;
  }
  .tape__list + .tape__list {
    display: none;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* ================= responsive ================= */

@media (max-width: 960px) {
  .hero__inner,
  .contact__inner,
  .research,
  .lwx,
  .trophy {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__inner {
    align-items: start;
  }

  .feature {
    grid-template-columns: minmax(0, 1fr);
  }
  .feature__media,
  .feature--reverse .feature__media {
    order: -1;
  }

  .index-list a {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .index-list__desc {
    grid-column: 1;
    grid-row: 2;
  }
  .index-list .arrow {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
  }

  .site-nav__right {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding: 8px var(--gutter) 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .site-nav__right.open {
    display: flex;
  }

  .site-nav__links {
    flex-direction: column;
    gap: 0;
  }
  .site-nav__links a {
    display: block;
    padding-block: 14px;
    border-bottom: 1px solid var(--line);
    font-size: 1.0625rem;
  }
  .site-nav__links a[aria-current='page']::after {
    display: none;
  }
  .site-nav__links a[aria-current='page'] {
    color: var(--brand);
  }

  .entry {
    grid-template-columns: minmax(0, 1fr);
  }
  .entry__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: baseline;
  }

  .glance__row {
    grid-template-columns: 5.5rem minmax(0, 1fr) 20px;
  }
  .contact__details div {
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }

  .strip__list {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .actions .btn {
    flex: 1 1 100%;
  }
}
