/* ==========================================================================
   Modals & popups
   - About panel (full screen, inverted)
   - Service showcase (full screen carousel)
   - Info popup (zooms out of the tile that opened it):
       FAQ accordion · The reel · Workshop slider · The numbers
   All follow the grid's light/dark theme via [data-theme] on #modals.
   On phones every modal is a full-screen sheet with a reachable close button.
   ========================================================================== */

#modals {
  color: var(--text);
}

.modal-close {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top));
  right: clamp(12px, 2.4vw, 30px);
  z-index: 5;
}

/* ==== About ================================================================= */

.about {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: clamp(64px, 7vw, 90px) clamp(24px, 7vw, 90px);
  background: var(--text);
  color: var(--bg);
  text-align: center;
  animation: fadeIn .25s ease;
}

.about__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
}

.about__logo {
  width: auto;
  height: clamp(40px, 6vw, 72px);
  margin-bottom: 44px;
}

[data-theme="dark"] .about__logo {
  filter: invert(1);
}

.about__title {
  max-width: 40ch;
  font-weight: var(--fw-thin);
  font-size: clamp(26px, 4.4vw, 52px);
  line-height: 1.12;
  text-wrap: balance;
}

.about__body {
  max-width: 90ch;
  margin-top: 28px;
  font-weight: var(--fw-thin);
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.6;
  opacity: .6;
}

.about__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px clamp(18px, 4vw, 48px);
  margin-top: 48px;
  font-weight: var(--fw-thin);
  font-size: 11px;
  opacity: .75;
}

.about__links a:hover {
  opacity: .65;
}

/* ==== Service showcase ====================================================== */

.showcase {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: calc(clamp(28px, 5vw, 64px) + env(safe-area-inset-top)) clamp(20px, 5vw, 64px) clamp(28px, 5vw, 64px);
  background: var(--bg);
  color: var(--text);
  animation: scOpen .34s var(--ease-out);
}

.showcase.is-closing {
  animation: scClose .28s var(--ease-out) forwards;
}

.showcase__kicker {
  font-weight: var(--fw-thin);
  font-size: var(--fs-xs);
  letter-spacing: .14em;
  text-align: center;
  opacity: .5;
}

.showcase__tabs {
  position: relative;
  flex: none;
  height: clamp(96px, 16vh, 150px);
  margin-top: 6px;
  overflow: hidden;
  cursor: ew-resize;
  touch-action: pan-y;
}

/* Fade neighbours into the page at both edges */
.showcase__tabs::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: linear-gradient(90deg, var(--bg) 0%, transparent 26%, transparent 74%, var(--bg) 100%);
}

.showcase__tab {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: var(--z, 1);
  font-weight: var(--fw-thin);
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1;
  white-space: nowrap;
  opacity: var(--o, 1);
  filter: blur(var(--b, 0));
  transform: translate(-50%, -50%) translateX(var(--x, 0)) scale(var(--s, 1));
  transition: transform .34s var(--ease-out), opacity .34s, filter .34s;
}

.showcase__tab-dot {
  display: inline-block;
  width: .13em;
  height: .13em;
  margin-left: .08em;
  background: currentColor;
}

.showcase__body {
  flex: 1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  min-height: 0;
  margin-top: clamp(22px, 3vw, 38px);
  animation: popIn .42s var(--ease-out);
}

.showcase__media {
  width: 100%;
  height: 100%;
  min-height: 260px;
  overflow: hidden;
  background: var(--border);
}

.showcase__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase__text {
  max-width: 46ch;
  font-weight: var(--fw-thin);
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.6;
  opacity: .72;
}

@media (max-width: 779px) {
  .showcase__body {
    flex: none;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .showcase__media {
    height: clamp(220px, 52vh, 460px);
  }
}

/* ==== Info popup ============================================================ */

.info-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-info);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 4vw, 54px);
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .34s ease;
}

.info-scrim.is-open {
  opacity: 1;
}

.info-card {
  position: relative;
  width: min(720px, 100%);
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(24px, 4vw, 54px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 44px 120px rgba(0, 0, 0, .5);
  transform-origin: center center;
  transition: transform .5s var(--ease-out), opacity .32s ease;
}

.info-card--numbers {
  width: min(1180px, 100%);
  max-height: 90dvh;
  padding: clamp(22px, 3vw, 46px);
  border-color: rgba(255, 255, 255, .16);
  border-radius: 10px;
  background: var(--black);
  color: var(--white);
  box-shadow: 0 44px 130px rgba(0, 0, 0, .7);
}

/* Sticky close stays reachable while the card scrolls */
.info-card__close {
  position: sticky;
  top: -8px;
  z-index: 3;
  float: right;
  margin: -14px -14px 0 12px;
  opacity: .65;
}

.info-card__close:hover {
  opacity: 1;
}

.info__eyebrow {
  min-height: 1em;
  font-weight: var(--fw-regular);
  font-size: var(--fs-xs);
  letter-spacing: .2em;
  opacity: .5;
}

.info__title {
  margin-top: 14px;
  font-weight: var(--fw-thin);
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.04;
  text-wrap: balance;
}

.info__intro {
  max-width: 56ch;
  margin-top: 18px;
  font-weight: var(--fw-thin);
  font-size: clamp(15px, 1.7vw, 18px);
  line-height: 1.6;
  opacity: .68;
}

.info__rule {
  border-top: 2px solid currentColor;
}

/* -- FAQ accordion -- */
.acc {
  margin-top: 30px;
}

.acc__row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 4px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  transition: all .2s var(--ease-out);
}

.acc__row[aria-expanded="true"] {
  background: var(--text);
  color: var(--bg);
}

.acc__num {
  flex: none;
  width: 52px;
  font-size: 11px;
  letter-spacing: .08em;
  opacity: .55;
}

.acc__name {
  flex: 1;
  font-weight: var(--fw-thin);
  font-size: clamp(17px, 2vw, 20px);
}

.acc__sign {
  width: 24px;
  font-weight: var(--fw-thin);
  font-size: 22px;
  text-align: center;
}

.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .42s var(--ease-out);
}

.acc__panel.is-open {
  grid-template-rows: 1fr;
}

.acc__panel > div {
  overflow: hidden;
}

.acc__panel p {
  padding: 16px 4px 22px 72px;
  border-bottom: 1px solid var(--border);
  font-weight: var(--fw-thin);
  font-size: 15px;
  line-height: 1.55;
  opacity: .72;
}

/* -- Tabs (reel) -- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.tab {
  flex: none;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: var(--fw-thin);
  font-size: var(--fs-sm);
  letter-spacing: .04em;
  transition: all .2s var(--ease-out);
}

.tab.is-on {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.reel__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 26px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--border);
}

.reel__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel__projects {
  margin-top: 24px;
}

.reel__project {
  padding: 22px 2px;
  border-bottom: 1px solid var(--border);
}

.reel__name {
  font-weight: var(--fw-thin);
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.1;
}

.reel__note {
  margin-top: 12px;
  font-weight: var(--fw-thin);
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.15;
  text-wrap: balance;
}

.reel__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 11px 18px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-weight: var(--fw-regular);
  font-size: var(--fs-xs);
  letter-spacing: .14em;
  transition: opacity .2s;
}

.reel__link:hover {
  opacity: .62;
}

/* -- Workshop slider -- */
.ws-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 26px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #111;
}

.ws-slider > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease;
}

.ws-slider > img.is-active {
  opacity: 1;
}

.ws-slider__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 45%, rgba(0, 0, 0, .72));
}

.ws-slider__logo {
  position: absolute;
  left: clamp(14px, 3vw, 22px);
  bottom: clamp(14px, 3vw, 20px);
  width: auto;
  height: clamp(20px, 3vw, 34px);
  filter: invert(1) brightness(2);
}

.ws-slider__nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .42);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--white);
  transform: translateY(-50%);
}

.ws-slider__nav .chev {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}

.ws-slider__nav--prev { left: 14px; }
.ws-slider__nav--next { right: 14px; }

.ws-slider__dots {
  position: absolute;
  right: clamp(14px, 3vw, 22px);
  bottom: clamp(16px, 3vw, 24px);
  display: flex;
  align-items: center;
  gap: 7px;
}

.ws-slider__dots button {
  width: 8px;
  height: 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .5);
  transition: all .3s var(--ease-out);
}

.ws-slider__dots button.is-on {
  width: 26px;
  background: var(--white);
}

.ws-steps__title {
  margin-top: 28px;
  font-weight: var(--fw-regular);
  font-size: 10px;
  letter-spacing: .16em;
  opacity: .5;
}

.ws-steps {
  margin-top: 12px;
}

.ws-step {
  display: flex;
  align-items: baseline;
  gap: 22px;
  padding: 16px 2px;
  border-bottom: 1px solid var(--border);
}

.ws-step__num {
  flex: none;
  width: 34px;
  font-weight: var(--fw-regular);
  font-size: 11px;
  letter-spacing: .06em;
  opacity: .5;
}

.ws-step__name {
  font-weight: var(--fw-thin);
  font-size: clamp(16px, 1.9vw, 20px);
  line-height: 1.2;
}

.ws-step__note {
  margin-top: 5px;
  font-weight: var(--fw-thin);
  font-size: var(--fs-sm);
  line-height: 1.5;
  opacity: .6;
}

.info__footer {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-weight: var(--fw-thin);
  font-size: 14px;
  line-height: 1.6;
  opacity: .7;
}

/* -- The numbers -- */
.numbers__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 24px;
  padding-right: 40px;
}

.numbers__title {
  font-weight: var(--fw-thin);
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1;
}

.numbers__title .dot {
  font-size: 1.3em;
}

.numbers__modes {
  display: flex;
  gap: 8px;
  flex: 0 1 auto;
}

.numbers__mode {
  flex: 1;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 6px;
  font-weight: var(--fw-light);
  font-size: var(--fs-sm);
  letter-spacing: .02em;
  transition: all .2s var(--ease-out);
}

.numbers__mode.is-on {
  border-color: var(--white);
  background: var(--white);
  color: var(--black);
}

.numbers__chart {
  position: relative;
  margin-top: 28px;
}

.numbers__chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.numbers__chart path,
.numbers__chart circle,
.numbers__chart line {
  transition: d .55s var(--ease-out), cy .55s var(--ease-out), y1 .55s var(--ease-out);
}

.numbers__val,
.numbers__month {
  position: absolute;
  color: var(--white);
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: top .55s var(--ease-out);
}

.numbers__val {
  font-weight: var(--fw-thin);
  font-size: clamp(12px, 1.5vw, 21px);
  letter-spacing: .01em;
}

.numbers__month {
  font-weight: var(--fw-light);
  font-size: clamp(9px, 1vw, 11px);
  letter-spacing: .14em;
  opacity: .35;
}

.numbers__figures {
  display: flex;
  flex-wrap: wrap;
  gap: 20px clamp(28px, 6vw, 80px);
  margin-top: 32px;
}

.numbers__figure-label {
  font-weight: var(--fw-regular);
  font-size: 10px;
  letter-spacing: .16em;
  opacity: .4;
}

.numbers__figure-value {
  margin-top: 6px;
  font-weight: var(--fw-thin);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
}

/* ---- Phones: info popup becomes a full-height sheet ----------------------- */

@media (max-width: 559px) {
  .info-scrim {
    align-items: flex-end;
    padding: 0;
  }

  .info-card,
  .info-card--numbers {
    width: 100%;
    max-height: 92dvh;
    padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
  }

  .acc__panel p {
    padding-left: 12px;
  }

  .acc__num {
    width: 36px;
  }

  .numbers__head {
    padding-right: 0;
  }

  .numbers__modes {
    width: 100%;
  }

  .numbers__mode {
    padding: 12px 4px;
    font-size: var(--fs-xs);
  }
}
