/*

--- 01 TYPOGRAPHY SYSTEM:

- Font Size:
Regular: 24px Title: 50px Sub-Title 40px

- Font Weights:
Default: 400 / Medium: 500 / Bold: 700

- Line Height: 
Default: 1.2 / Small: 1.05 / Medium: 1.2 / Paragraph: 1.6 / Large: 1.8

- Letter Spacing:

--- 02 COLORS:

- Primary:  

Whites: #FFFFFF

Tints:   #B4C6D2

Shades: #030509 #51595E

Accents:

Greys: #384C5F


--- 07 WHITESPACE:

- Spacing System (px)
16 / 20 / 24 

*/

/* =====================================================
DEBUG
===================================================== */

/* Direct bad img */
/* img:not([alt]) {
  outline: 5px solid red !important;
} */

/* Wrapper around bad img */
/* *:has(img:not([alt])) {
  outline: 5px solid red !important;
}

video:not([aria-label]),
video:not([aria-label]) * {
  outline: 5px solid red !important;
} */

/* .parent-debug {
  outline: 2px solid rgb(0, 255, 119);
} */

/* =====================================================
VARIABLES
===================================================== */

:root {
  --primary-text: #ffffff;
  --accent: rgb(0, 255, 55);

  --logo-shade: #e60000;

  --primary-tint: #b4c6d2;
  --primary-shade: #030509;
  --secondary-shade: #384c5f;
  --border-radius: 0.4rem;
  --grid-gap: 2.4rem;
  --focus-weight: 2px;
}

/* =====================================================
FONT-FACES
===================================================== */

@font-face {
  font-family: "Disket";
  src:
    url("/home/font/Disket-Mono-Regular.woff2") format("woff2"),
    url("/home/font/Disket-Mono-Regular.woff") format("woff");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Disket";
  src:
    url("/home/font/Disket-Mono-Bold.woff2") format("woff2"),
    url("/home/font/Disket-Mono-Bold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}

/* 400 — Regular */
@font-face {
  font-family: "IBM Plex Mono";
  src:
    url("/home/font/IBMPlexMono-Regular.woff2") format("woff2"),
    url("/home/font/IBMPlexMono-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* 500 — Medium */
@font-face {
  font-family: "IBM Plex Mono";
  src:
    url("/home/font/IBMPlexMono-Medium.woff2") format("woff2"),
    url("/home/font/IBMPlexMono-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* 600 — SemiBold */
@font-face {
  font-family: "IBM Plex Mono";
  src:
    url("/home/font/IBMPlexMono-SemiBold.woff2") format("woff2"),
    url("/home/font/IBMPlexMono-SemiBold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* 700 — Bold */
@font-face {
  font-family: "IBM Plex Mono";
  src:
    url("/home/font/IBMPlexMono-Bold.woff2") format("woff2"),
    url("/home/font/IBMPlexMono-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* =====================================================
GENERAL RULES
===================================================== */

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

*:focus-visible {
  outline: none;
}

html,
body {
  background-color: var(--primary-shade);
}

html {
  scroll-behavior: smooth;
  font-size: 62.5%;
}

h1 {
  font-family: "Disket", sans-serif;
}

body {
  min-height: 100dvh;
  font-family: "IBM Plex mono", monospace;
  font-size: 2rem;
  line-height: 1.6;
  font-weight: 400;
  color: var(--primary-text);

  overflow-x: hidden;
}

ul {
  list-style-type: none;
}

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

aside ul {
  display: flex;
  flex-direction: column;
  gap: calc(var(--grid-gap) / 8);
}

video {
  border-radius: var(--border-radius);
}

img {
  width: 100%;
  height: auto;
}

.container {
  max-width: 160rem;
  margin: 0 auto;
  padding: 4rem;
}

.flex {
  display: flex;
  gap: var(--grid-gap);
  justify-content: space-around;
  width: 100%;
}

.img-flex {
  display: flex;
}

.grid,
.grid-static {
  display: grid;
  z-index: 2;
}

.II-cols {
  justify-self: left;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
}

.II-cols-third {
  align-items: center;
  grid-template-columns: 1fr 2fr;
  gap: var(--grid-gap);
}

.main-layout {
  grid-template-columns: 1fr minmax(40rem, 70rem) 1fr;
  gap: var(--grid-gap);
}

.III-cols,
.III-cols-static {
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--grid-gap);
  grid-column: 2 / 3;
  place-items: center;
}

.info-box-style li {
  margin-bottom: 0.8rem;
}

.home-title {
  display: inline-block;
  font-weight: bold;
  font-size: 4rem;
  line-height: 1;
}

.title {
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 6rem);
  line-height: 1;
}

.sub-title {
  font-family: "Disket", monospace;
  font-weight: 600;
  font-size: clamp(1.2rem, 4vw, 3rem);
  text-wrap: balance;
}

.subtitle-home {
  font-weight: 500;
  font-size: 2.4rem;
}

.img-or {
  border-radius: var(--border-radius);
  max-width: 100%;
  height: auto;
}

.img-trasp {
  border-radius: var(--border-radius);
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 1.4rem 1.2rem rgba(3, 5, 9, 0.4));
}

.video-sq {
  width: 100%;
  height: auto;
}

.video-home {
  width: auto;
  height: 100%;
}

.video-home video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(100px); /* Slide in from the left */
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

article p,
article img,
article video,
.splide {
  animation: appear ease;
  animation-timeline: view();
  animation-range: entry 0% cover 35%;
}

/* =====================================================
 HOMEPAGE BACKGROUND
===================================================== */

.wrapper-home {
  position: relative;
  z-index: 0;
  padding-bottom: 4rem;
}

/* fixed gradient layer */
.wrapper-home::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background: linear-gradient(
    to bottom,
    var(--primary-shade) 0%,
    var(--secondary-shade) 50%,
    var(--primary-tint) 100%
  );
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: exclusion;

  --offset-x: 0;
  --offset-y: 0;
  --offset-z: 0;
}

#bg.bg-right {
  --offset-x: 0.3;
  --offset-y: -0.4;
  --offset-z: 0;
}

/* LEFT preset */
#bg.bg-left {
  --offset-x: -0.3;
  --offset-y: -0.4;
  --offset-z: 0;
}

/* =====================================================
 HOMEPAGE CONTENT
===================================================== */

.home-aside {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  position: sticky;
  top: 2.4rem;
  align-self: start;
  z-index: 9999;
  margin-right: 1.2rem;
}

.subtitle-home:hover .list-slide,
.subtitle-home:focus-visible .list-slide {
  transform: translateX(0.8rem);
  color: var(--accent);
}

.subtitle-home:hover .list-slide::after,
.subtitle-home:focus-visible .list-slide::after {
  width: 100%;
}

.home-list div {
  display: block;
}

/* //// LINKS BEHAVIOUR //// */

a.main-link {
  display: inline-block;
}

.list-slide {
  position: relative;
  /* transform: translateX(0.8rem); */
  display: inline-block;
  transition: all 0.4s ease;
}

.list-slide:focus-visible {
  transition: none;
}

.list-slide:hover,
.list-slide:active,
.list-slide:focus-visible {
  transform: translateX(0.8rem);
  color: var(--accent);
}

.main-link:focus-visible .list-slide {
  transform: translateX(0.8rem);
  color: var(--accent);
}

.main-link:hover .list-slide .no-slide,
.main-link:focus-visible .list-slide .no-slide {
  transform: translateX(0);
  color: var(--accent);
}

.main-link:hover .list-slide::after,
.main-link:focus-visible .list-slide::after {
  width: 100%;
}

.list-slide::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0px;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}

.wrapper-page .list-slide::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0px;
  width: 100%;
  height: 2px;
  background: currentColor;
}

.list-slide:hover::after,
.list-slide:focus-visible::after {
  width: 100%;
}

.list-slide.no-slide:hover,
.list-slide.no-slide:active,
.list-slide.no-slide:focus-visible {
  transform: translateX(0);
  color: var(--accent);
}

.bottom-bar {
  font-size: clamp(0.9rem, 1.2vw, 1.2rem);
  display: flex;
  white-space: nowrap;
  align-items: center;
  gap: var(--grid-gap);
  padding: 1rem 2rem;

  position: fixed;
  left: 50%;
  top: 95vh;
  transform: translate(-50%, -50%);
  z-index: 9999;

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  background-color: rgba(0, 0, 0, 0.35);
  border-radius: var(--border-radius);
}

.logo-container {
  display: flex;
  gap: var(--grid-gap);
  justify-content: start;
}

.logo {
  display: block;
  width: 100%;
  height: auto;
  color: var(--primary-text); /* controls fill="currentColor" */
}

.logo-container:hover .logo {
  color: var(--logo-shade);
}

.logo--responsive {
  height: 8rem;
  width: 8rem;
}

.logo-lettering {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  transform: translateX(1.2rem);
}

.logo-container:hover .logo-lettering {
  transform: translateX(0);
}

.logo-lettering,
.logo {
  transition: all 0.4s ease;
}

.logo-lettering > span {
  display: block; /* stacked lines like your old <p> */
}

.logo-word {
  display: block;
  line-height: 1;
  transform: translateY(0.3rem);
}

/* =====================================================
 BOX STYLES
===================================================== */

.box-style {
  width: 100%;
  position: relative;
  background-color: var(--secondary-shade);
  opacity: 0.8;
  filter: saturate(0) blur(2px) brightness(0.4);
  aspect-ratio: 3 / 4;
  border-radius: var(--border-radius);
  outline: 2px solid transparent;
}

.btn-box:hover .project-name,
.btn-box:hover,
.btn-box:focus-visible .project-name,
.btn-box:focus-visible,
.btn-box:active .project-name,
.btn-box:active {
  opacity: 1;
  filter: none;
}

.box-style:hover,
.box-style:active {
  outline: 2px solid var(--primary-tint);
}

.box-style:focus-visible {
  border: 2px solid var(--accent);
}

.project-name {
  opacity: 0;
  display: block;
  position: absolute;
  border-radius: var(--border-radius);
  backdrop-filter: blur(18px) brightness(0.6);
  color: var(--primary-text);
  border: solid 2px var(--primary-text);
  font-size: 1.6rem;
  line-height: 1.2;
  padding: 0.4rem 0.8rem;
  top: 85%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition: all 0.4s ease;
  text-align: center;
}

.btn-box {
  cursor: pointer;
  overflow: hidden;

  /* 🔑 REQUIRED FOR 3D */
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;

  /* 🔑 Smooth transition on hover in/out */
  /* transition: transform 0.25s ease-out; */
}

.btn-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;

  /* 🔑 VERY IMPORTANT */
  pointer-events: none;

  /* depth layer */
  /* transform: translateZ(30px); */
}

/* =====================================================
 PROJECT PAGES
===================================================== */

.wrapper-page {
  position: relative;
  z-index: 0;
  padding-bottom: 8rem;
}

/* fixed gradient background */
.wrapper-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background: linear-gradient(
    to bottom,
    var(--primary-shade) 0%,
    var(--secondary-shade) 100%
  );
}

.aside-box {
  z-index: 1;
}

.main-info {
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  grid-column: 2;
  margin-bottom: 4rem;
}

.info-box-style {
  background-color: #0305095a;
  min-width: 32rem;
  padding: 1.6rem 2rem;
  border: 2px solid var(--primary-tint);
  border-radius: var(--border-radius);
  position: sticky;
  align-self: start;
  top: 2.4rem;
}

.info-title {
  font-family: "Disket", "IBM Plex Mono", monospace;
  font-weight: bold;
  font-size: clamp(1.2rem, 5vw, 4rem);
  margin-bottom: 1.2rem;
  flex-shrink: 0;

  display: block;
  width: 8ch; /* adjust to max character count */
  white-space: nowrap;
}

.info-box-style {
  animation: slide 2s ease;
}

.info-cat {
  font-weight: bold;
}

@keyframes slide {
  from {
    opacity: 0;
    transform: translateX(400px);
  }
  to {
    opacity: 1;
    transform: translate(0px);
  }
}

.link-btn {
  font-family: "Disket", monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 48rem;
  height: 12rem;
  font-size: 2.8rem;
  padding-top: 0.2rem;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
  align-self: center;
  border-radius: var(--border-radius);
  background-color: var(--primary-tint);
  color: var(--primary-shade);
  transition: all 0.4s ease;
  box-shadow: 0px 5px 15px 01px #03050950;

  margin-top: 4rem;
}

.link-btn:hover,
.link-btn:active {
  background-color: var(--primary-shade);
  color: var(--primary-text);
}

.nav-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  position: fixed;
  z-index: 9999;
  bottom: 3rem;
}

.nav-btn {
  font-family: "Disket", monospace;
  display: flex;
  align-items: center;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.4rem;
  height: 4rem;
  width: 12rem;
  filter: brightness(0.4);
  backdrop-filter: blur(18px) brightness(0.9);
  border: 2px solid var(--primary-tint);
  padding-top: 0.1rem;
}

.nav-btn:hover {
  border: 2px solid var(--primary-text);
}

.nav-btn:focus-visible {
  border: 2px solid var(--accent);
}

.--left {
  width: 12rem;
  padding-right: 1.2rem;
  justify-content: right;
  border-top-left-radius: 50px;
  border-bottom-left-radius: 50px;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.--center {
  justify-content: center;
  border-radius: 8px;
}

.--right {
  padding-left: 1.2rem;
  justify-content: left;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  border-top-right-radius: 50px;
  border-bottom-right-radius: 50px;
}

.slide-right,
.slide-up,
.slide-left {
  transition: all 0.4s ease;
}

.nav-btn:hover .slide-right,
.nav-btn:focus-visible .slide-right {
  transform: translateX(0.8rem);
}

.nav-btn:hover .slide-up,
.nav-btn:focus-visible .slide-up {
  transform: translateY(-0.2rem);
}

.nav-btn:hover .slide-left,
.nav-btn:focus-visible .slide-left {
  transform: translateX(-0.8rem);
}

.nav-btn::before {
  content: "";
  position: absolute;
  inset: -80%;
  background: radial-gradient(circle, var(--primary-tint), transparent 60%);
  opacity: 0;
  transform: translate(0, 0) scale(1);
  transition:
    transform 1s ease,
    opacity 0.2s ease;
}

/* left → right */
.nav-btn.--right:hover::before,
.nav-btn.--right:focus-visible::before {
  opacity: 0.6;
  transform: translate(20%, 0) scale(1.8);
}

.nav-btn.--right:active::before {
  transform: translate(-20%, 0) scale(1.7);
}
/* down → up */
.nav-btn.--center:hover::before,
.nav-btn.--center:focus-visible::before {
  opacity: 0.6;
  transform: translate(0%, -50%) scale(1.5);
}

.nav-btn.--center:active::before {
  transform: translate(0, 50%) scale(1.5);
}

/* right → left */
.nav-btn.--left:hover::before,
.nav-btn.--left:focus-visible::before {
  opacity: 0.6;
  transform: translate(-20%, 0) scale(1.8);
}

.nav-btn.--left:active::before {
  transform: translate(20%, 0) scale(1.7);
}

.frame {
  position: relative; /* anchor for absolute children */
  transform-origin: top left; /* or center, depending on feel */
  z-index: 900;
  right: 0rem;
  width: 40rem;
}

.f1,
.f2,
.f3,
.f4,
.f5,
.f6 {
  position: absolute;
  animation: none;
}

.f1 {
  transform: scale(0.96) rotate(15deg);
  z-index: 930;

  top: 40rem;
}
.f2 {
  transform: rotate(-20deg);
  z-index: 992;

  top: 70rem;
}
.f3 {
  transform: scale(0.92);
  z-index: 900;

  top: 100rem;
}
.f4 {
  transform: scale(0.92) rotate(-15deg);
  z-index: 901;

  top: 140rem;
}
.f5 {
  transform: scale(1.07) rotate(0);
  z-index: 950;
}
.f6 {
  transform: scale(1) rotate(0deg);
  z-index: 900;
}

/* =====================================================
 PROJECT AS-BY-DF
===================================================== */

.grid-project {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

.grid-project img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* fills slot, preserves ratio, crops */
  display: block;
  border-radius: var(--border-radius);
}

.box-1 {
  grid-column: 1 / 2;
}
.box-2 {
  grid-column: 2 / -1;
} /* to end */
.box-3 {
  grid-column: 1 / 3;
}
.box-4 {
  grid-column: 3 / -1;
} /* example, adjust */
.box-5 {
  grid-column: 1 / 2;
}
.box-6 {
  grid-column: 2 / -1;
}

.press {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

.press-box {
  grid-column: 2 / 4;
}

.press img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* fills slot, preserves ratio, crops */
  display: block;
  border-radius: var(--border-radius);
}

/* =====================================================
   IMAGE SLIDER
===================================================== */

.comp-box {
  display: grid;
  place-items: center;
}
.comp-box img {
  display: block;
  max-width: 100%;
}

.comp-box-container {
  display: grid;
  position: relative;
  overflow: hidden;
  --position: 50%;
  width: 100%;
  border-radius: var(--border-radius);
}

.image-container {
  width: 100%;
}

.slider-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left;
}

.image-before {
  position: absolute;
  inset: 0;
  width: var(--position);
  z-index: 1;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  opacity: 0;
  /* for Firefox */
  width: 100%;
  height: 100%;
  z-index: 2;
}

.slider:focus-visible ~ .slider-button {
  outline: var(--focus-weight) solid var(--accent);
  outline-offset: 0.4rem;
  z-index: 2;
}

.slider-line {
  position: absolute;
  inset: 0;
  width: 0.4rem;
  height: 100%;
  background-color: var(--secondary-shade);
  z-index: 10;
  left: var(--position);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}

.slider-button {
  position: absolute;
  background-color: var(--secondary-shade);
  color: var(--primary-text);
  padding: 0.4rem;
  border-radius: var(--border-radius);
  display: grid;
  place-items: center;
  top: 50%;
  left: var(--position);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 100;
}

/* =====================================================
   GRAIN OVERLAY BODY
===================================================== */

body.grain {
  isolation: isolate; /* critical for blend-mode sanity */
}

body.grain::after {
  content: "";
  position: fixed;
  inset: -120%;
  pointer-events: none;
  z-index: 9999;

  background-image: url("/home/noise-bk.png");
  background-repeat: repeat;
  background-size: 120px 120px;

  opacity: 0.1;
  mix-blend-mode: soft-light;

  animation: grain 8s steps(10) infinite;
  will-change: transform;
}

@keyframes grain {
  0%,
  100% {
    transform: translate(0, 0);
  }
  10% {
    transform: translate(-5%, -10%);
  }
  20% {
    transform: translate(-15%, 5%);
  }
  30% {
    transform: translate(5%, -25%);
  }
  40% {
    transform: translate(-5%, 25%);
  }
  50% {
    transform: translate(-15%, 10%);
  }
  60% {
    transform: translate(15%, 0%);
  }
  70% {
    transform: translate(0%, 15%);
  }
  80% {
    transform: translate(5%, 35%);
  }
  90% {
    transform: translate(-10%, 10%);
  }
}
