/* --- Fonts--- */
@font-face {
  font-family: "Roboto";
  src: url("../fonts/roboto/roboto-variable.ttf")
    format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono";
  src: url("../fonts/roboto-mono/roboto-mono-variable.ttf")
    format("truetype");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Material Symbols";
  src: url("../fonts/material-symbols/material-symbols-outlined-variable.ttf")
    format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- Reset--- */
* {
  box-sizing: border-box;
  scroll-behavior: smooth;
  margin: 0;
  padding: 0;
  font: inherit;
}

:root {
  /* Fonts */
  --font-primary: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-secondary: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-symbols: "Material Symbols";

  /* Escala de grises */
  --neutral-100: #eee;
  --neutral-200: #ddd;
  --neutral-300: #ccc;
  --neutral-400: #aaa;
  --neutral-500: #888;
  --neutral-600: #666;
  --neutral-700: #444;
  --neutral-800: #333;
  --neutral-900: #222;

  /* Naranja */
  --orange-100: #f8e4be;
  --orange-200: #f5d599;
  --orange-300: #efbb5a;
  --orange-400: #e6a22a;
  --orange-500: #d7900b;
  --orange-600: #a87612;
  --orange-700: #744e0d;
  --orange-800: #45320a;
  --orange-900: #2a1d05;

  /* Azul */
  --blue-100: #e7f0fa;
  --blue-200: #d0e1f5;
  --blue-300: #a8c4eb;
  --blue-400: #7ca6df;
  --blue-500: #5189d3;
  --blue-600: #3e6fb9;
  --blue-700: #335c99;
  --blue-800: #2b4b7a;
  --blue-900: #233c60;

  /* Útiles */
  --focus-ring-500: #376038;
  --overlay-200: rgba(233, 236, 239, 0.8);
  --overlay-800: rgba(52, 58, 64, 0.8);
}

/* Light Theme */
:root[data-theme="light"] {
  --bg:                 var(--neutral-100);
  --surface:            var(--neutral-200);
  --surface-2:          var(--neutral-300);
  --surface-3:          var(--neutral-400);
  --border:             var(--neutral-500);
  --divider:            var(--neutral-500);
  --text-muted:         var(--neutral-600);
  --text:               var(--neutral-900);

  --primary:            var(--orange-300);
  --primary-hover:      var(--orange-500);
  --primary-foreground: var(--orange-900);
  --primary-contrast:   var(--orange-100);

  --accent:             var(--blue-600);
  --accent-hover:       var(--blue-400);

  --link:               var(--orange-800);
  --link-hover:         var(--orange-600);

  --focus-ring:         var(--focus-ring-500);
  --overlay:            var(--overlay-200);
}

/* Dark Theme */
:root[data-theme="dark"] {
  --bg:                 var(--neutral-900);
  --surface:            var(--neutral-800);
  --surface-2:          var(--neutral-700);
  --surface-3:          var(--neutral-600);
  --border:             var(--neutral-500);
  --divider:            var(--neutral-500);
  --text-muted:         var(--neutral-400);
  --text:               var(--neutral-100);

  --primary:            var(--blue-500);
  --primary-hover:      var(--blue-300);
  --primary-foreground: var(--blue-100);
  --primary-contrast:   var(--blue-700);

  --accent:             var(--orange-500);
  --accent-hover:       var(--orange-300);

  --link:               var(--blue-500);
  --link-hover:         var(--blue-300);

  --focus-ring:         var(--focus-ring-500);
  --overlay:            var(--overlay-800);
}

/* General Formats */
html, body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: flex-start;
  align-items: stretch;

  height: 100%;

  color: var(--text);
  background-color: var(--bg);
  font-family: var(--font-primary);
}

h1 {
  font-size: 2.5rem;
  font-weight: 400;
}

h2 {
  font-size: 1.5rem;
  font-weight: 400;
}

h3 {
  font-size: 1.25rem;
  font-weight: 300;
}

li {
  list-style-type: none;
}

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

a:hover {
  color: var(--link-hover);
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

.material-symbols-outlined {
  font-family: var(--font-symbols);
}

.selector {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--text-muted);
  cursor: pointer;
}

.selector:hover {
  color: var(--link-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .25rem .5rem;
  border-radius: .5rem;
  text-decoration: none;
}
.btn.primary {
  background: var(--primary-foreground);
  color: var(--bg);
}
.btn.primary:hover {
  background: var(--primary-hover);
  color: var(--primary-contrast);
}
.btn.ghost {
  background: var(--surface-2);
  color: var(--accent);
  border-color: var(--border);
}
.btn.ghost:hover {
  background: var(--accent-hover);
  color: var(--bg);
}

.btn:focus-visible,
.selector:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  position: fixed;
  top: 0;
  z-index: 100;
  width: 100%;
  padding: .25rem 2rem;
  
  background-color: var(--surface);
  font-family: var(--font-secondary);
}

header .logo {
    margin: .5rem;

    color: var(--accent);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.5rem;
}

header .logo:hover {
    color: var(--accent-hover);
}

header .right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

header nav ul {
  display: flex;
}

header nav a {
  font-size: 0.8125rem;
  margin: 1rem;
  color: var(--text-muted);
}

header nav a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

header nav li + li {
    border-left: 1px solid var(--border);
  }

/* header > selector */
.selector {
  font-size: 1.5rem;
  background: transparent;
  border: none;
  margin: .5rem;
}

.burger {
  display: none;
}

#theme-toggle .sun,
#theme-toggle .moon {
  display: none;
}

:root[data-theme="dark"] #theme-toggle .sun {
  display: inline;
}

:root[data-theme="light"] #theme-toggle .moon {
  display: inline;
}

/* main */
main {
  display: flex;
  justify-content: center;
  align-items: flex-start;

  width: 100%;
  padding: 2rem 4rem;
  margin-top: 4rem;
  gap: 2rem;
}

/* main - aside */
.profile {
  flex: 0 0 256px;
  top: 6rem;
  height: fit-content;
  max-width: 256px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  gap: 2rem;
}

.profile .avatar {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile .avatar img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  align-self: center;
}

.profile .me {
  gap: 0.5rem;

  display: flex;
  flex-direction: column;
}

.profile .me .name {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: baseline;
}

.profile .me .name h1 {
  line-height: 1;

  color: var(--text);
}

.profile .me .name span {
  font-size: 1.25rem;
  font-weight: 100;
  color: var(--text-muted);
}

.profile .me .subtitle {
  font-family: var(--font-secondary);
  font-weight: 500;
  font-size: 1rem;
  color: var(--accent);
}

.profile .me .desc {
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--text-muted);
}

.profile .meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  justify-content: center;
}

.profile .meta li {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  align-items: center;

  font-size: .8125rem;
  font-weight: 300;
}

.profile .meta li span {
  font-size: 1.5rem;
}

.profile .links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;

  padding: 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);

  font-size: .8125rem;
  font-weight: 600;
}

.icon, .tech-icon {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  background-color: currentColor;
  margin: 0 .125rem;

  /* WebKit */
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;

  /* Estándar */
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.icon-github { -webkit-mask-image: url("../img/icons/github.svg");
  mask-image: url("../img/icons/github.svg"); }
.icon-linkedin { -webkit-mask-image: url('../img/icons/linkedin.svg');
  mask-image: url('../img/icons/linkedin.svg'); }

.techs {
  display: flex;
  justify-content: space-between;

  color: var(--text-muted);
}

.tech-icon { width: 2rem; height: 2rem; }

.icon-html5 { -webkit-mask-image: url('../img/icons/html5.svg');
  mask-image: url('../img/icons/html5.svg'); }
.icon-css3 { -webkit-mask-image: url('../img/icons/css3.svg');
  mask-image: url('../img/icons/css3.svg'); }
.icon-js { -webkit-mask-image: url('../img/icons/javascript.svg');
  mask-image: url('../img/icons/javascript.svg'); }
.icon-db { -webkit-mask-image: url('../img/icons/db.svg');
  mask-image: url('../img/icons/db.svg'); }
.icon-python { -webkit-mask-image: url('../img/icons/python.svg');
  mask-image: url('../img/icons/python.svg'); }
.icon-java { -webkit-mask-image: url('../img/icons/java.svg');
  mask-image: url('../img/icons/java.svg'); }

/* main - sections */
main .content {
  flex: 1;

  display: flex;
  flex-direction: column;
  gap: 2rem;

  max-width: 960px;
}

main section + section {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

section h2 {
  padding-bottom: 2rem;
}

/* main - section - about */
#about p {
  line-height: 1.75;
  color: var(--text-muted);
}

#about p + p {
  padding-top: 1rem;
}

/* main - section - skills */
#skills .skills-list {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1rem;
}

#skills .skills-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  text-align: center;
}

#skills .skills-list span {
  width: 4rem;
  height: 4rem;
  align-content: center;
  border-radius: 50%;

  margin: .75rem 0;

  font-size: 3rem;
  background-color: var(--text-muted);
  color: var(--bg);
}

#skills .skills-list p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* main - section - experience/education */
:is(#experience, #education) .tl-group {
  position: relative;
}

:is(#experience, #education) .tl-year {
  color: var(--text-muted);
  font-weight: 600;
  margin: 0.25rem 0 1rem;
}

:is(#experience, #education) .tl-list {
  list-style: none;
  position: relative;
}

:is(#experience, #education) .tl-list::before {
  content: "";
  position: absolute;
  left: .75rem;
  top: .5rem;
  bottom: 0;
  width: 2px;
  background: var(--surface);
  border-radius: 1px;
}

:is(#experience, #education) .tl-item {
  position: relative;
  padding-left: 1.75rem;
  margin: 0 0 1.25rem 0;
}

:is(#experience, #education) .tl-item::before {
  content: "";
  position: absolute;
  left: .75rem;
  top: .5rem;
  transform: translateX(-50%);
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--surface),
    inset 0 0 0 4px var(--bg);
}

:is(#experience, #education) .tl-title {
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.25rem;
}

:is(#experience, #education) .tl-meta {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}

/* main - section - projects */
#projects {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#projects h2 {
  align-self: flex-start;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background-color: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 0.5rem;
  overflow: hidden;
}

.project-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.project-body {
  padding: .5rem 1rem 1rem;
}

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.project-title {
  color: var(--accent);
  font-weight: 600;
}

.project-title:hover {
  color: var(--accent-hover);
}

.project-badges {
  display: inline-flex;
  gap: 0.5rem;
}

.project-badges span {
  color: var(--text-muted);
}

.project-badges .tech-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-block;
}

.project-sep {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0 0.5rem;
}

.project-desc {
  color: var(--text-muted);
}

/* footer */
footer {
  display: flex;
  justify-content: center;
  align-items: center;

  position: relative;
  bottom: 0;
  z-index: 100;
  width: 100%;
  padding: .5rem 2rem;

  font-family: var(--font-secondary);


  background-color: var(--surface);
}

footer div {
  display: flex;
}

footer .footer-msg {
  font-size: .625rem;
  text-align: center;
  max-width: 40rem;

  margin: .5rem;
}

footer .footer-links {
    display: flex;
    justify-content: space-between;
}

footer .footer-links .button-link {
    height: 1.5rem;
    width: 1.5rem;
    margin: .5rem;

    color: var(--text-muted);
}

footer .footer-links .button-link:hover {
    color: var(--link-hover);
}

/* focus */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
:focus {
  outline: none;
}

/* media queries */
@media (max-width: 850px) {
  header .right {
    position: relative;
  }

  header .right #nav {
    display: none;
    position: absolute;
    top: 2.5rem;
    right: 0;
    width: max-content;
    flex-direction: column;
    z-index: 100;

    background-color: var(--surface);
    border-radius: 0.5rem;
  }

  header .right #nav.open {
    display: block;
  }

  header .right #nav ul {
    display: block;
  }

  header .right #nav a {
    display: block;
  }

  header nav li + li {
    border-left: none;
  }

  .burger {
    display: block;
  }

  main {
    flex-direction: column;
    align-items: center;
  }

  .projects-grid {
    grid-template-columns: minmax(256px, 512px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none;
    transition: none;
  }
  html:focus-within {
    scroll-behavior: auto;
  }
}
