/* Portfolio — custom styles on top of Bootstrap 5.3 (CDN).
   Goals:
   - Match the previous Tailwind + custom-keyframe visual 1:1.
   - Use the same color palette (Pantone "Space Sport") via CSS variables.
   - Provide the same animations (fade-up, fade-left, fade-right, progress,
     modal-in, hero slider, skill-bar fill, navbar hide-on-scroll).
*/

/* ---------- Webfonts (same as before) ---------- */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap");

/* ---------- Palette / design tokens ---------- */
:root {
  --background: 37 33% 93%;
  --foreground: 0 0% 15%;
  --card: 37 33% 93%;
  --card-foreground: 0 0% 15%;
  --muted: 37 20% 85%;
  --muted-foreground: 0 0% 45%;
  --primary: 78 100% 47%;
  --primary-foreground: 0 0% 10%;
  --border: 37 15% 78%;
  --ring: 78 100% 47%;

  --font-heading: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Space Mono", ui-monospace, monospace;
  --font-mono: "Space Mono", ui-monospace, monospace;

  --cloud: #f2efea;
  --darkest: #262626;
  --obsidian: #0a0a0a;
}

/* ---------- Base body / typography ---------- */
html,
body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}
body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.font-heading {
  font-family: var(--font-heading);
}
.font-body {
  font-family: var(--font-body);
}
.font-mono {
  font-family: var(--font-mono);
}

.text-foreground {
  color: hsl(var(--foreground));
}
.text-muted-2 {
  color: hsl(var(--muted-foreground));
}
.text-muted-3 {
  color: hsl(var(--foreground) / 0.5);
}
.text-cloud {
  color: var(--cloud);
}
.text-cloud-50 {
  color: hsl(0 0% 98% / 0.5);
}
.text-cloud-70 {
  color: hsl(0 0% 98% / 0.7);
}
.text-cloud-40 {
  color: hsl(0 0% 98% / 0.4);
}
.text-cloud-15 {
  color: hsl(0 0% 98% / 0.15);
}
.text-cloud-20 {
  color: hsl(0 0% 98% / 0.2);
}
.text-primary {
  color: hsl(var(--primary)) !important;
}
.text-foreground-20 {
  color: hsl(var(--foreground) / 0.2);
}
.text-foreground-30 {
  color: hsl(var(--foreground) / 0.3);
}

.bg-background {
  background: hsl(var(--background));
}
.bg-foreground {
  background: hsl(var(--foreground));
}
.bg-card {
  background: hsl(var(--card));
}
.bg-muted {
  background: hsl(var(--muted));
}
.bg-primary {
  background: hsl(var(--primary)) !important;
}
.bg-darkest {
  background: var(--darkest);
}
.bg-obsidian {
  background: var(--obsidian);
}

.border-custom {
  border-color: hsl(var(--border));
}
.border-cloud-15 {
  border-color: hsl(0 0% 98% / 0.15);
}
.border-cloud-20 {
  border-color: hsl(0 0% 98% / 0.2);
}
.border-primary {
  border-color: hsl(var(--primary)) !important;
}

.hover-text-primary:hover {
  color: hsl(var(--primary)) !important;
}
.hover-bg-foreground:hover {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}
.hover-border-primary:hover {
  border-color: hsl(var(--primary)) !important;
}
.hover-text-cloud:hover {
  color: var(--cloud);
}
.hover-text-foreground:hover {
  color: hsl(var(--foreground));
}

.text-uppercase {
  text-transform: uppercase;
}
.ls-widest {
  letter-spacing: 0.2em;
}
.ls-wider {
  letter-spacing: 0.1em;
}
.ls-tight-04 {
  letter-spacing: -0.04em;
}
.ls-tight-03 {
  letter-spacing: -0.03em;
}
.ls-tight-02 {
  letter-spacing: -0.02em;
}

.fs-10 {
  font-size: 10px;
}
.fs-11 {
  font-size: 11px;
}
.fs-12 {
  font-size: 12px;
}
.fluid-2to5 {
  font-size: clamp(2rem, 6vw, 5rem);
}
.fluid-3to10 {
  font-size: clamp(3rem, 12vw, 10rem);
}
.fluid-1to2_5 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

/* ---------- Layout utilities ---------- */
.min-vh-100 {
  min-height: 100vh;
}
.min-vh-70 {
  min-height: 70vh;
}

.container-xl {
  max-width: 1536px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
@media (min-width: 768px) {
  .container-xl {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}
@media (min-width: 992px) {
  .container-xl {
    padding-left: 5rem;
    padding-right: 5rem;
  }
}

.py-section {
  padding-top: 8rem;
  padding-bottom: 8rem;
}

/* Section number header row (label + horizontal rule) */
.section-num {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-num .label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: hsl(var(--muted-foreground));
}
.section-num.about .label {
  color: hsl(0 0% 98% / 0.4);
}
.section-num .rule {
  flex: 1;
  height: 1px;
  background: hsl(var(--border));
}
.section-num.about .rule {
  background: hsl(0 0% 98% / 0.1);
}

/* Ratio 3:2 (project images) */
.ratio.ratio-3x2 {
  --bs-aspect-ratio: 66.6667%;
}

/* ---------- Navbar (hide on scroll-down, show on scroll-up) ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  backdrop-filter: blur(8px);
  background: hsl(var(--background) / 0.8);
  border-bottom: 1px solid hsl(var(--border));
  transform: translateY(-100%);
  transition: transform 0.3s ease-out;
}
.site-nav.is-visible {
  transform: translateY(0);
}
.site-nav .navbar-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(var(--foreground));
  padding: 0;
  margin: 0;
}
.site-nav .navbar-brand:hover {
  color: hsl(var(--primary)) !important;
}
.site-nav .nav-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: hsl(var(--muted-foreground));
  padding: 0;
  position: relative;
}
.site-nav .nav-link:hover {
  color: hsl(var(--foreground));
}
.site-nav .nav-link .nav-underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: hsl(var(--primary)) !important;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.site-nav .nav-link.is-active {
  color: hsl(var(--foreground));
}
.site-nav .nav-link.is-active .nav-underline {
  transform: scaleX(1);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 1.5rem;
}
@media (min-width: 768px) {
  .hero {
    padding: 3rem;
  }
}
@media (min-width: 992px) {
  .hero {
    padding: 5rem;
  }
}

.hero h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 0.95;
  color: hsl(var(--foreground));
  margin: 0;
}
.hero .grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: hsl(var(--border));
}

.hero-slider {
  position: relative;
  height: 5rem;
  overflow: hidden;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
  pointer-events: none;
  text-align: right;
}
.hero-slide.is-active {
  opacity: 1;
  transform: translateY(0);
}
.hero-slide.is-exit {
  opacity: 0;
  transform: translateY(-20px);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.hero-scroll-indicator .arrow {
  color: hsl(var(--muted-foreground));
  transition: transform 0.15s ease;
}

.hero-living-rule {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: hsl(var(--primary)) !important;
  transform-origin: left;
}

/* ---------- Work / Project cards ---------- */
.project-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.project-card .card-img-wrap {
  position: relative;
  aspect-ratio: 3/2;
  overflow: hidden;
  background: hsl(var(--muted));
}
.project-card .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}
.project-card:hover .card-img-wrap img {
  transform: scale(1.05);
}
.project-card .card-overlay {
  position: absolute;
  inset: 0;
  background: hsl(var(--foreground) / 0);
  transition: background 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-card:hover .card-overlay {
  background: hsl(var(--foreground) / 0.7);
}
.project-card .card-overlay span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(var(--primary)) !important;
  border: 1px solid hsl(var(--primary) / 0.6) !important;
  padding: 0.5rem 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.project-card:hover .card-overlay span {
  opacity: 1;
}
.project-card .card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  color: hsl(var(--foreground));
  transition: color 0.3s ease;
}
.project-card:hover .card-title {
  color: hsl(var(--primary)) !important;
}
.project-card:hover .cajatitulo {
  background: #262626 !important;
}
.project-card .card-cat {
  font-family: var(--font-mono);
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}
.project-card .card-num {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: 700;
  color: hsl(var(--foreground) / 0.2);
  transition: color 0.3s ease;
}
.project-card:hover .card-num {
  color: hsl(var(--primary) / 0.3) !important;
}

/* ---------- Project modal (custom, NOT Bootstrap .modal) ---------- */
.pm-modal {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
@media (min-width: 768px) {
  .pm-modal {
    padding: 2rem;
  }
}
.pm-modal.is-open {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}
.pm-modal .pm-backdrop {
  position: absolute;
  inset: 0;
  background: hsl(0 0% 4% / 0.8);
  backdrop-filter: blur(4px);
}
.pm-modal .pm-card {
  position: relative;
  z-index: 1;
  max-width: 768px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.pm-modal .pm-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--background) / 0.8);
  backdrop-filter: blur(4px);
  border: 1px solid hsl(var(--border));
  transition: all 0.2s ease;
  color: hsl(var(--foreground));
}
.pm-modal .pm-close:hover {
  background: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
}
.pm-modal .pm-image {
  width: 100%;
  height: auto;
  aspect-ratio: 3/2;
  object-fit: cover;
}
.pm-modal .pm-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid hsl(var(--border));
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  padding: 2px 10px;
  border-radius: 4px;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}
.pm-modal .btn-behance {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1.5rem 2rem;
  border: 0;
  transition: all 0.3s ease;
  text-decoration: none;
}
.pm-modal .btn-behance:hover {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- About ---------- */
.skill-bar-fill {
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.reveal.is-visible .skill-bar-fill,
.skill-bar.in-view .skill-bar-fill {
  transform: scaleX(1);
}

.education-item,
.experience-card {
  border-left: 1px solid hsl(var(--primary) / 0.4) !important;
  padding-left: 1rem;
}

.tag-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid hsl(0 0% 98% / 0.2);
  color: hsl(0 0% 98% / 0.5);
  padding: 0.375rem 0.75rem;
  transition: all 0.2s ease;
  cursor: default;
}
.tag-pill:hover {
  border-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary)) !important;
}

/* ---------- Contact ---------- */
.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  border-bottom: 1px solid hsl(var(--border));
  transition: border-color 0.2s ease;
  text-decoration: none;
  color: inherit;
}
.contact-link:hover {
  border-color: hsl(var(--primary)) !important;
}
.contact-link .link-icon {
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease;
}
.contact-link:hover .link-icon {
  color: hsl(var(--primary)) !important;
}
.contact-link .link-arrow {
  color: hsl(var(--muted-foreground));
  transition: all 0.2s ease;
}
.contact-link:hover .link-arrow {
  color: hsl(var(--primary)) !important;
  transform: translate(2px, -2px);
}

.cf-input {
  width: 100%;
  background: transparent;
  border: 1px solid hsl(var(--border));
  font-family: var(--font-mono);
  font-size: 0.875rem;
  height: 3rem;
  padding: 0 0.75rem;
  outline: none;
  border-radius: 0;
  transition: border-color 0.2s ease;
  color: hsl(var(--foreground));
}
.cf-input:focus {
  border-color: hsl(var(--primary)) !important;
}
.cf-textarea {
  height: auto;
  padding: 0.5rem 0.75rem;
  resize: none;
}
.cf-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  display: block;
  margin-bottom: 0.5rem;
}
.cf-submit {
  width: 100%;
  background: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1.25rem;
  border: 0;
  transition: all 0.3s ease;
}
.cf-submit:hover {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}
.cf-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: hsl(var(--primary)) !important;
  transform-origin: left;
  transform: scaleX(0);
  z-index: 1060;
}

/* ---------- Animations (entry / reveal) ---------- */
.animate-fade-up,
.animate-fade-in,
.animate-fade-left,
.animate-fade-right,
.animate-progress {
  animation-fill-mode: both;
}
.animate-fade-up {
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-fade-in {
  animation: fadeIn 0.8s ease-out;
}
.animate-fade-left {
  animation: fadeLeft 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-fade-right {
  animation: fadeRight 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-progress {
  animation: progressBar 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.6s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes progressBar {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* Reveal-on-scroll (intersection observer) */
.reveal,
.reveal-left,
.reveal-right {
  opacity: 0;
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
body.show-all .reveal,
body.show-all .reveal-left,
body.show-all .reveal-right {
  opacity: 1 !important;
  transform: none !important;
}
.reveal {
  transform: translateY(24px);
}
.reveal-left {
  transform: translateX(-24px);
}
.reveal-right {
  transform: translateX(24px);
}
.reveal.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}
.reveal[data-delay],
.reveal-left[data-delay],
.reveal-right[data-delay] {
  transition-delay: calc(var(--i, 0) * 90ms);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: hsl(var(--primary)) !important;
}
html {
  scroll-behavior: smooth;
}

/* ---------- 404 page ---------- */
.error-404 h1 {
  font-size: 4.5rem;
  font-weight: 300;
  color: hsl(var(--muted-foreground));
}

/* ---------- Icons (lucide sizing) ---------- */
.lucide {
  width: 1em;
  height: 1em;
}
.icon-4 {
  width: 1rem;
  height: 1rem;
}
.icon-5 {
  width: 1.25rem;
  height: 1.25rem;
}
