/* Color Palette Variables */
:root {
  /* --- Core Colors --- */
  --main-primary: #47a; /* Steel Blue - Brand */
  --main-accent-hover: #c49f3b; /* Yellow-Gold - For interactive elements on hover/focus */

  /* --- Backgrounds --- */
  --bg-primary: #f5f5dc; /* Beige - Main page background*/
  --bg-secondary: #ffffff; /* White - For content cards, modals, or distinct sections to create contrast with beige */
  --bg-dark-section: #141414; /* Very Dark Gray - For footers, sidebars, or contrasting sections */
  --bg-secondary-dark: #2f323f; /* Dark Slate Blue/Charcoal - For secondary backgrounds, such as cards or sections on dark mode */

  /* --- Text Colors --- */
  --text-primary-on-light: #0a0a0a; /* Dark Gray - For primary text on light backgrounds (Beige, White) */
  --text-secondary-on-light: #64647c; /* Slate Gray/Manatee - For secondary text, subtitles on light backgrounds */
  --text-primary-on-dark: #fafafa; /* Light Beige/Off-White - For text on dark backgrounds (Dark Slate Blue) */
  --text-link: #476dae; /* Slightly desaturated Steel Blue - For hyperlinks, can be underlined with main-primary */
  --text-link-visited: #3a5b8e; /* Lighter Steel Blue - For visited links, slightly desaturated for distinction */
  --text-link-hover: var(--main-primary);

  /* --- Borders & Shadows --- */
  --border-light: #c4c4c4; /* Light Gray - For subtle borders on cards, inputs */
  --grid-alpha: rgba(196, 196, 196, 0.05);
  --border-dark: #64647c; /* Slate Gray/Manatee - For more pronounced borders or dividers */
  --shadow-color: #1414141a; /* Very Dark Gray with alpha - For subtle, clean shadows */

  /* --- UI Elements & States --- */
  --button-primary-bg: var(--main-primary);
  --button-primary-text: var(--text-primary-on-dark);
  --button-primary-hover-bg: #3a6b8f; /* Darker shade of Steel Blue for hover */
  --button-secondary-bg: var(--bg-secondary);
  --button-secondary-text: var(--main-primary);
  --button-secondary-border: var(--main-primary);
  --button-secondary-hover-bg: #e0e0e0; /* Light gray for hover on secondary buttons */

  --disabled-bg: #e0e0e0; /* Light Gray - For disabled input fields or buttons */
  --disabled-text: #a0a0a0; /* Medium Gray - For text on disabled elements */
}

/* Reset Styles */
/* From Andy's CSS Reset */
/* https://piccalil.li/blog/a-modern-css-reset

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

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

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

/*******************************************/

/* Global Styles */
html {
  font-size: clamp(1rem, 0.9565rem + 0.2174vw, 1.125rem);
  scroll-behavior: smooth;
}

body {
  background-color: var(--main-primary);
}
p {
  font-family: "Source Serif 4", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  color: var(--text-primary-on-light);
  margin-bottom: 1rem;
}
h1,
h2,
h3 {
  font-family: "Oswald", sans-serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
  color: var(--text-primary-on-light);
}
h1 {
  font-size: 3.77rem;
}
h2 {
  font-size: 2.33rem;
}
h3 {
  font-size: 1.44rem;
}
h4 {
  font-family: "Source Sans 3", sans-serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
  font-size: 1.3rem;
  color: var(--text-primary-on-light);
}
small {
  font-family: "Source Serif 4", serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
  color: var(--text-secondary-on-light);
  font-size: 0.89rem;
}
.dark-bg {
  background-color: var(--bg-dark-section);
  color: var(--text-primary-on-dark);
}
.dark-bg h1,
.dark-bg h2,
.dark-bg h3,
.dark-bg h4 {
  color: var(--text-primary-on-dark);
}
.grid-bg {
  background: repeating-linear-gradient(
      var(--grid-alpha) 0 1px,
      transparent 1px 30px
    ),
    repeating-linear-gradient(
      90deg,
      var(--grid-alpha) 0 1px,
      transparent 1px 30px
    ),
    radial-gradient(
      circle,
      var(--bg-secondary-dark) 1%,
      var(--bg-dark-section) 100%
    );
  background-size: 15px 15px, 15px 15px, 100% 600%;
}

.content-wrapper {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (aspect-ratio > 1.3) {
  .content-wrapper {
    padding: 0 2.1rem;
  }
}
@media (width > 1024px) {
  .content-wrapper {
    padding: 0;
  }
}

button {
  font-family: "Source Sans 3", sans-serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  color: var(--button-primary-text);
  cursor: pointer;
  border: none;
  padding: 0.5lh 0.8lh;
  margin: 0 auto;
  display: inline-block;
  background-color: var(--button-primary-bg);
  width: fit-content;
  transition-duration: 0.3s;
  position: relative;
  overflow: hidden;
}
button:hover {
  box-shadow: 0 0 8px 0 var(--button-primary-hover-bg),
    0 0 13px 0 var(--button-primary-hover-bg);
  background-color: var(--button-primary-hover-bg);
}
button:after {
  content: "";
  background: var(--button-primary-text);
  display: block;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 100%;
  opacity: 0;
  transition: all 0.8s;
}
button:focus-visible {
  outline: 1px solid var(--main-accent-hover);
  outline-offset: 0.2lh;
  background: var(--main-accent-hover);
}
button:active:after {
  padding: 0;
  margin: 0;
  width: 100%;
  opacity: 0.8;
  transition: 0s;
}
a {
  color: var(--text-link);
  transition: color 0.3s ease-in-out;
}
a:link {
  color: var(--text-link);
}
a:visited {
  color: var(--text-link-visited);
}
a:active {
  color: var(--main-accent-hover);
  outline: none;
}
a:hover,
a:focus {
  color: var(--text-link-hover);
}
a:focus {
  text-decoration-color: var(--main-accent-hover);
  text-underline-offset: 0.2lh;
  outline: 1px solid var(--main-accent-hover);
  outline-offset: 0.1lh;
}
/*******************************************/
/********Styles for header section**********/
header {
  position: sticky;
  background-color: rgba(20, 20, 20, 0.8);
  top: 0;
  z-index: 1000;
  box-shadow: 0 -5px 21px 2px var(--bg-secondary-dark);
  backdrop-filter: blur(3px);

  .content-wrapper {
    display: flex;
    justify-content: space-between;
    font-family: "Source Sans 3", sans-serif;
    font-weight: 600;
    text-transform: uppercase;
  }

  nav {
    display: flex;
  }

  ul {
    margin: 0;
    padding: 0;
    display: flex;
    list-style: none;
  }
  ul li {
    display: flex;
  }
  ul a {
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary-on-dark);
  }
  ul a:link {
    color: var(--text-primary-on-dark);
  }
  ul a:visited {
    color: var(--text-primary-on-dark);
  }
}
header li:hover,
header a:focus {
  background-color: var(--main-primary);
  color: var(--bg-dark-section);
}
#logo {
  width: 1.5rem;
  height: 1.5rem;
}
#logo-link {
  color: white;
  padding: 0.5rem 1rem;
  display: flex;
}
#logo-link:hover {
  color: var(--main-primary);
}
#logo-link:active {
  color: var(--main-accent-hover);
  outline: none;
}
#logo-link:focus {
  color: var(--text-primary-on-dark);
}

.no-break {
  white-space: nowrap;
}
#services,
#cv,
#portfolio {
  display: none;
}

/*******************************************/
/*********Styles for hero section***********/
#hero {
  height: calc(100vh);
  height: calc(100dvh);
  margin-top: -2.5rem;
  position: relative;
  overflow: hidden;
}
#hero .content-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#hero .first,
#hero .second {
  z-index: 1;
}

#hero .content-wrapper::after {
  content: "";
  position: absolute;
  background-image: url("../images/hero-bg-animation.svg");
  background-size: 120%;
  top: 0;
  left: 0;
  transform: translate(-125%, -125%);
  width: 500%;
  height: 500%;
  mix-blend-mode: color-dodge;
  background-repeat: no-repeat;
  animation: move-svg 8s linear infinite forwards;
}
@keyframes move-svg {
  from {
    transform: translate(-125%, -125%);
  }
  to {
    transform: translate(25%, 25%);
  }
}

#hero .second {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  animation: showSecond 2s cubic-bezier(0.7, 0, 0.4, 1) 0.2s forwards;
  opacity: 0;
}
.hero-img-wrapper {
  width: min(70vmin, 344px);
  aspect-ratio: 1;
}
#hero .second img {
  object-fit: contain;
  width: 100%;
}
@keyframes showSecond {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#hero .first {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  text-align: center;
  height: 100%;
  line-height: 1.1;
  margin-top: 2.5rem;

  h2 {
    opacity: 0;
    text-transform: uppercase;
    font-size: clamp(3.4rem, 2.1rem + 3.4vw, 5.5rem);
    color: var(--text-primary-on-dark);
    animation: showName 2s ease-in-out 0.2s forwards;
  }
  p {
    color: var(--text-secondary-on-light);
    opacity: 0;
    text-transform: uppercase;
    font-family: "Oswald", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: clamp(1.2rem, 0.5rem + 1.3vw, 2.1rem);
  }
  .main-description {
    font-size: clamp(1.3rem, 0.8rem + 1.44vw, 2.33rem);
    font-weight: 600;
    color: var(--main-primary);
    opacity: 0;
    animation: showDescription 2s cubic-bezier(0.7, 0, 0.4, 1) 0.2s forwards;
  }
  .bottom-text {
    animation: showText 1.6s cubic-bezier(0.7, 0, 0.4, 1) 0.6s forwards;
  }
  .top-text {
    animation: showText 1s ease-out 1.2s forwards;
  }
}
#hero-contact-button {
  font-family: "Source Sans 3", sans-serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  color: var(--button-primary-text);
  cursor: pointer;
  border: none;
  padding: 0.5lh 0.8lh;
  margin: 0 auto;
  cursor: pointer;
  border: none;
  display: inline-block;
  background-color: var(--button-primary-bg);
  width: fit-content;
  position: relative;
  transition: all 0.8s;
  opacity: 0;
  font-size: clamp(1rem, 0.5rem + 0.8vw, 1.5rem);
  animation: showName 2s cubic-bezier(0.7, 0, 0.4, 1) 0.2s forwards;
}
#hero-contact-button:hover {
  box-shadow: 0 0 8px 0 var(--button-primary-hover-bg),
    0 0 13px 0 var(--button-primary-hover-bg);
  background-color: var(--button-primary-hover-bg);
}
#hero-contact-button:after {
  content: "";
  background: var(--button-primary-text);
  display: block;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 100%;
  opacity: 0;
  transition: all 0.8s;
}
#hero-contact-button:active {
  background-color: var(--text-primary-on-dark);
  opacity: 0.8;
  transition: 0s;
}
#hero-contact-button:focus {
  outline: 0.2rem solid var(--main-accent-hover);
  outline-offset: 0.2lh;
}
#hero-contact-button:active {
  outline: none;
}
@keyframes showName {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes showDescription {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes showText {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (aspect-ratio > 1.3) {
  #hero .content-wrapper {
    flex-direction: row;
    justify-content: space-around;
    padding-block: 13vh;

    .first {
      width: 60%;
      text-align: left;
      white-space: nowrap;
      margin-top: 0;
    }
    .second {
      width: 40%;
      flex: 1;
    }
    img {
      border-radius: 10%;
      mask-image: linear-gradient(to bottom, black 90%, transparent);
    }
  }
  #hero-contact-button {
    text-align: left;
    margin: 0;
  }
}
@media (width > 640px) {
  #hero .content-wrapper::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    transform: rotate(-5deg) translate(-50%, -50%);
    background-size: 15%;
    background-color: var(--main-primary);
    mask-image: url("../images/hero-bg.svg");
    mask-size: 15%;
    opacity: 0.25;
  }
}

/********************************************/
/**************Styles for main***************/
/********************************************/
main {
  padding: 2rem 0;
}
main h3 {
  color: var(--text-primary-on-dark);
  margin-top: 1rem;
}
main p,
main strong {
  color: var(--text-primary-on-dark);
  font-family: "Oswald", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
}
main strong {
  display: block;
  width: fit-content;
  margin-left: auto;
  letter-spacing: 0.05lh;
  margin-bottom: 1rem;
}
/********************************************/
/*************Styles for skills**************/
/********************************************/
#skills {
  background-color: var(--bg-secondary);
  padding: 2rem 0;
}
#skills h2 {
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.skills-category ul {
  width: 80%;
}
.skills-category {
  display: flex;
  flex-direction: column;
  align-items: center;
  outline: 1px solid var(--border-light);
  width: 100%;
}
.skills-category h2,
.skills-category h3 {
  text-transform: uppercase;
  padding-top: 1rem;
}
.skills-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}
.first-skills-wrap {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.first-skills-wrap .skills-category {
  flex: 1 1 340px;
}
.second-skill-wrap {
  display: flex;
  gap: 1rem;
  width: 100%;
  justify-content: space-around;
  flex-wrap: wrap;
  padding: 1rem;
}
.skills-category {
  flex: 1 1 auto;
}
.software-skills {
  padding: 1rem;
  flex: 1;
  text-align: center;
  width: 100%;
  min-width: fit-content;
  box-shadow: 0 0 8px 0 var(--shadow-color), 0 0 13px 0 var(--shadow-color);
}
.software-skills ul {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  width: 100%;
}
.languages-skills {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}
.languages-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 1rem 1rem;
}
.languages-skills ul {
  width: auto;
  flex: 1;
  min-width: fit-content;
}
.languages-skills h3 {
  padding-bottom: 1rem;
  width: 30%;
  min-width: 300px;
  text-align: center;
}
/********************************************/
/*************Styles for footer**************/
footer {
  padding: 1.5rem 0;
}
footer .content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
footer h2 {
  text-align: center;
  margin-block: 1rem;
}
.footer-text {
  margin-bottom: 1rem;
}
footer p {
  text-align: center;
  color: var(--text-primary-on-dark);
  font-family: "Oswald", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
}
footer .external-link {
  display: inline-flex;
}
.cc0-img {
  width: 1.5rem;
  margin-left: 0.5rem;
  vertical-align: text-bottom;
}
.footer-license {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.footer-license p {
  padding: 0;
  margin: 0;
  line-height: 1.5;
}
#social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.social-item {
  display: inline-block;
  margin-inline: 0.5rem;
}
.social-item a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-link);
  font-family: "Source Sans 3", sans-serif;
  font-weight: 400;
  font-size: clamp(0.9rem, 0.6rem + 0.4vw, 1.2rem);
  transition: color 0.3s linear;
}
.social-item a:hover,
.social-item a:focus {
  color: var(--text-link-hover);
}
.social-item a:focus {
  text-decoration: underline;
  text-underline-offset: 0.2lh;
  text-decoration-color: var(--main-accent-hover);
  outline: 1px solid var(--main-accent-hover);
  outline-offset: 0.2lh;
}
.social-item a:active {
  color: var(--main-accent-hover);
}

.social-icon {
  width: 2rem;
  height: 2rem;
  padding: 0.25rem;
  margin: 0.25rem;
  align-self: center;
  color: white;
  transition: color 0.3s linear, background-color 0.3s linear;
  border-radius: 20%;
  position: relative;
}
.social-item:hover .mail-icon,
.social-item a:focus .mail-icon {
  background-color: var(--text-link-hover);
}

.social-item:hover .github-logo,
.social-item a:focus .github-logo {
  color: black;
  background-color: white;
}

.social-item:hover .medium-logo,
.social-item a:focus .medium-logo {
  color: black;
  background-color: white;
}
.linkedin-logo .linkedin-original,
.linkedin-logo .linkedin-inverted {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.social-item:hover .linkedin-logo,
.social-item a:focus .linkedin-logo {
  background-color: #0077b5;
}
.social-item:hover .linkedin-original,
.social-item a:focus .linkedin-original {
  opacity: 0;
  pointer-events: none;
}
.linkedin-logo .linkedin-inverted {
  opacity: 0;
  pointer-events: none;
  /* transition: opacity 0.5s linear; */
}
.social-item:hover .linkedin-inverted,
.social-item a:focus .linkedin-inverted {
  opacity: 1;
  pointer-events: auto;
  /* transition: opacity 0.5s linear; */
}
