/* ============================================================
   PORTFOLIO-V2 — STYLES.CSS — Álvaro Ruiz
   Light editorial · Orange + Black · Sora + Playfair Display
   ============================================================ */

:root {
  --orange: #ea580c;
  --orange-dark: #c2410c;
  --orange-light: #fff7ed;
  --orange-rgb: 234, 88, 12;

  --white: #ffffff;
  --cream: #f8f6f2;
  --gray-50: #faf9f6;
  --gray-100: #f3f1ec;
  --gray-200: #e5e2da;
  --gray-300: #c8c3b8;
  --gray-400: #9a9488;
  --gray-500: #6b6458;
  --gray-600: #4d4639;
  --gray-700: #3a3428;
  --gray-800: #262118;
  --gray-900: #1a1610;

  --canvas: var(--cream);
  --canvas-alt: var(--white);
  --ink: var(--gray-900);
  --ink-soft: var(--gray-700);
  --muted: var(--gray-500);
  --border: var(--gray-200);

  --font-main: 'Sora', system-ui, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  --fs-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.78rem);
  --fs-sm: clamp(0.82rem, 0.76rem + 0.3vw, 0.9rem);
  --fs-base: clamp(0.92rem, 0.86rem + 0.3vw, 1rem);
  --fs-md: clamp(1rem, 0.9rem + 0.5vw, 1.15rem);
  --fs-lg: clamp(1.15rem, 1rem + 0.75vw, 1.4rem);
  --fs-xl: clamp(1.4rem, 1.1rem + 1.5vw, 2rem);
  --fs-2xl: clamp(1.8rem, 1.3rem + 2.5vw, 2.8rem);
  --fs-3xl: clamp(2.2rem, 1.5rem + 3.5vw, 3.6rem);
  --fs-4xl: clamp(3rem, 2rem + 5vw, 5rem);

  --section-py: clamp(60px, 8vw, 110px);
  --container-max: 1100px;
  --container-px: clamp(16px, 4vw, 32px);

  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 20px; --radius-2xl: 28px; --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04); --shadow-md: 0 4px 16px rgba(0,0,0,0.06); --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --ease: cubic-bezier(0.4, 0, 0.2, 1); --duration: 0.35s;
  --z-sticky: 200; --z-overlay: 300; --z-preloader: 500;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; overflow-x: hidden; }
body { font-family: var(--font-main); font-size: var(--fs-base); color: var(--ink); background: var(--canvas); line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--duration) var(--ease); }
ul, ol { list-style: none; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 13px 16px; background: var(--white); width: 100%; transition: border-color var(--duration), box-shadow var(--duration); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(var(--orange-rgb), 0.1); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6458' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
::selection { background: rgba(var(--orange-rgb), 0.12); }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--container-px); }
.kicker { display: inline-block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange); margin-bottom: 14px; }
.section-title { font-size: var(--fs-3xl); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; color: var(--ink); margin-bottom: 14px; }
.section-title em { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--orange); }
.section-lead { font-size: var(--fs-md); color: var(--muted); max-width: 500px; line-height: 1.8; }
.section-header { margin-bottom: 48px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: var(--fs-sm); border-radius: var(--radius-full); padding: 12px 28px; transition: all var(--duration) var(--ease); border: 2px solid transparent; white-space: nowrap; }
.btn .material-icons { font-size: 18px; }
.btn--dark { background: var(--gray-900); color: var(--white); box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.btn--dark:hover { background: var(--gray-800); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.btn--outline { border-color: var(--border); color: var(--ink); }
.btn--outline:hover { border-color: var(--orange); color: var(--orange); }
.btn--sm { padding: 8px 20px; font-size: var(--fs-xs); }
.btn--lg { padding: 16px 36px; font-size: var(--fs-base); }
.btn--block { width: 100%; }

/* PRELOADER */
.preloader { position: fixed; inset: 0; z-index: var(--z-preloader); background: var(--cream); display: flex; align-items: center; justify-content: center; transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease); }
.preloader.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__text { font-size: var(--fs-lg); font-weight: 800; color: var(--ink); letter-spacing: -0.02em; margin-bottom: 12px; }
.preloader__line { width: 60px; height: 2px; background: var(--gray-200); border-radius: 2px; position: relative; overflow: hidden; margin: 0 auto; }
.preloader__line::after { content: ''; position: absolute; inset: 0; background: var(--orange); animation: lineSlide 1s ease-in-out infinite; }
@keyframes lineSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: calc(var(--z-sticky) + 1); background: var(--orange); transform-origin: left; transform: scaleX(0); }

/* NAVBAR */
.navbar { position: sticky; top: 0; z-index: var(--z-sticky); background: rgba(248,246,242,0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(0,0,0,0.04); transition: box-shadow var(--duration); }
.navbar.scrolled { box-shadow: var(--shadow-md); }
.navbar__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.navbar__brand { font-size: var(--fs-lg); font-weight: 300; color: var(--ink); letter-spacing: -0.02em; }
.navbar__brand em { font-family: var(--font-display); font-style: italic; font-weight: 500; color: var(--orange); }
.navbar__list { display: flex; gap: 4px; }
.navbar__link { padding: 6px 14px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); border-radius: var(--radius-md); transition: color var(--duration), background var(--duration); }
.navbar__link:hover, .navbar__link.active { color: var(--orange); background: var(--orange-light); }
.navbar__actions { display: flex; align-items: center; gap: 12px; }
.navbar__burger { display: none; flex-direction: column; gap: 5px; width: 24px; }
.navbar__burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: all var(--duration); }
.navbar__burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__burger.active span:nth-child(2) { opacity: 0; }
.navbar__burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* HERO */
.hero { padding: clamp(80px, 10vw, 120px) 0 var(--section-py); }
.hero__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.hero__tag { display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 20px; }
.hero__title { font-size: var(--fs-4xl); font-weight: 800; line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 20px; }
.hero__title em { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--orange); }
.hero__lead { font-size: var(--fs-md); color: var(--muted); line-height: 1.8; margin-bottom: 32px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__img img { width: 100%; height: 600px; object-fit: cover; border-radius: var(--radius-2xl); }

/* WORK SLIDER */
.work { padding: var(--section-py) 0; overflow: hidden; }
.work__slider { padding: 0 var(--container-px); }
.work-slide { position: relative; border-radius: var(--radius-xl); overflow: hidden; cursor: pointer; }
.work-slide img { width: 100%; height: 550px; object-fit: cover; transition: transform 0.6s var(--ease); }
.work-slide:hover img { transform: scale(1.03); }
.work-slide__info { position: absolute; bottom: 0; left: 0; right: 0; padding: 28px; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent); }
.work-slide__info span { font-size: var(--fs-xs); font-weight: 700; color: var(--orange); display: block; margin-bottom: 6px; letter-spacing: 0.04em; text-transform: uppercase; }
.work-slide__info h3 { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--white); font-weight: 500; font-style: italic; }

/* ABOUT */
.about { padding: var(--section-py) 0; background: var(--canvas-alt); }
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about__content p { font-size: var(--fs-md); color: var(--muted); line-height: 1.8; margin-bottom: 14px; }
.about__clients { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.about__clients span { font-size: var(--fs-xs); font-weight: 800; padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius-full); color: var(--ink-soft); transition: all var(--duration); letter-spacing: 0.04em; text-transform: uppercase; }
.about__clients span:hover { border-color: var(--orange); color: var(--orange); }
.about__img img { width: 100%; height: 520px; object-fit: cover; border-radius: var(--radius-2xl); }

/* SERVICES */
.services { padding: var(--section-py) 0; }
.services__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.svc-card { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--white); transition: all var(--duration); }
.svc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(var(--orange-rgb), 0.15); }
.svc-card__num { font-family: var(--font-display); font-size: var(--fs-xl); font-style: italic; color: var(--orange); display: block; margin-bottom: 12px; }
.svc-card h3 { font-size: var(--fs-base); font-weight: 800; margin-bottom: 8px; }
.svc-card p { font-size: var(--fs-sm); color: var(--muted); line-height: 1.6; }

/* TESTIMONIALS */
.testimonials { padding: var(--section-py) 0; background: var(--canvas-alt); }
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.testi-card { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--white); transition: all var(--duration); }
.testi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.testi-card--dark { background: var(--gray-900); border-color: transparent; color: var(--white); }
.testi-card--dark blockquote { color: rgba(255,255,255,0.8); }
.testi-card--dark span { color: rgba(255,255,255,0.5); }
.testi-card blockquote { font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.7; font-style: italic; margin-bottom: 18px; }
.testi-card strong { font-size: var(--fs-sm); font-weight: 800; display: block; }
.testi-card span { font-size: var(--fs-xs); color: var(--muted); }

/* CONTACT */
.contact { padding: var(--section-py) 0; }
.contact__grid { display: grid; grid-template-columns: 0.4fr 0.6fr; gap: 48px; align-items: start; }
.contact__details { display: grid; gap: 14px; margin-top: 20px; }
.contact__details > div { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--muted); }
.contact__details .material-icons { font-size: 20px; color: var(--orange); }
.contact__details a { color: var(--orange); font-weight: 600; }
.contact__form { padding: 32px; border-radius: var(--radius-2xl); background: var(--white); border: 1px solid var(--border); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: var(--fs-xs); font-weight: 700; margin-bottom: 5px; color: var(--ink-soft); }

/* FOOTER */
.footer { padding: 36px 0 0; border-top: 1px solid var(--border); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 24px; }
.footer__logo { font-size: var(--fs-lg); font-weight: 300; color: var(--ink); }
.footer__logo em { font-family: var(--font-display); font-style: italic; color: var(--orange); }
.footer__links { display: flex; gap: 20px; }
.footer__links a { font-size: var(--fs-sm); color: var(--gray-400); transition: color var(--duration); }
.footer__links a:hover { color: var(--orange); }
.footer__social { display: flex; gap: 12px; }
.footer__social a { font-size: var(--fs-xs); font-weight: 700; color: var(--gray-400); transition: color var(--duration); }
.footer__social a:hover { color: var(--orange); }
.footer__bottom { text-align: center; padding: 18px 0; border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--gray-400); }

.back-to-top { position: fixed; bottom: 28px; right: 28px; width: 44px; height: 44px; border-radius: 50%; background: var(--gray-900); color: var(--white); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); z-index: var(--z-overlay); opacity: 0; visibility: hidden; transform: translateY(16px); transition: all var(--duration); }
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); }

@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__img { display: none; }
  .about__grid { grid-template-columns: 1fr; }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .testi-grid { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; }
  .navbar__menu { position: fixed; inset: 0; width: 100vw; height: 100dvh; background: var(--cream); z-index: var(--z-overlay); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s; }
  .navbar__menu.open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.4s var(--ease); }
  .navbar__list { flex-direction: column; gap: 8px; }
  .navbar__link { font-size: var(--fs-lg); padding: 12px 24px; }
  .navbar__burger { display: flex; position: relative; z-index: calc(var(--z-overlay) + 1); }
}
@media (max-width: 768px) {
  .services__grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero__title { font-size: var(--fs-2xl); }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
  .footer__inner { flex-direction: column; text-align: center; }
}
