.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: clamp(52px, 6.5vw, 92px);
  padding-bottom: clamp(118px, 13vw, 176px);
}

.hero__wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  align-items: center;
  gap: clamp(36px, 5.5vw, 88px);
}

.hero__title {
  margin-top: 22px;
  font-size: clamp(3rem, 5.3vw, 5rem);
  font-weight: 600;
  letter-spacing: -.046em;
  line-height: .94;
}
.hero__title .dim { color: var(--muted); }
.hero__title.reveal { opacity: 1; translate: none; }

.hero__sub {
  margin-top: 24px;
  max-width: 46ch;
  font-size: 1.02rem;
  line-height: 1.68;
  color: var(--muted);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

.hero__sign {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  max-width: 520px;
}
.hero__mark {
  flex: none;
  width: 52px;
  height: 52px;
  transition: transform .8s var(--ease);
}
.hero__sign:hover .hero__mark { transform: rotate(-8deg) scale(1.06); }
.hero__mark--light { display: none; }
html[data-theme="dark"] .hero__mark--dark { display: none; }
html[data-theme="dark"] .hero__mark--light { display: block; }

.hero__slogan {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 550;
  letter-spacing: -.016em;
  line-height: 1.35;
  color: var(--ink);
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 5px;
}
.hero__meta li {
  position: relative;
  font-size: .76rem;
  font-weight: 500;
  color: var(--faint);
}
.hero__meta li + li::before {
  content: "";
  position: absolute;
  left: -9px; top: 50%;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
}

.deck { position: relative; }
.deck__stage {
  position: relative;
  aspect-ratio: 1 / .86;
}
.deck__card {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 84%;
  display: flex;
  flex-direction: column;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--sh-3);
  transform-origin: 20% 100%;
  transition: transform .9s var(--ease), opacity .6s var(--ease-2), box-shadow .5s var(--ease-2);
  -webkit-tap-highlight-color: transparent;
}
.deck__card[data-pos="0"] { z-index: 3; transform: none; opacity: 1; }
.deck__card[data-pos="1"] { z-index: 2; transform: translate(9%, -10%) rotate(3.5deg) scale(.94); opacity: .9; cursor: pointer; }
.deck__card[data-pos="2"] { z-index: 1; transform: translate(17%, -19%) rotate(7deg) scale(.88); opacity: .72; cursor: pointer; }
.deck:hover .deck__card[data-pos="1"] { transform: translate(13%, -11%) rotate(6deg) scale(.94); opacity: .96; }
.deck:hover .deck__card[data-pos="2"] { transform: translate(25%, -21%) rotate(11deg) scale(.88); opacity: .85; }
.deck .deck__card[data-pos="0"]:hover { transform: translateY(-5px); box-shadow: 0 34px 70px -26px rgba(41, 41, 41, .5), 0 4px 10px -4px rgba(41, 41, 41, .1); }
html[data-theme="dark"] .deck .deck__card[data-pos="0"]:hover { box-shadow: 0 34px 70px -26px rgba(0, 0, 0, .85), 0 4px 10px -4px rgba(0, 0, 0, .5); }

.deck__card.is-out { animation: deckOut .95s var(--ease) both; }
@keyframes deckOut {
  0% { z-index: 4; transform: none; opacity: 1; }
  40% { z-index: 4; transform: translate(-30%, 5%) rotate(-9deg) scale(.97); opacity: 1; }
  41% { z-index: 0; }
  100% { z-index: 0; transform: translate(17%, -19%) rotate(7deg) scale(.88); opacity: .72; }
}

.deck__img {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg-2);
}
.deck__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.deck__card[data-pos="0"]:hover .deck__img img { transform: scale(1.05); }

.deck__info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.deck__logo {
  flex: none;
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  overflow: hidden;
}
.deck__logo img { width: 100%; height: 100%; object-fit: cover; }
.deck__txt { min-width: 0; flex: 1; }
.deck__txt b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -.022em;
  line-height: 1.2;
}
.deck__txt small {
  display: block;
  margin-top: 1px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
}
.deck__go {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--ink);
  transition: background-color .3s var(--ease-2), color .3s var(--ease-2), border-color .3s var(--ease-2), transform .45s var(--ease);
}
.deck__card[data-pos="0"]:hover .deck__go { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: rotate(45deg); }

.deck__tabs {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
  width: 84%;
}
.deck__tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: 46px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--muted);
  overflow: hidden;
  transition: color .3s var(--ease-2), border-color .3s var(--ease-2), background-color .3s var(--ease-2);
}
.deck__tab:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface); }
.deck__tab[aria-selected="true"] { color: var(--ink); border-color: var(--line-3); background: var(--surface); }
.deck__tab img {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 4px;
  filter: grayscale(1);
  opacity: .7;
  transition: filter .3s var(--ease-2), opacity .3s var(--ease-2);
}
.deck__tab[aria-selected="true"] img,
.deck__tab:hover img { filter: none; opacity: 1; }
.deck__tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck__bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: transparent;
}
.deck__bar b {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.deck__tab.is-on .deck__bar b { animation: deckFill var(--deck-dur, 5200ms) linear forwards; }
.deck.is-paused .deck__tab.is-on .deck__bar b { animation-play-state: paused; }
@keyframes deckFill { to { transform: scaleX(1); } }

.stats {
  position: relative;
  background: var(--band);
  color: var(--band-ink);
  padding: clamp(30px, 4vw, 52px) 0 clamp(80px, 10vw, 130px);
}

.mq { padding: 8px 0 clamp(38px, 5vw, 64px); }
.mq__item {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(18px, 2.2vw, 30px);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.3vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--band-muted);
  transition: color .3s var(--ease-2);
}
.mq__item--brand { color: var(--band-ink); }
.mq__item img {
  width: .95em; height: .95em;
  border-radius: 6px;
  flex: none;
}
.mq__item:hover { color: var(--band-ink); }
.mq__sep {
  flex: none;
  width: 30px;
  height: 14px;
  display: block;
  background:
    linear-gradient(var(--band-muted), var(--band-muted)) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--band-muted), var(--band-muted)) 0 4px / 100% 2px no-repeat,
    linear-gradient(var(--band-muted), var(--band-muted)) 0 8px / 100% 2px no-repeat,
    linear-gradient(var(--band-muted), var(--band-muted)) 0 12px / 100% 2px no-repeat;
  clip-path: polygon(0 0, 100% 0, calc(100% - 13px) 100%, 0 100%);
  opacity: .55;
}

.stats__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 40px;
  padding-top: clamp(32px, 4vw, 48px);
  padding-bottom: 38px;
  border-top: 1px solid var(--band-line);
  border-bottom: 1px solid var(--band-line);
}
.stats .eyebrow { color: var(--band-muted); }
.stats .eyebrow::before { background: var(--band-line); }
.stats__title {
  margin-top: 14px;
  font-size: clamp(1.75rem, 3.3vw, 2.6rem);
  letter-spacing: -.03em;
}
.stats__sub {
  max-width: 42ch;
  font-size: .92rem;
  line-height: 1.65;
  color: var(--band-muted);
}

.stats__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stats__list li {
  position: relative;
  padding: 34px 26px 6px 0;
  border-right: 1px solid var(--band-line);
}
.stats__list li:first-child { padding-left: 0; }
.stats__list li:last-child { border-right: 0; }
.stats__list li + li { padding-left: 26px; }
.stats__list li::after {
  content: "";
  position: absolute;
  left: 0; top: -1px;
  width: 100%;
  height: 1px;
  background: var(--band-ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .6s var(--ease);
}
.stats__list li:hover::after { transform: scaleX(1); }

.stats__n {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.4vw, 4.15rem);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: transform .5s var(--ease);
}
.stats__list li:hover .stats__n { transform: translateY(-3px); }
.stats__k {
  display: block;
  margin-top: 12px;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--band-muted);
  max-width: 20ch;
}

.projects { padding: clamp(76px, 9vw, 122px) 0 clamp(40px, 5vw, 70px); }

.proj__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.proj__grid > .reveal { display: flex; }

.proj {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.proj:hover {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  box-shadow: var(--sh-3);
}
.proj[data-brand="clc"] { --brand: #233dff; }
.proj[data-brand="alex"] { --brand: var(--ink); }
.proj[data-brand="alex"] .btn--brand { background: var(--ink); color: var(--bg); }
.proj[data-brand="study"] { --brand: var(--avicen-brown); }
html[data-theme="dark"] .proj[data-brand="study"] { --brand: var(--avicen-sand); }
html[data-theme="dark"] .proj[data-brand="study"] .btn--brand { color: var(--avicen-brown); }

.proj__banner {
  position: relative;
  aspect-ratio: 16 / 7.4;
  overflow: hidden;
  background: var(--bg-2);
}
.proj__banner img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}
.proj:hover .proj__banner img { transform: scale(1.06); }
.proj__banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 45%, rgba(0, 0, 0, .28));
}
.proj__chip {
  position: absolute;
  z-index: 2;
  top: 13px; left: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  background: rgba(255, 255, 255, .92);
  color: #292929;
  font-size: .69rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}
.proj__num {
  position: absolute;
  z-index: 2;
  right: 14px; bottom: 10px;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: 1;
  color: rgba(255, 255, 255, .9);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s var(--ease-2), transform .6s var(--ease);
}
.proj:hover .proj__num { opacity: 1; transform: none; }

.proj__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 24px 24px;
}

.proj__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 18px;
}
.proj__mark {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px; height: 60px;
  margin-top: -30px;
  margin-bottom: 15px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  overflow: hidden;
  box-shadow: var(--sh-2);
  transition: transform .5s var(--ease);
}
.proj__mark img { width: 100%; height: 100%; object-fit: cover; }
.proj:hover .proj__mark { transform: translateY(-4px) rotate(-4deg); }
.proj__names h3 { font-size: 1.35rem; letter-spacing: -.03em; }
.proj__url {
  display: block;
  margin-top: 1px;
  font-family: var(--font-mono);
  font-size: .755rem;
  color: var(--faint);
}

.proj__desc {
  font-size: .92rem;
  line-height: 1.68;
  color: var(--muted);
}

.proj__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.proj__tags span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  font-size: .73rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--bg);
  transition: border-color .3s var(--ease-2);
}
.proj:hover .proj__tags span { border-color: var(--line-2); }

.proj__foot { margin-top: auto; padding-top: 24px; }

.explore { padding: clamp(40px, 5vw, 70px) 0 clamp(52px, 6vw, 86px); }

.join {
  position: relative;
  padding: clamp(40px, 5vw, 70px) 0 clamp(76px, 9vw, 116px);
}
.join::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--bg-2) 42%);
}

.join__box {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  min-height: 300px;
}

.join__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 3.2vw, 40px);
  border-right: 1px solid var(--line);
}
.join__title {
  margin-top: 14px;
  font-size: clamp(1.5rem, 2.4vw, 2.05rem);
  letter-spacing: -.032em;
}
.join__desc {
  margin-top: 12px;
  max-width: 36ch;
  font-size: .9rem;
  line-height: 1.65;
  color: var(--muted);
}
.join__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.join__actions .copy { height: 44px; }

.join__media { position: relative; overflow: hidden; background: var(--bg-2); }
.join__media img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.04);
  transition: transform 1.2s var(--ease);
}
.join__box:hover .join__media img { transform: scale(1.05); }
.join__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, var(--surface) 2%, transparent 52%);
}
html[data-theme="dark"] .join__media img { filter: grayscale(1) brightness(.72) contrast(1.05); }

@media (min-width: 1024px) and (max-width: 1180px) {
  .proj__grid { gap: 18px; }
  .proj__body { padding: 0 19px 21px; }
  .proj__names h3 { font-size: 1.22rem; }
  .proj__desc { font-size: .875rem; }
  .proj__tags { gap: 5px; }
  .proj__tags span { font-size: .7rem; padding: 3px 8px; }
  .deck__tab { font-size: .76rem; gap: 7px; padding: 0 8px; }
}

@media (max-width: 1023px) {

  .hero {
    padding-top: 40px;
    padding-bottom: clamp(84px, 16vw, 124px);
  }
  .hero__wrap { grid-template-columns: 1fr; align-items: start; gap: 44px; }
  .hero__title { font-size: clamp(2.6rem, 11.5vw, 4.2rem); margin-top: 18px; }
  .hero__sub { max-width: 40ch; font-size: .95rem; margin-top: 18px; }
  .hero__actions { gap: 9px; margin-top: 24px; }
  .hero__actions .btn { flex: 1 1 100%; height: 50px; }
  .hero__sign { margin-top: 28px; padding-top: 18px; }
  .hero__mark { width: 44px; height: 44px; }

  .deck { max-width: 560px; }
  .deck__card { width: 86%; }
  .deck__card[data-pos="1"] { transform: translate(7%, -9%) rotate(3deg) scale(.95); }
  .deck__card[data-pos="2"] { transform: translate(13%, -17%) rotate(6deg) scale(.9); }
  .deck__tabs { width: 100%; margin-top: 18px; }
  .deck__info { padding: 12px 13px; gap: 10px; }
  .deck__logo { width: 34px; height: 34px; }

  .stats { padding: 22px 0 clamp(72px, 15vw, 104px); }
  .mq { padding-bottom: 30px; }
  .stats__head {
    display: block;
    padding-top: 30px;
    padding-bottom: 4px;
    border-bottom: 0;
  }
  .stats__title { font-size: clamp(1.6rem, 6.2vw, 2.1rem); margin-top: 12px; }
  .stats__sub { max-width: none; margin-top: 12px; font-size: .89rem; }

  .stats__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 30px;
    border-top: 1px solid var(--band-line);
  }
  .stats__list li {
    padding: 24px 18px 20px 0;
    border-right: 1px solid var(--band-line);
    border-bottom: 1px solid var(--band-line);
  }
  .stats__list li::after { display: none; }
  .stats__list li:nth-child(2n) { border-right: 0; padding-left: 18px; }
  .stats__list li:nth-child(n + 3) { border-bottom: 0; }
  .stats__list li + li { padding-left: 0; }
  .stats__list li:nth-child(2n) { padding-left: 18px; }
  .stats__n { font-size: clamp(2.3rem, 11vw, 3.2rem); }
  .stats__k { max-width: none; font-size: .765rem; margin-top: 8px; }

  .projects { padding: 56px 0 32px; }
  .proj__grid { grid-template-columns: 1fr; gap: 18px; }
  .proj__banner { aspect-ratio: 16 / 8.4; }
  .proj__body { padding: 0 18px 20px; }
  .proj__mark { width: 54px; height: 54px; margin-top: -27px; margin-bottom: 13px; }
  .proj__names h3 { font-size: 1.22rem; }
  .proj__desc { font-size: .89rem; }
  .proj__tags { margin-top: 15px; }
  .proj__foot { padding-top: 20px; }
  .proj__foot .btn { width: 100%; height: 48px; }

  .explore { padding: 32px 0 48px; }

  .join { padding: 32px 0 64px; }
  .join__box { grid-template-columns: 1fr; min-height: 0; }
  .join__panel {
    border-right: 0;
    border-top: 1px solid var(--line);
    order: 2;
    padding: 24px 20px 26px;
  }
  .join__media { order: 1; aspect-ratio: 16 / 8; }
  .join__media::after {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 45%, var(--surface));
  }
  .join__title { font-size: clamp(1.45rem, 6vw, 1.9rem); margin-top: 12px; }
  .join__desc { max-width: none; font-size: .89rem; }
  .join__actions { margin-top: 20px; gap: 10px; }
  .join__actions .btn { width: 100%; height: 50px; }
  .join__actions .copy { width: 100%; justify-content: center; }
}

@media (max-width: 540px) {
  .hero { padding-top: 30px; }
  .deck__tab { justify-content: center; padding: 0; }
  .deck__tab span { display: none; }
  .deck__tab img { width: 26px; height: 26px; }
  .deck__txt b { font-size: 1rem; }
  .deck__go { width: 32px; height: 32px; }
  .stats__list li { padding-right: 14px; }
  .stats__list li:nth-child(2n) { padding-left: 14px; }
  .proj__tags span { font-size: .7rem; padding: 3px 8px; }
}

@media (max-width: 370px) {
  .stats__list { grid-template-columns: 1fr; }
  .stats__list li {
    border-right: 0;
    border-bottom: 1px solid var(--band-line);
    padding: 20px 0 18px !important;
  }
  .stats__list li:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .deck__card.is-out { animation: none; }
  .deck__tab.is-on .deck__bar b { animation: none; transform: scaleX(1); }
}
