/* ==========================================================================
   sections.css: hero, marquee, about, services, selected work (stacking cards)
   ========================================================================== */

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  overflow: clip;
  isolation: isolate;
  --p: 0;
}
.hero-head {
  position: relative;
  z-index: 1;
  padding: 5.25rem 1.5vw 0;
  text-align: center;
  transform: translate3d(0, calc(var(--p) * -60px), 0);
  opacity: calc(1 - var(--p) * 1.2);
}
.hero-heading {
  font-weight: 900;
  font-stretch: 80%;
  font-size: 12vw; /* JS fits it to the full width */
  line-height: 0.85;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.js .hero-heading {
  background: none;
}
.hero-letters {
  display: inline-block;
}
.hero-heading .hl {
  display: inline;
}
.hero-heading .ch {
  display: inline-block;
  padding: 0.14em 0.015em;
  margin: -0.14em -0.015em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.portrait {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  height: clamp(360px, 76svh, 860px);
  aspect-ratio: 1100 / 952;
  max-width: 94vw;
  transform: translate3d(-50%, calc(var(--p) * 12%), 0) scale(calc(1 - var(--p) * 0.08));
  transform-origin: 50% 100%;
  pointer-events: none;
}
.portrait-inner {
  width: 100%;
  height: 100%;
  will-change: transform;
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  -webkit-mask-image: linear-gradient(#000 72%, transparent 100%);
  mask-image: linear-gradient(#000 72%, transparent 100%);
  opacity: calc(1 - var(--p) * 0.85);
}

.hero-bottom {
  position: relative;
  z-index: 3;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 0 var(--gut) clamp(1.75rem, 4svh, 2.5rem);
  transform: translate3d(0, calc(var(--p) * -50px), 0);
  opacity: calc(1 - var(--p) * 1.4);
}
.hero-left .pill {
  margin-bottom: 1rem;
}
.hero-tag {
  max-width: 160px;
  color: var(--soft);
  font-weight: 300;
  font-size: clamp(0.75rem, 1.4vw, 1.5rem);
  line-height: 1.3;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Hero load sequence (runs as the intro curtain lifts) */
.js .nav-in,
.js .hero-left,
.js .hero-cta {
  opacity: 0;
}
.js .nav-in {
  transform: translateY(-20px);
}
.js .hero-left,
.js .hero-cta {
  transform: translateY(20px);
}
.js .hero-heading .ch {
  opacity: 0;
  transform: translateY(60%) rotate(6deg);
  filter: blur(8px);
}
.js .portrait {
  opacity: 0;
}
.js .portrait img {
  filter: blur(14px) brightness(0.4);
  transform: translateY(30px) scale(1.06);
}

.loaded .nav-in,
.loaded .hero-left,
.loaded .hero-cta {
  opacity: 1;
  transform: none;
}
.loaded .nav-in {
  transition:
    opacity 0.8s 0.85s,
    transform 0.9s var(--ease) 0.85s,
    padding 0.4s var(--ease);
}
.loaded .hero-left {
  transition:
    opacity 0.9s 0.3s,
    transform 1s var(--ease) 0.3s;
}
.loaded .hero-cta {
  transition:
    opacity 0.9s 0.45s,
    transform 1s var(--ease) 0.45s;
}
.loaded .hero-heading .ch {
  opacity: 1;
  transform: none;
  filter: none;
  transition:
    opacity 0.9s var(--ease-soft),
    transform 1.1s var(--ease),
    filter 0.9s var(--ease-soft);
  transition-delay: calc(0.45s + var(--i) * 0.035s);
}
.loaded .portrait {
  opacity: 1;
  transition: opacity 1.2s ease 0.15s;
}
.loaded .portrait img {
  filter: none;
  transform: none;
  transition:
    filter 1.8s var(--ease) 0.15s,
    transform 2.2s var(--ease) 0.15s;
}

/* ---------- Marquee ---------- */
.marquee {
  display: grid;
  gap: 0.75rem;
  padding: 6rem 0 2.5rem;
  overflow: clip;
}
.mq-track {
  display: flex;
  gap: 0.75rem;
  width: max-content;
  will-change: transform;
}
.mq-tile {
  position: relative;
  flex: none;
  width: 420px;
  height: 270px;
  margin: 0;
  overflow: hidden;
  border: 1px solid #1b1b1b;
  border-radius: 1rem;
  background: var(--raise);
}
.mq-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 0 0;
  transform: scale(var(--z, 1));
  transform-origin: var(--o, 0 0);
}
.mq-tile figcaption {
  position: absolute;
  left: 0.9rem;
  bottom: 0.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
/* Rows can be dragged, swiped or scrolled sideways; vertical page scroll stays native */
.marquee {
  user-select: none;
  -webkit-user-select: none;
}
.mq-row {
  cursor: grab;
  touch-action: pan-y;
}
.mq-row.dragging {
  cursor: grabbing;
}
.mq-track img {
  pointer-events: none;
  -webkit-user-drag: none;
}
.mq-hint {
  margin-top: 0.9rem;
  text-align: center;
}
.mq-note header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey);
}
.mq-name strong {
  display: block;
  overflow: hidden;
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mq-name small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--grey);
}

/* Systems whose screens hold client data: the tile says what it is instead. */
.mq-note {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 360px;
  padding: 1.15rem 1.25rem 1.1rem;
  background: linear-gradient(160deg, #161616, #0a0a0a);
}
.mq-note h3 {
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.mq-note > p {
  color: var(--grey);
  font-size: 0.85rem;
  line-height: 1.5;
}
.mq-note dl {
  display: grid;
  gap: 0.4rem;
  margin: auto 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid #242422;
}
.mq-note dl div {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
}
.mq-note dt {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.mq-note dd {
  margin: 0;
  color: var(--soft);
  font-size: 0.8rem;
  line-height: 1.4;
}
.mq-open {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Illustrated previews inside project cards (sample data, not screenshots) */
.mq-ui {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f4f4f1;
  color: #161616;
  font-size: 10px;
  line-height: 1.35;
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.9);
}
.mq-ui .t {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-weight: 700;
  font-size: 10.5px;
}
.mq-ui.phone .t {
  white-space: nowrap;
}
.mq-ui .t span {
  color: #77776f;
  font-weight: 500;
}
.mq-ui .r {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 3.5px 0;
  border-top: 1px dashed #d6d6d0;
  white-space: nowrap;
}
.mq-ui .r > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.mq-ui .ok {
  color: #1f8f4e;
}
.mq-ui .warn {
  color: #b87400;
}
.mq-ui .bad {
  color: #cf3f3f;
}
.mq-ui .dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: currentColor;
}
.mq-ui .chips {
  display: flex;
  gap: 4px;
  margin: 3px 0 5px;
}
.mq-ui .chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: #e4e4df;
  font-weight: 600;
}
.mq-ui .chip.on {
  background: #161616;
  color: #fff;
}
.mq-ui .btn {
  margin-top: 6px;
  padding: 4px;
  border-radius: 5px;
  background: #161616;
  color: #fff;
  font-weight: 600;
  text-align: center;
}
.mq-ui .bar {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 3px;
  background: #e2e2dd;
}
.mq-ui .bar i {
  display: block;
  width: var(--w);
  height: 100%;
  background: #161616;
}

/* Phone-shaped preview */
.mq-ui.phone {
  align-self: center;
  width: 130px;
  padding: 7px 8px;
  border: 5px solid #2a2a2a;
  border-radius: 16px;
  font-size: 9.5px;
}

/* Asset tag */
.mq-ui .asset {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 5px;
}
.mq-ui .mini-qr {
  flex: none;
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  background: repeating-conic-gradient(#161616 0 25%, #fff 0 50%) 0 0 / 7px 7px;
}

/* Floor plan */
.mq-ui .plan {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
}
.mq-ui .plan i {
  display: grid;
  place-items: center;
  height: 24px;
  border: 1px solid #cfcfc9;
  border-radius: 3px;
  font-style: normal;
  font-size: 9px;
  color: #6b6b64;
}
.mq-ui .plan i.on {
  border-color: #161616;
  background: #161616;
  color: #fff;
}
.mq-ui .plan i.wide {
  grid-column: 1 / -1;
  background: #e4e4df;
}

/* ---------- About ---------- */
.about {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.25rem;
}
.about-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4rem;
  text-align: center;
}
.about-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}
.about-para {
  max-width: 560px;
  font-weight: 500;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.65;
}
.about-para .word {
  display: inline-block;
  white-space: nowrap;
}
/* JS dims the letters and lights the ones near the cursor (mouse only) */
.about-para.spotlight {
  cursor: default;
}

.about-floats {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.float {
  position: absolute;
  width: clamp(180px, 16vw, 230px);
}
.float-tl {
  top: 11%;
  left: 4%;
}
.float-tr {
  top: 11%;
  right: 4%;
}
.float-bl {
  bottom: 8%;
  left: 8%;
}
.float-br {
  bottom: 8%;
  right: 8%;
}
.float-card {
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid #2c2c2a;
  border-radius: 22px;
  background: rgba(20, 20, 20, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.9);
  transform: rotate(var(--r, 0deg));
  animation: bob 7s ease-in-out infinite;
  animation-delay: var(--bd, 0s);
}
@keyframes bob {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -10px;
  }
}
.float-card .ico {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 0.9rem;
  border: 1px solid #333;
  border-radius: 50%;
}
.float-card svg {
  width: 18px;
  height: 18px;
}
.float-card strong {
  display: block;
  margin-top: 0.3rem;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* ---------- Services (light) ---------- */
.services {
  padding: 5rem 1.25rem 8.5rem;
  border-radius: 40px 40px 0 0;
  background: var(--paper);
  color: var(--ink);
}
.services .display {
  color: var(--ink);
}
.svc-sub {
  max-width: 44ch;
  margin: 1.25rem auto 4rem;
  text-align: center;
  color: rgba(10, 10, 10, 0.6);
}
.svc-list {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.svc-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem clamp(1.25rem, 4vw, 4rem);
  padding-block: 2rem;
  border-top: 1px solid rgba(10, 10, 10, 0.15);
}
.svc-item:last-child {
  border-bottom: 1px solid rgba(10, 10, 10, 0.15);
}
.svc-num {
  min-width: 1.3em;
  font-weight: 900;
  font-stretch: 80%;
  font-size: clamp(3rem, 10vw, 140px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  -webkit-text-stroke: 1.5px transparent;
  transition:
    color 0.4s,
    -webkit-text-stroke-color 0.4s;
}
.svc-item:hover .svc-num {
  color: transparent;
  -webkit-text-stroke-color: var(--ink);
}
.svc-item h3 {
  font-weight: 500;
  font-size: clamp(1rem, 2.2vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.svc-item p {
  max-width: 42rem;
  margin-top: 0.5rem;
  font-weight: 300;
  font-size: clamp(0.85rem, 1.6vw, 1.25rem);
  line-height: 1.65;
  opacity: 0.6;
}
.svc-item small {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(10, 10, 10, 0.2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Selected work (stacking cards) ---------- */
.work {
  position: relative;
  z-index: 1;
  margin-top: -2.5rem;
  padding: clamp(4.5rem, 9vw, 8rem) 0 clamp(4rem, 8vw, 7rem);
  border-radius: 40px 40px 0 0;
  background: var(--black);
}
.work-head {
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
  text-align: center;
}
.work-head p {
  max-width: 44ch;
  margin: 1.25rem auto 0;
  color: var(--grey);
}
.card-slot {
  height: 85vh; /* JS sizes each slot to fit its card */
}
.pcard {
  position: sticky;
  top: calc(6rem + var(--i) * 28px);
  padding: 1rem;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-xl);
  background: var(--ink);
  transform: scale(var(--s, 1));
  transform-origin: 50% 0;
}
.pcard-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem clamp(1rem, 3vw, 2.5rem);
  padding: 0.5rem 0.75rem 1.25rem;
}
.pcard-num {
  font-weight: 900;
  font-stretch: 80%;
  font-size: clamp(3rem, 8vw, 110px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  /* The gradient is painted into this element's box, and the digits sit
     outside it: a line-height below 1 crops their tops, and the negative
     letter-spacing crops the right of the last one. The padding grows the
     painted box; the matching negative margin keeps the layout where it was. */
  padding: 0.18em 0.08em;
  margin: -0.18em -0.08em;
}
.pcard-title {
  flex: 1;
  min-width: 14rem;
}
.pcard-title .eyebrow {
  margin-bottom: 0.5rem;
}
/* Says who a project was built for, quietly: my own products against client work. */
.pcard-kind {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid #333;
  border-radius: 999px;
  color: var(--grey);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.pcard-kind::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pcard-kind.own {
  border-color: #5a5a55;
  color: var(--white);
}
.pcard-title h3 {
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.035em;
}
.pcard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 0.75rem;
}
.pcard-col {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.75rem;
}
.pcard-panel {
  padding: clamp(1.1rem, 2.2vw, 1.9rem);
  border-radius: var(--radius-lg);
  background: var(--panel);
}
.pcard-lede {
  color: #d4d4d0;
  font-size: clamp(0.95rem, 1.25vw, 1.1rem);
  line-height: 1.55;
}
.pcard-feats {
  display: grid;
  align-content: start;
  gap: 1rem;
  margin: 0;
  list-style: none;
}
.pcard-feats strong {
  display: block;
  font-weight: 600;
  font-size: 1rem;
}
.pcard-feats span {
  display: block;
  margin-top: 0.2rem;
  color: var(--grey);
  font-size: 0.9rem;
  line-height: 1.5;
}
.pcard-shot {
  position: relative;
  min-height: clamp(260px, 30vw, 460px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #111;
}
.pcard-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 0 0;
}
.bot-card {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: min(300px, 80%);
  padding: 1rem 1.1rem;
  border: 1px solid #333;
  border-radius: 18px;
  background: rgba(20, 20, 20, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9);
}
.bot-card p {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--soft);
}
.bot-card .bot-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
}
