/* ==========================================================
   Meer Kaleem: editorial portfolio
   ========================================================== */

:root {
  --paper: #f6f1e7;
  --paper-2: #eee6d6;
  --ink: #1b1a17;
  --muted: #5f5a50;
  --rule: #d8cdb9;
  --accent: #b4432a;
  --accent-ink: #fff8ef;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --max: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151412;
    --paper-2: #1d1b18;
    --ink: #eee8dc;
    --muted: #a59e90;
    --rule: #35312b;
    --accent: #e0734f;
    --accent-ink: #151412;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

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

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 144;
}

em {
  font-style: italic;
}

p {
  margin: 0 0 1rem;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: .5rem 1rem;
  border-radius: var(--radius);
}

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

.eyebrow {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: 500 .95rem/1 var(--sans);
  text-decoration: none;
  padding: .95rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transform: translate(var(--tx, 0), var(--ty, 0));
  transition: color .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}

/* Fill sweep on hover */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform .45s var(--ease);
}

.btn:hover::before {
  transform: none;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn .arrow {
  display: inline-block;
  transition: transform .35s var(--ease);
}

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

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-ghost::before {
  background: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--paper);
}

.btn-accent::before {
  background: var(--paper);
}

.btn-accent:hover {
  border-color: var(--paper);
  color: var(--ink);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-small {
  padding: .6rem 1.1rem;
  font-size: .85rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav a:not(.btn) {
  font-size: .95rem;
  text-decoration: none;
  color: var(--muted);
  transition: color .2s;
}

.site-nav a:not(.btn):hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
}

.nav-toggle span:not(.sr-only) {
  position: absolute;
  left: .6rem;
  right: .6rem;
  height: 1.5px;
  background: var(--ink);
  transition: transform .3s var(--ease), top .3s var(--ease);
}

.nav-toggle span:nth-of-type(2) {
  top: 1.1rem;
}

.nav-toggle span:nth-of-type(3) {
  top: 1.6rem;
}

.nav-toggle[aria-expanded="true"] span:nth-of-type(2) {
  top: 1.35rem;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-of-type(3) {
  top: 1.35rem;
  transform: rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-top: clamp(4rem, 12vh, 8rem);
  padding-bottom: clamp(4rem, 10vh, 7rem);
}

.hero-title {
  font-size: clamp(2.6rem, 7.2vw, 6rem);
  font-weight: 350;
  line-height: 1.02;
  max-width: 15ch;
  letter-spacing: -0.03em;
}

.hero-title em {
  color: var(--accent);
  font-weight: 400;
}

.hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem 4rem;
  align-items: end;
  margin-top: clamp(2.5rem, 6vh, 4rem);
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.lede {
  max-width: 36rem;
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0;
}

.hero-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

/* ---------- Proof strip ---------- */

.proof {
  border-block: 1px solid var(--rule);
  background: var(--paper-2);
}

.proof-inner {
  display: flex;
  align-items: center;
  gap: 1rem 2.5rem;
  padding-block: 1.4rem;
  flex-wrap: wrap;
}

.proof-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.proof-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 2.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(4.5rem, 12vh, 8rem);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: 3rem;
  padding-bottom: 1.25rem;
  position: relative;
}

.section-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--ink);
  transform-origin: left;
  transition: transform 1.4s var(--ease) .15s;
}

.js .section-head:not(.is-visible)::after {
  transform: scaleX(0);
}

.section-head h2 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
}

.section-num {
  font: 500 .85rem var(--sans);
  color: var(--accent);
  letter-spacing: .08em;
}

/* ---------- Services ---------- */

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

.service {
  padding: .5rem 2rem 1rem;
  border-left: 1px solid var(--rule);
}

.service:first-child {
  padding-left: 0;
  border-left: 0;
}

.service h3 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.service p {
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.tags li {
  font-size: .78rem;
  padding: .3rem .7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
}

/* ---------- Work ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2.5rem;
}

.filter {
  font: 500 .88rem var(--sans);
  padding: .55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s var(--ease);
}

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

.filter.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2.25rem;
}

.work-card[hidden] {
  display: none;
}

.work-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
}

.work-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper-2);
  margin-bottom: 1.25rem;
}

.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}

.work-card a:hover .work-thumb img {
  transform: scale(1.04);
}

.work-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.work-meta {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
}

.work-card h3 {
  font-size: 1.45rem;
  line-height: 1.2;
  margin-bottom: .75rem;
  transition: color .2s;
}

.work-card a:hover h3 {
  color: var(--accent);
}

.work-body p:not(.work-meta) {
  font-size: .95rem;
  color: var(--muted);
}

.read-link {
  margin-top: auto;
  font-size: .88rem;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  align-self: flex-start;
  padding-bottom: 1px;
}

/* Featured card: spans full width, side-by-side */
.work-card.is-featured {
  grid-column: 1 / -1;
}

.work-card.is-featured a {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.work-card.is-featured .work-thumb {
  margin: 0;
}

.work-card.is-flipped a {
  grid-template-columns: 1fr 1.35fr;
}

.work-card.is-flipped .work-thumb {
  order: 2;
}

.work-card.is-featured h3 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  line-height: 1.08;
}

.work-card.is-featured .work-body p:not(.work-meta) {
  font-size: 1.05rem;
}

.work-card.is-featured .read-link {
  margin-top: 1rem;
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.about-photo {
  margin: 0;
  position: sticky;
  top: 6rem;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  filter: grayscale(.15) contrast(1.02);
}

.about-photo figcaption {
  font-family: var(--serif);
  font-style: italic;
  font-size: .95rem;
  color: var(--muted);
  margin-top: .75rem;
}

.about-lead {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.35;
  margin-bottom: 1.75rem;
}

.about-lead em {
  color: var(--accent);
}

.about-text>p:not(.about-lead) {
  color: var(--muted);
}

.sub-head {
  font-size: 1.4rem;
  margin: 3rem 0 1.25rem;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.timeline > li {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
}

.timeline strong {
  display: block;
  font-weight: 600;
  font-size: .98rem;
}

.timeline span {
  font-size: .9rem;
  color: var(--accent);
}

.timeline .now-tag {
  display: inline-block;
  margin-left: .45rem;
  padding: .1rem .5rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  vertical-align: .15em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
}

.role-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .95rem;
  color: var(--muted);
}

.role-list li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: .35rem;
}

.role-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .7em;
  width: .45rem;
  height: 1px;
  background: var(--accent);
}

.work-intro {
  max-width: 44rem;
  color: var(--muted);
  margin: -1.25rem 0 2rem;
}

.work-intro a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.work-intro a:hover {
  color: var(--accent);
}

.timeline p {
  margin: 0;
  font-size: .95rem;
  color: var(--muted);
}

/* ---------- Process ---------- */

.process {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  counter-reset: step;
}

.process li {
  counter-increment: step;
  padding-top: 1.25rem;
  border-top: 2px solid var(--ink);
}

.process li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font: 500 .8rem var(--sans);
  color: var(--accent);
  margin-bottom: .75rem;
}

.step {
  display: block;
  font-family: var(--serif);
  font-size: 1.6rem;
  margin-bottom: .5rem;
}

.process p {
  color: var(--muted);
  font-size: .95rem;
}

/* ---------- Contact ---------- */

.contact {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(5rem, 14vh, 9rem);
}

.contact .eyebrow {
  color: var(--accent);
}

.contact-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}

.contact-title {
  font-size: clamp(2.2rem, 4.8vw, 3.75rem);
  line-height: 1.05;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
}

.contact-title em {
  color: var(--accent);
}

.contact-intro>p:not(.eyebrow) {
  color: color-mix(in srgb, var(--paper) 70%, var(--ink));
  max-width: 30rem;
}

.contact-email {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  margin: 1rem 0 1.5rem;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  word-break: break-all;
}

.contact-email:hover {
  color: var(--accent);
}

.contact-socials {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: .92rem;
}

.contact-socials a {
  text-decoration: none;
  color: color-mix(in srgb, var(--paper) 70%, var(--ink));
}

.contact-socials a:hover {
  color: var(--paper);
}

.contact-form {
  display: grid;
  gap: 1.75rem;
}

.field label {
  display: block;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .04em;
  margin-bottom: .5rem;
  color: color-mix(in srgb, var(--paper) 70%, var(--ink));
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--paper);
  background: transparent;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 30%, var(--ink));
  padding: .6rem 0;
  border-radius: 0;
  resize: vertical;
  transition: border-color .2s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.field.has-error input,
.field.has-error textarea {
  border-bottom-color: #e5484d;
}

.contact-form .btn {
  justify-self: start;
}

.contact-form .btn:disabled {
  opacity: .6;
  cursor: wait;
}

.form-status {
  min-height: 1.5rem;
  margin: 0;
  font-size: .92rem;
}

.form-status.is-error {
  color: #ff8a80;
}

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px var(--ink) inset !important;
  -webkit-text-fill-color: var(--paper) !important;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

/* ==========================================================
   Motion & interaction
   ========================================================== */

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
}

/* ---------- Header entrance + active nav ---------- */
.js .site-header {
  animation: drop-in .9s var(--ease) both;
}

@keyframes drop-in {
  from {
    transform: translateY(-100%);
  }
}

.site-nav a:not(.btn) {
  position: relative;
}

.site-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}

.site-nav a:not(.btn):hover::after,
.site-nav a.is-current::after {
  transform: scaleX(1);
  transform-origin: left;
}

.site-nav a.is-current {
  color: var(--ink);
}

/* ---------- Split-word reveal (hero + contact titles) ---------- */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0 .06em .14em 0;
  margin: 0 -.06em -.14em 0;
}

.w-in {
  display: inline-block;
}

.js [data-split] .w-in {
  transform: translateY(115%) rotate(4deg);
  transform-origin: left top;
  transition: transform 1.1s var(--ease);
  transition-delay: calc(var(--i) * 55ms + 100ms);
}

.js [data-split].is-in .w-in {
  transform: none;
}

/* Hero accent words get an underline that draws in */
.hero-title em {
  background: linear-gradient(currentColor, currentColor) 0 94% / 0% .06em no-repeat;
  transition: background-size 1s var(--ease) 1.2s;
}

.hero-title.is-in em,
html:not(.js) .hero-title em {
  background-size: 100% .06em;
}

/* Elements in the hero that fade up after the title */
.js .hero-eyebrow,
.js .hero-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.js .hero-in {
  transition-delay: .7s;
}

.is-loaded .hero-eyebrow,
.is-loaded .hero-in {
  opacity: 1;
  transform: none;
}

.pulse-dot {
  display: inline-block;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: #2f9e5b;
  margin-right: .6rem;
  vertical-align: .1em;
  box-shadow: 0 0 0 0 rgba(47, 158, 91, .5);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 .5rem rgba(47, 158, 91, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(47, 158, 91, 0);
  }
}

/* ---------- Stats ---------- */
.stats {
  display: flex;
  gap: 2.5rem;
  margin: 2rem 0 0;
}

.stats div {
  display: flex;
  flex-direction: column-reverse;
}

.stats dt {
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .04em;
}

.stats dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 2.4rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------- Rotating badge ---------- */
.badge {
  position: absolute;
  right: var(--gutter);
  top: clamp(5rem, 14vh, 9rem);
  width: 9.5rem;
  height: 9.5rem;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--ink);
  border-radius: 50%;
  transition: transform .5s var(--ease);
}

.badge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: spin 18s linear infinite;
}

.badge text {
  font: 500 15px var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  fill: currentColor;
}

.badge-arrow {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.4rem;
  transition: transform .5s var(--ease);
}

.badge:hover {
  transform: scale(1.06);
}

.badge:hover svg {
  animation-duration: 6s;
}

.badge:hover .badge-arrow {
  transform: rotate(-45deg) scale(1.1);
}

.js .badge {
  opacity: 0;
  transform: scale(.6) rotate(-30deg);
  transition: opacity 1s var(--ease) 1s, transform 1s var(--ease) 1s;
}

.is-loaded .badge {
  opacity: 1;
  transform: none;
}

.is-loaded .badge:hover {
  transform: scale(1.06);
  transition-delay: 0s;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Marquee ---------- */
.marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-track .proof-list {
  flex-wrap: nowrap;
  padding-right: 2.25rem;
}

.marquee-track .proof-list li {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.marquee-track .proof-list li::after {
  content: "✦";
  font-style: normal;
  font-size: .7rem;
  color: var(--accent);
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Custom cursor (fine pointers only) ---------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: 2.25rem;
  height: 2.25rem;
  margin: -1.125rem 0 0 -1.125rem;
  border: 1px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  display: none;
  place-items: center;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s var(--ease), border-color .35s var(--ease), opacity .3s;
  opacity: 0;
}

.has-cursor .cursor {
  display: grid;
}

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

.cursor.is-link {
  width: 3.5rem;
  height: 3.5rem;
  margin: -1.75rem 0 0 -1.75rem;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.cursor.is-card {
  width: 6rem;
  height: 6rem;
  margin: -3rem 0 0 -3rem;
  background: var(--accent);
  border-color: var(--accent);
}

.cursor-label {
  font: 600 .8rem var(--sans);
  color: var(--accent-ink);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .3s, transform .35s var(--ease);
}

.cursor.is-card .cursor-label {
  opacity: 1;
  transform: none;
}

.cursor.is-hidden {
  opacity: 0;
}

.cursor.is-inverse:not(.is-card) {
  border-color: var(--paper);
}

/* ---------- Work: filter pill, counts, card motion ---------- */
.filters {
  position: relative;
}

.filter-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 999px;
  background: var(--ink);
  transition: transform .5s var(--ease), width .5s var(--ease), height .5s var(--ease);
  pointer-events: none;
}

.filter {
  position: relative;
  z-index: 1;
}

.has-pill .filter.is-active {
  background: transparent;
}

.filter-count {
  font-size: .7rem;
  vertical-align: super;
  margin-left: .2rem;
  opacity: .6;
}

.work-card {
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}

.js .work-card.reveal.is-leaving {
  opacity: 0;
  transform: scale(.96) translateY(10px);
}

.js .work-card.reveal.is-entering {
  opacity: 0;
  transform: translateY(24px);
}

.js .work-card.reveal {
  transition-delay: var(--d, 0s);
}

/* Thumbnail wipes open as it scrolls in */
.js .work-card .work-thumb {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.2s var(--ease) var(--d, 0s);
}

.js .work-card.is-visible .work-thumb {
  clip-path: inset(0 0 0 0);
}

.work-thumb img {
  transform: translate(calc(var(--mx, 0) * -12px), calc(var(--my, 0) * -12px)) scale(1.06);
  transition: transform .8s var(--ease);
}

.work-card a:hover .work-thumb img {
  transform: translate(calc(var(--mx, 0) * -12px), calc(var(--my, 0) * -12px)) scale(1.12);
}

.work-thumb {
  position: relative;
}

.work-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity .5s var(--ease);
}

.work-card a:hover .work-thumb::after {
  opacity: .12;
}

.read-link {
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0% 1px no-repeat;
  transition: background-size .45s var(--ease), color .3s;
}

.work-card a:hover .read-link {
  background-size: 100% 1px;
  color: var(--accent);
}

/* ---------- Service hover ---------- */
.service h3 {
  transition: color .3s, transform .45s var(--ease);
}

.service:hover h3 {
  color: var(--accent);
  transform: translateX(6px);
}

.service .tags li {
  transition: border-color .3s, color .3s, transform .3s var(--ease);
}

.service:hover .tags li {
  border-color: var(--ink);
  color: var(--ink);
}

.js .service.reveal:nth-child(2) {
  transition-delay: .12s;
}

.js .service.reveal:nth-child(3) {
  transition-delay: .24s;
}

/* ---------- About: scrubbed text ---------- */
[data-scrub] .sw {
  transition: opacity .3s, color .3s;
}

.js [data-scrub] .sw {
  opacity: .18;
}

.js [data-scrub] .sw.lit {
  opacity: 1;
}

.about-photo-frame {
  overflow: hidden;
  border-radius: var(--radius);
}

.about-photo img {
  transform: translateY(var(--parallax, 0)) scale(1.08);
  will-change: transform;
}

.timeline > li {
  transition: padding .4s var(--ease);
}

.timeline > li:hover {
  padding-left: .75rem;
}

.timeline > li:hover strong {
  color: var(--accent);
}

/* ---------- Process ---------- */
.process li {
  border-top-color: var(--rule);
  position: relative;
}

.process li .step-line {
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink);
  transform-origin: left;
  transition: transform 1s var(--ease) var(--d, 0s);
}

.js .process li:not(.is-visible) .step-line {
  transform: scaleX(0);
}

.js .process li.reveal {
  transition-delay: var(--d, 0s);
}

.process li:hover .step {
  color: var(--accent);
}

.step {
  transition: color .3s;
}

/* ---------- Contact form motion ---------- */
.field {
  position: relative;
}

.field::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease);
}

.field:focus-within::after {
  transform: scaleX(1);
}

.field:focus-within label {
  color: var(--accent);
}

.field label {
  transition: color .3s;
}

.contact-form .btn.is-sent::before {
  transform: none;
  background: #2f9e5b;
}

.contact-form .btn.is-sent {
  border-color: #2f9e5b;
  color: #fff;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  opacity: 0;
  transform: translateY(1rem) scale(.8);
  pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}

.to-top.is-shown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover {
  transform: translateY(-3px);
}

.to-top svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.to-top circle {
  fill: none;
  stroke-width: 2;
}

.to-top-track {
  stroke: var(--rule);
}

.to-top-ring {
  stroke: var(--accent);
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--progress, 0));
}

@media (max-width: 960px) {
  .badge {
    width: 7rem;
    height: 7rem;
    top: auto;
    bottom: clamp(4rem, 10vh, 7rem);
    display: none;
  }
}

@media (max-width: 760px) {
  .stats {
    gap: 1.75rem;
  }

  .stats dd {
    font-size: 2rem;
  }

  .proof-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .marquee {
    width: 100%;
  }
}

/* ---------- Reveal on scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    animation: none !important;
  }

  .js .work-card .work-thumb {
    clip-path: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services {
    grid-template-columns: 1fr;
  }

  .service,
  .service:first-child {
    padding: 1.75rem 0;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .service:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .process {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 2rem;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .about-photo {
    position: static;
    max-width: 22rem;
  }

  .contact-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: 4.5rem 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1rem var(--gutter) 2rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    transform: translateY(-1rem);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }

  .site-nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .site-nav a:not(.btn) {
    width: 100%;
    padding: .9rem 0;
    font-family: var(--serif);
    font-size: 1.6rem;
    color: var(--ink);
    border-bottom: 1px solid var(--rule);
  }

  .site-nav .btn {
    margin-top: 1.5rem;
  }

  .hero-foot {
    grid-template-columns: 1fr;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-card.is-featured a {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .work-card.is-featured .work-thumb {
    margin-bottom: 1.25rem;
    order: 0;
  }

  .timeline > li {
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  .process {
    grid-template-columns: 1fr;
  }
}
