/* ============================================================
   jamesyates.co.uk — v2 design system
   "Refined expert": warm cream editorial, near-black ink,
   burnished copper accent (the EMC metal), engraved B&W art.
   Type: Fraunces (display serif) / Public Sans (body)
         / IBM Plex Mono (technical labels).
   Motion: staggered reveals, marquee, hero word rise.
   ============================================================ */

:root {
  --cream: #f4f6f6;
  --cream-2: #e9eeee;
  --ink: #131619;
  --ink-soft: #3a4147;
  --muted: #64707a;
  --line: #dde3e5;
  --line-strong: #c3ccd0;
  --copper: #0d6e79;
  --copper-deep: #09525b;
  --dark: #0f1416;
  --dark-2: #151b1e;
  --on-dark: #eef3f3;
  --on-dark-muted: #9fadb2;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --measure: 68ch;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--copper); color: var(--cream); }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 80;
  background: color-mix(in srgb, var(--cream) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hdr .bar {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 0;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 600; font-size: 1.25rem; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.wordmark em { font-style: italic; color: var(--copper); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  font: 500 .82rem var(--sans);
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  padding: 8px 12px; border-radius: 3px;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--copper-deep); }

/* ---------- layout ---------- */
.wrap { width: min(1200px, calc(100% - 48px)); margin: 0 auto; }
.narrow { max-width: 760px; }
section { padding: 96px 0; }
section.tight { padding: 64px 0; }

.eyebrow {
  font: 500 .78rem var(--mono);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--copper-deep);
  margin: 0 0 22px;
}
.dark .eyebrow { color: var(--copper); opacity: .9; }

h1, .h1 {
  font-family: var(--serif);
  font-weight: 480;
  font-size: clamp(2.6rem, 6.4vw, 5.2rem);
  line-height: 1.04;
  letter-spacing: -.022em;
  margin: 0;
}
h1 em, .h1 em { font-style: italic; color: var(--copper-deep); }
.dark h1 em { color: var(--copper); }

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  line-height: 1.12; letter-spacing: -.015em;
  margin: 0 0 22px;
  max-width: 20ch;
}
h3 {
  font-family: var(--serif); font-weight: 560;
  font-size: 1.28rem; line-height: 1.25; letter-spacing: -.01em;
  margin: 0 0 10px;
}

.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-soft); max-width: var(--measure); }
p { max-width: var(--measure); }
.muted { color: var(--muted); }

a.text-link { color: var(--copper-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a.text-link:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero { position: relative; padding: 110px 0 90px; overflow: hidden; }
.hero .art {
  position: absolute; right: -14%; top: 50%;
  width: min(760px, 78vw);
  transform: translateY(-50%);
  color: var(--ink);
  opacity: .16;
  pointer-events: none;
}
.hero .art svg { width: 100%; height: auto; display: block; }
.hero .inner { position: relative; max-width: 820px; }
.hero .lede { margin-top: 28px; }

/* word-rise headline animation */
.rise .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.rise .w > span { display: inline-block; transform: translateY(110%); animation: wordrise .9s cubic-bezier(.22,.9,.24,1) forwards; }
@keyframes wordrise { to { transform: translateY(0); } }

/* ---------- stats strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.stat { padding: 34px 28px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat .n { font-family: var(--serif); font-weight: 500; font-size: 2.5rem; line-height: 1; letter-spacing: -.02em; }
.stat .n em { font-style: italic; color: var(--copper-deep); }
.stat .l { font: 500 .78rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
@media (max-width: 720px){ .stat { border-left: 0; padding-left: 0; } }

/* ---------- standards marquee ---------- */
.marquee {
  overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 22px 0; background: var(--cream-2);
}
.marquee .track { display: flex; gap: 64px; width: max-content; animation: scroll 46s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
.marquee span {
  font: 500 .92rem var(--mono); letter-spacing: .1em;
  color: var(--muted); white-space: nowrap;
}
.marquee span::after { content: "·"; margin-left: 64px; color: var(--copper); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- numbered section index ---------- */
.index-list { border-top: 1px solid var(--line-strong); margin-top: 20px; }
.index-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 28px; align-items: center;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none;
  position: relative;
}
.index-item .num {
  font-family: var(--serif); font-style: italic;
  font-size: 1.5rem; color: var(--line-strong);
  transition: color .3s;
}
.index-item .body h3 { margin: 0 0 4px; font-size: 1.6rem; transition: transform .35s cubic-bezier(.22,.9,.24,1); }
.index-item .body p { margin: 0; color: var(--muted); font-size: .95rem; max-width: 56ch; }
.index-item .go {
  font: 500 .8rem var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--copper-deep); opacity: 0; transform: translateX(-8px);
  transition: opacity .3s, transform .3s;
  white-space: nowrap;
}
.index-item .mini { width: 84px; color: var(--ink); opacity: .55; justify-self: end; }
.index-item .mini svg { width: 100%; height: auto; display: block; }
.index-item:hover { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--copper) 5%, transparent), transparent); }
.index-item:hover .num { color: var(--copper); }
.index-item:hover .body h3 { transform: translateX(6px); }
.index-item:hover .go { opacity: 1; transform: none; }
@media (max-width: 820px){
  .index-item { grid-template-columns: 56px 1fr; }
  .index-item .go, .index-item .mini { display: none; }
}

/* ---------- dark band ---------- */
.dark {
  background: var(--dark); color: var(--on-dark);
}
.dark .muted, .dark p { color: var(--on-dark-muted); }
.dark h2, .dark blockquote { color: var(--on-dark); }
blockquote.pull {
  font-family: var(--serif); font-weight: 420; font-style: italic;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem); line-height: 1.28; letter-spacing: -.01em;
  margin: 0; max-width: 26ch;
}
blockquote.pull strong { color: var(--copper); font-weight: 480; }
.attrib { font: 500 .8rem var(--mono); letter-spacing: .14em; text-transform: uppercase; margin-top: 30px; color: var(--on-dark-muted); }

/* ---------- timeline (leadership) ---------- */
.timeline { border-top: 1px solid var(--line-strong); margin-top: 12px; }
.tl {
  display: grid; grid-template-columns: 170px 1fr; gap: 34px;
  padding: 34px 0; border-bottom: 1px solid var(--line);
}
.tl .when { font: 500 .82rem var(--mono); letter-spacing: .1em; color: var(--copper-deep); padding-top: 8px; }
.tl h3 { margin-bottom: 6px; }
.tl .role { font: 500 .78rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 10px; }
.tl p { margin: 0; color: var(--ink-soft); font-size: .97rem; }
@media (max-width: 720px){ .tl { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- stories ---------- */
.story-block { display: grid; grid-template-columns: 90px 1fr; gap: 30px; padding: 56px 0; border-bottom: 1px solid var(--line); }
.story-block .num { font-family: var(--serif); font-style: italic; font-size: 2rem; color: var(--line-strong); }
.story-block h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); }
.story-block p { color: var(--ink-soft); }
.takeaway {
  border-left: 2px solid var(--copper);
  padding: 6px 0 6px 22px; margin-top: 26px;
  font-family: var(--serif); font-style: italic;
  font-size: 1.25rem; line-height: 1.45; color: var(--ink);
  max-width: 54ch;
}
@media (max-width: 720px){ .story-block { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- footer ---------- */
.ftr { border-top: 1px solid var(--line-strong); background: var(--cream-2); }
.ftr .bar {
  width: min(1200px, calc(100% - 48px)); margin: 0 auto;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 30px 0 40px;
  font: 500 .78rem var(--mono); letter-spacing: .06em; color: var(--muted);
}
.ftr a { color: var(--muted); text-decoration: none; }
.ftr a:hover { color: var(--ink); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.22,.9,.24,1), transform .8s cubic-bezier(.22,.9,.24,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .rise .w > span { transform: none; animation: none; }
  .marquee .track { animation: none; }
}
@media (max-width: 720px){
  .hdr .bar { flex-wrap: wrap; padding: 12px 0; }
  .nav { order: 3; width: 100%; }
  section { padding: 64px 0; }
  .hero { padding: 70px 0 56px; }
  .hero .art { opacity: .1; right: -40%; }
}
