:root {
  --commerce-ink: #f4f8f5;
  --commerce-paper: #020807;
  --commerce-muted: #91a39a;
  --commerce-panel: #07110e;
  --commerce-line: rgba(197, 255, 24, .18);
  --commerce-accent: #c5ff18;
}

html { scroll-behavior: smooth; }

.cover-project-group {
  margin: 16px 0 2px;
  padding: 12px 0 8px;
  border-bottom: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.54);
  font-size: 10px;
  letter-spacing: .17em;
}

.work-index {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 0 clamp(20px, 4vw, 72px);
  border-top: 1px solid rgba(255,255,255,.13);
  border-bottom: 1px solid rgba(255,255,255,.13);
  color: #fff;
  background: rgba(2, 8, 7, .88);
  backdrop-filter: blur(18px);
}

.work-index > span {
  font-size: 11px;
  letter-spacing: .18em;
}

.work-index div { display: flex; gap: clamp(18px, 3vw, 42px); }

.work-index a {
  position: relative;
  padding: 24px 0 21px;
  color: rgba(255,255,255,.65);
  font-size: 11px;
  letter-spacing: .13em;
  text-decoration: none;
  transition: color .25s ease;
}

.work-index a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 15px;
  left: 0;
  height: 1px;
  background: var(--commerce-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s ease;
}

.work-index a:hover,
.work-index a:focus-visible { color: #fff; }
.work-index a:hover::after,
.work-index a:focus-visible::after { transform: scaleX(1); transform-origin: left; }

.commerce-section {
  position: relative;
  padding: clamp(88px, 11vw, 170px) clamp(20px, 5vw, 84px);
  color: var(--commerce-ink);
  background:
    radial-gradient(circle at 88% 8%, rgba(197,255,24,.075), transparent 24%),
    radial-gradient(circle at 4% 42%, rgba(36,99,72,.16), transparent 30%),
    linear-gradient(180deg, #020807 0%, #04100c 50%, #020807 100%);
  overflow: clip;
}

.commerce-section::before {
  content: "COMMERCE";
  position: absolute;
  top: 3.5rem;
  right: -1.5vw;
  color: rgba(197,255,24,.035);
  font-size: clamp(76px, 15vw, 260px);
  font-weight: 700;
  line-height: .8;
  letter-spacing: -.07em;
  pointer-events: none;
}

.commerce-heading {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .65fr);
  align-items: end;
  gap: 40px;
  max-width: 1500px;
  margin: 0 auto clamp(76px, 9vw, 138px);
}

.commerce-kicker,
.commerce-supporting header p,
.ai-commerce-copy > p:first-child,
.illustration-gallery header > div > p {
  margin: 0 0 18px;
  font-size: 11px;
  letter-spacing: .2em;
}

.commerce-particle-title { position: relative; width: min(100%, 1050px); }
.particle-text {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(270px, 34vw, 510px);
  min-height: 270px;
  overflow: visible;
  touch-action: pan-y;
  isolation: isolate;
  contain: layout paint;
}
.particle-text__canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.particle-text__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: clamp(56px, 9vw, 148px);
  font-weight: 700;
  line-height: .78;
  letter-spacing: -.075em;
  transition: opacity .25s ease;
}
.particle-text.is-ready .particle-text__fallback {
  opacity: .12;
  color: #dce8df;
  text-shadow: 0 0 28px rgba(197,255,24,.07);
}
.particle-text.is-pointer-active .particle-text__fallback { opacity: .18; }
.particle-text__sr,
.commerce-heading .particle-text__sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.commerce-title-arrow {
  position: absolute;
  right: 1.5%;
  bottom: 11%;
  z-index: 2;
  color: var(--commerce-accent);
  font: clamp(48px, 7vw, 105px)/1 Space, sans-serif;
  transform: rotate(-2deg);
  text-shadow: 0 0 28px rgba(197,255,24,.2);
  pointer-events: none;
}
.commerce-cn-title { margin: 25px 0 0; font-size: 16px; letter-spacing: .08em; }

.commerce-intro {
  max-width: 520px;
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid var(--commerce-line);
  font-size: clamp(16px, 1.35vw, 22px);
  line-height: 1.75;
}

.commerce-featured { max-width: 1500px; margin: 0 auto; }
[id^="commerce-case-"] { scroll-margin-block: clamp(80px, 12vh, 150px); }

.commerce-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, .55fr);
  align-items: center;
  gap: clamp(36px, 7vw, 112px);
  min-height: min(820px, 85vh);
  padding: clamp(44px, 6vw, 92px) 0;
  border-top: 1px solid var(--commerce-line);
}

.commerce-feature--reverse { grid-template-columns: minmax(290px, .55fr) minmax(0, 1.45fr); }
.commerce-feature--reverse .commerce-feature-media { grid-column: 2; }
.commerce-feature--reverse .commerce-feature-copy { grid-column: 1; grid-row: 1; }

.image-slot {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: #08140f;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
}

.image-slot::before,
.image-slot::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.image-slot::before {
  inset: 0;
  background:
    linear-gradient(115deg, transparent 25%, rgba(197,255,24,.11) 25.2%, transparent 25.5%),
    linear-gradient(25deg, transparent 62%, rgba(255,255,255,.04) 62.2%, transparent 62.5%);
}

.image-slot::after {
  width: 42%;
  aspect-ratio: 1;
  right: 8%;
  bottom: -18%;
  border: 1px solid rgba(197,255,24,.2);
  border-radius: 50%;
}

.image-slot--wide { aspect-ratio: 16 / 9; }
.image-slot--card { aspect-ratio: 16 / 9; }
.image-slot--stage { width: 100%; height: 100%; min-height: 0; aspect-ratio: 16 / 9; }

.image-slot img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform .75s cubic-bezier(.2,.7,.2,1), filter .45s ease;
}

.image-slot:hover img { transform: scale(1.035); filter: saturate(1.04); }

.image-slot-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(20px, 3vw, 44px);
  text-align: left;
}

.image-slot-placeholder b {
  font-size: clamp(54px, 8vw, 118px);
  font-weight: 500;
  line-height: .8;
  letter-spacing: -.08em;
}
.image-slot-placeholder strong { margin-top: auto; font-size: 13px; letter-spacing: .16em; }
.image-slot-placeholder small { margin-top: 10px; opacity: .55; }
.image-slot-placeholder b { color: var(--commerce-accent); }

.image-slot-action {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 16px;
  padding: 10px 13px;
  color: #fff;
  background: rgba(0,0,0,.62);
  font-size: 10px;
  letter-spacing: .1em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}
.image-slot:hover .image-slot-action,
.image-slot:focus-visible .image-slot-action { opacity: 1; transform: none; }
.image-slot.has-image .image-slot-placeholder { opacity: 0; }

.supports-image-drop { position: relative; }
.image-drop-label {
  position: absolute;
  z-index: 12;
  inset: 12px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(197,255,24,.68);
  color: #c5ff18;
  background: rgba(2,8,7,.86);
  backdrop-filter: blur(8px);
  font: 700 11px/1 var(--mono, monospace);
  letter-spacing: .14em;
  opacity: 0;
  transform: scale(.98);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
body.is-dragging-image .supports-image-drop .image-drop-label { opacity: .48; }
.supports-image-drop.is-drag-over .image-drop-label { opacity: 1; transform: scale(1); }
.supports-image-drop.is-drag-over { outline: 2px solid #c5ff18; outline-offset: 4px; }
.image-drop-toast {
  position: fixed;
  z-index: 10000;
  left: 50%;
  bottom: 28px;
  padding: 13px 18px;
  color: #061008;
  background: #c5ff18;
  box-shadow: 0 15px 50px rgba(0,0,0,.38);
  font: 700 11px/1 var(--mono, monospace);
  letter-spacing: .1em;
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.image-drop-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.commerce-project-meta { margin: 0 0 18px; font-size: 11px; letter-spacing: .16em; }
.commerce-feature-copy h3 { margin: 0; font-size: clamp(36px, 4.5vw, 72px); line-height: 1.03; letter-spacing: -.045em; }
.commerce-feature-copy > p:not(.commerce-project-meta) { margin: 28px 0; font-size: 16px; line-height: 1.8; }
.commerce-feature-copy > p:not(.commerce-project-meta),
.commerce-intro,
.illustration-gallery header > p { color: var(--commerce-muted); }
.commerce-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.commerce-tags span { padding: 8px 11px; border: 1px solid var(--commerce-line); font-size: 9px; letter-spacing: .12em; }

.commerce-case-link,
.commerce-mini-card button[data-case-link] {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-width: 210px;
  margin-top: 36px;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.commerce-case-link span { transition: transform .25s ease; }
.commerce-case-link:hover span { transform: translate(5px, -5px); }

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  color: #071008;
  background: var(--commerce-accent);
  clip-path: inset(100% 0 0 0);
  pointer-events: none;
  transition: clip-path .48s cubic-bezier(.76,0,.24,1);
}
.page-transition span { font-size: 11px; font-weight: 700; letter-spacing: .22em; }
.is-leaving-page .page-transition { clip-path: inset(0 0 0 0); }

.commerce-supporting {
  max-width: 1500px;
  margin: clamp(80px, 12vw, 180px) auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--commerce-line);
}
.commerce-supporting header { display: flex; align-items: end; justify-content: space-between; margin-bottom: 34px; }
.commerce-supporting header h3 { margin: 0; font-size: clamp(34px, 4vw, 62px); letter-spacing: -.045em; }
.commerce-supporting-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(18px, 3vw, 46px); }
.commerce-mini-card { min-width: 0; }
.commerce-mini-card > div { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; padding-top: 18px; }
.commerce-mini-card p { grid-column: 1 / -1; margin: 0; font-size: 10px; letter-spacing: .15em; }
.commerce-mini-card h4 { margin: 0; font-size: clamp(25px, 2.7vw, 42px); font-weight: 500; letter-spacing: -.035em; }
.commerce-mini-card button[data-case-link] { min-width: auto; margin: 0; font-size: 12px; }

.ai-commerce {
  display: grid;
  grid-template-columns: minmax(300px, .75fr) minmax(0, 1.25fr);
  max-width: 1500px;
  min-height: 0;
  margin: clamp(110px, 14vw, 220px) auto 0;
  color: var(--commerce-ink);
  background: #030b08;
  border: 1px solid rgba(197,255,24,.14);
}
.ai-commerce-copy { display: flex; flex-direction: column; padding: clamp(34px, 5vw, 72px); }
.ai-commerce-copy h3 { margin: 0; font-size: clamp(42px, 5.6vw, 84px); line-height: .92; letter-spacing: -.06em; }
.ai-commerce-copy > p:nth-of-type(2) { max-width: 520px; margin: 28px 0 42px; color: rgba(255,255,255,.62); line-height: 1.8; }
.ai-stage-tabs { margin-top: auto; border-top: 1px solid rgba(255,255,255,.15); }
.ai-stage-tabs button { display: grid; grid-template-columns: 42px 1fr; width: 100%; padding: 17px 0; border: 0; border-bottom: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.45); background: transparent; text-align: left; cursor: pointer; transition: color .25s ease, padding-left .25s ease; }
.ai-stage-tabs button[aria-selected="true"] { padding-left: 10px; color: #fff; }
.ai-stage-tabs button[aria-selected="true"] b { color: var(--commerce-accent); }
.ai-stage-view { min-width: 0; aspect-ratio: 16 / 9; align-self: center; background: #06120d; overflow: hidden; }
.ai-stage-panel { width: 100%; height: 100%; animation: commerceStageIn .5s cubic-bezier(.2,.75,.25,1) both; }
.ai-stage-panel .image-slot { background: #08150f; color: var(--commerce-ink); }
.ai-stage-panel .image-slot::after { border-color: rgba(197,255,24,.24); }

@keyframes commerceStageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.illustration-gallery { max-width: 1500px; margin: clamp(110px, 14vw, 220px) auto 0; }
.illustration-gallery header { display: grid; grid-template-columns: 1.1fr .7fr; align-items: end; gap: 40px; margin-bottom: 48px; }
.illustration-gallery header h3 { margin: 0; font-size: clamp(48px, 7vw, 112px); line-height: .85; letter-spacing: -.065em; }
.illustration-gallery header > p { margin: 0; padding-top: 20px; border-top: 1px solid var(--commerce-line); line-height: 1.75; }
.accordion-gallery {
  --ag-gap: 10px;
  display: flex;
  width: 100%;
  height: clamp(460px, 58vw, 720px);
  gap: var(--ag-gap);
  perspective: 1400px;
  perspective-origin: 50% 50%;
}
.accordion-gallery .ag-panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(197,255,24,.12);
  border-radius: 3px;
  background: #06110c;
  box-shadow: 0 24px 70px -38px rgba(0,0,0,.9);
  transform-style: preserve-3d;
  transform-origin: center;
  will-change: flex-grow, transform;
}
.accordion-gallery .ag-panel.is-active { flex-grow: 5.5; border-color: rgba(197,255,24,.5); }
.accordion-gallery .ag-panel .image-slot { height: 100%; background: #08140f; }
.accordion-gallery .ag-panel:nth-child(2n) .image-slot { background: #0a1711; }
.accordion-gallery .ag-panel:nth-child(3n) .image-slot { background: #06100d; }
.accordion-gallery .ag-panel img {
  filter: grayscale(1) brightness(.68);
  transform: scale(1.08);
  transition: filter .6s ease, transform .8s cubic-bezier(.2,.75,.25,1);
}
.accordion-gallery .ag-panel.is-active img { filter: grayscale(0) brightness(1); transform: scale(1.02); }
.accordion-gallery .ag-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 45%, rgba(1,7,5,.9) 100%);
}
.accordion-gallery .ag-panel figcaption {
  position: absolute;
  z-index: 3;
  right: 20px;
  bottom: 21px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-size: clamp(12px, 1.2vw, 18px);
  letter-spacing: .1em;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity .35s ease, transform .45s ease;
  pointer-events: none;
}
.accordion-gallery .ag-panel figcaption i {
  display: block;
  width: 3px;
  height: 28px;
  background: var(--commerce-accent);
  box-shadow: 0 0 16px rgba(197,255,24,.65);
}
.accordion-gallery .ag-panel.is-active figcaption { opacity: 1; transform: none; }
.accordion-gallery .ag-panel:focus-within { outline: 2px solid var(--commerce-accent); outline-offset: 3px; }

.commerce-dialog,
.portfolio-lightbox {
  width: min(900px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  border: 0;
  color: #fff;
  background: #030b08;
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
}
.commerce-dialog { padding: clamp(34px, 6vw, 86px); }
.commerce-dialog::backdrop,
.portfolio-lightbox::backdrop { background: rgba(5,5,5,.75); backdrop-filter: blur(10px); }
.commerce-dialog-close,
.portfolio-lightbox > button { position: absolute; top: 18px; right: 20px; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; color: #fff; background: transparent; font-size: 24px; cursor: pointer; }
.commerce-dialog-index { color: var(--commerce-accent); font-size: clamp(80px, 14vw, 180px); line-height: .78; letter-spacing: -.08em; }
.commerce-dialog > p:not(.commerce-dialog-description) { margin: 35px 0 10px; font-size: 10px; letter-spacing: .18em; }
.commerce-dialog h2 { margin: 0; font-size: clamp(42px, 7vw, 92px); line-height: 1; letter-spacing: -.06em; }
.commerce-dialog-description { max-width: 680px; margin: 25px 0 44px; color: rgba(255,255,255,.65); font-size: 18px; line-height: 1.7; }
.commerce-dialog-outline { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255,255,255,.2); border-bottom: 1px solid rgba(255,255,255,.2); }
.commerce-dialog-outline span { padding: 18px 10px; font-size: 10px; letter-spacing: .08em; }
.commerce-dialog small { display: block; margin-top: 24px; color: rgba(255,255,255,.45); }
.portfolio-lightbox { padding: 52px 18px 18px; }
.portfolio-lightbox img { display: block; width: 100%; max-height: calc(100vh - 145px); object-fit: contain; }
.portfolio-lightbox p { margin: 14px 0 0; font-size: 11px; letter-spacing: .16em; text-align: center; }

.reveal-on-scroll { opacity: 0; transform: translateY(36px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.75,.25,1); }
.reveal-on-scroll.is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .work-index > span { display: none; }
  .work-index { justify-content: center; overflow-x: auto; }
  .work-index div { min-width: max-content; }
  .commerce-heading,
  .commerce-feature,
  .commerce-feature--reverse,
  .ai-commerce,
  .illustration-gallery header { grid-template-columns: 1fr; }
  .commerce-heading { align-items: start; }
  .commerce-feature { min-height: 0; gap: 30px; }
  .commerce-feature--reverse .commerce-feature-media,
  .commerce-feature--reverse .commerce-feature-copy { grid-column: auto; grid-row: auto; }
  .commerce-feature--reverse .commerce-feature-media { order: 0; }
  .commerce-feature--reverse .commerce-feature-copy { order: 1; }
  .image-slot--stage { min-height: 0; aspect-ratio: 16 / 9; }
  .accordion-gallery { height: 620px; }
}

@media (max-width: 620px) {
  .work-index { min-height: 58px; justify-content: flex-start; padding-inline: 18px; }
  .work-index a { padding-block: 20px 17px; }
  .commerce-section { padding-inline: 16px; }
  .particle-text { height: clamp(245px, 76vw, 350px); min-height: 245px; }
  .particle-text__fallback { font-size: clamp(48px, 16vw, 76px); }
  .commerce-title-arrow { right: 0; bottom: 10%; }
  .commerce-supporting-grid { grid-template-columns: 1fr; }
  .commerce-supporting header { display: block; }
  .commerce-mini-card > div { display: block; }
  .commerce-mini-card button[data-case-link] { margin-top: 12px; }
  .ai-commerce-copy { min-height: 560px; }
  .image-slot--stage { min-height: 0; aspect-ratio: 16 / 9; }
  .accordion-gallery { flex-direction: column; height: 720px; gap: 7px; perspective: none; }
  .accordion-gallery .ag-panel { min-height: 72px; transform: none !important; }
  .accordion-gallery .ag-panel.is-active { flex-grow: 5; }
  .commerce-dialog-outline { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-on-scroll { opacity: 1; transform: none; transition: none; }
  .image-slot img,
  .ai-stage-panel { transition: none; animation: none; }
}
