:root {
  --bg: #f5f5f3;
  --ink: #141414;
  --ink-2: #4a4a4a;
  --ink-3: #757575;
  --rule: #b9b9b6;
  --veil: rgba(245, 245, 243, 0.86);
  --hairline: rgba(20, 20, 20, 0.08);

  --gutter: clamp(16px, 5vw, 72px);
  --col-gap: clamp(16px, 2vw, 32px);
  --space: clamp(96px, 14vw, 220px);
  --header-pad: clamp(16px, 2vw, 28px);

  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keep anchor targets clear of the sticky header (height set by script) */
  scroll-padding-top: calc(var(--header-h, 72px) + var(--header-pad));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol {
  margin: 0;
  padding: 0;
  font-weight: 400;
}

ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

/* Layout */

.wrap {
  max-width: 1600px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  margin-top: var(--space);
}

.row > :first-child {
  grid-column: 1 / 4;
}

.row > :nth-child(2) {
  grid-column: 4 / -1;
}

/* Ruled sections draw the hairline inside the gutters */
.ruled {
  position: relative;
  padding-top: clamp(28px, 3.4vw, 48px);
}

.ruled::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  border-top: 1px solid var(--rule);
}

.label {
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.005em;
  color: var(--ink-3);
}

/* Header: sticky, veiled in the page colour; the hairline shows only once scrolled */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--veil);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  border-bottom-color: var(--hairline);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  padding-block: var(--header-pad);
  font-size: 13px;
  line-height: 1.4;
}

.wordmark {
  font-size: clamp(22px, 2vw, 30px);
  letter-spacing: -0.015em;
}

/* K mark sized off the wordmark and centred on its cap height */
.mark {
  display: inline-block;
  height: 1em;
  width: auto;
  margin-right: 0.42em;
  vertical-align: -0.135em;
}

.site-header nav {
  display: flex;
  gap: clamp(16px, 2vw, 28px);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  /* Original gap below the header, less the sticky header's own padding */
  padding-top: calc(clamp(120px, 20vw, 300px) + clamp(20px, 2.8vw, 40px) - 2 * var(--header-pad));
}

.hero h1 {
  grid-column: 4 / -1;
  font-size: clamp(3rem, 2rem + 3.6vw, 5.75rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

/* Intro */

.intro .intro-text {
  grid-column: 4 / -1;
}

.intro-text {
  max-width: 28em;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 1.5;
  letter-spacing: -0.005em;
}

/* Focus */

.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: clamp(56px, 6.5vw, 104px);
}

.focus-grid li {
  max-width: 30em;
}

.index {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.focus-grid h3 {
  margin-top: 12px;
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.focus-grid p {
  margin-top: 16px;
  max-width: 27em;
  color: var(--ink-2);
}

/* Contact */

.email {
  font-size: clamp(1.5rem, 1.25rem + 2.5vw, 3.875rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

/* Footer */

.site-footer {
  padding-bottom: clamp(24px, 3.4vw, 48px);
}

/* Small screens: labels sit above content, everything stacks */

@media (max-width: 760px) {
  .row,
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .row > :first-child,
  .row > :nth-child(2),
  .hero h1 {
    grid-column: 1 / -1;
  }

  .row > .label:first-child {
    margin-bottom: 24px;
  }

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

  /* Small-screen display sizes keep their original, steeper scale */
  .hero h1 {
    font-size: clamp(3rem, 7.6vw, 7.5rem);
  }

  .email {
    font-size: clamp(1.5rem, 5.4vw, 4.75rem);
  }

  .site-footer > .label:first-child {
    margin-bottom: 0;
  }
}

/* Phones: trim the mark and header gaps so brand and nav stay on one row */

@media (max-width: 420px) {
  .site-header-inner {
    column-gap: 16px;
  }

  .site-header nav {
    gap: 12px;
  }

  .mark {
    height: 0.85em;
    margin-right: 0.3em;
    vertical-align: -0.06em;
  }
}
