/* =======================================================
   matiasbull.com — light theme (Fintual-inspired)
   ======================================================= */

/* === Design tokens === */
:root {
  --bg:         #ffffff;
  --surface:    #f7f9fc;
  --surface-2:  #eef1f6;
  --text:       #1a1d23;
  --muted:      #6b7280;
  --accent:     #0dc47c;
  --accent-dark:#0aa868;
  --accent-dim: rgba(13, 196, 124, 0.1);
  --border:     rgba(0, 0, 0, 0.07);
  --shadow:     0 2px 20px rgba(0, 0, 0, 0.07);
  --shadow-lg:  0 8px 40px rgba(0, 0, 0, 0.1);
  --radius:     14px;
  --header-h:   64px;
}

/* === Reset & base === */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: var(--accent-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  margin-top: 0;
}

img { max-width: 100%; }

/* === Preloader === */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
}

#preloader::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Back to top === */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 996;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 22px;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s;
}

.back-to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.back-to-top.active {
  visibility: visible;
  opacity: 1;
}

/* === Header === */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 997;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

#header .container {
  height: 100%;
}

.logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent) !important;
  letter-spacing: 0.04em;
}

/* === Navbar === */
#navbar {
  display: flex;
  align-items: center;
}

#navbar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}

#navbar ul li a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 50px;
  transition: all 0.2s;
  display: block;
}

#navbar ul li a:hover,
#navbar ul li a.active {
  color: var(--text);
  background: var(--accent-dim);
}

.mobile-nav-toggle {
  display: none;
  font-size: 24px;
  color: var(--text);
  cursor: pointer;
  margin-left: 16px;
  line-height: 1;
}

/* === Mobile nav === */
@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: block;
  }

  #navbar ul {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    flex-direction: column;
    padding: 12px 16px 16px;
    gap: 4px;
  }

  body.mobile-nav-active #navbar ul {
    display: flex;
  }

  #navbar ul li a {
    padding: 10px 16px;
    border-radius: var(--radius);
  }
}

/* === AOS: disable delay on mobile === */
@media (max-width: 768px) {
  [data-aos-delay] { transition-delay: 0 !important; }
}

/* === Sections general === */
section {
  padding: 100px 0;
  overflow: hidden;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 48px;
}

/* === Hero === */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--header-h);
  background: var(--bg);
}

.hero-container {
  max-width: 760px;
  padding: 0 24px;
}

#hero h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.05;
}

#hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--muted);
  margin-bottom: 44px;
  min-height: 2em;
  font-weight: 400;
}

#hero p span {
  color: var(--accent);
  font-weight: 600;
}

#hero .social-links {
  display: flex;
  justify-content: center;
  gap: 16px;
}

#hero .social-links a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: var(--muted);
  transition: all 0.2s;
}

#hero .social-links a:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* === About === */
.about {
  background: var(--surface);
}

.profile-img {
  width: 240px;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.about-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}

.about-text {
  color: var(--text);
  font-size: 0.975rem;
  line-height: 1.85;
  margin-bottom: 36px;
}

.about-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px 16px;
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fact-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.fact-value a {
  color: var(--accent);
}

/* === Skills === */
.skills {
  background: var(--bg);
}

.skills-groups {
  display: flex;
  flex-direction: column;
  gap: 48px;
  max-width: 680px;
}

.skill-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 16px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: 50px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all 0.2s;
  cursor: default;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.skill-tag--strong {
  background: var(--accent-dim);
  border-color: rgba(13, 196, 124, 0.35);
  color: var(--accent-dark);
  font-weight: 600;
}

/* === Contact === */
.contact {
  background: var(--surface);
}

.contact-title {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.contact-social {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.contact-social a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: var(--muted);
  transition: all 0.2s;
}

.contact-social a:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* === Footer === */
#footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
}

#footer p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* === Portfolio Details page === */
.portfolio-details {
  padding-top: 40px;
  background: var(--bg);
  min-height: 100vh;
}

.portfolio-details .portfolio-details-slider img {
  width: 100%;
  border-radius: var(--radius);
}

.portfolio-details .portfolio-details-slider .swiper-pagination {
  margin-top: 20px;
  position: relative;
}

.portfolio-details .portfolio-details-slider .swiper-pagination .swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background: var(--surface-2);
  opacity: 1;
  border: 1px solid var(--accent);
}

.portfolio-details .portfolio-details-slider .swiper-pagination .swiper-pagination-bullet-active {
  background: var(--accent);
}

.portfolio-details .portfolio-info {
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.portfolio-details .portfolio-info h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.portfolio-details .portfolio-info ul {
  list-style: none;
  padding: 0;
  font-size: 15px;
  color: var(--muted);
}

.portfolio-details .portfolio-info ul li + li {
  margin-top: 10px;
}

.portfolio-details .portfolio-description {
  padding-top: 30px;
}

.portfolio-details .portfolio-description h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 20px;
}

.portfolio-details .portfolio-description p {
  color: var(--muted);
}
