/* =====================================================================
   1. TIPOGRAFIES
   ===================================================================== */

@font-face {
  font-family: 'Sentient Variable';
  src: url('assets/Sentient-Variable.ttf') format('truetype');
}

@font-face {
  font-family: 'Sentient Variable Italic';
  src: url('assets/Sentient-VariableItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'General Sans Variable';
  src: url('assets/GeneralSans-Variable.ttf') format('truetype');
}

@font-face {
  font-family: 'General Sans Variable Italic';
  src: url('assets/GeneralSans-VariableItalic.ttf') format('truetype');
}



/* =====================================================================
   2. VARIABLES DE COLOR
   ===================================================================== */

:root {
  --bg: #EAE5DD;
  --text: #612705;
  --transition-speed: 0.6s;

  /* variables d'opacitat */
  --op-strong: 1;
  --op-medium: 0.7;
  --op-soft: 0.5;
}



/* =====================================================================
   3. BASE
   ===================================================================== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0px;
}

body {
  padding: 0px 40px 0px 40px;
  display: flex; 
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg);
  color: var(--text);
  font-family: 'General Sans Variable';
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

.no-scroll {
  height: 100dvh;
  overflow: hidden;
  scrollbar-gutter: stable;
}

h1 {
  margin: 0 0 0 0;
}

/* RESPONSIVITAT */
@media (max-width: 768px) {
  body {
    padding: 0px 16px 0px 16px;
  }

}



/* =====================================================================
    4. LAYOUT COMPARTIT - HEADER
   ===================================================================== */

.header-bar {
  padding: 20px 0 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
}

.header-bar div {
  width: 100%;
}

header a {
  text-decoration: none;
  font-family: 'Sentient Variable Italic';
  font-style: normal;
  font-size: 16px;
  font-weight: 250;
  color: var(--text);
  opacity: var(--op-strong);
  cursor: pointer;
  padding: 0;
  transition: opacity 0.3s ease, color var(--transition-speed) ease;
}

header a:hover {
  color: var(--text);
  opacity: var(--op-soft);
}

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

header a:visited {
  color: var(--text);
}

header a:active {
  color: var(--text);
}

.logo {
  font-family: 'General Sans Variable';
  font-style: normal;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  opacity: var(--op-strong);
  cursor: pointer;
  padding: 0;
  transition: opacity 0.3s ease, color var(--transition-speed) ease;
}

nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

nav a:first-child {
  justify-self: end;
}

nav a:last-child {
  justify-self: start;
}

.nav-sep {
  justify-self: center;
  color: var(--text);
  opacity: var(--op-strong);
}

.active {
  font-weight: 400;
}

.location {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.location span {
  color: var(--text);
  opacity: var(--op-strong);
  font-weight: 350;
}

.location strong {
  color: var(--text);
  opacity: var(--op-strong);
  font-weight: 500;
}

/* RESPONSIVITAT */
@media (min-width: 1025.02px) {
  .hide-desktop {
    display: none;
  }
}

@media (max-width: 1025px) {
  header {
    position: sticky;
    top: 0;
    z-index: 10;
    isolation: isolate;
    /* perquè el ::before quedi darrere del contingut del header */
  }

  header::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    /* percentatge baix = transparencia alta*/
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    z-index: -1;

    mask-image: linear-gradient(to bottom, black 50%, transparent 105%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 105%);
  }
}

@media (min-width: 768.02px) and (max-width: 1025px) {
  header::before {
    left: -40px;
    right: -40px;
  }

  .hide-tablet {
    display: none;
  }

  .header-bar {
    padding: 20px 0px 32px 0px;
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  header::before {
    left: -16px;
    right: -16px;
  }

  .hide-mobile {
    display: none;
  }

  .header-bar {
    padding: 16px 0px 16px 0px;
    font-size: 14px;
  }

  header a {
    font-size: 14px;
  }

  .logo {
    font-size: 14px;
  }

  nav {
    width: 100vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}




/* =====================================================================
    5. LAYOUT COMPARTIT - MAIN
   ===================================================================== */

main.page-home,
main.page-about {
  height: 100%;
  padding: 96px 0px 20px 0px;
}

/* RESPONSIVITAT */
@media (max-width: 768px) {

  main.page-home {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 1;
    padding: 0px 0px 20px 0px;
  }

  main.page-about {
    padding: 80px 0px 0px 0px;
  }
}



/* =====================================================================
    6. LAYOUT COMPARTIT - FOOTER
   ===================================================================== */

.footer-div {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px 0px 20px 0px;
}

footer {
  width: fit-content;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  opacity: var(--op-soft);
  margin-bottom: 6px;
}

/* RESPONSIVITAT */
@media (max-width: 769px) {
  footer {
    font-size: 10px;
  }
}



/* =====================================================================
    7. PÀGINA: HOME
   ===================================================================== */

.page-home p {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.30;
  margin: 0 0 20px 0;
  color: var(--text);
}

.page-home p b {
  font-weight: 550;
}

.page-home a {
  text-decoration: underline;
  color: var(--text);
  opacity: var(--op-strong);
  cursor: pointer;
  padding: 0;
  transition: opacity 0.3s ease, color var(--transition-speed) ease;
}

.page-home a:hover {
  color: var(--text);
  opacity: var(--op-soft);
}

/* RESPONSIVITAT */
@media (max-width: 768px) {
  .page-home p {
    font-size: 20px;
    line-height: 1.30;
  }
}



/* =====================================================================
    8. PÀGINA: ABOUT
   ===================================================================== */

main.page-about {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-gap: 24px;
}

/* SECCIÓ ESQUERRA: INTRO + DESCRIPCIÓ + CONTACTE */

.about-intro {
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.about-description {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 40px 0;
}

.about-description p.about-role {
  margin: 0 0 8px 0;
  font-family: 'General Sans Variable Italic';
  font-size: 14px;
  font-weight: 500;
}

.about-description p {
  margin: 0;
  font-family: 'General Sans Variable';
  font-size: 16px;
  font-weight: 400;
  line-height: 1.30;
  color: var(--text);
}

.about-contact-container {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.about-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.about-contact div {
  margin-bottom: 4px;
  font-family: "General Sans Variable";
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
}

.about-contact a {
  text-decoration: underline;
  color: var(--text);
  opacity: var(--op-strong);
  cursor: pointer;
  padding: 0;
  transition: opacity 0.3s ease, color var(--transition-speed) ease;
}

.about-contact a:hover {
  color: var(--text);
  opacity: var(--op-soft);
}


/* SECCIÓ DRETA: CV */

.about-cv {
  height: fit-content;
  grid-column: span 7;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.about-section {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-gap: 24px;
  margin: 0 0 24px 0;
}

.about-section.education-section {
  margin-bottom: 0px;
}

.about-section-title {
  min-width: stretch;
  grid-column: span 1;
  padding: 1.5px 0 0 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  align-self: stretch;
  gap: 10px;
}

.about-section-title h2 {
  color: var(--text);
  margin: 0px;
  font-family: 'Sentient Variable Italic';
  font-size: 12px;
  font-weight: 300;
  line-height: 1.20;
  text-align: right;
}

.about-section-title h2 span {
  color: var(--text);
  font-family: 'General Sans Variable Italic';
  font-weight: 400;
}

.about-entries {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.about-entry {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 12px 0;
}

.about-entry-less-margin {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 8px 0;
}

.about-entry h3 {
  margin: 0px;
  font-family: 'General Sans Variable';
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
}

.about-entry h3 b {
  font-weight: 550;
}

.about-entry h3 a {
  font-family: 'General Sans Variable Italic';
  text-decoration: underline;
  color: var(--text);
  opacity: var(--op-strong);
  cursor: pointer;
  padding: 0;
  transition: opacity 0.3s ease, color var(--transition-speed) ease;
}

.about-entry a:hover {
  color: var(--text);
  opacity: var(--op-soft);
}

.about-dates {
  margin: 0px;
  font-family: 'General Sans Variable';
  font-size: 14px;
  font-weight: 400;
  line-height: 1.20;
  opacity: var(--op-medium);
}

.about-entry-description {
  margin: 0 0 2px 0;
  font-family: 'General Sans Variable';
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
}


/* RESPONSIVITAT */
@media (max-width: 1025px) {
  body.no-scroll {
    height: auto;
    min-height: 100svh;
    overflow: visible;
    scrollbar-gutter: auto;
    scrollbar-width: none;
    -ms-overflow-style: none
  }

  html::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Edge modern (Chromium) */
  }

  main.page-about {
    display: flex;
    flex-direction: column;
    padding-top: 0px;
    height: auto;
    gap: var(--header-h, 96px);
  }

  /* about-intro ocupa tota la pantalla disponible (viewport - alçada del header) */
  .about-intro {
    min-height: calc(100svh - var(--header-h, 40px));
    justify-content: flex-end;
    padding: 0 0 24px 0;
    gap: 2rem;
  }

  .about-description {
    margin: 0;
  }

  /* fa que el scroll del botó "ir" deixi la secció about-cv just sota el header */
  #section-about-cv {
    scroll-margin-top: var(--header-h, 96px);
    min-height: calc(100svh - var(--header-h, 96px));
  }

  .scroll-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--text);
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: opacity 0.3s ease, color var(--transition-speed) ease, border-color var(--transition-speed) ease;
  }

  .scroll-arrow:hover {
    opacity: var(--op-soft);
  }

  .scroll-arrow svg {
    display: block;
  }

  .about-cv {
    padding: 24px 0 0 0;
  }

  .about-section {
    display: grid;
    grid-template-columns: 64px repeat(5, 1fr);
    grid-gap: 16px;
  }

  .about-section.education-section {
    margin-bottom: 24px;
  }

  .about-entries {
    grid-column: span 5;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

}