/* ---------- Reset ---------- */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--fg);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
}
p {
  margin: 0;
}
table {
  border-collapse: collapse;
}

/* ---------- Tokens ---------- */
:root {
  --bg-dark: #0e0e0d;
  --fg-dark: #f4f3f0;
  --bg-light: #eae9e5;
  --bg-lighter: #f1f0ec;
  --fg: #131211;
  --muted: #8c8a83;
  --muted-dark: #7c7b76;
  --line: rgba(19, 18, 17, 0.1);
  --line-dark: rgba(244, 243, 240, 0.14);
  --serif: "Instrument Serif", Georgia, serif;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s cubic-bezier(0.16, 0.8, 0.24, 1),
    transform 0.9s cubic-bezier(0.16, 0.8, 0.24, 1);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Header ---------- */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 1rem;
  padding: 1.5rem var(--gutter);
  background: var(--bg-dark);
  color: var(--fg-dark);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.site-header__availability {
  max-width: 300px;
}
.site-header__logo {
  justify-self: center;
  font-weight: 600;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
}
.site-header__folio {
  justify-self: end;
  text-align: right;
  line-height: 1.4;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--bg-dark);
  color: var(--fg-dark);
  padding: 1.5rem var(--gutter) 5rem;
}
.hero__intro {
  position: relative;
  z-index: 2;
  max-width: 46rem;
  font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  line-height: 1.18;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.hero__figure {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: -4rem auto 0;
}
.hero__caption {
  position: absolute;
  top: 5rem;
  left: -9rem;
  max-width: 6rem;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-dark);
  line-height: 1.5;
}
.hero__image {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: linear-gradient(155deg, #2b2f2a, #14150f);
}
.hero__quote {
  position: absolute;
  bottom: 2rem;
  right: -14rem;
  max-width: 20rem;
  font-size: 1.35rem;
  line-height: 1.35;
  text-align: right;
}
.hero__quote em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

@media (max-width: 1100px) {
  .hero__caption {
    position: static;
    max-width: none;
    margin-bottom: 1rem;
  }
  .hero__quote {
    position: static;
    max-width: none;
    text-align: left;
    margin-top: 1.5rem;
  }
  .hero__figure {
    margin-top: 2.5rem;
  }
}

/* ---------- Section nav (repeating page marker) ---------- */
.section-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--gutter);
  background: var(--bg-light);
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.section-nav__links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
  flex-wrap: wrap;
}
.section-nav__link {
  text-decoration: none;
  color: var(--fg);
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
.section-nav__link:hover {
  opacity: 1;
}
.section-nav__number {
  opacity: 0.4;
  white-space: nowrap;
}
.section-nav--no-rule {
  border-top: none;
}
.section-nav--lighter {
  background: var(--bg-lighter);
}
.section-nav:has(+ .clients) {
  background: #fff;
}

/* ---------- About ---------- */
.about {
  position: relative;
  display: flex;
  background: var(--bg-light);
}
.about__image {
  position: relative;
  align-self: flex-start;
  flex-shrink: 0;
  width: 50%;
  aspect-ratio: 1 / 1;
}
.about__slide {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(155deg, #cfcdc4, #a9a79c);
  opacity: 0;
  pointer-events: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='21' fill='rgba(244,243,240,0.9)' stroke='rgba(19,18,17,0.15)'/%3E%3Cpath d='M18 14l8 8-8 8' fill='none' stroke='%23131211' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    22 22, pointer;
  transition: opacity 0.5s ease;
}
.about__slide.is-active {
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}
.about__slider-dots {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}
.about__slider-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(244, 243, 240, 0.5);
  box-shadow: 0 0 0 1px rgba(19, 18, 17, 0.15);
  cursor: pointer;
  transition: background 0.2s ease;
}
.about__slider-dot.is-active {
  background: var(--fg-dark);
}
.about__right {
  width: 50%;
  display: flex;
  flex-direction: column;
}
.about__nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 0.9rem var(--gutter);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.about__nav-link {
  text-decoration: none;
  color: var(--fg);
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
.about__nav-link:hover {
  opacity: 1;
}
.about__nav-number {
  opacity: 0.4;
  white-space: nowrap;
}
.about__facts {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 3rem var(--gutter);
}
.about__facts p {
  max-width: 26rem;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.7;
  text-align: right;
}

@media (max-width: 800px) {
  .about {
    display: block;
    min-height: 0;
  }
  .about__image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
  }
  .about__right {
    width: auto;
    margin-left: 0;
  }
  .about__nav {
    padding: 0.9rem var(--gutter);
  }
  .about__facts {
    padding: 2.5rem var(--gutter) 3rem;
  }
  .about__facts p {
    text-align: left;
  }
}

/* ---------- Expertise ---------- */
.expertise {
  display: flex;
  align-items: flex-start;
  gap: var(--gutter);
  background: var(--bg-lighter);
  padding: 4.5rem var(--gutter);
}
.expertise__intro {
  width: 50%;
}
.expertise__intro p {
  max-width: 26rem;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.6;
}
.expertise__steps {
  width: 50%;
  display: flex;
  flex-direction: column;
}
.expertise__step {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.5rem var(--gutter);
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.expertise__step:last-child {
  border-bottom: 1px solid var(--line);
}
.expertise__letter {
  font-size: 0.85rem;
  color: var(--muted);
}
.expertise__title {
  grid-column: 2;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 500;
  font-family: var(--serif);
  font-style: italic;
}
.expertise__body {
  grid-column: 2;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--muted);
}

@media (max-width: 800px) {
  .expertise {
    display: block;
  }
  .expertise__intro {
    width: auto;
    margin-bottom: 3rem;
  }
  .expertise__steps {
    width: auto;
  }
  .expertise__step {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .expertise__title,
  .expertise__body {
    grid-column: 1;
  }
}

/* ---------- Experiences ---------- */
.experiences {
  background: var(--bg-light);
}
.experiences__hero {
  width: 100%;
  height: 100vh;
}
.experiences__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: radial-gradient(ellipse at center, #3a3a3a, #050505);
}
.experiences__content {
  padding: 0 var(--gutter) var(--gutter);
}
.experiences__nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 0.9rem 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.experiences__nav-link {
  text-decoration: none;
  color: var(--fg);
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
.experiences__nav-link:hover {
  opacity: 1;
}
.experiences__nav-number {
  opacity: 0.4;
  white-space: nowrap;
}
.experiences__quote {
  max-width: 26rem;
  margin: 3rem 0 3.5rem auto;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.6;
  text-align: right;
}
.experiences__table {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  font-size: 0.85rem;
}
.experiences__table td {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.experiences__table tr:last-child td {
  border-bottom: 1px solid var(--line);
}
.experiences__table td:last-child {
  font-size: 0.65rem;
  text-align: right;
  color: var(--muted);
}
.experiences__table-category {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}
.experiences__table-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease;
}
.experiences__table-link:hover {
  border-bottom-color: currentColor;
}
@media (max-width: 700px) {
  .experiences__table,
  .experiences__table tbody,
  .experiences__table tr,
  .experiences__table td {
    display: block;
    width: 100%;
  }
  .experiences__table tr {
    padding: 1rem 0;
    border-top: 1px solid var(--line);
  }
  .experiences__table tr:last-child {
    border-bottom: 1px solid var(--line);
  }
  .experiences__table td {
    padding: 0.35rem 0;
    border-top: none;
  }
  .experiences__table tr:last-child td {
    border-bottom: none;
  }
  .experiences__table td:last-child {
    text-align: left;
  }
}

.experiences__mentions {
  max-width: 22rem;
  margin: 2.5rem auto 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.experiences__resume-link {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.experiences__resume-link:hover {
  opacity: 0.7;
}

/* ---------- Clients ---------- */
.clients {
  padding: 4.5rem var(--gutter);
  background: #fff;
}
.clients__intro {
  max-width: 26rem;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.6;
}
.clients__list {
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
  display: grid;
  /* auto-fill locks one column template for the whole grid, so a short
     last row leaves empty cells instead of stretching its logos to fill
     the leftover width (which flex's per-row grow was doing). The 1fr max
     (not a fixed px) keeps auto-fill's column count based on the 160px
     minimum, so narrow viewports still get multiple columns. */
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  justify-items: center;
  gap: 0.5rem 1rem;
}
.clients__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 1rem;
}
.clients__logo img {
  /* Cap at the logo's native pixel size — never upscale, only shrink
     if the tile has less room than that on smaller screens. */
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  filter: grayscale(1);
  opacity: 0.75;
}
.clients__logo-fallback {
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 560px) {
  .clients__logo {
    padding: 0.625rem;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-dark);
  color: var(--fg-dark);
  font-size: 0.8rem;
}
.site-footer__nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 0.9rem var(--gutter);
  border-top: 1px solid var(--line-dark);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.site-footer__nav-link {
  text-decoration: none;
  color: inherit;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
.site-footer__nav-link:hover {
  opacity: 1;
}
.site-footer__nav-number {
  opacity: 0.4;
  white-space: nowrap;
}
.site-footer__columns {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gutter);
  padding: 7rem var(--gutter) 14rem;
}
.sparkle {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  color: var(--fg-dark);
  line-height: 1;
  pointer-events: none;
  animation: sparkle-pop 700ms ease-out forwards;
}
@keyframes sparkle-pop {
  0% {
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--sparkle-drift, 0px)), calc(-50% - 18px))
      scale(1) rotate(var(--sparkle-rotate, 45deg));
    opacity: 0;
  }
}
.site-footer__column {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.site-footer__link {
  display: inline-block;
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-footer__link:hover {
  border-bottom-color: currentColor;
}
.site-footer__note {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted-dark);
}
.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--gutter) 2rem;
  border-top: 1px solid var(--line-dark);
}
.site-footer__copyright {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted-dark);
}
.site-footer__contact-button {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--line-dark);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: inherit;
  opacity: 0.9;
  transition:
    opacity 0.2s ease,
    background 0.2s ease;
}
.site-footer__contact-button:hover {
  opacity: 1;
  background: rgba(244, 243, 240, 0.08);
}

@media (max-width: 900px) {
  .site-footer__columns {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 560px) {
  .site-footer__columns {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
