:root {
  --font-body: "Geist", sans-serif;
  --font-display: "Amiri", serif;

  --page-bg: #f2eeeb;
  /* Flat fill for fixed sidebar strips; hero uses its own gradient. */
  --page-background: #f2eeeb;
  --page-bg-soft: #efe9e5;
  --surface-card: rgba(255, 255, 255, 0.62);
  --surface-card-strong: rgba(255, 255, 255, 0.86);
  --surface-pill: rgba(255, 255, 255, 0.52);
  --surface-pill-strong: #ff7631;
  --ink-strong: #33231d;
  --ink-soft: rgba(51, 35, 29, 0.76);
  --ink-muted: rgba(51, 35, 29, 0.58);
  --line-soft: rgba(51, 35, 29, 0.08);
  --shadow-card: 0 26px 80px rgba(84, 56, 37, 0.08);
  --shadow-hover: 0 22px 70px rgba(84, 56, 37, 0.14);
  --shadow-pill: 0 8px 14px -14px rgba(0, 0, 0, 0.16), 0 0 0.5px 0.5px rgba(0, 0, 0, 0.05);
  --radius-pill: 999px;
  --radius-card: 1.9rem;
  --radius-frame: 999px;
  --scene-frame-inset: 1rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  --text-eyebrow: 20px;
  /* Eyebrow column strip: section top padding + heading pad + one line + 80px below label */
  --eyebrow-strip-height: calc(0.65rem + 1.3 * var(--text-eyebrow) + 80px);
  --section-eyebrow-strip-height: calc(4.5rem + var(--eyebrow-strip-height));
  --text-heading-100: 1rem;
  --text-heading-200: 1.25rem;
  --text-body-100: 1rem;
  --text-body-200: 1.25rem;
  --text-body-300: clamp(1.375rem, 2vw, 1.625rem);
  --text-display: clamp(5.5rem, 16vw, 15rem);

  --shell-width: min(100% - 2rem, 82rem);
  --grid-columns: 12;
  --grid-gutter: 32px;
  --motion-smooth: 180ms ease;
  /* Set from JS to match fixed header height (fallback until measured). */
  --site-header-height: 5.5rem;
  /* JS overwrites with distance from .page-wrapper top to below .hero__eyebrow; desktop-only fallback. */
  --dot-grid-offset-top: calc(
    var(--site-header-height) + 8.5rem + 1.3 * var(--text-eyebrow)
  );
  /* JS overwrites with .site-footer height so the strip ends above the footer. */
  --dot-grid-offset-bottom: 4.6rem;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 20rem;
  font-family: var(--font-body);
  color: var(--ink-strong);
  background-color: var(--page-bg);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

p,
h1,
h2,
h3 {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 50;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--ink-strong);
  color: white;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.page-wrapper {
  position: relative;
  width: var(--shell-width);
  margin-inline: auto;
}

.dot-grid {
  position: absolute;
  left: 0;
  width: calc(
    (100% - 11 * var(--grid-gutter)) / 12 * 2 + var(--grid-gutter)
  );
  pointer-events: none;
  background-image: radial-gradient(
    circle at center,
    rgba(51, 35, 29, 0.12) 1px,
    transparent 1px
  );
  background-size: 0.75rem 0.75rem;
  background-position: 0 0;
}

/* Segments 0–2: top + height from JS. Segment 3: top from JS, bottom clears footer. */
.dot-grid--segment {
  display: none;
  bottom: auto;
}

.dot-grid--segment-to-footer {
  bottom: var(--dot-grid-offset-bottom);
  height: auto;
}

@media (min-width: 761px) {
  html.is-dot-grid-synced .dot-grid--segment.is-dot-grid-visible {
    display: block;
  }
}

@media (max-width: 760px) {
  .dot-grid {
    display: none;
  }
}

.shell {
  width: 100%;
  margin-inline: auto;
}

/* scroll-margin aligns hash jumps with the fixed header; avoid duplicating html scroll-padding + main padding. */
#overview {
  padding-top: var(--site-header-height);
  scroll-margin-top: var(--site-header-height, 5.5rem);
}

#work,
#about {
  scroll-margin-top: var(--site-header-height, 5.5rem);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: 100vw;
  max-width: 100vw;
  padding: 1.5rem 0 0.5rem;
  color: rgba(51, 35, 29, 1);
  background: transparent;
  background-clip: unset;
  -webkit-background-clip: unset;
  box-shadow: none;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  transition:
    transform 100ms cubic-bezier(0.25, 0.1, 0.25, 1) 50ms,
    visibility 0s;
}

.site-header.is-header-hidden {
  transform: translate3d(0, -100%, 0);
  pointer-events: none;
  visibility: hidden;
  box-shadow: none;
  transition:
    transform 200ms cubic-bezier(0.25, 0.1, 0.25, 1),
    visibility 0s linear 200ms;
}

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

  .site-header.is-header-hidden {
    transition: none;
  }

}

.shell--header {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--shell-width);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  column-gap: var(--grid-gutter);
}

.pill-nav {
  grid-column: 1 / -1;
  justify-self: center;
  display: inline-flex;
  flex-wrap: wrap;
  padding: 8px;
  align-items: flex-start;
  gap: 6px;
  justify-content: flex-start;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  background: #f7f4f2;
  box-shadow:
    0 75px 21px 0 rgba(204, 204, 204, 0),
    0 34px 19px 0 rgba(204, 204, 204, 0.01),
    0 20px 16px 0 rgba(204, 204, 204, 0.04),
    0 10px 12px 0 rgba(204, 204, 204, 0.05),
    0 2px 7px 0 rgba(204, 204, 204, 0.07);
}

.pill-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.125rem;
  padding: 0.55rem 0.95rem;
  border: 0.5px solid rgba(142, 142, 142, 0.3);
  border-radius: var(--radius-pill);
  box-shadow: none;
  background: rgba(243, 238, 235, 1);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  color: var(--ink-strong);
  transition:
    background-color 150ms linear,
    border-color 150ms linear,
    box-shadow 150ms linear;
}

.pill-nav__link:hover:not(.is-current),
.pill-nav__link:focus-visible:not(.is-current) {
  background: rgba(236, 229, 224, 1);
  box-shadow: var(--shadow-pill);
  transition:
    background-color 150ms ease-out,
    border-color 150ms ease-out,
    box-shadow 150ms ease-out;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.125rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 0.5px solid #E8E8E8;
  background: #EDE9E7;
  box-shadow: 0 4px 4px -4px rgba(0, 0, 0, 0.16) inset;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.875rem;
  line-height: 1;
  color: var(--ink-strong);
}

a.pill-nav__link.is-current {
  background: var(--surface-pill-strong);
  border-color: rgba(255, 118, 49, 0.55);
  color: var(--ink-strong);
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.2),
    0 0.5px 1px rgba(0, 0, 0, 0.15);
  box-shadow:
    var(--shadow-pill),
    0 0 24px rgba(255, 118, 49, 0.28);
}

.hero {
  margin-top: calc(-1 * var(--site-header-height));
  padding: var(--site-header-height) calc(50vw - 50%) 64px;
  margin-left: calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
  box-sizing: border-box;
  background: linear-gradient(180deg, #f7f4f2 50%, #f2eeeb 100%);
}

.shell--hero {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  column-gap: var(--grid-gutter);
  align-items: start;
  position: relative;
}

.eyebrow,
.hero__eyebrow {
  font-size: var(--text-eyebrow);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero__eyebrow {
  grid-column: 1 / 3;
  align-self: stretch;
  height: fit-content;
  padding-top: 8.5rem;
  padding-bottom: 240px;
  padding-inline: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: transparent;
}

.hero__copy {
  grid-column: 3 / 7;
  padding-top: 8.0625rem; /* 129px */
  display: grid;
  gap: 1.6rem;
  max-width: 26rem;
}

.hero__lede {
  font-size: 24px;
  line-height: 1.45;
  color: var(--ink-strong);
}

.about__intro,
.about__body p {
  font-size: 20px;
  line-height: 1.45;
  color: var(--ink-strong);
}

.hero__visual {
  grid-column: 8 / 13;
  grid-row: 1 / span 2;
  position: relative;
  z-index: 1;
  min-height: 42rem;
}

.scene-frame {
  display: flex;
  align-items: stretch;
  height: min(60vw, 60.75rem);
  min-height: 34rem;
  padding: var(--scene-frame-inset);
  border-radius: var(--radius-frame);
  background: linear-gradient(180deg, #f5f0ed 0%, #e6e0dc 100%);
  box-shadow: inset 0 4px 16px -8px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.36);
  overflow: hidden;
}

.scene-frame__unicorn {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.scene-frame__unicorn canvas,
.scene-frame__unicorn iframe {
  width: 100% !important;
  height: 100% !important;
  transform: scale(1.3);
  transform-origin: center;
}

.scene-frame__unicorn a {
  opacity: 0;
}

.hero__display {
  grid-column: 3 / 7;
  grid-row: 2;
  align-self: end;
  margin-top: -80px;
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: var(--text-display);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.72);
  max-width: 8ch;
  pointer-events: none;
}

.section {
  padding: 1rem 0 4rem;
}

.section--lines {
  border: 0;
}

.shell--section {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  column-gap: var(--grid-gutter);
}

.appearances {
  position: relative;
  /* Net offset to label matches old 4.25rem + 0.65rem while using 3px heading padding-top */
  padding-top: calc(4.25rem - 3px + 0.65rem);
  padding-bottom: 3.5rem;
}

.appearances::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc((100% - 11 * var(--grid-gutter)) / 12 * 2 + var(--grid-gutter));
  background: var(--page-background);
  pointer-events: none;
  z-index: 0;
}

.appearances .shell--section {
  z-index: 1;
}

.appearances .section-heading {
  background-color: transparent;
  padding: 3px 0 0.85rem 0;
}

.section--lines .shell--section {
  position: relative;
}

/* Abspos pseudos do not participate in grid — use left/right, not grid-column. */
.section--lines .shell--section::before,
.section--lines .shell--section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-soft);
  pointer-events: none;
  z-index: 1;
}

.section--lines .shell--section::before {
  /* Matches .appearances padding-top (line sits at section content top) */
  top: calc(-4.25rem + 3px - 0.65rem);
}

.section--lines .shell--section::after {
  bottom: -3.5rem;
}

.about .shell--about::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -4.5rem;
  height: 1px;
  background: var(--line-soft);
  pointer-events: none;
  z-index: 1;
}

@media (min-width: 1221px) {
  .section--lines .shell--section::before,
  .section--lines .shell--section::after,
  .about .shell--about::after {
    left: calc(
      (100% - 11 * var(--grid-gutter)) / 12 * 2 + 2 * var(--grid-gutter)
    );
    right: 0;
  }

  .hero__eyebrow {
    font-size: 18px;
    padding-top: 133px;
    padding-bottom: 200px;
  }

  .hero__lede {
    font-size: 22px;
  }

  .about__body {
    padding-top: 8px;
  }
}

.section-heading {
  grid-column: 1 / 3;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-sizing: border-box;
  width: 100%;
  padding: 0.65rem 0 0.85rem 0;
}

.section-heading .eyebrow {
  margin: 0;
}

#work-title {
  font-size: 19px;
}

.appearances__list {
  grid-column: 3 / 13;
  display: grid;
  gap: 1rem;
}

.appearance-row {
  width: fit-content;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-size: var(--text-body-100);
  line-height: 1.4;
}

.appearance-row__title {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 0.04em;
  text-underline-offset: 0.1em;
}

.appearance-row__description {
  color: var(--ink-soft);
}

.appearance-row__meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.work {
  position: relative;
  padding-top: 4.5rem;
}

.section.work::before,
.section.about::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: calc((100% - 11 * var(--grid-gutter)) / 12 * 2 + var(--grid-gutter));
  height: var(--section-eyebrow-strip-height);
  background: var(--page-background);
  pointer-events: none;
}

.shell--work {
  position: relative;
  z-index: 1;
  align-items: start;
}

.work-grid {
  grid-column: 3 / 11;
  display: grid;
  gap: 2.2rem;
}

.work-card {
  position: relative;
  min-width: 0;
  border-radius: 32px;
  border: 1px solid #F5F5F5;
  background: #F7F3F1;
  box-shadow: 8px 32px 60px 0 rgba(0, 0, 0, 0.02), 0 24px 44px -40px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.work-card__link {
  display: block;
  min-width: 0;
  text-decoration: none;
}

.work-card__media {
  box-sizing: border-box;
  margin: 16px;
  width: calc(100% - 32px);
  max-width: calc(100% - 32px);
  padding: 0;
  border-radius: 16px;
  background: transparent;
  overflow: hidden;
}

.work-card__body {
  display: grid;
  gap: 1.25rem;
  padding: 8px 2rem 24px;
}

.work-card__title {
  font-size: 16px;
  line-height: 1.15;
  font-weight: 700;
}

.work-card__body .work-card__summary {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 16px !important;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ink-soft);
}

.work-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.work-card__meta .meta-pill {
  min-height: 32px;
  height: 32px;
  padding-block: 0;
  padding-inline: 0.95rem;
}

.preview {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(51, 35, 29, 0);
}

.preview img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.meta-pill--brand {
  gap: 6px;
  min-height: calc(21px + 1.1rem + 1px);
  max-height: calc(21px + 1.1rem + 1px);
  padding-left: 15px;
  padding-right: 15px;
  color: #fff5ee;
  border-color: transparent;
}

.meta-pill__logo {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  height: 21px;
  width: auto;
  object-fit: contain;
}

.meta-pill--hubspot {
  background-color: rgba(255, 72, 0, 1);
}

.meta-pill--miro {
  background: #ffd43b;
  color: #1f2130;
}

.meta-pill--intercom {
  background: #19100f;
}

.meta-pill--economist {
  background: rgba(228, 19, 11, 1);
}

.work-card__meta .meta-pill.meta-pill--brand {
  min-height: 32px;
  max-height: 32px;
  height: 32px;
  padding-block: 0;
}

.about {
  position: relative;
  padding-top: 4.5rem;
  padding-bottom: 5rem;
}

.shell--about {
  position: relative;
  z-index: 1;
  align-items: start;
}

.about__body {
  grid-column: 3 / 13;
  display: grid;
  gap: 1.4rem;
  max-width: 45rem;
}

.about__body p {
  color: var(--ink-strong);
}

.about__intro {
  color: var(--ink-strong);
}

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 1.35rem 0 2rem;
}

.shell--footer {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.875rem;
}

@media (max-width: 1220px) {
  :root {
    --shell-width: min(100% - 2rem, 64rem);
  }

  .shell--hero {
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    column-gap: var(--grid-gutter);
    row-gap: 48px;
  }

  /* Stack heading + body in DOM order (avoids baseline grid quirks on narrow layouts). */
  .shell--section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .section-heading {
    padding: 3px 0 0.85rem 0;
  }

  .appearances::before,
  .section.work::before,
  .section.about::before {
    width: 100%;
  }

  /* Hide dot-grid strip behind Selected Work only (same width as .dot-grid); shell--work stays above. */
  .section.work::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: calc((100% - 11 * var(--grid-gutter)) / 12 * 2 + var(--grid-gutter));
    background: var(--page-background);
    z-index: 0;
    pointer-events: none;
  }

  .appearances .section-heading {
    padding: 3px 0 0.85rem 0;
  }

  .appearances .shell--section {
    align-items: stretch;
  }

  .shell--work,
  .shell--about {
    align-items: stretch;
  }

  /* About uses the same flex column stack as Work; avoid a 12-col grid here or the eyebrow
     stays in cols 1–2 only while the body sits in 3–12 (narrow “left column” on phones). */

  .section-heading,
  .appearances__list,
  .work-grid {
    grid-column: 1 / -1;
  }

  .hero__visual {
    grid-column: 1 / -1;
    grid-row: 1;
    order: -1;
    min-height: auto;
  }

  .hero__display {
    display: none;
  }

  .hero__eyebrow {
    grid-column: 1 / 3;
    grid-row: 2;
    height: fit-content;
    padding-top: 4px;
    padding-bottom: 92px;
    padding-inline: 0;
    line-height: 35px;
  }

  .hero__copy {
    grid-column: 3 / 11;
    grid-row: 2;
    padding-top: 3px;
    padding-bottom: 3px;
    max-width: 52rem;
  }

  .scene-frame {
    height: min(70vw, 42rem);
    min-height: 28rem;
  }

  .scene-frame__unicorn canvas,
  .scene-frame__unicorn iframe {
    transform: scale(1.5);
  }
}

@media (max-width: 760px) {
  :root {
    --shell-width: min(100% - 1.25rem, 42rem);
    --text-body-300: 1.2rem;
    --scene-frame-inset: 8px;
  }

  .site-header {
    padding-top: 0.9rem;
  }

  .pill-nav {
    justify-content: center;
  }

  .pill-nav__link {
    font-size: 0.75rem;
  }

  .hero {
    padding-top: calc(var(--site-header-height) + 1.25rem);
  }

  .hero__eyebrow {
    grid-column: 1 / 3;
    grid-row: auto;
    padding-top: 0;
    padding-bottom: 0;
    padding-inline: 0;
    line-height: 1.3;
  }

  .hero__copy {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .hero__lede {
    font-size: 20px;
    font-weight: 400;
  }

  .scene-frame {
    min-height: 22rem;
    height: 27rem;
  }

  .scene-frame__unicorn canvas,
  .scene-frame__unicorn iframe {
    transform: scale(1.5);
  }

  .work-card__body {
    padding-inline: 1.25rem;
  }

  .appearance-row__meta {
    flex-basis: 100%;
    width: 100%;
  }

  .work-card__meta .meta-pill {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.5px;
  }
}

@media (max-width: 540px) {
  .scene-frame {
    min-height: 18rem;
    height: 21rem;
  }

  .scene-frame__unicorn canvas,
  .scene-frame__unicorn iframe {
    transform: scale(2.25);
  }

  .appearance-row {
    align-items: flex-start;
  }

  .work-card__meta {
    gap: 0.5rem;
  }

  .shell--footer {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
