/* ===========================
   CSS VARIABLES & RESET
   =========================== */
:root {
  --bg: #faf9f6;
  --bg-alt: #ffffff;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #555568;
  --text-muted: #8888a0;
  --accent: #111111;
  --accent-light: #e0e0e0;
  --accent-hover: #000000;
  --border: #e8e7ed;
  --border-hover: #cccad6;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 50px;
  --max-width: 1100px;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-heading: "Space Grotesk", "Inter", sans-serif;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.1) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

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

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

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: var(--accent-light);
  color: var(--accent);
}

/* ===========================
   NAVBAR
   =========================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(250, 249, 246, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: all 0.4s var(--ease);
}

#navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--text);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  transition: color 0.3s var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.3s var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-right {
  display: flex;
  gap: 0.75rem;
}

.btn-nav {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.3s var(--ease);
}

.btn-nav:hover {
  border-color: var(--text);
  color: var(--text);
}

.btn-nav.btn-filled {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-nav.btn-filled:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s var(--ease);
  transform-origin: center;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===========================
   HERO
   =========================== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 2rem 80px;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.hero-content {
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  margin: 0 auto;
}

.hero-text-section {
  flex: 1;
  text-align: left;
}

.hero-photo-section {
  flex-shrink: 0;
}

.hero-greeting {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
  display: block;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  font-weight: 400;
}

.hero-degree {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-weight: 400;
}

.char {
  display: inline;
  opacity: 0;
  transition: opacity 0.05s var(--ease-out);
}

.char.visible {
  opacity: 1;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-socials-inline {
  display: flex;
  gap: 1.5rem;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s var(--ease);
  cursor: pointer;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--text);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--text);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-filled {
  background: var(--text);
  border: 1.5px solid var(--text);
  color: var(--bg);
}

.btn-filled:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hero-socials-inline a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text);
  transition: all 0.3s var(--ease);
}

.hero-socials-inline a:hover {
  color: var(--accent);
  transform: translateY(-3px) scale(1.1);
}

.hero-photo {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, var(--accent-light), #f5f5f5);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.hero-photo:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: var(--shadow-lg), 0 0 0 2px var(--accent);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: var(--accent);
  opacity: 0.6;
}

/* ===========================
   SECTION COMMON
   =========================== */
section {
  padding: 100px 2rem;
}

.section-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  margin-bottom: 3.5rem;
}

.section-label {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 500px;
}

.tag {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.3s var(--ease);
}

.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
}

/* ===========================
   WORK CARDS
   =========================== */
.work-grid {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 1.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.work-grid::-webkit-scrollbar {
  height: 8px;
}

.work-grid::-webkit-scrollbar-track {
  background: var(--border);
  border-radius: 10px;
}

.work-grid::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

.work-grid::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.4s var(--ease);
  flex: 0 0 450px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.work-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.work-card-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 2.5rem;
  gap: 2rem;
  flex: 1;
}

.work-card-image {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-light), #f5f5f5);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: transform 0.4s var(--ease);
}

.work-card:hover .work-card-image {
  transform: scale(1.02);
}

.work-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.4;
}

.work-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.work-card-content h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.work-card-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  max-width: 550px;
}

.work-card-links {
  display: flex;
  gap: 1.25rem;
  margin-top: auto;
}

.work-card-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.3s var(--ease);
}

.work-card-links a:hover {
  color: var(--accent-hover);
  transform: translateX(2px);
}

.work-card-visual {
  flex-shrink: 0;
}

.work-card-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-light), #f5f5f5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease);
}

.work-card:hover .work-card-icon {
  transform: scale(1.05) rotate(2deg);
}

.work-card-icon i {
  font-size: 2rem;
  color: var(--accent);
}

/* ===========================
   SKILLS
   =========================== */
#skills {
  background: var(--bg-alt);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.4s var(--ease);
}

.skill-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.skill-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.skill-card-icon i {
  font-size: 1.2rem;
  color: var(--accent);
}

.skill-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tags span {
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.3s var(--ease);
}

.skill-tags span:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ===========================
   JOURNEY
   =========================== */
.journey-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.journey-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}

.journey-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: height 0.5s var(--ease-out);
}

.journey-card:hover::before {
  height: 100%;
}

.journey-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.journey-year {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.75rem;
}

.journey-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.journey-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===========================
   ABOUT
   =========================== */
#about {
  background: var(--bg-alt);
}

.about-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
}

.about-content {
  max-width: 600px;
  flex: 1;
}

.about-image {
  flex-shrink: 0;
  width: 320px;
  height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.about-image:hover {
  transform: scale(1.02) rotate(-1deg);
  box-shadow: var(--shadow-lg), 0 0 0 2px var(--accent);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-content p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 1.25rem;
}

.about-content strong {
  color: var(--text);
  font-weight: 600;
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  justify-content: center;
}

/* ===========================
   CONTACT / CTA
   =========================== */
#contact {
  padding: 120px 2rem;
}

.cta-block {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta-block h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.cta-email {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent);
  padding: 0.75rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all 0.3s var(--ease);
  margin-bottom: 2rem;
}

.cta-email:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 58, 255, 0.2);
}

.cta-socials {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
}

.cta-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 1.8rem;
  transition: all 0.3s var(--ease);
}

.cta-socials a:hover {
  color: var(--accent);
  transform: translateY(-3px) scale(1.1);
}

/* ===========================
   FOOTER
   =========================== */
footer {
  text-align: center;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===========================
   ANIMATIONS
   =========================== */
.anim-fade {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.anim-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

.anim-slide-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.anim-slide-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth page load */
body {
  animation: pageLoad 0.8s var(--ease-out);
}

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

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background: rgba(250, 249, 246, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform 0.4s var(--ease-out);
    z-index: 999;
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 0;
    font-size: 1rem;
  }

  .nav-right {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  #hero {
    padding: 100px 1.5rem 60px;
  }

  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
    gap: 3rem;
  }

  .hero-text-section {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-socials-inline {
    justify-content: center;
  }

  .hero-name {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }

  .hero-photo {
    width: 200px;
    height: 200px;
  }

  .hero-photo-placeholder {
    font-size: 3.5rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    gap: 1rem;
  }

  .btn-hero {
    width: 100%;
  }

  .work-card-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.75rem;
  }

  .work-card {
    flex: 0 0 320px;
  }

  .work-card-icon {
    width: 56px;
    height: 56px;
  }

  .work-card-icon i {
    font-size: 1.4rem;
  }

  .about-wrapper {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2.5rem;
  }

  .about-image {
    width: 280px;
    height: 280px;
  }

  section {
    padding: 60px 1.5rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .journey-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0 1rem;
  }

  section {
    padding: 50px 1rem;
  }

  .hero-name {
    font-size: clamp(1.8rem, 12vw, 3rem);
  }

  .hero-greeting {
    font-size: 0.9rem;
  }

  .hero-subtitle,
  .hero-degree {
    font-size: 0.9rem;
  }

  .btn-hero {
    font-size: 0.9rem;
    padding: 0.65rem 1.5rem;
  }

  .hero-socials-inline a {
    font-size: 1.8rem;
  }

  .work-card {
    flex: 0 0 280px;
  }
}

/* ===========================
   POR SECTION
   =========================== */
.por-header {
  text-align: center;
  margin-top: 5rem;
  margin-bottom: 3rem;
}

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

.por-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  transition: all 0.3s var(--ease);
}

.por-box:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.por-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.por-item:last-child {
  margin-bottom: 0;
}

.por-icon {
  font-size: 1.25rem;
  color: var(--text);
  margin-top: 0.25rem;
}

.por-content h4 {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.por-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}