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

html {
  scroll-padding-top: var(--layout-nav-height);
}

body {
  margin: 0;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: var(--type-body-md-size);
  line-height: var(--type-body-md-line-height);
  -webkit-font-smoothing: antialiased;
}

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

/* Page margin from the Figma frame (48px desktop) — narrows to the grid margin on mobile. */
:root {
  --page-margin: var(--space-5xl);
  --page-max: 1440px;
}

.container {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-margin);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  height: var(--layout-nav-height);
  background: var(--color-bg-primary);
  border-bottom: var(--border-width-thin) solid var(--color-border-default);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-margin);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  white-space: nowrap;
}

.nav__name {
  font-size: var(--type-body-lg-size);
  line-height: var(--type-body-lg-line-height);
  transition: color 0.2s ease;
}

.nav__role {
  font-size: var(--type-body-sm-size);
  line-height: var(--type-body-sm-line-height);
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

.nav__brand:is(:hover, :focus-visible) .nav__name {
  color: var(--color-text-brand);
}

.nav__brand:is(:hover, :focus-visible) .nav__role {
  color: var(--color-text-primary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 50px;
}

.nav__links a,
.nav__cta {
  font-size: var(--type-body-md-size);
  line-height: var(--type-body-md-line-height);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav__links a:hover {
  color: var(--color-text-brand);
}

.nav__cta {
  color: var(--color-text-brand);
}

/* Let's Connect turns bold on hover. A hidden bold copy reserves the width so nothing shifts. */
.nav__cta {
  display: inline-grid;
}

.nav__cta::after,
.nav__links .nav__links-cta::after {
  content: attr(data-text);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 600;
}

.nav__cta:is(:hover, :focus-visible),
.nav__links .nav__links-cta:is(:hover, :focus-visible) {
  font-weight: 600;
}

.nav__toggle,
.nav__links-cta {
  display: none;
}

/* ---------- Hero illustrations ---------- */
/* In Figma the nav covers the top 72px of the stage. When the stage scales down,
   push it so the same slice (5% of its width) stays tucked under the nav. */
.hero-art {
  overflow: hidden;
  margin-top: calc(var(--layout-nav-height) - min(max(100vw, 720px), 1440px) * 0.05);
}

/* Stage keeps the 1440 × 390 Figma coordinates; never shrinks below half scale. */
.hero-art__stage {
  container-type: inline-size;
  position: relative;
  width: max(100%, 720px);
  max-width: 1440px;
  aspect-ratio: 1440 / 390;
  margin-left: 50%;
  transform: translateX(-50%);
}

.art {
  --u: calc(100cqw / 1440);
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
}

.art > div {
  position: absolute;
}

.art img,
.art svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.art--flip-y {
  transform: scaleY(-1);
}

.art--flip-x {
  transform: scaleX(-1);
}

.figure {
  --w: 200.64;
  --h: 200.64;
  display: block;
}

/* Phones: the stage is wider than the screen, so instead of cutting figures at the
   edges, drop the outer three (with their strings) and centre on the middle trio —
   gymnastics → skating spans x 495–1101, centred on x 798 of the 1440 frame. */
@media (max-width: 719px) {
  .hero-art__stage {
    transform: translateX(calc(-798 / 1440 * 100%));
  }

  .art--wide-only {
    display: none;
  }
}

/* ---------- Hero motion: strings draw in, then each figure drops onto its string ---------- */
:root {
  --ease-draw: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-drop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* White stroke inside the mask = visible part of the string. pathLength="1" makes the dash
   math length-independent; offset ±1 → 0 reveals from the start or the end of the path. */
.string__draw {
  fill: none;
  stroke: #fff;
  stroke-width: 10;
  stroke-dasharray: 1 1;
  stroke-dashoffset: var(--from);
  animation: string-draw var(--dur) var(--ease-draw) var(--delay) forwards;
}

@keyframes string-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.figure {
  opacity: 0;
  transform-origin: 50% 0;
  animation: figure-drop 0.7s var(--ease-drop) var(--delay) forwards;
}

@keyframes figure-drop {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }
  40% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Figure hover: tilt on the string + a phrase beside it ---------- */
/* Only the drawn area (--hx/--hy/--hw/--hh, in figure units) reacts, so the
   overlapping 200px boxes don't steal each other's hover. */
.figure {
  pointer-events: none;
}

.figure__hit {
  position: absolute;
  left: calc((var(--hx) - 8) * var(--u));
  top: calc((var(--hy) - 8) * var(--u));
  width: calc((var(--hw) + 16) * var(--u));
  height: calc((var(--hh) + 16) * var(--u));
  pointer-events: auto;
}

.figure img {
  transform-origin: calc(var(--ox) * var(--u)) calc(var(--oy) * var(--u));
  transition: rotate 0.6s var(--ease-drop);
}

.figure:hover {
  z-index: 2;
}

.figure:hover img {
  rotate: -8deg;
}

/* Desktop: the phrase sits beside its figure and scales with the stage
   (16/24 = Body/SM at the 1440 frame), so it keeps its clearance from every line. */
.figure__note {
  position: absolute;
  left: calc(var(--nx) * var(--u));
  top: calc(var(--ny) * var(--u));
  margin: 0;
  padding: calc(2 * var(--u)) calc(4 * var(--u));
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-size: calc(16 * var(--u));
  line-height: calc(24 * var(--u));
  white-space: nowrap;
  opacity: 0;
  translate: -6px 0;
  transition: opacity 0.2s ease, translate 0.3s var(--ease-draw);
}

.figure__note-break {
  display: none;
}

/* Narrower screens: the drawings shrink but text can't, so each phrase breaks onto
   two lines in Body/SM mobile (14/22) and moves to a roomier spot next to its figure
   (--sx/--sy in figure units). --right anchors the left edge, --below the top centre,
   --below-start the top-left corner. */
@media (max-width: 1151px) {
  .figure__note {
    left: calc(var(--sx) * var(--u));
    top: calc(var(--sy) * var(--u));
    padding: 0 var(--space-xs);
    font-size: 14px;
    line-height: 22px;
    text-align: center;
  }

  .figure__note--right {
    transform: translateY(-50%);
  }

  .figure__note--below {
    transform: translateX(-50%);
  }

  .figure__note-break {
    display: inline;
  }
}

.figure:hover .figure__note {
  opacity: 1;
  translate: 0 0;
  transition-delay: 0.08s;
}

@media (prefers-reduced-motion: reduce) {
  .figure img,
  .figure__note {
    transition: opacity 0.2s ease;
  }

  .figure:hover img {
    rotate: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .string__draw,
  .figure {
    animation: none;
  }

  .string__draw {
    stroke-dashoffset: 0;
  }

  .figure {
    opacity: 1;
  }
}

/* ---------- Intro ---------- */
.intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3xl);
  margin-top: 28px;
}

.intro__heading {
  max-width: 624px;
  margin: 0;
  font-family: var(--font-family-display);
  font-size: var(--type-h2-size);
  line-height: var(--type-h2-line-height);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.intro__heading em {
  color: var(--color-text-brand);
  font-style: normal;
}

.experience {
  display: flex;
  flex-direction: column;
  gap: 19px;
  width: 492px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 24px;
  line-height: normal;
}

.experience li {
  display: flex;
  align-items: center;
  gap: 36px;
  white-space: nowrap;
}

.experience li > span {
  text-box: trim-both cap alphabetic;
}

.experience__year {
  font-weight: 500;
  color: var(--color-text-secondary);
}

.experience__org {
  color: var(--color-text-brand);
}

/* ---------- Work ---------- */
.work {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  margin-top: var(--space-10xl);
  padding-bottom: var(--layout-section-gap);
}

.work__column {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl);
}

.project-card {
  --ease-card: cubic-bezier(0.0019, 0.5152, 0.3356, 1.0448); /* Figma Smart Animate curve */
  position: relative;
  display: block;
  container-type: inline-size;
}

.project-card__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ratio);
  border-radius: var(--radius-md);
  /* The cover reels have black rounded corners baked in; clipping to the same rounded
     shape keeps them hidden even while the video scales on hover. */
  clip-path: inset(0 round var(--radius-md));
  isolation: isolate;
  background: var(--color-bg-secondary);
}

.project-card__media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* CNN: the reel sits at full height in the middle of a pink card (Figma: 602 of 656 wide).
   Its edges fade into the pink so the video's baked-in black corners never show. */
.project-card__frame--cnn {
  background: #ffe3e3;
}

.project-card__frame--cnn .project-card__media {
  left: 4.12%;
  width: 91.77%;
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 2%, #000 98%, transparent),
    linear-gradient(to bottom, transparent, #000 2.5%, #000 97.5%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 2%, #000 98%, transparent),
    linear-gradient(to bottom, transparent, #000 2.5%, #000 97.5%, transparent);
  mask-composite: intersect;
}

/* Hover (same as the Work page): the cover eases in slightly. */
.project-card__media {
  transition: scale 0.6s var(--ease-morph);
}

@media (hover: hover) {
  .project-card--project:hover .project-card__media {
    scale: 1.03;
  }
}

/* Caption under each card (Figma: Body/MD, project left, company and year right). */
.project-card__caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-top: var(--space-sm);
  color: var(--color-text-primary);
  font-size: var(--type-body-md-size);
  line-height: var(--type-body-md-line-height);
}

.project-card__caption p {
  margin: 0;
}

.project-card__caption p:last-child {
  flex-shrink: 0;
  white-space: nowrap;
}

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

/* ---------- Tablet ---------- */
@media (max-width: 1199px) {
  .intro {
    flex-direction: column;
    gap: var(--space-5xl);
  }

  .experience {
    width: auto;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  :root {
    --page-margin: var(--grid-margin);
  }

  .nav__toggle {
    display: block;
    margin-left: auto;
    padding: var(--space-sm) 0;
    border: 0;
    background: none;
    color: var(--color-text-primary);
    font: inherit;
    cursor: pointer;
  }

  .nav__cta {
    display: none;
  }

  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xl);
    padding: var(--space-2xl) var(--page-margin) var(--space-3xl);
    background: var(--color-bg-primary);
    border-bottom: var(--border-width-thin) solid var(--color-border-default);
  }

  .nav.is-open .nav__links {
    display: flex;
  }

  .nav__links .nav__links-cta {
    display: inline-grid;
    color: var(--color-text-brand);
  }

  .intro {
    gap: var(--space-3xl);
  }

  .experience {
    font-size: var(--type-body-md-size);
    gap: var(--space-lg);
  }

  .experience li {
    gap: var(--space-lg);
    white-space: normal;
  }

  .work {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-top: var(--layout-block-gap);
  }

  /* Single column: flatten the two columns so finished projects come first
     (each column's first card), followed by the placeholders. */
  .work {
    display: flex;
    flex-direction: column;
  }

  .work__column {
    display: contents;
  }

  .work__column > * {
    order: 2;
  }

  .work__column > :first-child {
    order: 1;
  }
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  border: var(--border-width-thin) solid transparent;
  border-radius: var(--radius-full);
  font-size: var(--type-body-md-size);
  line-height: var(--type-body-md-line-height);
  white-space: nowrap;
  transition:
    transform 0.25s var(--ease-pop),
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

/* Solid stays dark in both themes, like the Figma "View Work" / "About Me" buttons. */
.button--solid {
  background: var(--color-neutral-950);
  color: var(--color-neutral-50);
}

.button--light {
  background: var(--color-neutral-50);
  color: var(--color-neutral-950);
}

/* Connect on the photo: fills brand blue with light text, like About Me / View Work. */
a.button--light:is(:hover, :focus-visible) {
  background: var(--color-bg-brand);
  color: var(--color-neutral-50);
}

.button--outline {
  background: var(--color-bg-primary);
  border-color: var(--color-border-inverse);
  color: var(--color-text-primary);
}

:root {
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1); /* slight overshoot, like a spring */
}

/* ---------- Recent experiences ---------- */
.experiences {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6xl);
}

.experiences__title {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin: 0;
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: var(--type-h3-size);
  line-height: var(--type-h3-line-height);
  letter-spacing: -0.01em;
}

/* Experience cards */
.experiences__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5xl); /* 48px between the Amazon row and the other experiences */
  width: min(1002px, 100%);
}

.exp--featured {
  display: flex;
  align-items: center;
  gap: var(--space-7xl);
}

.experiences__row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 236px));
  justify-content: space-between;
  gap: var(--space-3xl) var(--space-5xl);
}

/* ---------- Skating line through the three cards (from the About page) ----------
   The line and the skater both run behind the cards: she disappears behind each card and
   pops out in the gaps, ending clear of the last one. */
.exp-trail {
  position: absolute;
  inset: 0 -64px;
  pointer-events: none;
}

.experiences__row .exp {
  position: relative;
  z-index: 1;
}

.exp-trail__line {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.exp-trail__line path {
  fill: none;
  stroke-width: 1;
  stroke-linecap: round;
}

.exp-trail__ahead {
  stroke: var(--color-border-default);
  stroke-dasharray: 3 7;
}

.exp-trail__done {
  stroke: var(--color-text-primary);
}

/* A zero-size anchor on the line; she hangs from it by her skates. */
.exp-trail__rider {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  will-change: transform;
}

.exp-trail__rider img {
  position: absolute;
  width: calc(44px * 2.659); /* drawn 44px tall */
  max-width: none;
  translate: -52.2% -69.4%; /* feet on the anchor */
}

/* Cards wait below the line until she skates past them. */
.experiences__row.has-trail .exp {
  opacity: 0;
  translate: 0 10px;
  transition: opacity 0.9s var(--ease-morph), translate 1.1s var(--ease-morph);
}

.experiences__row.has-trail .exp.is-in {
  opacity: 1;
  translate: 0 0;
}

/* Hover: the photo wipes up inside the card, settling from a slight zoom (the About photo reveal). */
.exp__snap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  border-radius: inherit;
  background: var(--color-bg-secondary);
  clip-path: inset(100% 0 0 0 round var(--radius-md));
  transition: clip-path 0.8s var(--ease-morph);
}

.exp__snap img {
  height: 100%; /* whole photo, never cropped */
  width: auto;
  border-radius: var(--radius-sm);
  scale: 1.15;
  transition: scale 1.1s var(--ease-morph);
}

@media (hover: hover) {
  .exp__folder:hover .exp__snap {
    clip-path: inset(0 0 0 0 round var(--radius-md));
  }

  .exp__folder:hover .exp__snap img {
    scale: 1;
  }
}

.exp__folder {
  position: relative;
  isolation: isolate;
  flex: none;
  max-width: 100%;
}

.exp__card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 62px;
  width: 236px;
  max-width: 100%;
  aspect-ratio: 1;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  transition: translate 0.4s var(--ease-pop);
}

.exp__card--tight {
  gap: 22px;
}

.exp__card--amazon {
  --color-text-primary: var(--color-neutral-50);
  justify-content: center;
  width: 458.28px;
  max-width: 100%;
  aspect-ratio: auto;
  height: 204px;
  padding: var(--space-xl);
  background: #ff6200;
  overflow: hidden;
}

.exp__logo {
  position: absolute;
  top: 40.55px;
  right: var(--space-xl);
  width: 149.28px;
  height: 122.9px;
}

.exp__mark {
  display: block;
  width: auto;
  height: auto;
}

.exp__card-text {
  position: relative;
  color: var(--color-text-primary);
}

.exp__card--amazon .exp__card-text {
  width: 261px;
  max-width: 100%;
  margin-top: 25.45px;
}

.exp__role {
  margin: 0;
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: var(--type-h4-size);
  line-height: var(--type-h4-line-height);
}

.exp__org {
  margin: 0;
  font-size: var(--type-body-md-size);
  line-height: var(--type-body-md-line-height);
}

.exp__card--amazon .exp__org {
  font-size: var(--type-body-lg-size);
  line-height: var(--type-body-lg-line-height);
}

.exp__detail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xl);
  width: 464px;
}

.exp__detail p {
  margin: 0;
  color: var(--color-text-secondary);
}

/* Hover: the card lifts a touch. */
@media (hover: hover) {
  .exp__folder:hover .exp__card {
    translate: 0 -4px;
  }
}

/* ---------- About ---------- */
.about {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 59px;
  margin-top: var(--layout-section-gap);
}

.profile {
  --color-text-primary: var(--color-neutral-50);
  position: relative;
  flex: none;
  width: min(365px, 100%);
  aspect-ratio: 365 / 447;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  color: var(--color-text-primary);
  background: var(--color-neutral-700);
}

.profile__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 95px;
  background: linear-gradient(to top, var(--color-neutral-950), transparent);
}

.profile__head {
  position: absolute;
  z-index: 1;
  inset: 18px 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.profile__head p,
.profile__foot p {
  margin: 0;
}

.profile__name {
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: var(--type-h4-size);
  line-height: var(--type-h4-line-height);
}

.profile__status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-line-height);
}

/* "Connecting" loop: the hand-drawn line keeps tracing itself round, drawing on then
   off, like a loading indicator. */
.profile__loop {
  flex: none;
  overflow: visible;
}

.profile__loop path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.625;
  stroke-linecap: round;
  stroke-dasharray: 1 1;
  animation: profile-loop 2.4s ease-in-out infinite;
}

@keyframes profile-loop {
  0% { stroke-dashoffset: 1; }
  45%, 55% { stroke-dashoffset: 0; } /* brief hold once fully drawn */
  100% { stroke-dashoffset: -1; }
}

@media (prefers-reduced-motion: reduce) {
  .profile__loop path {
    animation: none;
    stroke-dashoffset: 0;
  }
}

.profile__foot {
  position: absolute;
  z-index: 1;
  inset: auto 27px 28px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.profile__handle {
  display: flex;
  align-items: center;
  gap: 7px;
}

.profile__handle img {
  border-radius: 50%;
}

.profile__user {
  font-size: var(--type-body-md-size);
  line-height: var(--type-body-md-line-height);
}

.profile__network {
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-line-height);
}

.about__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-lg);
  width: 603px;
  max-width: 100%;
}

.about__text {
  margin: 7px 0 0;
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: var(--type-h3-size);
  line-height: var(--type-h3-line-height);
  letter-spacing: -0.01em;
}

/* Doodles sit in the line like words, without stretching the line height. */
.about__doodle {
  position: relative;
  --scale: 1; /* doodles were drawn for the 36px desktop heading */
  display: inline-block;
  width: calc(var(--w) * var(--scale));
  height: 1em;
  margin-inline: 0.2em;
  vertical-align: middle;
}

.about__doodle .doodle {
  position: absolute;
  left: 0;
  top: 50%;
  width: calc(var(--w) * var(--scale));
  height: calc(var(--h) * var(--scale));
  translate: 0 calc(-50% + var(--dy, 0px));
  transition: rotate 0.3s var(--ease-pop), scale 0.3s var(--ease-pop);
}

.about__doodle:hover .doodle {
  rotate: -8deg;
  scale: 1.1;
}

.about__actions {
  display: flex;
  gap: var(--space-3xl);
  padding-top: 28px; /* keeps the buttons where they sat in Figma */
}

/* Resume: outline and text turn brand blue. About Me / View Work: fill brand blue with light text. */
.peek:is(:hover, :focus-visible) .button--outline {
  border-color: var(--color-border-brand);
  color: var(--color-text-brand);
}

.peek:is(:hover, :focus-visible) .button--solid,
a.button--solid:is(:hover, :focus-visible) {
  background: var(--color-bg-brand);
  color: var(--color-neutral-50);
}

/* About doodles: each one plays a small loop of its own.
   Screen: the wireframe draws itself and a cursor clicks the button.
   Tools: the pen, brush and pencil each take a turn making a quick stroke.
   People: the two take turns leaning in, like they're chatting. */
.doodle {
  overflow: visible;
  color: var(--color-text-brand);
}

/* Only the animated parts; the wrapper <g> keeps its Figma rotation untouched. */
.doodle [class*="dd-"] {
  transform-box: fill-box;
  transform-origin: center;
}

.dd-line {
  transform-origin: left center;
  animation: dd-draw 3.2s ease-out infinite both;
}

.dd-line--2 { animation-delay: 0.15s; }
.dd-line--3 { animation-delay: 0.3s; }

.dd-pop {
  animation: dd-pop 3.2s var(--ease-pop) infinite both;
}

.dd-press {
  animation: dd-press 3.2s ease-in-out infinite;
}

.dd-cursor {
  transform-origin: left top;
  animation: dd-cursor 3.2s ease-in-out infinite;
}

.dd-tool {
  transform-origin: 50% 100%;
  animation: dd-stroke 3s ease-in-out infinite;
}

.dd-tool--2 { animation-delay: 0.6s; }
.dd-tool--3 { animation-delay: 1.2s; }

.dd-talk {
  transform-origin: 50% 100%;
  animation: dd-talk 3.2s ease-in-out infinite;
}

.dd-talk--him {
  --lean: -1;
  animation-delay: -1.6s;
}

@keyframes dd-draw {
  0% { transform: scaleX(0); opacity: 1; }
  30%, 85% { transform: scaleX(1); opacity: 1; }
  95%, 100% { transform: scaleX(1); opacity: 0; }
}

@keyframes dd-pop {
  0%, 5% { transform: scale(0.4); opacity: 0; }
  20% { transform: scale(1); opacity: 1; }
  85% { opacity: 1; }
  95%, 100% { opacity: 0; }
}

@keyframes dd-press {
  0%, 46%, 60%, 100% { transform: scale(1); }
  52% { transform: scale(0.85); }
}

@keyframes dd-cursor {
  0% { transform: translate(9px, 8px); opacity: 0; }
  15% { opacity: 1; }
  44% { transform: translate(0, 0) scale(1); }
  52% { transform: translate(0, 0) scale(0.85); }
  60%, 88% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(0, 0); opacity: 0; }
}

@keyframes dd-stroke {
  0%, 30%, 100% { transform: translateY(0) rotate(0deg); }
  8% { transform: translateY(-3px) rotate(-12deg); }
  18% { transform: translateY(-1px) rotate(10deg); }
}

@keyframes dd-talk {
  0%, 45%, 100% { transform: rotate(0deg) translateY(0); }
  12% { transform: rotate(calc(var(--lean, 1) * 5deg)) translateY(-1.5px); }
  20% { transform: rotate(calc(var(--lean, 1) * 3deg)) translateY(0); }
  28% { transform: rotate(calc(var(--lean, 1) * 5deg)) translateY(-1.5px); }
}

@media (prefers-reduced-motion: reduce) {
  .doodle [class*="dd-"] {
    animation: none;
  }
}

/* ---------- Footer ---------- */
.footer {
  margin-top: var(--layout-section-gap);
  background: var(--color-bg-secondary);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  max-width: var(--page-max);
  min-height: 134px;
  margin-inline: auto;
  padding-inline: var(--page-margin);
  font-size: var(--type-body-lg-size);
  line-height: var(--type-body-lg-line-height);
}

.footer__inner p {
  margin: 0;
}

.footer__links {
  display: flex;
  gap: var(--space-6xl);
}

.footer__links a {
  transition: color 0.2s ease;
}

.footer__links a:is(:hover, :focus-visible) {
  color: var(--color-text-brand);
}

@media (prefers-reduced-motion: reduce) {
  .exp__card,
  .about__doodle .doodle {
    transition: none;
  }
}

/* ---------- Responsive: new sections ---------- */
@media (max-width: 1099px) {
  .exp--featured {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3xl);
  }

  .exp__detail {
    width: min(464px, 100%);
  }

  .about {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-5xl);
  }
}

@media (max-width: 767px) {
  .experiences {
    gap: var(--space-5xl);
  }

  .experiences__list {
    gap: var(--space-4xl);
  }

  .about__doodle {
    --scale: calc(26 / 36); /* mobile H3 is 26px */
  }

  .experiences__row {
    grid-template-columns: 236px;
  }

  .exp-trail {
    display: none;
  }

  .exp__card--amazon {
    width: 100%;
  }

  .exp__card--amazon .exp__card-text {
    margin-top: 0;
  }

  .exp__logo {
    top: auto;
    bottom: var(--space-lg);
    width: 110px;
    height: auto;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--space-lg);
    padding-block: var(--space-3xl);
    font-size: var(--type-body-md-size);
    line-height: var(--type-body-md-line-height);
  }

  .footer__links {
    gap: var(--space-3xl);
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  .nav__role {
    display: none;
  }
}

/* ---------- Custom cursor ----------
   A small brand-blue dot follows the mouse everywhere; over a project it smoothly
   grows into a "View Project" pill. Mouse/trackpad only; touch keeps the system cursor. */
:root {
  --ease-morph: cubic-bezier(0.22, 1, 0.36, 1);
}

.cursor {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--color-bg-brand);
  color: var(--color-neutral-50);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition:
    width 0.4s var(--ease-morph),
    height 0.4s var(--ease-morph),
    opacity 0.2s ease;
}

.cursor.is-active {
  opacity: 1;
}

/* Over links and buttons the dot grows a touch. */
.cursor.is-link {
  width: 20px;
  height: 20px;
}

.cursor.is-project {
  width: var(--pill-w, 132px);
  height: var(--pill-h, 32px);
}

.cursor__label {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: var(--space-xs) var(--space-md);
  font-size: var(--type-body-sm-size);
  line-height: var(--type-body-sm-line-height);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.cursor.is-project .cursor__label {
  opacity: 1;
  transition: opacity 0.25s ease 0.12s;
}

.has-custom-cursor,
.has-custom-cursor * {
  cursor: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .cursor,
  .cursor__label {
    transition: opacity 0.15s ease;
  }
}

/* ---------- Page transition ----------
   Leaving: a brand-blue panel with a wavy edge sweeps up over the page; the
   destination's name rises into the middle and a squiggle underlines it. Arriving: the
   page opens covered, then the panel carries on upward, taking the name with it. Driven by home.js. */
.pt {
  /* Always the site blue, even on project pages that take their own colour. */
  --color-bg-brand: var(--color-blue-500);
  --pt-edge: 10vh; /* depth of the wavy top and bottom edges */
  --pt-ease: cubic-bezier(0.76, 0, 0.24, 1);
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.pt__panel {
  position: absolute;
  inset: 0;
  background: var(--color-bg-brand);
  translate: 0 calc(100% + var(--pt-edge));
}

.pt__edge {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--pt-edge);
  fill: var(--color-bg-brand);
}

.pt__edge--top {
  bottom: calc(100% - 1px);
}

.pt__edge--bottom {
  top: calc(100% - 1px);
}

.pt__label {
  position: absolute;
  inset: 50% 0 auto;
  display: flex;
  justify-content: center;
  translate: 0 -50%;
}

.pt__name {
  position: relative;
  margin: 0;
  color: var(--color-text-on-brand);
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: var(--type-h1-size);
  line-height: var(--type-h1-line-height);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.pt__mask {
  display: block;
  overflow: hidden;
}

.pt__text {
  display: block;
  translate: 0 110%;
}

/* The same squiggle as the Work headline, in off-white. */
.pt__line {
  position: absolute;
  left: -2%;
  bottom: -0.14em;
  width: 104%;
  height: 0.32em;
  overflow: visible;
}

.pt__line path {
  fill: none;
  stroke: var(--color-neutral-50);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.1;
}


/* Shown while covering (leaving) or covered (arriving). */
.pt.is-covering,
.is-arriving .pt {
  visibility: visible;
  pointer-events: auto;
}

.pt.is-covering .pt__panel,
.is-arriving .pt__panel {
  translate: 0 0;
}

.pt.is-covering .pt__text,
.is-arriving .pt__text {
  translate: 0 0;
}

.pt.is-covering .pt__line path,
.is-arriving .pt__line path {
  stroke-dashoffset: 0;
}

/* Leaving: sweep in, then name, underline and drawing follow. */
.pt.is-covering .pt__panel { transition: translate 0.7s var(--pt-ease); }
.pt.is-covering .pt__text { transition: translate 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.35s; }
.pt.is-covering .pt__line path { transition: stroke-dashoffset 0.45s cubic-bezier(0.65, 0, 0.35, 1) 0.55s; }

/* Arriving: lift everything off the top. */
.is-arriving .pt.is-lifting { pointer-events: none; }

.is-arriving .pt.is-lifting .pt__panel {
  translate: 0 calc(-100% - var(--pt-edge));
  transition: translate 0.8s var(--pt-ease) 0.1s;
}


