/*
  roasters.dev — warm editorial theme.
  Deep espresso base, cream type, copper accent, numbered sections on a
  two-column editorial grid. No dependencies. Plain HTML/CSS.
*/

/* Fonts: DM Sans and Instrument Serif, self-hosted from /fonts (SIL Open Font License) */

@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-sans-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-sans-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/dm-sans-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/dm-sans-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/instrument-serif-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/instrument-serif-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/instrument-serif-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/instrument-serif-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: oklch(17% 0.016 55);
  --bg-raised: oklch(21% 0.018 55);
  --text: oklch(93% 0.014 80);
  --text-muted: oklch(72% 0.02 70);
  --accent: oklch(74% 0.14 55);
  --accent-strong: oklch(80% 0.13 60);
  --accent-deep: oklch(46% 0.12 50);
  --accent-line: oklch(74% 0.14 55 / 0.55);
  /* The one strength for every copper glow */
  --accent-wash: oklch(74% 0.14 55 / 0.14);
  --rule: oklch(93% 0.014 80 / 0.15);
  --rule-strong: var(--rule);
  /* Form fields and slot buttons: strong enough to read as controls (3:1) */
  --rule-field: oklch(93% 0.014 80 / 0.45);
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Instrument Serif', 'Georgia', serif;
  /* Type scale: every font size on the site is one of these */
  --fs-display: clamp(3rem, 8.5vw, 8rem);
  --fs-heading: clamp(2.25rem, 4.5vw, 3.75rem);
  --fs-figure: clamp(2.5rem, 4.5vw, 4rem);
  /* Article pages: long page titles and their sub-headings */
  --fs-title: clamp(2rem, 3.6vw, 3.25rem);
  --fs-subhead: clamp(1.75rem, 3vw, 2.5rem);
  --fs-lead: clamp(1.3rem, 2vw, 1.75rem);
  --fs-statement: clamp(1.2rem, 1.6vw, 1.45rem);
  --fs-body: 1rem;
  --fs-small: 0.85rem;
  --fs-label: 0.75rem;
  --track-label: 0.12em;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --space-2xl: 8rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --max-width: 76rem;
  --label-col: 13rem;
  --transition: 0.25s ease;
  --radius-btn: 10px;
}

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

*::selection {
  background: var(--accent-deep);
  color: var(--text);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.05;
  margin-top: 0;
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--fs-display);
  line-height: 0.95;
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: var(--fs-heading);
  margin-bottom: var(--space);
}

h3 {
  font-size: var(--fs-statement);
  margin-bottom: 0.75rem;
}

p {
  margin: 0 0 1rem;
  max-width: 62ch;
}

p:last-child {
  margin-bottom: 0;
}

em {
  font-style: italic;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
  transition: border-color var(--transition), color var(--transition);
}

a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

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

.eyebrow {
  display: block;
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  font-size: var(--fs-body);
}

.arrow-link::after {
  content: '\2192';
  transition: transform var(--transition);
}

.arrow-link:hover {
  color: var(--text);
  border-bottom-color: transparent;
}

.arrow-link:hover::after {
  transform: translateX(0.3rem);
}

/* Layout */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

main {
  flex: 1;
  width: 100%;
}

/* Header */
#site-header {
  min-height: 5.5rem;
}

.site-header {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space) var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
}

.header-mark {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  line-height: 1;
  border-bottom: none;
  user-select: none;
  transition: color 0.5s ease;
}

.header-mark em {
  color: var(--accent);
  transition: color 0.5s ease;
}

.header-mark:hover {
  color: var(--accent);
}

.header-mark:hover em {
  color: var(--text);
}

.site-nav {
  display: flex;
  gap: var(--space);
}

.site-nav a {
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover {
  color: var(--accent);
}

/* Hero */
.hero {
  position: relative;
  padding: var(--space-sm) 0 var(--space-xl);
  /* Clip the glow sideways only, so it fades out behind the header instead of being cut off */
  overflow-x: clip;
}

.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -20% -10% auto auto;
  width: 60vw;
  height: 60vw;
  max-width: 48rem;
  max-height: 48rem;
  background: radial-gradient(
    closest-side,
    var(--accent-wash),
    transparent 70%
  );
  pointer-events: none;
}

.hero .wrap {
  position: relative;
}

.frame {
  /* Frames bleed into the gutter so their padded content lines up with the logo */
  margin-inline: calc(-1 * var(--gutter));
  padding: var(--gutter);
}

/* Borderless trial: hide every box line inside the frames.
   Form fields keep their underlines. Delete this block to bring the boxes back. */
.frame {
  --rule-strong: transparent;
}

/* Field and button outlines need 3:1 against the background to be visible as controls */
.frame .contact-form {
  --rule-strong: var(--rule-field);
}

.hero-frame {
  padding-block: clamp(2rem, 5vw, 4.5rem);
  display: flex;
  flex-direction: column;
  animation: rise 0.7s ease-out both;
}

.hero h1 {
  font-size: var(--fs-display);
  line-height: 0.95;
  margin-bottom: 0;
  padding-bottom: var(--space);
  border-bottom: 1px solid var(--rule-strong);
}

.hero h1 em {
  color: var(--accent);
}

.hero-text {
  max-width: 64ch;
  margin: var(--space-lg) 0 var(--space-lg);
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  line-height: 1.25;
}

.hero-text p {
  max-width: none;
  margin: 0;
  text-wrap: pretty;
}

.hero-text p + p {
  margin-top: 0.6em;
}

/* Second line is supporting detail */
.hero-text p:not(:first-child) {
  font-size: 0.8em;
  color: var(--text-muted);
}

/* Button follows the intro sentence, in reading order */
.hero-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-lg);
  margin-top: var(--space);
}

.hero-body .hero-text {
  margin: 0;
}

.hero-text em {
  color: var(--accent);
}

.hero-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 64px;
  padding: 0 2.25rem;
  font-size: 1.25rem;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-btn);
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition),
    transform var(--transition);
}

.hero-cta::after {
  content: '\2192';
}

.hero-cta:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--bg);
  transform: translateY(-1px);
}

/* Case study (homepage teaser) */
.case {
  padding: 0 0 var(--space-xl);
}

.case-frame {
  --pad: var(--gutter);
  padding: 0;
}

.case-head {
  padding: var(--pad) var(--pad) var(--space);
}

.case-head .eyebrow {
  font-size: var(--fs-body);
  margin-bottom: var(--space);
}

.case-head h2 {
  font-size: var(--fs-heading);
  line-height: 0.95;
  max-width: none;
  margin: 0;
  text-wrap: balance;
}

/* Screenshot spans the same column as the text, with an overlapping stamp */
.case-media {
  position: relative;
  margin: 0;
  padding: var(--space) var(--pad) 0;
}

/* Wrapper so the stamp can sit on the window's corner (the window clips) */
.case-shot {
  position: relative;
  margin: 0;
  padding: 0;
}

.case-window {
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  box-shadow: 0 20px 60px oklch(0% 0 0 / 0.35);
}

/* Homepage teaser only: dim and warm the bright screenshot so it sits in the dark page.
   The case study page keeps its screenshots at full brightness for legibility. */
.case-shot .case-window {
  filter: brightness(0.8) sepia(0.15);
}

.case-window-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: oklch(88% 0.012 80);
}

.case-window-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: oklch(74% 0.012 70);
}

.case-window img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1600 / 760;
  object-fit: cover;
  object-position: top;
}

.case-stamp {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(30%, -45%) rotate(-9deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(5.5rem, 8.5vw, 7.5rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--accent-line);
  text-align: center;
  line-height: 1;
}

.case-stamp-small {
  font-size: clamp(0.5rem, 0.7vw, 0.62rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.case-stamp-big {
  margin-top: 0.3rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 1.9vw, 1.75rem);
}

/* Stats strip */
.case-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule-strong);
}

.case-stats li {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space) var(--pad);
}

.case-stats li + li {
  border-left: 1px solid var(--rule-strong);
}

.case-stat-num {
  font-family: var(--font-serif);
  font-size: var(--fs-figure);
  line-height: 0.85;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.case-stat-label {
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-muted);
  max-width: 30ch;
}

/* Quote + links */
.case-foot {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.case-links {
  align-self: center;
  list-style: none;
  padding: 0;
  margin: var(--pad);
  border-top: 1px solid var(--rule-strong);
}

.case-links li {
  border-bottom: 1px solid var(--rule-strong);
}

.case-links a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  min-height: 56px;
  border-bottom: none;
  font-family: var(--font-serif);
  font-size: var(--fs-statement);
  line-height: 1.2;
}

.case-links a::after {
  content: '\2192';
  margin-left: auto;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--accent);
  transition: transform var(--transition);
}

.case-links a:hover::after {
  transform: translateX(0.3rem);
}

.case-links small {
  order: 3;
  flex-basis: 100%;
  margin-top: -0.6rem;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.case-quote {
  position: relative;
  margin: 0;
  padding: var(--pad);
  border-right: 1px solid var(--rule-strong);
  display: flex;
  flex-direction: column;
  gap: var(--space);
}

.case-quote p {
  font-family: var(--font-serif);
  font-size: var(--fs-statement);
  line-height: 1.3;
  max-width: none;
  margin: 0;
}

.case-quote p::before {
  content: '\201C';
  display: block;
  font-size: 5rem;
  line-height: 0.8;
  height: 2.5rem;
  color: var(--accent);
}

.case-quote cite {
  font-style: normal;
  font-size: var(--fs-small);
  line-height: 1.4;
}

.case-quote cite span {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* When to call us: title left, buying moments right (same 1:2 split as the services) */
.when {
  padding: 0 0 var(--space-xl);
}

/* Same raised panel as What We Do */
.when-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--space-lg);
  border-radius: var(--radius-btn);
  background:
    radial-gradient(60% 90% at 0% 100%, var(--accent-wash), transparent 70%),
    var(--bg-raised);
}

.when-title {
  margin: 0;
  font-size: var(--fs-heading);
  line-height: 0.95;
}

.when-title em {
  color: var(--accent);
}

.when-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--accent-line);
}

.when-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-serif);
  font-size: var(--fs-statement);
  line-height: 1.25;
}

.when-not {
  max-width: none;
  margin: var(--space) 0 0;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* How we work */
.how,
.what {
  padding: 0 0 var(--space-xl);
}

.how-frame,
.what-frame {
  --pad: var(--gutter);
  padding: 0;
}

.frame-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  align-items: end;
  gap: var(--space) var(--space-lg);
  padding: var(--pad) var(--pad) var(--space);
  border-bottom: 1px solid var(--rule-strong);
}

.frame-head h2 {
  font-size: var(--fs-heading);
  line-height: 0.95;
  margin: 0;
}

.frame-head h2 em {
  color: var(--accent);
}

.frame-head p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-statement);
  line-height: 1.35;
  color: var(--text-muted);
}

/* How We Work: heading and a numbered list, same pattern as What We Do and When to Call Us */
.how-frame {
  display: grid;
  row-gap: var(--space);
  padding: var(--pad);
}

.how-frame h2 {
  margin: 0;
  font-size: var(--fs-heading);
  line-height: 0.95;
}

.how-frame h2 em {
  color: var(--accent);
}

.how-principles {
  list-style: none;
  counter-reset: how;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--accent-line);
}

.how-principles li {
  counter-increment: how;
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}

.how-principles li::before {
  content: counter(how, decimal-leading-zero);
  flex: none;
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  color: var(--accent);
}

.how-principles h3 {
  margin: 0;
  font-size: var(--fs-statement);
  line-height: 1.25;
}

/* Testimonial: 2:1 grid, quote left and attribution right */
.split-quote {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-lg);
  margin: 0;
  padding: var(--pad);
  border-bottom: 1px solid var(--rule-strong);
}

.split-quote blockquote {
  margin: 0;
}

.split-quote p {
  margin: 0;
  max-width: none;
  font-family: var(--font-serif);
  font-size: var(--fs-statement);
  line-height: 1.3;
  text-wrap: pretty;
}

.split-quote blockquote p::before {
  content: '\201C';
  display: block;
  height: 2.5rem;
  font-size: 5rem;
  line-height: 0.8;
  color: var(--accent);
}

.split-quote figcaption {
  align-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space);
  padding-left: var(--space-lg);
  border-left: 1px solid var(--rule-strong);
  line-height: 1.4;
}

.split-quote small {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* Variant: attribution starts level with the quote's first line (below the mark) */
.split-quote-top figcaption {
  align-self: start;
  margin-top: 2.85rem;
}

.split-quote img {
  width: auto;
  height: 1.25rem;
  opacity: 0.85;
}

/* Services: raised panel in its own section */
.how-services {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--space-lg);
  padding: var(--pad);
  border-radius: var(--radius-btn);
  background:
    radial-gradient(60% 90% at 0% 100%, var(--accent-wash), transparent 70%),
    var(--bg-raised);
}

.how-services-title {
  margin: 0;
  font-size: var(--fs-heading);
  line-height: 0.95;
}

.how-services-title em {
  color: var(--accent);
}

.how-services-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-lg);
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--accent-line);
}

.how-services-list li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule-strong);
  font-family: var(--font-serif);
  font-size: var(--fs-statement);
  line-height: 1.15;
}

.how-services-list small {
  margin-top: 0.25rem;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* Who we are */
.who,
.talk {
  padding: 0 0 var(--space-xl);
}

.who-frame,
.talk-frame {
  --pad: var(--gutter);
  padding: 0;
}

.who-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
  border-bottom: 1px solid var(--rule-strong);
}

/* Copper line threading the three years together */
.who-timeline::before {
  content: '';
  position: absolute;
  top: calc(var(--space-lg) + 0.3rem);
  left: var(--pad);
  right: var(--pad);
  height: 1px;
  background: var(--accent-line);
}

.who-timeline li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--pad);
}

.who-timeline li + li {
  border-left: 1px solid var(--rule-strong);
}

.who-timeline li::before {
  content: '';
  width: 0.6rem;
  aspect-ratio: 1;
  margin-bottom: var(--space-sm);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--bg);
}

.who-year {
  font-family: var(--font-serif);
  font-size: var(--fs-figure);
  line-height: 0.85;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.who-label {
  max-width: 22ch;
  color: var(--text-muted);
}

.who-frame .frame-head {
  align-items: last baseline;
}

.who-badge {
  justify-self: end;
  border-bottom: none;
  font-size: var(--fs-heading);
  line-height: 0.95;
}

.who-badge img {
  display: inline-block;
  width: auto;
  height: 0.7em;
}

/* Testimonial standing on its own inside a .wrap: bleeds into the gutter like a frame */
.wrap-quote {
  --pad: var(--gutter);
  --rule-strong: transparent;
  margin-inline: calc(-1 * var(--gutter));
  padding-block: var(--space-lg) 0;
}

/* The timeline's own bottom padding already adds space above the testimonial */
.who {
  padding-bottom: var(--space-lg);
}

/* Book a call */
.talk-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
}

.talk-intro,
.talk-side {
  padding: var(--pad);
}

.talk-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space);
  border-right: 1px solid var(--rule-strong);
  border-radius: var(--radius-btn);
  background:
    radial-gradient(80% 70% at 0% 100%, var(--accent-wash), transparent 70%),
    var(--bg-raised);
}

.talk-intro h2 {
  margin: 0;
  font-size: var(--fs-heading);
  line-height: 0.95;
}

.talk-intro h2 em {
  color: var(--accent);
}

.talk-intro p {
  margin: 0;
  max-width: 32ch;
  font-family: var(--font-serif);
  font-size: var(--fs-statement);
  line-height: 1.35;
  color: var(--text-muted);
}

/* The opening question reads as the lead, the rest as supporting detail */
.talk-intro p:first-of-type {
  color: var(--text);
}

.talk-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.talk-side .form-btn {
  background: var(--accent);
  color: var(--bg);
}

.talk-side .form-btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.talk-book {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-sm);
  margin: 0;
  padding-top: var(--space);
  border-top: 1px solid var(--rule-strong);
  color: var(--text-muted);
}

/* Case study page */
.study-page main {
  padding: var(--space-sm) 0 var(--space-xl);
}

.study-frame {
  --pad: var(--gutter);
  padding: 0;
  animation: rise 0.7s ease-out both;
}

.study-head {
  /* Same centered 40rem column as the article body below */
  padding: var(--pad) max(var(--pad), calc((100% - 40rem) / 2));
  border-bottom: 1px solid var(--rule-strong);
  /* The glow sits fully inside the header so it never meets a hard edge */
  background:
    radial-gradient(30% 45% at 72% 45%, var(--accent-wash), transparent 100%),
    var(--bg);
}

.study-crumbs {
  margin-bottom: var(--space-lg);
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.study-crumbs a {
  color: var(--text-muted);
}

.study-head .eyebrow {
  font-size: var(--fs-body);
  margin-bottom: var(--space);
}

.study-head h1 {
  max-width: 30ch;
  margin: 0;
  font-size: var(--fs-title);
  line-height: 1.05;
  text-wrap: balance;
}

.study-lead {
  max-width: 40ch;
  margin: var(--space) 0 0;
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  line-height: 1.3;
  color: var(--text-muted);
}

/* Reading column; figures and quotes break out wider */
.study-body {
  --measure: 40rem;
  padding: var(--pad);
}

.study-body > * {
  max-width: var(--measure);
  margin-inline: auto;
}

.study-body p,
.study-body li {
  color: var(--text-muted);
}

.study-body p {
  margin-top: 0;
  margin-bottom: var(--space);
}

.study-body a {
  color: var(--text);
}

.study-body h2 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space);
  font-size: var(--fs-subhead);
  line-height: 1.1;
  text-wrap: balance;
}

.study-body code {
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--bg-raised);
  color: var(--text);
}

.study-body .case-results {
  list-style: none;
  padding: 0;
  margin-bottom: var(--space-lg);
  border-top: 1px solid var(--rule-strong);
}

.study-body .case-results li {
  padding: var(--space-sm) 0 var(--space-sm) 1.75rem;
  border-bottom: 1px solid var(--rule-strong);
  color: var(--text);
  position: relative;
}

.study-body .case-results li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.study-figure {
  max-width: 56rem;
  margin-block: var(--space-lg);
}

.study-figure .case-window {
  border-bottom: 1px solid var(--rule-strong);
  border-radius: 12px;
}

.study-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.study-figure figcaption {
  margin-top: var(--space-sm);
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.study-quote {
  margin-block: var(--space-lg);
  padding: var(--space-lg) 0;
  border-block: 1px solid var(--rule-strong);
}

.study-quote blockquote {
  margin: 0;
}

.study-quote p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-statement);
  line-height: 1.3;
  color: var(--text);
}

.study-quote p::before {
  content: '\201C';
  display: block;
  height: 2.5rem;
  font-size: 5rem;
  line-height: 0.8;
  color: var(--accent);
}

.study-quote figcaption {
  margin-top: var(--space-sm);
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.study-body .case-technical {
  margin-top: var(--space-xl);
}

.study-body hr {
  margin-block: var(--space-lg);
  border: 0;
  border-top: 1px solid var(--rule-strong);
}

.study-body .case-backmatter p {
  font-size: var(--fs-small);
}

.study-body .case-backmatter strong {
  color: var(--text);
  font-weight: 500;
}

/* 404 page */
.study-body .arrow-link {
  color: var(--accent);
}

/* Book a Call under a case study */
.study-page .talk {
  margin-top: var(--space-xl);
  padding-bottom: 0;
}

.study-body ul {
  margin: 0 auto var(--space);
  padding-left: 1.25rem;
}

.study-body ul li + li {
  margin-top: var(--space-xs);
}

.study-foot {
  padding: 0 var(--pad) var(--pad);
}

.study-foot .case-links {
  max-width: 40rem;
  margin: 0 auto;
}

/* Numbered editorial sections */
.section {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--rule);
}

/* Keep mixed-case brand names intact inside uppercase lines */
.brand-case {
  text-transform: none;
}

/* Contact */
.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-input {
  padding: 0.9rem 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  border-radius: 0;
  transition: border-color var(--transition);
}

.form-input:focus-visible {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: 0 2px 0 var(--accent);
}

textarea.form-input {
  resize: vertical;
  min-height: 7rem;
  line-height: 1.6;
}

.form-btn {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 56px;
  padding: 0 1.75rem;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--text);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.form-btn::after {
  content: '\2192';
}

.form-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.form-msg {
  grid-column: 1 / -1;
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin: 0;
}

/* Call booking: time zone, day tabs and time slots inside the contact form */
select.form-input {
  width: 100%;
  min-width: 0;
  color-scheme: dark;
  cursor: pointer;
}

.booking-slots {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space);
}

.booking-slots[hidden] {
  display: none;
}

.day-tabs,
.slot-grid {
  gap: var(--space-xs);
}

/* Switches the form between booking a call and sending a message */
.talk-toggle {
  padding: 0;
  font-family: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.day-tabs {
  display: flex;
  flex-wrap: wrap;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.75rem, 1fr));
}

.day-tab,
.slot-btn {
  min-height: 44px;
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  color: var(--text);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.slot-btn {
  padding-inline: var(--space-xs);
}

.day-tab:hover,
.slot-btn:hover {
  border-color: var(--accent);
}

.day-tab.active,
.slot-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.day-tab:focus-visible,
.slot-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.slot-selected {
  color: var(--text);
}

.slot-selected:empty {
  display: none;
}

.form-btn:focus-visible,
.hero-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.form-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: var(--space-lg) 0;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space);
}

.footer-mark {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--text);
  border-bottom: none;
}

.footer-mark em {
  color: var(--accent);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space);
}

.footer-nav a {
  border-bottom: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

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

/* Skip link: hidden until it receives keyboard focus */
a.visually-hidden:focus {
  position: fixed;
  top: var(--space-xs);
  left: var(--space-xs);
  z-index: 10;
  width: auto;
  height: auto;
  margin: 0;
  padding: var(--space-xs) var(--space-sm);
  clip: auto;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-btn);
}

/* Sections focused by script after an in-page jump don't need a ring */
[tabindex='-1']:focus {
  outline: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/*
  Shared grid. On desktop every multi-column block on the homepage sits on the same
  three equal columns with the same gutter, so column edges line up down the page:
  stats, timeline, quote + links, testimonial, What We Do, How We Work, When to Call Us
  and Book a Call. Section titles take column 1; lists and forms take columns 2 and 3.
*/
@media (min-width: 901px) {
  .case-stats,
  .who-timeline,
  .case-foot,
  .split-quote,
  .how-services,
  .how-frame,
  .when-frame,
  .talk-frame {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--gutter);
    padding-inline: var(--gutter);
  }

  .case-stats li,
  .who-timeline li,
  .case-quote,
  .talk-side {
    padding-inline: 0;
  }

  .case-quote,
  .split-quote blockquote {
    grid-column: 1 / 3;
  }

  .case-links {
    margin-inline: 0;
  }

  .split-quote figcaption {
    padding-left: 0;
  }

  .how-principles,
  .when-body,
  .how-services-list,
  .talk-side {
    grid-column: 2 / -1;
  }

  /* Two-column lists and the form share the outer columns 2 and 3 */
  .how-services-list {
    grid-template-columns: subgrid;
    column-gap: var(--gutter);
  }

  .contact-form {
    column-gap: var(--gutter);
  }

  /* The tinted Book a Call panel wraps column 1: out to the frame edge on the left,
     half a gutter past the column on the right */
  .talk-intro {
    margin: 0 calc(var(--gutter) / -2) 0 calc(-1 * var(--gutter));
    padding-right: calc(var(--gutter) / 2);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .hero-body {
    flex-direction: column;
  }

  .when-frame {
    grid-template-columns: 1fr;
    gap: var(--space);
  }

  .frame-head,
  .split-quote,
  .how-services,
  .talk-frame {
    grid-template-columns: minmax(0, 1fr);
  }

  .talk-intro {
    border-right: none;
    border-bottom: 1px solid var(--rule-strong);
  }

  .split-quote {
    gap: var(--space);
  }

  .split-quote figcaption {
    margin-top: 0;
    gap: var(--space-sm);
    padding: var(--space) 0 0;
    border-left: none;
    border-top: 1px solid var(--rule-strong);
  }

  /* Stacked layout: heading, then the timeline, then the partner badge under the dates.
     The header box dissolves so the badge can be ordered after the timeline. */
  .who-frame {
    display: flex;
    flex-direction: column;
  }

  .who-frame .frame-head {
    display: contents;
  }

  .who-frame .frame-head h2 {
    padding: var(--pad) var(--pad) var(--space);
  }

  .who-timeline {
    order: 1;
  }

  .who-badge {
    order: 2;
    align-self: flex-start;
    padding: var(--space) var(--pad) 0;
  }

  /* Stacked under the heading, the badge no longer has to match its cap height */
  .who-badge img {
    height: 3.25rem;
  }

  .case-foot {
    grid-template-columns: 1fr;
  }

  .case-quote {
    border-right: none;
    border-bottom: 1px solid var(--rule-strong);
  }

  .case-window img {
    aspect-ratio: 4 / 3;
    object-position: 0 0;
  }
}

@media (max-width: 600px) {
  /* Headline and intro sit closer together on a phone */
  .hero-body {
    margin-top: var(--space-sm);
  }

  /* Let the case study heading wrap naturally instead of at the desktop break */
  .case-head h2 br {
    display: none;
  }

  /* Four day tabs don't fit in one row: two even rows instead of a lone wrapped tab */
  .day-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Breathing room between the screenshot and the quote below it */
  .case-foot {
    padding-top: var(--space);
  }

  .case-stamp {
    width: 4.5rem;
    box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--accent-line);
    transform: translate(15%, -60%) rotate(-9deg);
  }

  .case-stamp-small {
    font-size: 0.42rem;
  }

  .case-stamp-big {
    font-size: 1.05rem;
  }

  .how-services-list {
    grid-template-columns: 1fr;
  }

  .who-timeline {
    grid-template-columns: 1fr;
  }

  .who-timeline::before {
    display: none;
  }

  .who-timeline li {
    padding-block: var(--space);
  }

  .who-timeline li::before {
    display: none;
  }

  .who-timeline li + li {
    border-left: none;
    border-top: 1px solid var(--rule-strong);
  }

  .case-stats {
    grid-template-columns: 1fr;
  }

  .case-stats li {
    flex-direction: row;
    align-items: center;
    gap: var(--space);
    padding-block: var(--space);
  }

  .case-stats li + li {
    border-left: none;
    border-top: 1px solid var(--rule-strong);
  }

  .case-stat-num {
    min-width: 4ch;
  }

  :root {
    --space-xl: 3.5rem;
    --space-2xl: 4.5rem;
  }

  .site-header {
    flex-wrap: wrap;
    row-gap: 0;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: var(--space-xs);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav a {
    flex: none;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
  }

  .contact-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
