:root {
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #16151a;
  --muted: #6b6b72;
  --line: #e6e5e2;
  --paper: #fbfaf8;
  --accent: #ec1e7c;
  --max: 920px;
  --gutter: clamp(24px, 6vw, 96px);
}

* { box-sizing: border-box; }


body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------------------------------------------- */
/* Password gate                                                     */
/* ---------------------------------------------------------------- */
body.locked > *:not(.password-gate) {
  display: none !important;
}

.password-gate {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  padding: 24px;
}

.password-gate__form {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.password-gate__label {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.password-gate__input {
  font-family: var(--sans);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.password-gate__input:focus {
  outline: none;
  border-color: var(--ink);
}

.password-gate__submit {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 14px;
  border: none;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.password-gate__submit:hover {
  opacity: 0.9;
}

.password-gate__error {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0;
}

/* ---------------------------------------------------------------- */
/* Reveal-on-scroll                                                  */
/* ---------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------------------------- */
/* Scroll hint: visible on load, fades out as the first line reveals */
/* ---------------------------------------------------------------- */
.scroll-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 5%;
  height: 0;
  pointer-events: none;
  z-index: 5;
}

.scroll-hint__line {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 100vh;
  height: 100svh;
  border-left: 1px dashed rgba(22, 21, 26, 0.18);
  transform-origin: bottom center;
  transform: rotate(10deg);
}

.scroll-hint__label {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- */
/* Pinned intro sequence: the hero stays fixed on screen while each  */
/* line builds up into the final composed layout, one at a time.    */
/* Nothing exits once revealed — it accumulates, then the page       */
/* continues scrolling normally underneath once it's fully built.    */
/* ---------------------------------------------------------------- */
.intro-track {
  position: relative;
  height: calc(var(--beats) * 100vh);
  height: calc(var(--beats) * 100svh);
}

.intro-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.intro-content {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--gutter);
}

.intro-item {
  opacity: 0;
  transform: translateY(24px);
  will-change: opacity, transform;
}

.hero__name.intro-item {
  opacity: 1;
  transform: translateY(0);
}

.hero__name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 32px;
  letter-spacing: -0.01em;
}

.hero__lede {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  max-width: 640px;
  margin: 0 0 24px;
}

.hero__body {
  font-family: var(--serif);
  color: var(--muted);
  max-width: 680px;
  font-size: 18px;
  margin: 0 0 40px;
}

.principles {
  padding-top: 8px;
}

.principles__label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  margin: 0 0 10px;
}

.principles__line {
  font-family: var(--serif);
  color: var(--muted);
  font-size: 18px;
  margin: 0 0 4px;
  max-width: 760px;
}

/* ---------------------------------------------------------------- */
/* Section label                                                     */
/* ---------------------------------------------------------------- */
.section-label {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main .section-label {
  padding-top: 24px;
  padding-bottom: 8px;
}

/* ---------------------------------------------------------------- */
/* Projects                                                           */
/* ---------------------------------------------------------------- */
.project {
  padding: 40px var(--gutter) 8px;
  max-width: 1400px;
  margin: 0 auto;
}

.project--sub {
  padding-top: 8px;
}

.project__meta {
  display: flex;
  align-items: baseline;
  gap: 20px;
  max-width: var(--max);
  margin: 0 auto 20px;
  padding: 0 0;
}

.project--sub .project__meta {
  margin-left: 0;
}

.project__year {
  font-family: var(--serif);
  color: var(--muted);
  font-size: 16px;
  min-width: 92px;
  flex-shrink: 0;
}

.project__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  transition: opacity 0.2s ease;
}

.project__title:hover {
  opacity: 0.6;
}

.arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}

.project__title:hover .arrow {
  transform: translateX(4px);
}

/* ---------------------------------------------------------------- */
/* Filmstrip                                                          */
/* ---------------------------------------------------------------- */
/* Holds the position:fixed magnify clones outside the clipped, scrolling
   filmstrip, so they can freely scale and paint over anything (including
   the title above the row) without being cropped by overflow-x: auto. */
.magnify-overlay-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 9999;
}

.filmstrip {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px var(--gutter) 24px;
  margin: 0 calc(var(--gutter) * -1);
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--gutter);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filmstrip::-webkit-scrollbar {
  display: none;
}

.filmstrip__item {
  flex: 0 0 auto;
  width: 250px;
  margin: 0;
  scroll-snap-align: start;
  overflow: hidden;
  border-radius: 0;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.05);
  position: relative;
  transform: scale(1);
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.filmstrip__item:not(:first-child) {
  margin-left: 0;
}

.filmstrip__item:first-child {
  border-radius: 8px 0 0 8px;
}

.filmstrip__item:last-child {
  border-radius: 0 8px 8px 0;
}

.filmstrip__item img {
  width: 100%;
  height: 141px;
  object-fit: cover;
  display: block;
  border: 0.5px solid rgba(0, 0, 0, 0.2);
  border-radius: inherit;
}

.placeholder {
  width: 100%;
  height: 141px;
  border-radius: inherit;
  border: 0.5px solid rgba(0, 0, 0, 0.2);
}

.placeholder--0 { background: linear-gradient(155deg, #f1efe9, #e4e1d8); }
.placeholder--1 { background: linear-gradient(155deg, #eef0f0, #dde1e2); }
.placeholder--2 { background: linear-gradient(155deg, #efece7, #e7e2d8); }
.placeholder--3 { background: linear-gradient(155deg, #eceef0, #dadfe3); }
.placeholder--4 { background: linear-gradient(155deg, #f0eee9, #e2ddd1); }

.filmstrip__item.is-dark .placeholder {
  background: linear-gradient(155deg, #2a2a33, #16151c);
}

/* ---------------------------------------------------------------- */
/* Contact                                                            */
/* ---------------------------------------------------------------- */
.contact {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px var(--gutter) 120px;
}

.contact .section-label {
  padding: 0;
  margin-bottom: 24px;
}

.contact__list {
  margin: 0;
}

.contact__row {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 10px 0;
}

.contact__row dt {
  color: var(--muted);
  min-width: 92px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
}

.contact__row dd {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
}

.contact__row a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------- */
/* Case study modal                                                  */
/* ---------------------------------------------------------------- */
.filmstrip__item--clickable {
  cursor: pointer;
}

.case-study-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 21, 26, 0.6);
  display: flex;
  justify-content: center;
  padding: 5vh 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2000;
  overflow-y: auto;
}

.case-study-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.case-study-modal {
  position: relative;
  width: 90vw;
  height: fit-content;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.case-study-overlay.is-open .case-study-modal {
  transform: translateY(0);
}

.case-study-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
}

.case-study-modal__close:hover {
  background: rgba(0, 0, 0, 0.12);
}

.case-study-modal__content {
  padding: 0 0 240px;
}

#case-study-risk-rrg-ai-help-agent .case-study-modal__content {
  padding-bottom: 0;
}

.case-study-modal__hero {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  margin: 0 0 48px;
}

.case-study-modal__video-row {
  display: flex;
  width: 100%;
  margin: 0 0 48px;
}

.case-study-modal__video-row video {
  flex: 1 1 0;
  width: 0;
  height: auto;
  display: block;
  background: #000;
}

.case-study-modal__hero:not(:has(+ .case-study-modal__block)):not(:has(+ .case-study-modal__columns)) {
  margin-bottom: 0;
}

.case-study-modal__video-row:not(:has(+ .case-study-modal__block)):not(:has(+ .case-study-modal__columns)) {
  margin-bottom: 0;
}

.case-study-modal__hero-wrap {
  position: relative;
  margin: 0 0 581px;
}

.case-study-modal__hero-wrap .case-study-modal__hero {
  margin: 0;
}

.case-study-modal__hero-overlay {
  position: absolute;
  left: 50%;
  bottom: -521px;
  transform: translateX(-50%);
  width: 70%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  background: #000;
}

.case-study-modal__block {
  max-width: 920px;
  margin: 0 auto 64px;
  padding: 0 clamp(24px, 4vw, 64px);
}

.case-study-modal__block .case-study-modal__heading,
.case-study-modal__block .case-study-modal__body {
  max-width: 640px;
}

.case-study-modal__columns {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  max-width: 920px;
  margin: 0 auto 64px;
  padding: 0 clamp(24px, 4vw, 64px);
}

.case-study-modal__label {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.case-study-modal__label:has(+ .case-study-modal__stat) {
  margin-bottom: 2px;
}

.case-study-modal__heading {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.case-study-modal__heading + .case-study-modal__body {
  margin-bottom: 24px;
}

.case-study-modal__body {
  font-family: var(--serif);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 8px;
}

.case-study-modal__list {
  font-family: var(--serif);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 8px;
  padding-left: 1.2em;
}

.case-study-modal__caption + .case-study-modal__caption {
  margin-top: 20px;
}

.case-study-modal__stat {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.4rem;
  line-height: 1.1;
  margin: 0 0 2px;
}

.case-study-modal__caption {
  font-family: var(--serif);
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.case-study-modal__caption + .case-study-modal__stat {
  margin-top: 20px;
}

.case-study-modal__link {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 4px;
  text-decoration: underline;
}

/* ---------------------------------------------------------------- */
/* Responsive                                                        */
/* ---------------------------------------------------------------- */
@media (max-width: 640px) {
  .project__meta {
    flex-direction: column;
    gap: 4px;
  }

  .case-study-modal__columns {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
