/* Mono editorial: ink on paper, four greys, a light serif for display type, Inter for the rest. */

:root {
  --ink: #1A1A1A;
  --paper: #FBFAF8;
  --panel: #F2F1ED;
  --panel2: #EAE8E3;
  --mid: #5A5A5A;
  --faint: #B5B5B5;
  --rule: #E3E1DC;
  --band: #1A1A1A;
  --band-ink: #FFFFFF;
  --band-mid: #B5B5B5;
  --band-rule: #3A3A3A;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: Inter, 'Helvetica Neue', Arial, sans-serif;
  --nav-h: 52px;
  --section-y: 72px;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* The page sets its own mood: dark bands on light paper. Dark mode is opt-in via data-theme. */
:root[data-theme="dark"] {
  --ink: #F4F4F4;
  --paper: #1A1A1A;
  --panel: #262626;
  --panel2: #303030;
  --mid: #B5B5B5;
  --faint: #6E6E6E;
  --rule: #3A3A3A;
  --band: #0D0D0D;
  --band-rule: #2E2E2E;
}

html {
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 72px);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* Covers the notch area so content never shows above the sticky nav */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--paper);
  z-index: 11;
}

main {
  flex: 1 0 auto;
}

a { color: var(--ink); }
a:hover { color: var(--mid); }

p { margin: 0; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Display type */

.serif {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.012em;
}

.kicker {
  font-size: 13px;
  color: var(--mid);
}

.sec-h {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.012em;
}

.lede {
  max-width: 36em;
  font-size: 18px;
  line-height: 1.6;
  color: var(--mid);
}

.rule {
  height: 1px;
  background: var(--rule);
}

/* Pills */

.pill,
.pill:hover {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 7px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--mid);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.pill:hover {
  border-color: var(--faint);
  color: var(--ink);
}

.pill-active,
.pill-active:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

/* Pills on a dark band */
.band .pill,
.band .pill:hover {
  border-color: var(--band-rule);
  color: var(--band-mid);
}

.band .pill:hover {
  border-color: var(--band-mid);
  color: var(--band-ink);
}

.band .pill-active,
.band .pill-active:hover {
  border-color: var(--band-ink);
  background: var(--band-ink);
  color: #1A1A1A;
}

/* Masthead band */

.band {
  background: var(--band);
  color: var(--band-ink);
}

/* The masthead fills the first screen, like Rogo: one headline, one line, one button, centred.
   A faint lift behind the type and a fall-off to the base give it depth without imagery. */
.masthead {
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--nav-h) - env(safe-area-inset-top, 0px));
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(255, 255, 255, 0.045), transparent 70%),
    linear-gradient(180deg, var(--band) 0%, #0A0A0A 100%);
}

.masthead .wrap {
  width: 100%;
  padding-top: 64px;
  padding-bottom: 96px;
}

.masthead-body {
  align-items: center;
  text-align: center;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.masthead-body {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.masthead-h {
  margin: 0;
  /* No forced break: the browser wraps where it must and balances the lines so no word is stranded */
  text-wrap: balance;
  font-family: var(--serif);
  font-weight: 350; /* the serif loads as a 300–400 range, so this sits between light and regular */
  font-size: clamp(48px, 8.6vw, 124px);
  line-height: 1.04;
  letter-spacing: -0.012em;
}

/* Each line is clipped so it can rise into view on load; the padding keeps descenders inside the clip */
.masthead-h .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}

.masthead-h .line > span {
  display: block;
}

.masthead-sub {
  max-width: 46em;
  font-size: 18px;
  line-height: 1.5;
  color: var(--band-mid);
}

/* Tagline as plain text beside the button, as Legora does it: the button is the only thing that looks clickable */
.masthead-cta {
  display: inline-flex;
  align-self: center;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
}

.masthead-tagline {
  font-size: 14px;
  font-weight: 400;
  color: var(--band-mid);
  white-space: nowrap;
}

/* Main calls to action (hero and contact) share one heavier pill */
.pill-cta,
.pill-cta:hover {
  gap: 12px;
  min-height: 46px;
  padding: 6px 6px 6px 22px;
  font-size: 13px;
  font-weight: 600;
}

/* Arrow disc seated in the button's right end, inverted from the button colours */
.pill-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1A1A1A;
  color: #FFFFFF;
  transition: transform 0.25s cubic-bezier(.2, .7, .1, 1);
}

.pill-cta:hover .pill-arrow { transform: translateX(2px); }

/* The load animation only runs once JS has marked the page, so the text is never left hidden */
.js .masthead-h .line > span {
  transform: translateY(110%);
  animation: rise 1.5s cubic-bezier(.2, .7, .1, 1) forwards;
}

.js .masthead-h .line:nth-child(2) > span { animation-delay: 0.2s; }

.js .masthead-sub {
  opacity: 0;
  animation: fade 1s ease 0.9s forwards;
}

.js .masthead-cta {
  opacity: 0;
  animation: fade 1s ease 1.3s forwards;
}

/* Compact masthead on secondary pages: no full-screen fill, title left-aligned */
.masthead-page {
  min-height: 0;
}

.masthead-page .wrap {
  padding-top: 48px;
  padding-bottom: 48px;
}

.masthead-page .masthead-body {
  align-items: flex-start;
  text-align: left;
}

.masthead-page .masthead-h {
  font-size: clamp(32px, 4.5vw, 44px);
}

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

@keyframes fade {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .js .masthead-h .line > span,
  .js .masthead-sub,
  .js .masthead-cta {
    animation: none;
    transform: none;
    opacity: 1;
  }
}

/* Sticky nav at the top of the page */

.site-nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-nav .wrap {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.brand:hover {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.tabs a,
.tabs a:hover {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--nav-h);
  font-size: 14px;
  color: var(--mid);
  text-decoration: none;
}

.tabs a:hover { color: var(--ink); }

/* Underline scales in on the active tab */
.tabs a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1.5px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(.2, .7, .1, 1);
}

.tabs a.active { color: var(--ink); }
.tabs a.active::after { transform: scaleX(1); }

/* Sections */

.section {
  padding: var(--section-y) 0;
  scroll-margin-top: calc(var(--nav-h) + 8px);
}

.section-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

/* Statement: larger, quieter type than the other sections, set apart before the contact band */
/* The Who title carries the hero weight; other section titles stay light */
#who-h,
#services-h { font-weight: 350; }

.statement {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding: calc(var(--section-y) + 32px) 0 calc(var(--section-y) + 56px);
}

/* Same widths as the other section intros: the title spans the content width, the paragraph the 648px lede measure */
.statement-h {
  width: 100%;
}

.statement-p {
  max-width: 648px;
}

.statement-h {
  margin: 0;
  text-wrap: balance;
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.012em;
}

.statement-p {
  font-size: 19px;
  line-height: 1.6;
  color: var(--mid);
}

.narrow {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Panels */

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 28px 32px;
  border-radius: 2px;
  background: var(--panel);
}

.panel h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.012em;
}

.panel p:last-child {
  font-size: 15px;
  line-height: 1.55;
  color: var(--mid);
}

/* Services story: pinned stage on the left, steps scrolling on the right */

.story {
  /* Column width: the wrap's inner width minus the gap, halved. Steps match it so each one is the stage's height. */
  --stage-h: calc((min(1040px, 100vw) - 64px - 64px) / 2);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}

.story-pin {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.story-pin .section-intro { margin-bottom: 28px; }

.story-stage {
  position: relative;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--panel);
  overflow: hidden;
}

.stage-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--mid);
}

.stage-caption-num {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stage-caption-title { color: var(--ink); font-weight: 500; }
.stage-caption-time { margin-left: auto; font-variant-numeric: tabular-nums; }

.scene {
  position: absolute;
  inset: 0 0 48px;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(18px) scale(.98);
  transition: opacity .55s ease, filter .55s ease, transform .7s cubic-bezier(.2, .7, .1, 1);
}

.scene.is-active {
  opacity: 1;
  filter: none;
  transform: none;
}

.scene-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  .scene { transition: none; }
}

.story-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  /* Start level with the stage: kicker + gap + title + intro margin */
  padding-top: var(--story-intro-h, 0px);
  /* Room for the last step to reach the middle of the screen before the pin is pushed up */
  padding-bottom: 40px;
}

/* Each step takes most of a viewport so there is room for the stage to change */
.story-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  height: var(--stage-h);
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  transition: opacity 0.4s ease;
}

.story-step:first-child { border-top: 0; }

.story-step:not(.is-active) { opacity: 0.35; }

.story-step h3 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -0.012em;
}

.story-step p {
  max-width: 26em;
  font-size: 18px;
  line-height: 1.5;
  color: var(--mid);
}

/* What you get: hairline rows, ink text */
.step-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-width: 26em;
  font-size: 15px;
}

.step-list li {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}

.step-list li::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  margin-top: 0.6em;
  border-radius: 50%;
  background: var(--ink);
}

.story-step .step-time { font-size: 13px; color: var(--mid); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .story-step { transition: none; }
}

.step-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.step-num {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.012em;
  color: var(--faint);
}

/* Contact band */

.contact {
  scroll-margin-top: calc(var(--nav-h) + 8px);
}

.contact .wrap {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact .kicker { color: var(--band-mid); }
.contact .lede { color: var(--band-mid); }

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

.email-link,
.email-link:hover {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: var(--band-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--band-rule);
}

.site-footer .wrap {
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--band-mid);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--band-ink);
  font-weight: 500;
}

/* Padding plus matching negative margin: 44px tap target, footer height unchanged */
.footer-link,
.footer-link:hover {
  display: inline-block;
  padding: 12px 8px;
  margin: -12px -8px;
  line-height: 20px;
  color: var(--band-mid);
  text-decoration: none;
}

.footer-link:hover { color: var(--band-ink); }

@media (max-width: 640px) {
  /* Two lines at most for the headline on phones */
  .masthead-h { font-size: clamp(40px, 11.5vw, 56px); line-height: 1.06; }
}

@media (max-width: 860px) {
  :root { --section-y: 56px; }
  .wrap { padding-left: 18px; padding-right: 18px; }
  .masthead { min-height: calc(85vh - var(--nav-h)); }
  .masthead .wrap { padding-top: 56px; padding-bottom: 72px; }
  .masthead-cta { display: flex; flex-direction: column; align-items: center; gap: 16px; }
  .tabs { display: none; }
  .sec-h { font-size: 28px; }
  .statement { padding: var(--section-y) 0 calc(var(--section-y) + 16px); }
  .statement-p { font-size: 17px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .story { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .story-pin { position: static; }
  .story-stage { max-width: 420px; }
  .story-steps { padding-top: 0; padding-bottom: 0; }
  .story-step { height: auto; padding: 28px 0; }
  .story-step:not(.is-active) { opacity: 1; }
  .story-step h3 { font-size: 32px; }
  .story-step p { font-size: 16px; }
}
