/* =========================================================
   Quantic · Inner pages
   Page hero, filters and the Work grid.
   ========================================================= */

/* ---------- Page hero ---------- */
.page-hero { padding-block: clamp(56px, 2rem + 6vw, 120px) clamp(40px, 1rem + 4vw, 72px); }
.page-hero__title {
  margin-top: 20px;
  font-size: clamp(3rem, 1.6rem + 4.8vw, 5.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.page-hero__lead {
  max-width: 40rem;
  margin-top: 28px;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--text-muted);
}

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 44px; }
.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.filter__count { font-size: 13px; opacity: 0.5; font-variant-numeric: tabular-nums; }
.filter:hover { border-color: var(--red); color: var(--red); }
.filter.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- Work grid ---------- */
.work-list { padding-bottom: var(--section-pad); }
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px 24px;
}
.work-item--wide { grid-column: 1 / -1; }
.work-item.is-hidden { display: none; }
.work-grid.is-filtered .work-item--wide { grid-column: auto; }

/* entering animation when the filter changes */
.work-item.is-entering { animation: work-in 600ms var(--ease) both; animation-delay: calc(var(--d, 0) * 60ms); }
@keyframes work-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } }

.work-card { --mx: 60%; --my: 50%; display: block; }
.work-card__stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 588 / 420;
  padding: 36px;
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
  background: var(--red-deep);
  color: #FFFBF5;
}
.work-card__stage::before {          /* grid + light following the mouse */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(420px circle at var(--mx) var(--my), rgba(225, 38, 44, 0.65), transparent 60%),
    linear-gradient(to right, rgba(225, 38, 44, 0.26) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size),
    linear-gradient(to bottom, rgba(225, 38, 44, 0.26) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size);
}
.work-card__img {
  width: auto;
  height: auto;
  max-width: 88%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 34px 50px rgba(10, 0, 2, 0.5));
  transform: translate3d(var(--dx, 0), var(--dy, 0), 0);
  transition: transform 700ms var(--ease);
}
.work-card:hover .work-card__img { transform: translate3d(var(--dx, 0), calc(var(--dy, 0px) - 10px), 0) scale(1.04); }
.work-card__count {
  position: absolute;
  top: 22px; left: 26px;
  font-size: 15px;
  font-weight: 500;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.work-card__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding-top: 24px;
}
.work-card__name {
  font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  transition: color var(--t-base) var(--ease);
}
.work-card__label { margin-top: 6px; font-size: var(--fs-small); font-weight: 500; color: var(--red); }
.work-card__platforms { font-size: var(--fs-small); color: var(--text-soft); text-align: right; }
.work-card:hover .work-card__name { color: var(--red); }

/* compact name row for wide cards: only shown while a filter is active */
.work-card__meta--compact { display: none; }
.work-grid.is-filtered .work-card__meta--compact { display: grid; }

/* wide card: info on the left, mockup on the right, all on the red stage */
.work-card--wide .work-card__stage {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  place-items: center stretch;
  aspect-ratio: auto;
  min-height: 560px;
  padding: 0;
}
.work-card--wide .work-card__info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(28px, 4vw, 56px);
}
.work-card--wide .work-card__count { top: clamp(24px, 3vw, 44px); left: clamp(28px, 4vw, 56px); }
.work-card--wide .work-card__label { color: rgba(255, 251, 245, 0.75); font-size: var(--fs-body); }
.work-card--wide .work-card__name { font-size: clamp(3rem, 2rem + 3.2vw, 5rem); letter-spacing: -0.04em; line-height: 1; }
.work-card--wide:hover .work-card__name { color: #FFFBF5; }
.work-card--wide .work-card__desc { max-width: 25rem; font-size: var(--fs-lead); line-height: 1.5; opacity: 0.82; }
.work-card--wide .work-card__platforms { text-align: left; color: rgba(255, 251, 245, 0.6); }
.work-card--wide .work-card__img { justify-self: center; max-width: 92%; max-height: 480px; }

/* when a filter is active every card has the same size */
.work-grid.is-filtered .work-card--wide .work-card__stage { grid-template-columns: 1fr; min-height: 0; aspect-ratio: 588 / 420; padding: 36px; }
.work-grid.is-filtered .work-card--wide .work-card__info { display: none; }

.work-empty { padding: 64px 0; color: var(--text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .work-card--wide .work-card__stage { grid-template-columns: 1fr; min-height: 0; }
  .work-card--wide .work-card__img { order: -1; max-height: 340px; margin-top: 56px; }
  .work-card--wide .work-card__info { padding: 24px 28px 32px; }
  .work-card__meta { grid-template-columns: 1fr; gap: 8px; }
  .work-card__platforms { text-align: left; }
}

@media (max-width: 768px) {
  .work-grid { grid-template-columns: 1fr; gap: 40px; }
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .work-card__stage { padding: 28px; }
  .work-card--wide .work-card__img { max-height: 260px; }
}

/* =========================================================
   About page
   ========================================================= */
.about-hero .page-hero__title { max-width: 14ch; }

/* wide photo with a red edge; it zooms slightly as you scroll (JS sets --zoom) */
.about-photo {
  position: relative;
  width: min(100% - 2 * var(--gutter), 1440px);
  margin-inline: auto;
  height: clamp(280px, 42vw, 560px);
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
  background: var(--red-deep);
}
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 16%;   /* keep the developer and the screen in frame */
  transform: scale(var(--zoom, 1.12));
  transform-origin: 40% 16%;
  transition: transform 200ms linear;
}
.about-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, rgba(40, 4, 6, 0.85), rgba(40, 4, 6, 0.35) 40%, transparent 65%);
}
.about-photo__caption {
  position: absolute;
  right: clamp(20px, 4vw, 56px);     /* the free (right) side of the photo */
  bottom: clamp(20px, 4vw, 48px);
  z-index: 1;
  display: grid;
  justify-items: end;
  text-align: right;
  gap: 4px;
  color: #FFFBF5;
}
.about-photo__caption span:first-child { font-size: clamp(2.5rem, 1.6rem + 3vw, 4.5rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.about-photo__caption span:last-child { font-size: var(--fs-body); opacity: 0.85; }

/* story */
.about-story__inner { display: grid; grid-template-columns: 360px minmax(0, 1fr); }
.about-story__title {
  font-size: var(--fs-statement);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.02em;
}
.about-story__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-top: 40px;
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--text-muted);
}
.stats--boxed { border-top: 1px solid var(--line); }

/* vision & mission */
.vm__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: clamp(40px, 5vw, 64px);
}
.vm-card {
  --mx: 50%; --my: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 460px;
  padding: clamp(28px, 4vw, 56px);
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
}
.vm-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(420px circle at var(--mx) var(--my), rgba(225, 38, 44, 0.22), transparent 65%),
    linear-gradient(to right, rgba(225, 38, 44, 0.14) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size),
    linear-gradient(to bottom, rgba(225, 38, 44, 0.14) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size);
}
.vm-card--vision { background: var(--surface); border: 1px solid var(--line); }
.vm-card--mission { background: var(--red-deep); color: #FFFBF5; }
.vm-card--mission::before {
  background:
    radial-gradient(420px circle at var(--mx) var(--my), rgba(225, 38, 44, 0.7), transparent 65%),
    linear-gradient(to right, rgba(225, 38, 44, 0.28) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size),
    linear-gradient(to bottom, rgba(225, 38, 44, 0.28) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size);
}
.vm-card__tag {
  align-self: flex-start;
  padding: 6px 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--red);
}
.vm-card--mission .vm-card__tag { color: #FFFBF5; opacity: 0.85; }
.vm-card__lead {
  margin-top: auto;
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.02em;
}
.vm-card__text { font-size: var(--fs-body); line-height: 1.55; opacity: 0.78; }

/* values: cards fill red from the bottom on hover */
.values__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
}
.value-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 320px;
  padding: 32px 28px;
  border-left: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  transition: color var(--t-slow) var(--ease);
}
.value-card:first-child { border-left: 0; }
.value-card__fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--red);
  clip-path: inset(100% 0 0 0);
  transition: clip-path 500ms var(--ease);
}
.value-card__no { font-size: var(--fs-body); font-weight: 500; color: var(--red); transition: color var(--t-slow) var(--ease); }
.value-card__name {
  margin-top: auto;
  font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  transition: transform var(--t-slow) var(--ease);
}
.value-card__desc { color: var(--text-muted); transition: color var(--t-slow) var(--ease); }
.value-card:hover { color: var(--on-red); }
.value-card:hover .value-card__fill { clip-path: inset(0 0 0 0); }
.value-card:hover .value-card__no,
.value-card:hover .value-card__desc { color: rgba(255, 251, 245, 0.9); }
.value-card:hover .value-card__name { transform: translateY(-6px); }

@media (max-width: 1024px) {
  .about-story__inner { grid-template-columns: 1fr; gap: 24px; }
  .vm__grid { grid-template-columns: 1fr; }
  .vm-card { min-height: 360px; }
  .values__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .value-card:nth-child(3) { border-left: 0; }
  .value-card:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .value-card { min-height: 260px; }
}
@media (max-width: 768px) {
  .about-story__cols { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 480px) {
  .values__grid { grid-template-columns: 1fr; }
  .value-card { border-left: 0; min-height: 0; padding: 28px 4px; }
  .value-card:nth-child(n + 2) { border-top: 1px solid var(--line); }
  .value-card__name { margin-top: 12px; }
  .about-photo { border-radius: 0; width: 100%; height: 340px; }
  .about-photo img { object-position: 30% 16%; transform-origin: 30% 16%; }
  .about-photo::after { background: linear-gradient(0deg, rgba(40, 4, 6, 0.9), transparent 60%); }
  .about-photo__caption { left: 20px; right: 20px; }
}

/* compact row of a wide card uses the normal (non-stage) colors */
.work-card--wide .work-card__meta--compact .work-card__name,
.work-card--wide:hover .work-card__meta--compact .work-card__name { color: var(--text); font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem); letter-spacing: -0.02em; line-height: 1.1; }
.work-card--wide:hover .work-card__meta--compact .work-card__name { color: var(--red); }
.work-card--wide .work-card__meta--compact .work-card__label { color: var(--red); font-size: var(--fs-small); }
.work-card--wide .work-card__meta--compact .work-card__platforms { color: var(--text-soft); text-align: right; }
@media (max-width: 1024px) { .work-card--wide .work-card__meta--compact .work-card__platforms { text-align: left; } }

/* =========================================================
   Services page
   ========================================================= */
.svc-list { padding-bottom: var(--section-pad); }
.svc-list__inner {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 80px;
  padding-top: 56px;
  border-top: 2px solid var(--red);
}

/* sticky index that follows the scroll */
.svc-index { position: sticky; top: calc(var(--header-h) + 40px); align-self: start; }
.svc-index__title { font-size: var(--fs-xs); font-weight: 500; color: var(--text-soft); margin-bottom: 16px; }
.svc-index__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 0 11px 30px;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-soft);
  transition: color var(--t-base) var(--ease), padding var(--t-slow) var(--ease);
}
.svc-index__link::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 16px; height: 2px;
  background: currentColor;
  opacity: 0.4;
  transition: width var(--t-slow) var(--ease), background-color var(--t-base) var(--ease), opacity var(--t-base) var(--ease);
}
.svc-index__no { font-variant-numeric: tabular-nums; }
.svc-index__link:hover { color: var(--text); }
.svc-index__link.is-active { color: var(--text); font-weight: 600; padding-left: 46px; }
.svc-index__link.is-active::before { width: 32px; background: var(--red); opacity: 1; }

/* service blocks */
.svc {
  position: relative;
  padding-bottom: 96px;
  margin-bottom: 96px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 40px);
}
.svc:last-child { margin-bottom: 0; border-bottom: 0; padding-bottom: 0; }
.svc__no {
  display: block;
  font-size: clamp(5rem, 3rem + 5vw, 7.5rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: color-mix(in srgb, var(--text) 8%, transparent);
  transition: color 500ms var(--ease), transform 500ms var(--ease);
}
.svc:hover .svc__no,
.svc.is-current .svc__no { color: var(--red); }
.svc:hover .svc__no { transform: translateX(8px); }
.svc__title {
  margin-top: 32px;
  max-width: 20ch;
  font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.svc__desc { max-width: 45rem; margin-top: 20px; font-size: var(--fs-lead); line-height: 1.6; color: var(--text-muted); }
.svc__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.svc__tags li {
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--red) 50%, transparent);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--red);
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.svc__tags li:hover { background: var(--red); color: var(--on-red); }
.svc__link { margin-top: 32px; }

@media (max-width: 1024px) {
  .svc-list__inner { grid-template-columns: 1fr; gap: 0; padding-top: 0; border-top: 0; }
  /* index becomes a sticky row of chips under the header */
  .svc-index {
    top: var(--header-h);
    z-index: 5;
    margin-inline: calc(-1 * var(--gutter));
    padding: 12px var(--gutter);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 2px solid var(--red);
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .svc-index::-webkit-scrollbar { display: none; }
  .svc-index__title { display: none; }
  .svc-index ol { display: flex; gap: 8px; width: max-content; }
  .svc-index__link,
  .svc-index__link.is-active { padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 14px; white-space: nowrap; }
  .svc-index__link::before { display: none; }
  .svc-index__link.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
  .svc { scroll-margin-top: calc(var(--header-h) + 80px); padding-bottom: 64px; margin-bottom: 64px; }
  .svc-list__items { padding-top: 48px; }
}

