/**
* Ana Florencia Rueda - Portfolio CV
* Editorial pop: warm cream paper, ink, one vermilion that owns the page.
*/

/*--------------------------------------------------------------
# Variables
--------------------------------------------------------------*/
:root {
  --paper: #f7f0e4;
  --paper-deep: #efe4d0;
  --card: #fffaf0;
  --ink: #1b1511;
  --text: #1b1511;
  --text-muted: #4a3f36;
  --text-dim: #6b5d51;
  --accent: #f0421c;
  --accent-deep: #c22d0c;
  --sun: #ffd23f;
  --border: 2px solid var(--ink);
  --hard-shadow: 6px 6px 0 var(--ink);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --font-display: "Bricolage Grotesque", "Arial Black", sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/*--------------------------------------------------------------
# Base
--------------------------------------------------------------*/
body {
  font-family: var(--font-body);
  color: var(--text-muted);
  background-color: var(--paper);
  line-height: 1.6;
}

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

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

a:focus-visible,
button:focus-visible,
.mobile-nav-toggle:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

/*--------------------------------------------------------------
# Back to top
--------------------------------------------------------------*/
.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 20px;
  bottom: 20px;
  z-index: 996;
  background: var(--sun);
  border: var(--border);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), opacity 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top i {
  font-size: 28px;
  color: var(--ink);
  line-height: 0;
}

.back-to-top:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

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

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

#preloader:before {
  content: "";
  position: fixed;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
  border: 5px solid var(--ink);
  border-top-color: var(--sun);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: animate-preloader 0.7s linear infinite;
}

@keyframes animate-preloader {
  to { transform: rotate(360deg); }
}

@media screen and (max-width: 768px) {
  [data-aos-delay] {
    transition-delay: 0 !important;
  }
}

/*--------------------------------------------------------------
# Header / Sidebar
--------------------------------------------------------------*/
#header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 9997;
  transition: all 0.5s var(--ease-out);
  padding: 20px 12px;
  overflow-y: auto;
  background: var(--paper);
  border-right: var(--border);
}

@media (max-width: 991px) {
  #header {
    width: 280px;
    left: -280px;
  }
}

@media (min-width: 991px) {
  #main {
    margin-left: 100px;
  }
}

/*--------------------------------------------------------------
# Navigation Menu
--------------------------------------------------------------*/
.nav-menu {
  padding: 0;
  display: block;
}

.nav-menu * {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu > ul > li {
  position: relative;
  white-space: nowrap;
}

.nav-menu a,
.nav-menu a:focus {
  display: flex;
  align-items: center;
  color: var(--ink);
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
  font-size: 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  height: 52px;
  width: 100%;
  overflow: hidden;
  border: 2px solid transparent;
}

.nav-menu a i,
.nav-menu a:focus i {
  font-size: 20px;
  color: var(--ink);
  min-width: 24px;
}

.nav-menu a span,
.nav-menu a:focus span {
  padding: 0 5px 0 10px;
  color: var(--ink);
  font-weight: 600;
}

@media (min-width: 992px) {
  .nav-menu a,
  .nav-menu a:focus,
  .nav-menu .active,
  .nav-menu .active:focus {
    width: 52px;
    justify-content: center;
  }

  .nav-menu a span,
  .nav-menu a:focus span,
  .nav-menu .active span,
  .nav-menu .active:focus span {
    display: none;
  }
}

.nav-menu a:hover,
.nav-menu .active,
.nav-menu .active:focus,
.nav-menu li:hover > a {
  background: var(--accent);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.nav-menu a:hover,
.nav-menu li:hover > a {
  width: 100%;
}

.nav-menu a:hover span,
.nav-menu li:hover > a span {
  display: block;
}

/*--------------------------------------------------------------
# Mobile Navigation
--------------------------------------------------------------*/
.mobile-nav-toggle {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 9998;
  border: var(--border);
  background: var(--sun);
  font-size: 24px;
  cursor: pointer;
  line-height: 0;
  border-radius: var(--radius-sm);
  padding: 10px;
  box-shadow: 3px 3px 0 var(--ink);
}

.mobile-nav-toggle i {
  color: var(--ink);
}

.mobile-nav-active {
  overflow: hidden;
}

.mobile-nav-active #header {
  left: 0;
}

/*--------------------------------------------------------------
# Hero Section
--------------------------------------------------------------*/
#hero {
  width: 100%;
  min-height: 100vh;
  background: var(--accent);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 48px;
  padding-bottom: 48px;
}

/* Sun sticker peeking from the corner */
#hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: clamp(220px, 32vw, 460px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sun);
  border: 3px solid var(--ink);
  pointer-events: none;
}

@media (min-width: 992px) {
  #hero {
    padding-left: 130px;
  }
}

#hero .container {
  position: relative;
  z-index: 1;
}

#hero h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(56px, 11vw, 176px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-wrap: balance;
}

#hero p {
  color: var(--ink);
  margin: 28px 0 0;
  font-size: clamp(20px, 2.4vw, 30px);
  font-family: var(--font-display);
  font-weight: 500;
}

#hero p span {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-weight: 700;
  display: inline-block;
  transform: rotate(-2deg);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.btn-pop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius-pill);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.btn-pop:hover {
  color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.btn-pop:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn-pop--sun {
  background: var(--sun);
}

#hero .social-links {
  margin-top: 36px;
  display: flex;
  gap: 12px;
}

#hero .social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: var(--border);
  background: var(--paper);
  color: var(--ink);
  font-size: 22px;
  transition: transform 0.25s var(--ease-out), background-color 0.2s;
}

#hero .social-links a:hover {
  background: var(--sun);
  transform: translateY(-3px) rotate(-6deg);
}

@media (min-width: 992px) {
  .hero-enter > * {
    animation: hero-rise 0.8s var(--ease-out) both;
  }

  .hero-enter > *:nth-child(2) { animation-delay: 0.08s; }
  .hero-enter > *:nth-child(3) { animation-delay: 0.16s; }
  .hero-enter > *:nth-child(4) { animation-delay: 0.24s; }
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(32px); }
}

@media (max-width: 992px) {
  #hero {
    text-align: left;
  }

  #hero .social-links {
    justify-content: flex-start;
  }
}

/*--------------------------------------------------------------
# Sections General
--------------------------------------------------------------*/
section {
  padding: 110px 0;
  overflow: hidden;
}

.section-bg {
  background-color: var(--sun);
  border-top: var(--border);
  border-bottom: var(--border);
}

.section-title {
  text-align: left;
  padding-bottom: 56px;
}

.section-pill {
  display: block;
  width: fit-content;
  margin: 0 0 14px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--ink);
  border-radius: var(--radius-pill);
  background: var(--paper);
  border: var(--border);
}

.glass-card {
  position: relative;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--hard-shadow);
  padding: 36px;
}

.section-title h2 {
  font-size: clamp(48px, 9vw, 120px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0;
  color: var(--ink);
}

.section-title h2::after {
  content: ".";
  color: var(--accent);
}

.section-bg .section-title h2::after {
  color: var(--ink);
}

.section-title p {
  margin-top: 20px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 17px;
  max-width: 60ch;
}

/*--------------------------------------------------------------
# About
--------------------------------------------------------------*/
.about .content h3 {
  font-weight: 800;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.about-bio {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 65ch;
  margin-bottom: 28px;
}

.about-info {
  margin-bottom: 8px;
}

.about .content ul {
  list-style: none;
  padding: 0;
}

.about .content ul li {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  color: var(--text-muted);
  font-size: 15px;
  gap: 6px;
}

.about .content ul strong {
  color: var(--ink);
  min-width: 96px;
  flex-shrink: 0;
}

.about .content ul i {
  font-size: 12px;
  margin-top: 5px;
  color: var(--accent-deep);
  line-height: 1;
  flex-shrink: 0;
}

/* Photo as a tilted sticker */
.about-photo {
  position: relative;
  max-width: 300px;
  width: 100%;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--sun);
  box-shadow: var(--hard-shadow);
  transform: rotate(-3deg);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out);
}

.about-photo:hover {
  transform: rotate(0deg);
}

.about-photo img {
  display: block;
  width: 100%;
}

.about-photo-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--sun);
  border-top: var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #16a34a;
  border: 2px solid var(--ink);
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  50% { opacity: 0.4; }
}

/*--------------------------------------------------------------
# Skills (rows, no cards)
--------------------------------------------------------------*/
.skills-content > [class*="col-"] {
  flex: 0 0 100%;
  max-width: 100%;
  width: 100%;
  margin-bottom: 0 !important;
}

.skill-category {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 3fr;
  gap: 12px 32px;
  align-items: start;
  padding: 24px 0;
  border-top: var(--border);
}

.skills-content > [class*="col-"]:last-child .skill-category {
  border-bottom: var(--border);
}

.skill-category h3 {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

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

.skill-tag {
  background: var(--card);
  border: var(--border);
  color: var(--ink);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-mono);
  transition: transform 0.2s var(--ease-out), background-color 0.2s;
}

.skill-tag:hover {
  background: var(--accent);
  transform: translateY(-2px) rotate(-2deg);
}

.skill-category--ai .skill-tag {
  background: var(--ink);
  color: var(--paper);
}

.skill-category--ai .skill-tag:hover {
  background: var(--accent);
  color: var(--ink);
}

@media (max-width: 767px) {
  .skill-category {
    grid-template-columns: 1fr;
  }
}

/*--------------------------------------------------------------
# Resume
--------------------------------------------------------------*/
.resume .resume-title {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-top: 8px;
  margin-bottom: 28px;
  color: var(--ink);
  display: inline-block;
  padding: 4px 14px;
  background: var(--accent);
  border: var(--border);
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.resume .resume-item {
  padding: 24px 24px 12px;
  margin: 0 0 28px;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--ink);
  position: relative;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.resume .resume-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.resume .resume-item h4 {
  line-height: 1.25;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.resume .resume-item h5 {
  font-size: 12px;
  background: var(--sun);
  color: var(--ink);
  padding: 3px 12px;
  display: inline-block;
  font-weight: 500;
  margin-bottom: 10px;
  border-radius: var(--radius-pill);
  border: var(--border);
  font-family: var(--font-mono);
}

.resume .resume-item p {
  color: var(--text-muted);
  font-size: 15px;
}

.resume .resume-item p em {
  color: var(--text-dim);
}

.resume .resume-item ul {
  padding-left: 18px;
}

.resume .resume-item ul li {
  padding-bottom: 8px;
  color: var(--text-muted);
  font-size: 15px;
}

.cv-link .cv-button {
  background: var(--accent);
  border: var(--border);
  padding: 13px 44px;
  color: var(--ink);
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 15px;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.cv-link .cv-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

/*--------------------------------------------------------------
# Portfolio
--------------------------------------------------------------*/
/* Gallery behavior mirrors the v0 "hover video cards" template */
.portfolio {
  background: var(--ink);
}

.portfolio .section-title h2 {
  color: var(--paper);
}

.portfolio .section-pill {
  background: var(--sun);
}

.portfolio .section-title p {
  color: rgba(247, 240, 228, 0.8);
}

.works-group + .works-group {
  margin-top: 56px;
}

.works-label {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--sun);
}

.works-gallery {
  display: flex;
  align-items: stretch;
  gap: 16px;
}

.video-card {
  position: relative;
  flex: 0.8 1 0%;
  min-width: 0;
  height: clamp(420px, 65vh, 600px);
  overflow: hidden;
  border-radius: 2.5rem;
  border: 2px solid var(--paper);
  opacity: 0.92;
  transition: flex 800ms cubic-bezier(0.4, 0, 0.2, 1), opacity 800ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 300ms;
}

.video-card:hover,
.video-card:focus-visible {
  flex-grow: 2.4;
  opacity: 1;
  border-color: var(--accent);
}

.video-card:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 4px;
}

.video-card-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: opacity 700ms, filter 700ms, transform 6s ease-out;
}

img.video-card-media {
  filter: grayscale(1) brightness(0.75);
}

video.video-card-media {
  opacity: 0;
}

.video-card:hover img.video-card-media,
.video-card:focus-visible img.video-card-media {
  filter: none;
  transform: scale(1.08);
}

.video-card:hover video.video-card-media,
.video-card:focus-visible video.video-card-media {
  opacity: 1;
}

.video-card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms;
}

.video-card-glass {
  min-width: 240px;
  padding: 20px 24px;
  background: var(--sun);
  border: var(--border);
  border-radius: 1rem;
  box-shadow: 5px 5px 0 var(--ink);
  transform: translateY(32px);
  opacity: 0;
  transition: transform 700ms ease-out, opacity 700ms ease-out;
}

.video-card:hover .video-card-info,
.video-card:focus-visible .video-card-info,
.video-card:hover .video-card-glass,
.video-card:focus-visible .video-card-glass {
  opacity: 1;
  transform: none;
}

.video-card-glass h3,
.video-card-glass p {
  text-align: left;
}

.video-card-glass h3 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.video-card-glass p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink);
}

/* Custom cursor: dot shown while a card is hovered (fine pointers only) */
.has-custom-cursor .video-card {
  cursor: none;
}

.gallery-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--ink);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50vw, -50vh, 0);
  transition: opacity 200ms;
  will-change: transform;
}

.gallery-cursor.is-active {
  opacity: 1;
}

@media (max-width: 991px) {
  .works-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .video-card {
    height: 420px;
    border-radius: 2rem;
    opacity: 1;
  }

  img.video-card-media {
    filter: none;
  }

  .video-card-info,
  .video-card-glass {
    opacity: 1;
    transform: none;
  }

  .video-card-info {
    padding: 16px;
  }

  .video-card-glass {
    min-width: 0;
    padding: 14px 18px;
  }

  .gallery-cursor {
    display: none;
  }
}

/*--------------------------------------------------------------
# Contact
--------------------------------------------------------------*/
.contact {
  background: var(--accent);
  border-top: var(--border);
}

.contact .info {
  width: 100%;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.contact .info .address,
.contact .info .email,
.contact .info .phone {
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--hard-shadow);
  padding: 32px 28px;
  flex: 1;
  min-width: 220px;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.contact .info .address:hover,
.contact .info .email:hover,
.contact .info .phone:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--ink);
}

.contact .info i {
  font-size: 26px;
  color: var(--ink);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 56px;
  height: 56px;
  background: var(--sun);
  border: var(--border);
  border-radius: 50%;
  margin: 0 0 20px;
}

.contact .info h3 {
  padding: 0;
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-dim);
}

.contact .info p {
  padding: 0;
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.contact .info p a {
  display: inline-block;
  padding: 12px 0;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.contact .info p a:hover {
  color: var(--accent-deep);
}

.contact .section-title h2::after {
  color: var(--ink);
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
#footer {
  color: rgba(247, 240, 228, 0.8);
  font-size: 14px;
  text-align: center;
  padding: 56px 0 40px;
  background: var(--ink);
}

#footer h3 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  color: var(--paper);
}

#footer .social-links {
  margin: 0 0 28px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

#footer .social-links a {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sun);
  color: var(--ink);
  border: 2px solid var(--paper);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  transition: transform 0.25s var(--ease-out), background-color 0.2s;
  line-height: 1;
  padding: 0;
}

#footer .social-links a:hover {
  background: var(--accent);
  transform: translateY(-3px) rotate(-6deg);
}

#footer .copyright {
  margin: 0;
  color: rgba(247, 240, 228, 0.8);
}

/*--------------------------------------------------------------
# Reduced motion
--------------------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .video-card:hover img.video-card-media,
  .video-card:focus-visible img.video-card-media,
  .about-photo:hover {
    transform: none;
  }
}
