/* ============================================
   Santiago Gil — Portfolio
   Clean CSS with animations & interactivity
   ============================================ */

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

:root {
  --dark: #0d121e;
  --light: #f5f0eb;
  --accent: #ff4a39;
  --white: #ffffff;
  --gray: #8a8f98;
  --radius: 12px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

body.loading { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; cursor: none; }
ul { list-style: none; }
button { cursor: none; border: none; background: none; font: inherit; }
input, textarea { font: inherit; cursor: none; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============================================
   LOADER
   ============================================ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-expo), visibility 0.6s;
}

.loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__inner { text-align: center; }

.loader__logo {
  color: var(--accent);
  margin-bottom: 24px;
  animation: loaderPulse 1.2s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1); }
}

.loader__bar {
  width: 120px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.loader__progress {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  pointer-events: none;
  mix-blend-mode: difference;
}

.cursor__dot {
  width: 8px;
  height: 8px;
  background: var(--white);
  border-radius: 50%;
  position: absolute;
  top: -4px;
  left: -4px;
  transition: transform 0.1s;
}

.cursor__ring {
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  position: absolute;
  top: -20px;
  left: -20px;
  transition: width 0.4s var(--ease-expo), height 0.4s var(--ease-expo),
              top 0.4s var(--ease-expo), left 0.4s var(--ease-expo),
              border-color 0.3s, background 0.3s, opacity 0.3s;
}

.cursor.hover .cursor__ring {
  width: 80px;
  height: 80px;
  top: -40px;
  left: -40px;
  border-color: var(--accent);
}

.cursor.big .cursor__ring {
  width: 120px;
  height: 120px;
  top: -60px;
  left: -60px;
  background: rgba(255, 74, 57, 0.15);
  border-color: transparent;
}

.cursor.big .cursor__dot { transform: scale(0); }

.cursor__text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}

.cursor.big .cursor__text { opacity: 1; }

/* Hide cursor on touch */
@media (hover: none) and (pointer: coarse) {
  .cursor { display: none; }
  body, a, button, input, textarea { cursor: auto; }
}

/* ============================================
   CONTACT MODAL
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.modal[aria-hidden="false"] { pointer-events: all; }

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal[aria-hidden="false"] .modal__overlay { opacity: 1; }

.modal__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 580px;
  height: 100%;
  background: var(--dark);
  color: var(--white);
  padding: 80px 48px 48px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.6s var(--ease-expo);
}

.modal[aria-hidden="false"] .modal__panel { transform: translateX(0); }

.modal__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
}

.modal__close span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  position: absolute;
  top: 50%;
  left: 50%;
}

.modal__close span:first-child { transform: translate(-50%, -50%) rotate(45deg); }
.modal__close span:last-child { transform: translate(-50%, -50%) rotate(-45deg); }

.modal__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 40px;
  overflow: hidden;
}

.modal__title span {
  display: inline-block;
  transform: translateY(120%);
  transition: transform 0.7s var(--ease-expo) 0.3s;
}

.modal[aria-hidden="false"] .modal__title span { transform: translateY(0); }

.modal__field {
  position: relative;
  margin-bottom: 28px;
}

.modal__field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding: 12px 0;
  color: var(--white);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

.modal__field input:focus { border-color: var(--accent); }

.modal__field label {
  position: absolute;
  top: 12px;
  left: 0;
  font-size: 0.9rem;
  color: var(--gray);
  pointer-events: none;
  transition: all 0.3s var(--ease);
}

.modal__field input:focus + label,
.modal__field input:not(:placeholder-shown) + label {
  top: -10px;
  font-size: 0.7rem;
  color: var(--accent);
}

.modal__form small {
  display: block;
  margin-top: 16px;
  color: var(--gray);
  font-size: 0.75rem;
}

@media (max-width: 600px) {
  .modal__panel { padding: 80px 24px 24px; max-width: 100%; }
}

/* ============================================
   SECTION LABEL & HEADERS
   ============================================ */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 300;
  line-height: 1.3;
  max-width: 700px;
}

.section-header h2 strong { font-weight: 700; }

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */

/* Fade up */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-expo);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Mask reveal (text lines) */
.reveal-mask .line {
  display: block;
  overflow: hidden;
}

.reveal-mask .line span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.8s var(--ease-expo);
}

.reveal-mask.visible .line span { transform: translateY(0); }

.reveal-mask.visible .line:nth-child(2) span { transition-delay: 0.08s; }
.reveal-mask.visible .line:nth-child(3) span { transition-delay: 0.16s; }

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  transition: background 0.4s var(--ease), box-shadow 0.4s, padding 0.4s;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  padding: 12px 32px;
}

.nav__logo {
  color: var(--white);
  transition: color 0.4s;
  z-index: 101;
}

.nav.scrolled .nav__logo { color: var(--dark); }

.nav__links { display: flex; align-items: center; gap: 32px; }

.nav__links a, .nav__links button {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s;
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}

.nav__links a:hover::after { width: 100%; }
.nav.scrolled .nav__links a, .nav.scrolled .nav__links button { color: var(--dark); }
.nav__links a:hover, .nav__links button:hover { color: var(--white); }
.nav.scrolled .nav__links a:hover, .nav.scrolled .nav__links button:hover { color: var(--accent); }

.nav__cta {
  background: var(--accent) !important;
  color: var(--white) !important;
  padding: 8px 20px;
  border-radius: 100px;
  font-weight: 600 !important;
  transition: transform 0.3s, opacity 0.3s !important;
}

.nav__cta::after { display: none !important; }
.nav__cta:hover { transform: scale(1.05); opacity: 0.9; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  z-index: 101;
  padding: 4px;
}

.nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: 0.3s var(--ease);
  border-radius: 2px;
}

.nav.scrolled .nav__toggle span { background: var(--dark); }
.nav__toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav__toggle.active span:nth-child(2) { opacity: 0; }
.nav__toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    inset: 0;
    background: var(--dark);
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
  }
  .nav__links.open { opacity: 1; pointer-events: all; }
  .nav__links a, .nav__links button { font-size: 1.5rem; color: var(--white) !important; }
}

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255, 74, 57, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(255, 74, 57, 0.05) 0%, transparent 60%);
}

.hero__content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero__logo-wrap {
  overflow: hidden;
}

.hero__logo {
  width: min(70vw, 420px);
  height: auto;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease-expo) 0.5s, transform 1s var(--ease-expo) 0.5s;
}

body.loaded .hero__logo {
  opacity: 1;
  transform: translateY(0);
}

.hero__tagline {
  overflow: hidden;
}

.hero__tagline span {
  display: inline-block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  transform: translateY(100%);
  transition: transform 0.8s var(--ease-expo) 0.8s;
}

body.loaded .hero__tagline span { transform: translateY(0); }

.hero__scroll {
  position: absolute;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.8s 1.4s;
}

body.loaded .hero__scroll { opacity: 1; animation: bounce 2s 1.8s infinite; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ============================================
   INTRO
   ============================================ */
.intro { padding: 120px 0; background: var(--dark); }

.intro__heading {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 300;
  line-height: 1.4;
  color: var(--white);
  max-width: 800px;
}

.intro__words {
  position: relative;
  display: block;
  height: 1.3em;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--accent);
  max-width: 800px;
  overflow: hidden;
}

.intro__word {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.5s, transform 0.6s var(--ease-expo);
}

.intro__word.active {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   STATEMENT
   ============================================ */
.statement { padding: 120px 0; background: var(--light); }

.statement__text {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 300;
  line-height: 1.4;
  max-width: 900px;
}

.statement__text strong {
  font-weight: 700;
  background: var(--dark);
  color: var(--white);
  padding: 2px 10px;
  border-radius: 4px;
}

/* ============================================
   PORTFOLIO
   ============================================ */
.portfolio { padding: 120px 0 80px; background: var(--white); }
.portfolio .section-header { margin-bottom: 64px; }

.portfolio__grid { display: flex; flex-direction: column; }

.portfolio__item {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}

.portfolio__img {
  overflow: hidden;
  position: relative;
}

.parallax-wrap { overflow: hidden; }

.parallax-img {
  width: 100%;
  height: 120%;
  object-fit: cover;
  will-change: transform;
  transition: transform 0.6s var(--ease-out);
}

.portfolio__item:hover .parallax-img { transform: scale(1.05); }

.portfolio__info {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.portfolio__info h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }

.portfolio__info p {
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 500px;
}

@media (min-width: 769px) {
  .portfolio__item { grid-template-columns: 1.2fr 1fr; min-height: 400px; }
  .portfolio__item:nth-child(even) { grid-template-columns: 1fr 1.2fr; }
  .portfolio__item:nth-child(even) .portfolio__img { order: 2; }
  .portfolio__info { padding: 48px; }
  .portfolio__info h3 { font-size: 2rem; }
}

/* ============================================
   EXPERIENCE
   ============================================ */
.experience {
  padding: 120px 0;
  background: var(--dark);
  color: var(--white);
}

.experience .section-header { margin-bottom: 64px; }
.experience .section-header h2 { color: var(--white); font-weight: 300; }

.experience__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 769px) {
  .experience__grid { grid-template-columns: repeat(3, 1fr); gap: 40px; }
}

.experience__col h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.experience__col ul { display: flex; flex-direction: column; gap: 16px; }

.experience__col li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.experience__col li strong { font-weight: 500; font-size: 0.95rem; }
.experience__col li span { font-size: 0.8rem; color: var(--gray); white-space: nowrap; }

.skills { display: flex; flex-direction: column; gap: 20px; }

.skill-group h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 4px;
}

.skill-group p { font-size: 0.9rem; color: rgba(255, 255, 255, 0.7); line-height: 1.5; }

/* ============================================
   ABOUT
   ============================================ */
.about { padding: 120px 0; background: var(--light); }

.about__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

@media (min-width: 769px) {
  .about__inner { grid-template-columns: 1fr 1fr; gap: 80px; }
}

.about__text h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 20px;
}

.about__text p {
  color: var(--gray);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.about__photo img {
  border-radius: var(--radius);
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 120px 0 40px;
  background: var(--dark);
  color: var(--white);
}

.footer__cta {
  text-align: center;
  margin-bottom: 80px;
}

.footer__big {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  margin-bottom: 8px;
  cursor: none;
  transition: color 0.3s;
}

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

.footer__cta p {
  color: var(--gray);
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 32px;
  border: none;
  border-radius: 100px;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

.btn:hover { transform: scale(1.05); opacity: 0.9; }

.btn--outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.3);
}

.btn--outline:hover { border-color: var(--accent); background: var(--accent); }

.btn--modal {
  width: 100%;
  margin-top: 8px;
  padding: 16px;
}

.btn--modal span {
  display: inline-block;
  transition: transform 0.3s;
}

.btn--modal:hover span { transform: scale(1.02); }

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer__social { display: flex; gap: 16px; }

.footer__social a {
  color: var(--gray);
  transition: color 0.3s, transform 0.3s;
}

.footer__social a:hover { color: var(--accent); transform: translateY(-2px); }

.footer__copy { font-size: 0.8rem; color: var(--gray); }

/* ============================================
   MAGNETIC BUTTON EFFECT (applied via JS)
   ============================================ */
.magnetic { transition: transform 0.3s var(--ease-expo); }

/* ============================================
   BRANDS SECTION
   ============================================ */
.brands {
  padding: 120px 0;
  background: var(--light);
}

.brands .section-header {
  margin-bottom: 64px;
}

.brands__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: rgba(13, 18, 30, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (min-width: 640px)  { .brands__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .brands__grid { grid-template-columns: repeat(6, 1fr); } }

.brands__slot {
  aspect-ratio: 1;
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.4s var(--ease);
}

.brands__slot[data-placeholder]::before {
  content: '';
  width: 40%;
  height: 40%;
  background: rgba(13, 18, 30, 0.06);
  border-radius: 8px;
  transition: background 0.4s var(--ease);
}

.brands__slot:hover { background: var(--white); }
.brands__slot:hover[data-placeholder]::before { background: rgba(255, 74, 57, 0.12); }

.brands__note {
  text-align: center;
  margin-top: 32px;
  color: var(--gray);
  font-size: 0.9rem;
  font-style: italic;
}
