/* Brain Up Studio - faithful rebuild of the old WordPress/Elementor site.
   Values (colours, sizes, spacing) measured on www.brainup-studio.com, see
   docs/audit-site-actuel.md. */

:root {
  --bg: #19181d;
  --bg-footer: #000;
  --header-bg: rgba(8, 8, 11, 0.5);
  --header-socials-bg: #312439;
  --text: #fff;
  --text-soft: #f9fefe;
  --text-muted: #9c9c9c;
  --accent: #b73f61;
  --link: #cc3366;
  --accent-type: #b83c6b;
  --text-beige: #cfc9c0;
  --divider: rgba(255, 255, 255, 0.6);

  --font-heading: 'Roboto', Arial, sans-serif;
  --font-body: 'Manjari', 'Roboto', Arial, sans-serif;
  --font-nav: 'Cabin', Arial, sans-serif;

  --header-h: 76px;
  --container: 1300px;
  --gutter: 20px;

  /* Fluid title sizes: the old desktop size on wide screens, scaling down
     smoothly on smaller ones instead of jumping at breakpoints. */
  --fs-title: clamp(26px, 1.2rem + 1.4vw, 35px);
  --fs-display: clamp(30px, 1.2rem + 2.4vw, 45px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text-soft);
  font-family: var(--font-heading);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

main {
  flex: 1;
  padding-top: var(--header-h);
  padding-bottom: 109px;
}

body[data-page="index"] main {
  padding-top: 0;
  padding-bottom: 0;
}

body[data-page="contact"] main {
  padding-bottom: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.wrap,
.block {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.block + .block {
  margin-top: 40px;
}

/* Per-block spacing from the JSON ("space": [top, bottom]) - measured on
   the old desktop layout, so capped on small screens (see media query). */
.block.has-space {
  margin-top: var(--space-top) !important;
  margin-bottom: var(--space-bottom) !important;
}

/* Entrance animations ("reveal" in the JSON, see js/blocks.js): hidden until
   in view, then a short, soft fade / rise. Same placement as the old site's
   Elementor animations, but shorter and subtler (the old ones ran 1.25s and
   moved by the element's full height). Hidden with opacity, not visibility:
   visibility:hidden would stop lazy images from loading before the reveal. */
:root {
  --reveal-duration: 0.8s;
  --reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --reveal-stagger: 60ms;
}

.reveal:not(.is-revealed):not(.reveal-stagger),
.reveal-stagger:not(.is-revealed) .reveal-item {
  opacity: 0;
}

.reveal.is-revealed {
  animation-duration: var(--reveal-duration);
  animation-timing-function: var(--reveal-ease);
  animation-fill-mode: both;
}

/* Items of a "stagger" block come in one after another (--i set in JS),
   capped so a long grid doesn't take ages. */
.reveal-stagger.is-revealed .reveal-item {
  animation: reveal-fade-up var(--reveal-duration) var(--reveal-ease) both;
  animation-delay: calc(min(var(--i, 0), 12) * var(--reveal-stagger));
}

.reveal-fade.is-revealed {
  animation-name: reveal-fade;
}

.reveal-fade-up.is-revealed {
  animation-name: reveal-fade-up;
}

.reveal-slide-up.is-revealed {
  animation-name: reveal-slide-up;
}

@keyframes reveal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes reveal-fade-up {
  from { opacity: 0; transform: translate3d(0, 40px, 0); }
  to { opacity: 1; transform: none; }
}

@keyframes reveal-slide-up {
  from { opacity: 0; transform: translate3d(0, 80px, 0); }
  to { opacity: 1; transform: none; }
}

/* Page transitions: a short cross-fade between pages of the site (View
   Transitions API; browsers without it just change page as before). The
   header is its own layer so it stays put instead of fading. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
  animation-timing-function: ease;
}

.site-header {
  view-transition-name: site-header;
}

@media (prefers-reduced-motion: reduce) {
  .reveal:not(.is-revealed):not(.reveal-stagger),
  .reveal-stagger:not(.is-revealed) .reveal-item {
    opacity: 1;
  }

  .reveal.is-revealed,
  .reveal-stagger.is-revealed .reveal-item {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Slow bounce inviting to scroll ("bounce": true on an image block). */
.block-image.is-bouncing img {
  animation: bounce 2.4s ease-in-out infinite;
}

@keyframes bounce {
  0%, 60%, 100% { transform: none; }
  30% { transform: translateY(10px); }
}

.page-error {
  padding: 120px 0;
  text-align: center;
}

.align-left { text-align: left; }
.align-right { text-align: right; }
.align-center { text-align: center; }

/* ---------- Icons (Font Awesome Free brand SVGs, used as masks so they take currentColor) ---------- */

.icon {
  display: inline-block;
  width: 25px;
  height: 25px;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.icon-instagram { --icon: url('../assets/icons/instagram.svg'); }
.icon-facebook { --icon: url('../assets/icons/facebook.svg'); }
.icon-linkedin { --icon: url('../assets/icons/linkedin.svg'); }

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  color: #fff;
  transition: opacity 0.2s;
}

.social-link:hover {
  opacity: 0.7;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  transition: background 0.4s, box-shadow 0.4s, backdrop-filter 0.4s;
}

.site-header.is-scrolled {
  background: rgba(12, 11, 16, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.site-header.is-scrolled .header-logo img {
  transform: scale(0.88);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 0 0 10px;
}

.header-logo img {
  width: 150px;
  height: auto;
  transform-origin: left center;
  transition: transform 0.4s var(--reveal-ease);
}

.main-nav {
  display: flex;
  margin-left: auto;
  margin-right: 11px;
}

.nav-link {
  position: relative;
  display: block;
  padding: 26px 16px 25px;
  font-family: var(--font-nav);
  font-size: 16px;
  font-weight: 600;
  line-height: 25px;
  text-transform: uppercase;
  color: var(--text-soft);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: #fff;
  transform: scaleX(0);
  transition: transform 0.3s;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

.header-socials {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 100%;
  padding: 0 23px 0 22px;
  background: var(--header-socials-bg);
}

.nav-toggle {
  display: none;
}

/* ---------- Footer ---------- */

.site-footer {
  font-family: var(--font-body);
  color: var(--text-soft);
}

.footer-contact {
  background: var(--bg-footer);
  padding: 30px 0 54px;
}

.footer-title {
  margin-bottom: 30px;
  font-family: var(--font-nav);
  font-size: 20px;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
  color: #fff;
}

/* Address ends just left of the page centre, email starts just right of it,
   logo pinned to the left edge - same as the old footer. */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
  align-items: start;
}

.footer-logo {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  margin-top: 14px;
  padding-left: 10px;
}

.footer-address {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.footer-email {
  grid-column: 2;
  grid-row: 1;
}

.footer-logo img {
  width: 183px;
}

.footer-address {
  text-align: right;
}

.footer-address,
.footer-email {
  font-size: 16px;
  line-height: 24px;
}

.footer-grid strong {
  font-weight: 700;
}

.footer-email a {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--link);
}

.footer-bottom {
  padding: 40px 20px 24px;
  text-align: center;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 20px;
}

.footer-copyright {
  font-size: 18px;
  line-height: 27px;
}

.footer-sep {
  margin: 0 10px;
  opacity: 0.5;
}

.footer-legal {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-legal:hover {
  color: #fff;
}

/* ---------- Slider (home hero) ---------- */

.block-slider {
  position: relative;
  max-width: none;
  padding: 0;
  overflow: hidden;
  background: #000;
  touch-action: pan-y; /* horizontal swipes go to the slider (js/blocks.js) */
}

.slider-track {
  position: relative;
  height: 100%;
}

.slider-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}

.slider-slide.is-active {
  z-index: 1;
  opacity: 1;
}

/* Slow zoom over the slide's whole time on screen, fade-out included. */
.is-autoplay .slider-slide.is-active,
.is-autoplay .slider-slide.is-leaving {
  animation: ken-burns calc(var(--interval) + 1.2s) linear both;
}

@keyframes ken-burns {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}

/* Progress bars: the active one fills over the interval, and the end of that
   fill moves to the next slide. Hover, keyboard focus or the pause button
   freeze it. */
.slider-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  /* Keeps the white controls readable on light slides (Maiko). */
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.slider-dot {
  width: 56px;
  padding: 10px 0;
}

.slider-dot span {
  position: relative;
  display: block;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.35);
}

.slider-dot span::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
}

.slider-dot.is-active span::after {
  transform: scaleX(1);
}

.is-autoplay .slider-dot.is-active span::after {
  animation: slider-progress var(--interval) linear both;
}

@keyframes slider-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.slider-dot:hover span {
  background: rgba(255, 255, 255, 0.6);
}

.block-slider:hover .slider-dot span::after,
.block-slider:focus-within .slider-dot span::after,
.block-slider.is-paused .slider-dot span::after,
.block-slider:hover .slider-slide,
.block-slider:focus-within .slider-slide,
.block-slider.is-paused .slider-slide {
  animation-play-state: paused;
}

.slider-pause {
  position: relative;
  width: 28px;
  height: 28px;
  margin-left: 8px;
  opacity: 0.8;
}

.slider-pause:hover {
  opacity: 1;
}

/* Two bars = pause; a triangle = play once paused. */
.slider-pause::before,
.slider-pause::after {
  content: '';
  position: absolute;
  top: 8px;
  width: 3px;
  height: 12px;
  background: #fff;
}

.slider-pause::before { left: 9px; }
.slider-pause::after { left: 16px; }

.is-paused .slider-pause::before {
  left: 10px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #fff;
  background: none;
}

.is-paused .slider-pause::after {
  display: none;
}

.slider-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  background: center / contain no-repeat;
  opacity: 0.8;
}

.slider-arrow:hover {
  opacity: 1;
}

.slider-prev {
  left: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M11.43 15.99L22.69 5.71a1 1 0 0 0-1.42-1.42L9.29 15.23c-.21.21-.3.49-.29.76-.01.28.08.56.28.77l11.98 10.94a1 1 0 0 0 1.42-1.42z' fill='%23fff'/%3E%3C/svg%3E");
}

.slider-next {
  right: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M10.72 4.29a1 1 0 0 0-1.43 1.42l11.29 10.28L9.29 26.28a1 1 0 0 0 1.43 1.42l12-10.94c.21-.21.3-.49.29-.77.01-.27-.08-.55-.29-.76z' fill='%23fff'/%3E%3C/svg%3E");
}

/* ---------- Banner (page header image) ---------- */

.block-banner {
  max-width: none;
  padding: 0;
  height: 332px;
  overflow: hidden;
}

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

.block-banner + .block {
  margin-top: 70px;
}

.heading-page {
  font-size: 24px;
  font-weight: 600;
  line-height: 24px;
  text-transform: uppercase;
}

.block-heading + .block-project-grid {
  margin-top: 70px;
}

.block-heading + .block-project-grid.grid-games {
  margin-top: 80px;
  margin-bottom: 20px;
}

/* ---------- Heading / text / image / divider ---------- */

.block-heading h1,
.block-heading h2,
.block-heading h3,
.block-heading h4 {
  font-family: var(--font-heading);
  color: #fff;
}

.heading-section {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
}

.heading-sub {
  font-size: 18px;
  font-weight: 500;
  line-height: 18px;
  text-transform: uppercase;
}

.block-credits + .block-heading {
  margin-top: 44px;
}

.block-heading + .block-gallery,
.block-heading + .block-video {
  margin-top: 80px;
}

.block-heading .heading-accent {
  font-size: 24px;
  font-weight: 300;
  line-height: 30px;
  color: var(--accent-type);
}

.block-heading .heading-title {
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: 1.17;
  color: var(--accent-type);
}

.block-heading .heading-display {
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: 1;
  color: var(--text-beige);
}

.block-heading .heading-gallery {
  font-size: 24px;
  font-weight: 600;
  line-height: 24px;
  text-transform: uppercase;
  color: var(--text-beige);
}

.heading-display .accent {
  color: var(--accent-type);
}

.heading-display .small {
  font-size: 0.67em;
}

.block-text.text-large {
  padding: 0 40px;
  font-size: 20px;
  font-weight: 500;
}

.text-beige {
  color: var(--text-beige);
}

.block-text {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
}

.block-text.align-center {
  max-width: 1170px;
}

.block-text p + p {
  margin-top: 14px;
}

.block-text a {
  font-weight: 600;
  color: var(--link);
}

.block-text a:hover {
  text-decoration: underline;
}

.contact-note {
  font-size: 14px;
  color: var(--text-muted);
}

.text-intro,
.text-roboto {
  font-family: var(--font-heading);
  color: #fff;
}

.text-legal {
  font-family: var(--font-body);
}

.text-legal h2 {
  margin: 40px 0 12px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  color: #fff;
}

.text-legal h2:first-child {
  margin-top: 0;
}

.text-legal p + p {
  margin-top: 12px;
}

.text-legal a {
  color: var(--link);
}

.text-intro h5 {
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
}

.block-image {
  display: block;
}

.block-image.align-center img {
  margin: 0 auto;
}

.block-image.align-right img {
  margin-left: auto;
}

.block-image.has-shadow img {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

.block-image.is-zoomable {
  cursor: zoom-in;
}

.block-divider {
  width: 260px;
  max-width: 260px;
  height: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--divider);
}

.block.block-divider {
  margin-top: 88px;
  margin-bottom: 35px;
  border-top-color: #fff;
}

.block-divider + .block {
  margin-top: 0;
}

.block-divider.align-left {
  margin-left: 0;
}

.block-heading .heading-contact {
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.block-heading .heading-contact-sub {
  font-size: 24px;
  font-weight: 600;
  line-height: 24px;
}

/* ---------- Feature (home: alternating image / text) ---------- */

.block-feature {
  max-width: none;
  padding: 0;
  margin-top: 50px;
}

.feature-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0;
}

.feature-text {
  padding: 0 50px;
}

.image-right .feature-text {
  text-align: right;
}

.image-left .feature-text {
  order: 2;
}

.image-left .feature-media {
  order: 1;
}

/* Shadow on the frame, not the image: the frame clips the hover zoom. */
.feature-media {
  display: block;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.45);
}

.feature-media img {
  width: 100%;
  transition: transform 0.6s var(--reveal-ease);
}

.feature-media:hover img {
  transform: scale(1.03);
}

.feature-label {
  margin-bottom: 25px;
  font-size: 24px;
  font-weight: 600;
  line-height: 24px;
  text-transform: uppercase;
  color: var(--accent);
}

.feature-title {
  margin-bottom: 20px;
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: 1.1;
  text-transform: uppercase;
  color: #fff;
}

.feature-body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
}

.feature-note {
  margin-top: 36px;
  font-size: 16px;
  line-height: 24px;
  color: var(--accent);
}

.feature-link {
  display: inline-block;
  margin: 44px 42px 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 21px;
  text-transform: uppercase;
  color: var(--text-muted);
  /* Underline drawn from the left on hover, arrow nudged forward. */
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: color 0.2s, background-size 0.35s var(--reveal-ease);
}

.feature-link::after {
  content: '\2192';
  display: inline-block;
  margin-left: 8px;
  transition: transform 0.35s var(--reveal-ease);
}

.feature-link:hover,
.feature-link:focus-visible {
  color: #fff;
  background-size: 100% 1px;
}

.feature-link:hover::after,
.feature-link:focus-visible::after {
  transform: translateX(5px);
}

/* ---------- Video ---------- */

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.45);
}

.video-frame iframe,
.video-poster,
.video-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-poster img {
  object-fit: cover;
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  transition: background 0.2s, transform 0.2s;
}

.video-play::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 16px 0 16px 26px;
  border-color: transparent transparent transparent #fff;
}

.video-poster:hover .video-play {
  background: rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%) scale(1.08);
}

/* ---------- Credits ---------- */

.block-credits {
  font-family: var(--font-body);
  text-align: center;
}

.credits-title {
  margin-bottom: 83px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 500;
  line-height: 18px;
  text-transform: uppercase;
  color: #fff;
}

/* Three columns hugging the centre: right-aligned, centred, left-aligned. */
.credits-grid {
  display: grid;
  grid-template-columns: repeat(3, 250px);
  justify-content: center;
  gap: 58px 102px;
}

.credit:nth-child(3n + 1) { text-align: right; }
.credit:nth-child(3n + 2) { text-align: center; }
.credit:nth-child(3n) { text-align: left; }

.credit-role {
  margin-bottom: 17px;
  font-size: 16px;
  font-weight: 700;
  line-height: 19px;
  color: var(--text-soft);
}

.credit-names {
  font-size: 16px;
  line-height: 24px;
}

/* ---------- Gallery ---------- */

.block-gallery {
  display: grid;
  grid-template-columns: repeat(var(--columns, 4), 1fr);
  gap: 20px;
  padding-left: 10px;
  padding-right: 10px;
}

.gallery-item {
  display: block;
  aspect-ratio: var(--ratio, 305 / 172);
  overflow: hidden;
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}

.lightbox[hidden] {
  display: none;
}

.lightbox:not([hidden]) {
  animation: reveal-fade 0.25s ease both;
  touch-action: none; /* swipes go to the lightbox (js/blocks.js) */
}

.lightbox.is-closing {
  animation: lightbox-out 0.2s ease both;
}

@keyframes lightbox-out {
  to { opacity: 0; }
}

.lightbox img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  animation: lightbox-image 0.4s var(--reveal-ease) both;
}

@keyframes lightbox-image {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

.lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  font-size: 48px;
  line-height: 1;
  color: #fff;
  opacity: 0.8;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-close { top: 16px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); font-size: 64px; }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); font-size: 64px; }

/* ---------- Project grid (Animations / Games) ---------- */

.grid-filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.grid-filter {
  height: 35px;
  padding: 6px 15px;
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  color: #fff;
}

.grid-filter.is-active,
.grid-filter:hover {
  background: #333;
}

.grid-items {
  display: grid;
  grid-template-columns: repeat(var(--columns, 3), 1fr);
  gap: 20px;
  max-width: 1260px;
  margin: 0 auto;
}

.grid-games .grid-items {
  max-width: 1062px;
}

.project-card {
  position: relative;
  display: block;
  aspect-ratio: 407 / 300;
  overflow: hidden;
  background: #000;
}

.grid-games .project-card {
  aspect-ratio: 16 / 9;
}

.project-card[hidden] {
  display: none;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.54);
  opacity: 0;
  transition: opacity 0.3s;
}

.card-title {
  font-size: 22px;
  font-weight: 600;
  line-height: 30px;
  text-transform: uppercase;
  color: #fff;
}

.card-type {
  font-size: 18px;
  font-weight: 300;
  line-height: 30px;
  color: #fff;
}

.project-card:hover .card-overlay,
.project-card:focus-visible .card-overlay {
  opacity: 1;
}

.project-card:hover img {
  transform: scale(1.05);
}

/* Title and type rise into place as the overlay fades in. */
.card-title,
.card-type {
  transform: translateY(14px);
  transition: transform 0.45s var(--reveal-ease);
}

.card-type {
  transition-delay: 40ms;
}

.project-card:hover .card-title,
.project-card:hover .card-type,
.project-card:focus-visible .card-title,
.project-card:focus-visible .card-type {
  transform: none;
}

/* Touch screens have no hover: keep the title visible at the bottom of the
   thumbnail, on a dark gradient. */
@media (hover: none) {
  .card-overlay {
    justify-content: flex-end;
    gap: 0;
    padding: 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 60%);
    opacity: 1;
  }

  .card-title,
  .card-type {
    transform: none;
  }

  .card-title {
    font-size: 18px;
    line-height: 24px;
  }

  .card-type {
    font-size: 14px;
    line-height: 20px;
  }
}

/* ---------- Team (about) ---------- */

.block.block-team {
  padding-left: 10px;
  padding-right: 10px;
}

.block-team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 630px));
  justify-content: center;
  gap: 20px;
  text-align: center;
}

.team-photo {
  width: 300px;
  margin: 0 auto 20px;
}

.team-name {
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: 600;
  line-height: 24px;
  color: #fff;
}

.team-bio {
  font-family: var(--font-body);
  line-height: 24px;
  text-align: justify;
}

.team-bio p + p {
  margin-top: 14px;
}

/* ---------- Row ---------- */

.block-row {
  display: grid;
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  grid-auto-flow: column;
  gap: 40px;
}

.block-row.valign-center { align-items: center; }
.block-row.valign-top { align-items: start; }

.row-cell > .block {
  max-width: none;
  padding: 0;
}

.row-cell > .block + .block {
  margin-top: 20px;
}

/* ---------- Section (full-width band with background) ---------- */

.block.block-section {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.block-section {
  padding-top: var(--pad-top, 0);
  padding-bottom: var(--pad-bottom, 0);
}

.block-section > .block:first-child {
  margin-top: 0;
}

.block-section > .block-video {
  padding-left: 0;
  padding-right: 0;
}

/* ---------- Project nav (previous / next project) ---------- */

.block.block-project-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 1062px;
  margin-top: 110px;
}

.project-nav-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: #000;
}

.project-nav-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  transition: opacity 0.4s, transform 0.6s var(--reveal-ease);
}

.project-nav-link:hover img,
.project-nav-link:focus-visible img {
  opacity: 0.7;
  transform: scale(1.04);
}

/* Dark gradient on the text side, so the title stays readable on light
   thumbnails. */
.project-nav-link::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.1) 75%);
}

.project-nav-link.is-next::after {
  background: linear-gradient(to left, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.1) 75%);
}

.project-nav-text {
  position: absolute;
  z-index: 1;
  inset: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 0 28px;
}

.is-next .project-nav-text {
  align-items: flex-end;
  text-align: right;
}

.project-nav-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.is-prev .project-nav-label::before { content: '\2190  '; }
.is-next .project-nav-label::after { content: '  \2192'; }

.project-nav-title {
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  color: #fff;
}

/* ---------- Project page ---------- */

.project-hero {
  max-width: var(--container);
  margin: 54px auto 0;
}

.project-hero > .block {
  max-width: none;
  padding: 0;
}

.project-head {
  margin-top: 70px;
  text-align: center;
}

.project-title {
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: 1.1;
  text-transform: uppercase;
  color: #fff;
}

.project-type {
  margin-top: 20px;
  font-size: 24px;
  font-weight: 300;
  line-height: 30px;
  color: var(--accent-type);
}

.project-body > .block:first-child {
  margin-top: 70px;
}

.project-body > .block-video {
  max-width: var(--container);
  padding: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    margin: 0;
    background: #08080b;
    display: none;
  }

  .site-header.is-open .main-nav {
    display: flex;
  }

  /* Links drop in one after another when the menu opens. */
  .site-header.is-open .nav-link {
    animation: reveal-fade-up 0.45s var(--reveal-ease) both;
  }

  .site-header.is-open .nav-link:nth-child(2) { animation-delay: 40ms; }
  .site-header.is-open .nav-link:nth-child(3) { animation-delay: 80ms; }
  .site-header.is-open .nav-link:nth-child(4) { animation-delay: 120ms; }
  .site-header.is-open .nav-link:nth-child(5) { animation-delay: 160ms; }
  .site-header.is-open .nav-link:nth-child(6) { animation-delay: 200ms; }

  .nav-link {
    padding: 14px 24px;
  }

  .nav-link::after {
    display: none;
  }

  .header-socials {
    margin-left: auto;
    padding: 0 10px;
    gap: 0;
  }

  .social-link {
    width: 40px;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 56px;
    height: 100%;
    padding: 0 16px;
  }

  .nav-toggle span {
    display: block;
    height: 2px;
    background: #fff;
    transition: transform 0.3s var(--reveal-ease), opacity 0.2s;
  }

  /* Burger turns into a cross (bars are 2px high, 5px apart). */
  .site-header.is-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.is-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .credits-grid {
    grid-template-columns: repeat(2, minmax(0, 250px));
  }

  .credit:nth-child(n) { text-align: center; }

  .grid-items {
    --columns: 2;
  }
}

@media (max-width: 767px) {
  .block.has-space {
    margin-top: min(var(--space-top), 48px) !important;
    margin-bottom: min(var(--space-bottom), 48px) !important;
  }

  .block-section {
    padding-top: min(var(--pad-top, 0px), 60px);
    padding-bottom: min(var(--pad-bottom, 0px), 60px);
  }

  .header-logo img {
    width: 110px;
  }

  .header-socials {
    display: none;
  }

  .nav-toggle {
    margin-left: auto;
  }

  .block-feature {
    margin-top: 60px;
  }

  .feature-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 var(--gutter);
  }

  .feature-text,
  .image-right .feature-text {
    order: 2;
    padding: 0;
    text-align: center;
  }

  .feature-media,
  .image-left .feature-media {
    order: 1;
  }

  .feature-link {
    margin: 24px 0 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-logo,
  .footer-address,
  .footer-email {
    grid-column: 1;
    grid-row: auto;
    justify-self: center;
    text-align: center;
  }

  .footer-logo {
    margin: 0 0 20px;
    padding: 0;
  }

  .footer-email {
    margin-top: 16px;
  }

  .credits-grid {
    grid-template-columns: 1fr;
  }

  .block-gallery {
    --columns: 2 !important;
    gap: 10px;
  }

  .grid-items {
    --columns: 1 !important;
  }

  .block-row {
    grid-auto-flow: row;
    grid-template-columns: 1fr !important;
  }

  .block-banner {
    height: 180px;
  }

  .block.block-project-nav {
    grid-template-columns: 1fr;
    margin-top: 60px;
  }
}
