/* CSS VARIABLES FOR THEMING */
:root {
  /* Dark Theme (default) */
  --bg-body: #090909;
  --bg-box: #141414;
  --bg-box-alt: #1a1a1a;
  --bg-button: #242424;
  --bg-button-hover: #2a2a2a;
  --bg-toggle: #333333;
  --bg-toggle-inner: #090909;

  --border-grid: #242424;
  --border-box: #242424;
  --border-button: #242424;
  --border-icon: #333333;

  --text-primary: #cccccc;
  --text-secondary: #666666;
  --text-tertiary: #acacac;
  --text-hover: #cccccc;

  --grain-opacity: 0.15;
  --grain-box-opacity: 0.02;
}

/* Light Theme */
body.light-theme {
  --bg-body: #f4f5f6;
  --bg-box: #ffffff;
  --bg-box-alt: #ffffff;
  --bg-button: #eef0f1;
  --bg-button-hover: #e4e6e8;
  --bg-toggle: #d8dbde;
  --bg-toggle-inner: #ffffff;

  --border-grid: #d8dbde;
  --border-box: #d8dbde;
  --border-button: #c3c4c6;
  --border-icon: #d8dbde;

  --text-primary: #1f1f1f;
  --text-secondary: #8a949e;
  --text-tertiary: #6b7580;
  --text-hover: #1f1f1f;

  --grain-opacity: 0.15;
  --grain-box-opacity: 0.08;
}

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

html {
  font-family: "Nunito";
  color: var(--text-primary);
  cursor: url("../images/cursor.png"), auto;
}

body {
  background: var(--bg-body);
  min-height: 100vh;
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
  background-size: 182px;
  opacity: var(--grain-opacity);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s ease;
}

main {
  position: relative;
  z-index: 1;
}

/* GRID */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  border: 3px solid var(--border-grid);
  border-radius: 24px;
  padding: 16px;
  margin: 10px auto;
  width: 99%;
  transition: border-color 0.3s ease;
}

/* Grid positioning */
.box-1 {
  grid-column: 1 / 7;
  grid-row: 1;
}
.box-2 {
  grid-column: 7 / 10;
  grid-row: 1;
}
.box-8 {
  grid-column: 10 / 13;
  grid-row: 1;
}
.box-3 {
  grid-column: 1 / 4;
  grid-row: 2;
}
.box-4 {
  grid-column: 4 / 10;
  grid-row: 2;
}
.box-9 {
  grid-column: 10 / 13;
  grid-row: 2 / 4;
}
.box-5 {
  grid-column: 1 / 5;
  grid-row: 3;
}
.box-6 {
  grid-column: 5 / 8;
  grid-row: 3;
}
.box-7 {
  grid-column: 8 / 10;
  grid-row: 3;
}

/* Remove wrapper influence */
.col-left,
.col-right,
.box {
  display: contents;
}

/* Combined: All box base styling */
.inner-left-col-box,
.inner-right-col-box {
  border-radius: 24px;
  overflow: hidden;
  border: 3px solid var(--border-box);
  background: var(--bg-box);
  position: relative;
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
}

/* Combined: Grainy texture for all boxes */
.inner-left-col-box::before,
.box-9::before,
.btn::after,
.box-5-btn::before,
.socials-holder::before,
.stack-icon::before,
.about-icon-holder::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
  background-size: 182px;
  opacity: var(--grain-box-opacity);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s ease;
}

.btn::after,
.box-5-btn::before {
  opacity: var(--grain-opacity);
}

.btn::after {
  border-radius: 50px;
}

.box-5-btn::before,
.stack-icon::before {
  border-radius: 16px;
}

.socials-holder::before,
.about-icon-holder::before {
  border-radius: 24px;
}

.about-icon-holder::before {
  border-radius: 50%;
}

/* Z-index for content above grain */
.box > *,
.inner-right-col-box,
.inner-left-col-box > *,
.box-9-holder,
.stack-icons {
  position: relative;
  z-index: 1;
}

/* BOX 1 - Intro */
.box-1 {
  padding: 30px;
}

.box-1-text-holder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.box-1-title {
  font-size: 48px;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.box-1-text {
  font-size: 24px;
  color: var(--text-secondary);
  line-height: 1.4;
  transition: color 0.3s ease;
}

/* BOX 2 & 6 - Projects */
.box-2-link,
.box-6-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  display: block;
  z-index: 3;
  cursor: url("../images/cursor.png"), auto;
}

.box-2,
.box-6 {
  position: relative;
  cursor: url("../images/cursor.png"), auto;
}

.box-2-image,
.box-6-image {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.7s ease;
  z-index: 1;
}

.box-2-image {
  background-image: url(../images/project.webp);
}

.box-6-image {
  background-image: url(../images/project-three.webp);
}

.box-2:hover .box-2-image,
.box-6:hover .box-6-image {
  transform: scale(1.1);
}

.box-2-overlay {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 30px;
  transform: translateY(100%);
  transition: transform 0.4s ease;
  z-index: 2;
  pointer-events: none;
}

.box-2:hover .box-2-overlay,
.box-6:hover .box-2-overlay {
  transform: translateY(0);
}

.prjocet-title {
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  color: #ffffff;
}

.box-2-icon {
  transform: rotate(0deg) !important;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8)) !important;
  color: #ffffff;
}

/* BOX 3 - Photo */
.box-3 {
  background-image: url(../images/about-img.webp);
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
}

.box-3::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.6) 100%
  );
  pointer-events: none;
}

/* BOX 4 - About */
.box-4 {
  padding: 30px;
  transition: background 0.3s ease;
}

.box-4:hover {
  background: var(--bg-button);
  cursor: pointer;
  cursor: url("../images/cursor.png"), auto;
}

.box-4:hover .box-4-icon {
  transform: scale(1.2);
}

.box-4-text-holder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.box-4-label {
  color: var(--text-secondary);
  font-size: 16px;
  letter-spacing: 2px;
  font-weight: 500;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.box-4-text {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.box-4-icon-holder {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 3px solid var(--border-icon);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  align-self: flex-end;
  transition: border-color 0.3s ease;
}

.box-4-icon {
  color: var(--text-tertiary);
  transform: rotate(-45deg);
  font-size: 20px;
  transition: all 0.3s ease;
}

.box-4-link {
  text-decoration: none;
  grid-row: 2;
  grid-column: 4 / 10;
  color: var(--text-primary);
  cursor: url("../images/cursor.png"), auto;
  transition: color 0.3s ease;
}

/* BOX 5 - Contact */
.box-5 {
  padding: 30px;
}

.box-5-text-holder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.box-5-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  width: 100%;
  border-radius: 16px;
  border: none;
  background-color: var(--bg-button);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 18px;
  position: relative;
  cursor: url("../images/cursor.png"), auto;
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

.box-5-btn:hover {
  background: var(--bg-button-hover);
}

.copied-message {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: var(--text-primary);
}

.copied-message.show {
  opacity: 1;
}

.copied-message-icon {
  font-size: 20px;
}

/* BOX 7 - Theme switcher */
.box-7 {
  padding: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.box-7-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.btn {
  background-color: var(--bg-toggle);
  width: 120px;
  height: 56px;
  cursor: pointer;
  border-radius: 50px;
  position: relative;
  transition: 0.2s;
  border: 3px solid var(--border-button);
  position: relative;
  cursor: url("../images/cursor.png"), auto;
}

.btn::before {
  position: absolute;
  content: "";
  background-color: var(--bg-body);
  background-image: url(../images/logo2.webp);
  background-position: center;
  background-size: 30px;
  background-repeat: no-repeat;
  width: 45px;
  height: 45px;
  border-radius: 50px;
  margin: 3px;
  transition: all 0.4s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

input:checked + .btn::before {
  transform: translateX(63px);
  background-color: var(--bg-body);
  background-image: url(../images/logo-light-theme.webp);
}

#check {
  display: none;
}

/* BOX 8 - Social media */
.box-8 {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  background: transparent;
  border: none;
}

.box-8-soacila-medias {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
}

.box-8-soacila-medias a {
  cursor: url("../images/cursor.png"), auto;
}

.socials-holder {
  background: var(--bg-box);
  border: 3px solid var(--border-box);
  border-radius: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100px;
  position: relative;
  transition: all 0.3s ease;
}

.box-8-icon {
  font-size: 32px;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
  transition: color 0.3s ease;
}

.socials-holder:hover {
  transform: translateY(-5px);
}

.instagram:hover {
  background: linear-gradient(
    45deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
  border: 1px solid #cc2366;
}

.instagram:hover .box-8-icon {
  color: #ffffff;
}

.linkedin:hover {
  background: #0077b5;
  border: 1px solid #0077b5;
}

.linkedin:hover .box-8-icon {
  color: #ffffff;
}

.tiktok:hover {
  background: #000000;
  border: 1px solid #000000;
}

.tiktok:hover .box-8-icon {
  color: #ffffff;
}

.mail:hover {
  background: #ea4335;
  border: 1px solid #ea4335;
}

.mail:hover .box-8-icon {
  color: #ffffff;
}

/* BOX 9 - Stack */
.box-9 {
  padding: 30px;
}

.box-9-holder {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 400px;
}

.stack-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.stack-icon {
  aspect-ratio: 1;
  background: var(--bg-box-alt);
  border: 3px solid var(--border-box);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  animation: float 4s ease-in-out infinite;
  position: relative;
  cursor: url("../images/cursor.png"), auto;
}

.stack-icon img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.stack-icon:hover {
  transform: rotate(0deg) translateY(-5px) scale(1.05);
  animation: none;
}

.icon-1 {
  --rotation: -20deg;
  animation-delay: 0s;
}
.icon-2 {
  --rotation: 10deg;
  animation-delay: 0.2s;
}
.icon-3 {
  --rotation: -10deg;
  animation-delay: 0.4s;
}
.icon-4 {
  --rotation: 6deg;
  animation-delay: 0.6s;
}
.icon-5 {
  --rotation: -4deg;
  animation-delay: 0.8s;
}
.icon-6 {
  --rotation: 2deg;
  animation-delay: 1s;
}
.icon-7 {
  --rotation: 20deg;
  animation-delay: 1.2s;
}
.icon-8 {
  --rotation: -20deg;
  animation-delay: 1.4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(var(--rotation, 0deg));
  }
  50% {
    transform: translateY(-5px) rotate(var(--rotation, 0deg));
  }
}

/* ABOUT PAGE */
.about-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr) !important;
}

.about-page-btn-holder {
  width: 100%;
  display: flex;
  justify-content: center;
  grid-column: 1 / 13;
  padding: 30px 0 60px;
}

.about-icon-holder {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  border: 3px solid var(--border-icon);
  width: 50px;
  height: 50px;
  position: relative;
  transition:
    border-color 0.3s ease,
    background 0.3s ease;
}

.about-icon-holder:hover {
  background: var(--bg-button-hover);
}

.about-page-icon {
  color: var(--text-primary);
  font-size: 24px;
  transition: color 0.3s ease;
}

.box-1-about,
.box-2-about,
.box-3-about,
.box-4-about {
  padding: 30px;
}

.box-1-about {
  grid-column: 2 / 9;
}

.box-1-about-text-holder {
  gap: 20px;
}

.box-1-about-text-holder span {
  width: 100%;
  height: 2px;
  background-color: var(--border-box);
  border-radius: 10px;
  transition: background-color 0.3s ease;
}

.box-1-about-title {
  font-weight: 500;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.story-section h3,
.section-label,
.box-1-project-info h3,
.box-2-project-overview h3 {
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.story-section,
.current-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.current-section {
  margin-top: 16px;
}

.box-1-about-text,
.slide-text,
.box-1-project-info p,
.box-2-project-overview p,
.project-section p,
.challenge-list,
.process-step p,
.solution-item p {
  font-size: 20px;
  line-height: 1.7;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.box-2-about {
  grid-column: 2 / 8;
}

.carousel-container {
  margin-top: 32px;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 16px;
  padding-bottom: 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  min-width: 100%;
  scroll-snap-align: start;
}

.slide-title {
  font-size: 28px;
  font-weight: 500;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 20px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-icon);
  cursor: url("../images/cursor.png"), auto;
  transition: all 0.3s ease;
}

.dot:hover {
  background: var(--text-tertiary);
}

.dot.active {
  background: var(--text-primary);
  width: 24px;
  border-radius: 4px;
}

.box-3-about {
  grid-row: 2;
  grid-column: 9 / 12;
}

.box-3-holder {
  min-height: 0;
  gap: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.about-page-stack-icon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.box-4-about {
  grid-column: 8 / 12;
}

.box-4-about-text-holder {
  gap: 24px;
}

/* PROJECT PAGE */
.project-header {
  display: grid;
  align-items: flex-start;
  gap: 24px;
  grid-column: 2 / 12;
}

.project-title-holder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.project-heading {
  font-weight: 500;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.project-subheading {
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 20px;
  font-weight: 600;
  transition: color 0.3s ease;
}

.project-cart-holder {
  display: grid;
  align-items: center;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
}

.box-1-project {
  grid-column: 1 / 5;
  padding: 30px;
}

.box-1-project-text-holder,
.box-2-project-text-holder,
.box-1-project-info,
.box-2-project-overview,
.story-section,
.process-step,
.solution-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.box-1-project-text-holder {
  gap: 24px;
}

.box-1-project-info {
  gap: 4px;
}

.box-2-project {
  grid-row: 1;
  grid-column: 5 / 13;
  height: 100%;
  padding: 30px;
}

.box-2-project-text-holder {
  gap: 28px;
}

.box-2-project-overview {
  gap: 16px;
}

.project-box-btn-link {
  max-width: 200px;
  width: 100%;
  text-decoration: none;
  cursor: url("../images/cursor.png"), auto;
}

.project-box-btn {
  font-size: 18px;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
  border: 3px solid var(--border-button);
  max-width: 200px;
  width: 100%;
  padding: 10px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  cursor: url("../images/cursor.png"), auto;
  border-radius: 16px;
  transition: all 0.3s ease;
}

.project-box-btn:hover {
  background: var(--bg-button);
}

.box-3-project,
.box-5-project,
.solution-image {
  grid-column: 2 / 12;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  aspect-ratio: 16 / 9;
  margin: 20px 0;
  border-radius: 12px;
}

.box-3-project {
  grid-row: 4;
  background-image: url(../images/RatakFit.webp);
}

.box-3-project-restaurant {
  background-image: url(../images/AlpineHouse.webp);
}

.project-section,
.process-section,
.solution-section {
  grid-column: 2 / 12;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
}

.project-section {
  grid-row: 3;
}

.project-section h2,
.process-section h2,
.solution-section h2 {
  font-size: 28px;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.project-section h2,
.solution-section h2 {
  margin-top: 20px;
}

.solution-section-rest h2 {
  margin: 0;
}

.challenge-list {
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.process-section {
  grid-row: 5;
}

.process-step {
  gap: 12px;
}

.process-step h4,
.solution-item h4 {
  font-size: 22px;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.process-step h4 {
  font-weight: 500;
}

.box-5-project {
  grid-row: 6;
  background-image: url(../images/Home.webp);
}

.solution-section {
  grid-row: 7;
}

.solution-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.solution-item {
  gap: 4px;
}

.solution-image {
  grid-row: 8;
  background-image: url(../images/RatakFit2.webp);
}

.solution-image-restaurant {
  background-image: url(../images/AlpineHouse2.webp);
}
