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

:root {
  --transition: all 0.3s ease-in-out;
  --font-family: "Source Code Pro", monospace;
  /* SIZES */
  --font-weight-bold: 700;
  --font-size-normal: 0.9rem;
  --font-size-small: 0.5rem;
  /* COLORS */
  --color-accent: #cc4331;
  --text-color: black;
  --background-color: #f8f8f8;
  /* GLASS */
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
}

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

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

html {
  scroll-behavior: smooth;
}

body {
  letter-spacing: 0;
  line-height: 1.5;
  font-family: var(--font-family);
  font-size: var(--font-size-normal);
  background-color: var(--background-color);
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(204, 67, 49, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%, rgba(80, 100, 220, 0.30) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(140, 60, 180, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 0% 100%, rgba(204, 67, 49, 0.20) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(100, 130, 230, 0.15) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-color);
  transition: color 1.9s, background-color 1.9s;
  overflow-x: hidden;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: var(--text-color);
}

p {
  line-height: 2em;
  margin-bottom: 1em;
}

section {
  min-height: 100vh;
}

.glassmorphism {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}


/* THEME */

.change-theme {
  color: var(--text-color);
  cursor: pointer;
}

body.dark-theme {
  --text-color: white;
  --background-color: #0f1117;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-shadow: 0 8px 20px rgba(0, 0, 0, 0.30);
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(204, 67, 49, 0.50) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%, rgba(60, 80, 200, 0.45) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(120, 40, 160, 0.40) 0%, transparent 50%),
    radial-gradient(ellipse at 0% 100%, rgba(204, 67, 49, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(80, 110, 210, 0.25) 0%, transparent 60%);
  background-attachment: fixed;
}

/* MENU */

.navbar {
  position: fixed;
  left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100vw;
  padding: 0.75rem 2rem;
  opacity: 0;
  animation: fadeIn 2s ease-in-out forwards 3.5s;
  background: rgba(248, 248, 248, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

body.dark-theme .navbar {
  background: rgba(15, 17, 23, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-theme .navbar__link--active {
  color: white;
}

@media (hover: hover) {
  body.dark-theme .navbar__link:hover,
  body.dark-theme .icon:hover {
    color: white;
  }
}

.theme-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.lang-button {
  background: none;
  border: 1px solid currentColor;
  color: var(--text-color);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: var(--font-weight-bold);
  padding: 3px 7px;
  border-radius: 4px;
  transition: var(--transition);
}

@media (hover: hover) {
  .lang-button:hover {
    color: var(--color-accent);
    transform: scale(1.2);
  }

  body.dark-theme .lang-button:hover {
    color: white;
  }
}

.navbar__links {
  position: relative;
  display: flex;
  gap: 25px;
  align-items: center;
}

.navbar__link {
  color: var(--text-color);
  font-size: var(--font-size-normal);
  opacity: 0.5;
  transition: var(--transition);
  display: inline-block;
}

.navbar__link::after {
  content: attr(data-text);
  font-weight: var(--font-weight-bold);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  display: block;
}

@media (hover: hover) {
  .navbar__link:hover {
    color: var(--color-accent);
    opacity: 1;
    transform: scale(1.1);
  }
}

.navbar__link--active {
  color: var(--color-accent);
  opacity: 1;
  font-weight: var(--font-weight-bold);
}

.navbar__progress {
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: rgba(128, 128, 128, 0.2);
}

.navbar__progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--color-accent);
  transition: width 0.1s linear;
}

body.dark-theme .navbar__progress-fill {
  background-color: white;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar__separator {
  width: 1px;
  height: 20px;
  background-color: currentColor;
  opacity: 0.5;
}

.navbar__hamburger {
  display: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.navbar__mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 25px 20px;
  background: rgba(248, 248, 248, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

body.dark-theme .navbar__mobile-menu {
  background: rgba(15, 17, 23, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar--open .navbar__mobile-menu {
  display: flex;
}

.navbar__mobile-link {
  color: var(--text-color);
  font-size: 1.2rem;
  transition: var(--transition);
}

@media (hover: hover) {
  .navbar__mobile-link:hover {
    color: var(--color-accent);
  }
}

.navbar__mobile-socials {
  display: flex;
  gap: 5px;
}

.social-links {
  display: flex;
  gap: 16px;
}

.icon {
  color: var(--text-color);
  font-size: 30px;
  display: inline-block;
  transition: var(--transition);
}

@media (hover: hover) {
  .icon:hover {
    color: var(--color-accent);
    transform: scale(1.2);
  }
}

@media (max-width: 768px) {
  .navbar__links {
    display: none;
  }

  .social-links {
    display: none;
  }

  .navbar__separator,
  .navbar__actions > .lang-button,
  .navbar__actions > .theme-button {
    display: none !important;
  }

  .navbar__hamburger {
    display: flex;
    align-items: center;
  }
}

.navbar__mobile-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* FOOTER */

footer {
  font-size: var(--font-size-normal);
  display: flex;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0.5;
}

/* ================================
   HOME
   ================================ */

.home {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#signature-svg {
  width: clamp(300px, 50vw, 800px);
}

#signature-svg g {
  animation: fill 0.5s ease forwards 3.5s;
}
/* m */
#signature-svg path:nth-child(6) {
  stroke-dasharray: 7951.7;
  stroke-dashoffset: 7951.7;
  animation: draw-text 2s ease forwards;
}
/* i */
#signature-svg path:nth-child(13) {
  stroke-dasharray: 3130.1;
  stroke-dashoffset: 3130.1;
  animation: draw-text 2s ease forwards 0.3s;
}
/* dot */
#signature-svg path:nth-child(2) {
  stroke-dasharray: 1109.9;
  stroke-dashoffset: 1109.9;
  animation: draw-text 2s ease forwards 0.4s;
}
/* 1. c */
#signature-svg path:nth-child(7) {
  stroke-dasharray: 4112;
  stroke-dashoffset: 4112;
  animation: draw-text 2s ease forwards 0.5s;
}
/* 1. a */
#signature-svg path:nth-child(8) {
  stroke-dasharray: 5316.3;
  stroke-dashoffset: 5316.3;
  animation: draw-text 2s ease forwards 0.6s;
}
/* h */
#signature-svg path:nth-child(3) {
  stroke-dasharray: 5734.1;
  stroke-dashoffset: 5734.1;
  animation: draw-text 2s ease forwards 0.7s;
}
/* l */
#signature-svg path:nth-child(4) {
  stroke-dasharray: 4227;
  stroke-dashoffset: 4227;
  animation: draw-text 2s ease forwards 0.8s;
}
/* 2. c */
#signature-svg path:nth-child(5) {
  stroke-dasharray: 4820.5;
  stroke-dashoffset: 4820.5;
  animation: draw-text 2s ease forwards 0.9s;
}
/* hook */
#signature-svg path:nth-child(1) {
  stroke-dasharray: 1573.1;
  stroke-dashoffset: 1573.1;
  animation: draw-text 2s ease forwards 1s;
}
/* 2. a */
#signature-svg path:nth-child(9) {
  stroke-dasharray: 5316.3;
  stroke-dashoffset: 5316.3;
  animation: draw-text 2s ease forwards 1.1s;
}
/* p */
#signature-svg path:nth-child(10) {
  stroke-dasharray: 5674.2;
  stroke-dashoffset: 5674.2;
  animation: draw-text 2s ease forwards 1.2s;
}
/* o */
#signature-svg path:nth-child(11) {
  stroke-dasharray: 4495.2;
  stroke-dashoffset: 4495.2;
  animation: draw-text 2s ease forwards 1.3s;
}
/* u */
#signature-svg path:nth-child(14) {
  stroke-dasharray: 4933.8;
  stroke-dashoffset: 4933.8;
  animation: draw-text 2s ease forwards 1.4s;
}
/* n */
#signature-svg path:nth-child(12) {
  stroke-dasharray: 4928.8;
  stroke-dashoffset: 4928.8;
  animation: draw-text 2s ease forwards 1.5s;
}

@keyframes draw-text {
  to {
    stroke-dashoffset: 0;
    stroke: var(--text-color);
  }
}

@keyframes fill {
  from {
    fill: transparent;
  }
  to {
    fill: var(--text-color);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ================================
   HERO
   ================================ */

.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 80px clamp(1.5rem, 5vw, 4rem) 4rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.hero__container {
  flex: 1 1 300px;
  max-width: 600px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--glass-shadow);
}

.hero img {
  flex: 1 1 30%;
  max-width: 500px;
  max-height: 520px;
  object-fit: contain;
}

.hero__links {
  display: flex;
  gap: 20px;
  padding-top: 20px;
}

.hero__link {
  padding: 10px;
  border-radius: 5px;
  font-size: 14px;
  color: white;
  background-color: var(--color-accent);
  text-transform: capitalize;
}

/* ================================
   PROJECTS
   ================================ */

.projects {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
}

.projects__track-wrapper {
  overflow: hidden;
  flex: 1;
  max-width: min(42vw, 660px);
}

@media (max-width: 768px) {
  .hero img {
    min-width: 0;
    max-width: min(75vw, 320px);
  }

  .hero__container {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .hero__links {
    flex-wrap: wrap;
  }

  .projects {
    position: relative;
    padding: 2rem 0;
  }

  .projects__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    font-size: 2rem;
    padding: 0.4rem;
    opacity: 0.7;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
  }

  .projects__nav--prev {
    left: 0.25rem;
  }

  .projects__nav--next {
    right: 0.25rem;
  }

  .projects__track-wrapper {
    max-width: 92vw;
  }
}

.cards {
  display: flex;
  margin: 0;
  padding: 0;
  transition: transform 0.4s ease;
  will-change: transform;
}

.cards__item {
  flex: 0 0 100%;
  min-width: 0;
  padding: 1rem;
  display: flex;
}

.projects__nav {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  font-size: 3rem;
  opacity: 0.4;
  transition: var(--transition);
  padding: 0.5rem;
}

@media (hover: hover) {
  .projects__nav:hover {
    opacity: 1;
    color: var(--color-accent);
  }
}

.card {
  border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
}

.card__content {
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem 0 1rem;
}

.card__image {
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: contrast(70%);
  overflow: hidden;
  position: relative;
  transition: filter 0.5s cubic-bezier(0.43, 0.41, 0.22, 0.91);
}

.card__image::before {
  content: "";
  display: block;
  padding-top: 40.76%;
}

.card__image--portfolio {
  background-image: url(../assets/portfolio.png);
  background-size: contain;
}

.card__image--map-archive {
  background-image: url(https://unsplash.it/800/600?image=82);
  filter: blur(20px);
}

.card__title {
  color: var(--text-color);
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.card__text {
  font-size: 0.875rem;
}

.card__links {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.card__link {
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 14px;
  color: white;
  background-color: var(--color-accent);
  text-transform: capitalize;
}

/* ================================
   CONTACT
   ================================ */

.contact-section {
  perspective: 1000px;
  -webkit-perspective: 1000px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.code-block {
  font-size: 15px;
}

.contact-container {
  color: var(--text-color);
  position: relative;
  width: min(90vw, 36rem);
  height: clamp(13rem, 22vw, 16rem);
  transition: 0.9s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.contact-container--active {
  transform: rotateX(180deg);
}

.contact {
  position: absolute;
  height: 100%;
  width: 100%;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

body.dark-theme .contact {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.20) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.contact__front {
  font-size: 35px;
  text-transform: capitalize;
}

.contact__back {
  transform: rotateX(180deg);
  flex-direction: column;
}


.contact__flip-icon {
  font-family: boxicons;
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 20px;
  transform: rotate(45deg);
  z-index: 2;
  cursor: pointer;
}

.line-numbers {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 0;
  padding: 0 10px;
  background-color: rgba(245, 245, 245, 0.03);
  font-size: 13px;
}

.line-numbers > span {
  padding: 2.5px 0;
}

.indent {
  display: block;
  padding-left: 30px;
}

.operator { color: #0891b2; }
.string, .string a { color: #15803d; }
.variable { color: #7e22ce; }
.property { color: #b91c1c; }
.function { color: #b45309; }

body.dark-theme .operator { color: #4dd0e1; }
body.dark-theme .string,
body.dark-theme .string a { color: #9ccc65; }
body.dark-theme .variable { color: #ba68c8; }
body.dark-theme .property { color: #ef5350; }
body.dark-theme .function { color: #fdd835; }
