/* Estudio Fadelli — landing institucional
   Réplica del diseño de Wix: tarjetas redondeadas sobre fondo beige.
   Sin dependencias externas (tipografía autoalojada). */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/inter-latin-300-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
}

:root {
  --bg: #d8d2c6;
  --ink: #3b3a3a;
  --card: #ffffff;
  --dark: #4b4b4b;
  --gold: #bb9f81;
  --error: #9b2c2c;
  --ok: #2f5d3a;

  --gap: clamp(20px, 3vw, 43px);          /* margen de página y separación entre tarjetas */
  --pad: clamp(20px, 3.5vw, 50px);        /* relleno interno de las tarjetas */
  --radius: clamp(20px, 1.5vw, 24px);
  --circle: clamp(100px, 8.8vw, 127px);   /* botones circulares */

  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  padding: var(--gap);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px;
  text-decoration: none; font-weight: 400;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

main { display: flex; flex-direction: column; gap: var(--gap); }
section[id], header[id] { scroll-margin-top: var(--gap); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: clamp(422px, 42vw, 640px);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  padding: var(--pad);
  isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img {
  position: absolute; top: 50%; right: 0;
  width: 116%; max-width: none; height: auto; min-height: 100%;
  translate: 0 calc(-50% + var(--py, 0px));
  scale: 1.16;
  animation: hero-zoom 2.4s cubic-bezier(0.2, 0.6, 0.2, 1) both;
  object-fit: cover;
  will-change: translate;
}
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(36, 28, 22, 0.55) 0%, rgba(36, 28, 22, 0.62) 100%);
}
.brand {
  position: absolute; left: clamp(20px, 6.4vw, 90px); top: clamp(20px, 2.6vw, 38px);
  width: clamp(210px, 23vw, 336px); line-height: 0;
}
.brand img { width: 100%; height: auto; }

.menu-btn {
  position: absolute; right: clamp(16px, 4.3vw, 62px); top: clamp(16px, 2.8vw, 40px);
  display: inline-flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 22px 0 20px;
  border: 0; border-radius: 999px; background: #fff; color: var(--ink);
  font: 400 16px/1 var(--font); letter-spacing: 0.01em; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.menu-btn:hover { background: var(--ink); color: #fff; }
.burger { display: flex; flex-direction: column; justify-content: space-between; width: 18px; height: 14px; }
.burger i { display: block; width: 18px; height: 2px; border-radius: 1px; background: currentColor; transition: width 0.3s cubic-bezier(0.2, 0.7, 0.2, 1); }
.menu-btn:hover .burger i:nth-child(2) { width: 12px; }
@media (max-width: 700px) {
  .menu-btn { width: 42px; height: 42px; padding: 0; justify-content: center; }
  .menu-btn span:not(.burger) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

.hero__title {
  max-width: 59%;
  margin-left: auto;
  text-align: right;
  font-weight: 400;
  font-size: clamp(28px, 3.5vw, 56px);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: auto;
  margin-top: clamp(86px, 9.6vw, 140px);
  text-wrap: balance;
}
.hero__down {
  flex: none;
  width: clamp(60px, 6vw, 86px); height: clamp(60px, 6vw, 86px);
  border: 1px solid #fff; border-radius: 50%;
  display: grid; place-items: center; color: #fff; text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.hero__down:hover { background: #fff; color: var(--ink); }
.hero__down svg { animation: bob 2.4s ease-in-out 1.6s infinite; }
.hero__down:hover svg { animation-play-state: paused; }
@media (max-width: 700px) {
  .hero { align-items: flex-start; }
  .hero__title { max-width: 100%; margin-top: clamp(80px, 22vw, 96px); }
}

/* ---------- Menú lateral ---------- */
.menu-overlay {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.35);
  animation: fade-in 0.35s ease both;
}
.menu-overlay[hidden] { display: none; }
.menu {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(620px, 100%); background: var(--ink); color: #fff;
  padding: clamp(60px, 6vw, 80px) clamp(28px, 6vw, 90px);
  transform: translateX(100%); visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.35s;
  overflow-y: auto;
}
.menu.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.menu ul { display: grid; gap: 18px; }
.menu li { opacity: 0; translate: 40px 0; transition: opacity 0.5s ease, translate 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.menu.is-open li { opacity: 1; translate: 0 0; }
.menu.is-open li:nth-child(1) { transition-delay: 0.12s; }
.menu.is-open li:nth-child(2) { transition-delay: 0.18s; }
.menu.is-open li:nth-child(3) { transition-delay: 0.24s; }
.menu.is-open li:nth-child(4) { transition-delay: 0.30s; }
.menu.is-open li:nth-child(5) { transition-delay: 0.36s; }
.menu.is-open li:nth-child(6) { transition-delay: 0.42s; }
.menu a {
  display: inline-block; text-decoration: none; font-weight: 300;
  font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: -0.01em;
  padding: 2px 0;
  background: linear-gradient(var(--gold), var(--gold)) no-repeat 0 100% / 0 1px;
  transition: background-size 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.menu a:hover { background-size: 100% 1px; }
.menu__close {
  position: absolute; top: clamp(20px, 3vw, 40px); right: clamp(20px, 3.4vw, 44px);
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; color: #fff; cursor: pointer;
}

/* ---------- Tarjetas ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--pad);
}
.eyebrow { font-size: clamp(14px, 1.25vw, 18px); font-weight: 300; line-height: 1.3; }
.eyebrow--sub { margin-top: clamp(28px, 3.6vw, 54px); }
.lead {
  font-weight: 400;
  font-size: clamp(24px, 2.35vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-top: clamp(14px, 1.6vw, 22px);
  text-wrap: pretty;
}
.title {
  font-weight: 400;
  font-size: clamp(24px, 3.44vw, 50px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-top: clamp(12px, 1.4vw, 20px);
  text-wrap: balance;
}
.display {
  font-weight: 400;
  font-size: clamp(24px, 3.44vw, 50px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.body {
  font-size: clamp(16px, 1.56vw, 22.5px);
  line-height: 1.6;
  font-weight: 300;
  margin-top: clamp(10px, 1.1vw, 16px);
  max-width: 34em;
}

.card--split, .card--media-left {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--pad);
  align-items: stretch;
  padding: calc(var(--pad) * 0.45);
}
.card--split .card__text, .card--media-left .card__text {
  padding: calc(var(--pad) * 0.55) calc(var(--pad) * 0.55) calc(var(--pad) * 0.55) calc(var(--pad) * 0.55);
  display: flex; flex-direction: column;
}
.card__media {
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  min-height: 360px;
  position: relative;
}
.card__media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  scale: 1.14;
  translate: 0 calc(var(--p, 0) * 100%);
  transition: scale 1s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: translate;
}
.card__media:hover img { scale: 1.19; }
.card__media--sala img { object-position: 22% 50%; }
.card__media--logros img { object-position: 50% 42%; }
.card__media--exp img { object-position: 50% 40%; }
.card--media-left { border-radius: calc(var(--radius) + 6px); }

/* Botón circular */
.circle {
  width: var(--circle); height: var(--circle);
  border: 1px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  padding: 10px; text-decoration: none; color: var(--ink);
  font-size: clamp(11px, 0.95vw, 13px); font-weight: 400;
  letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.3;
  background: linear-gradient(var(--ink), var(--ink)) no-repeat center bottom / 100% 0%;
  transition: background-size 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.3s, scale 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.circle:hover, .circle:focus-visible { background-size: 100% 100%; color: #fff; scale: 1.06; }
.circle--end { margin-top: auto; align-self: flex-end; }
.circle--center { margin: clamp(24px, 3vw, 42px) auto 0; }
.card--media-left .circle { margin-top: clamp(28px, 3.4vw, 50px); }
.card--split .card__text .body + .circle--end { margin-top: clamp(28px, 3vw, 44px); }

/* Servicios */
.card--services { padding: clamp(24px, 2.4vw, 34px) var(--pad) clamp(28px, 3vw, 44px); }
.services { margin-top: clamp(20px, 2.8vw, 40px); border-bottom: 1px solid var(--ink); }
.services li {
  display: grid; grid-template-columns: clamp(30px, 17.5vw, 253px) 1fr;
  align-items: center; border-top: 1px solid var(--ink);
  padding: clamp(18px, 3.4vw, 52px) 0;
}
.services li { transition: background-color 0.3s; }
.services li:hover { background-color: #faf7f2; }
.services__n { font-size: clamp(16px, 1.25vw, 18px); font-weight: 300; transition: color 0.3s; }
.services li:hover .services__n { color: var(--gold); }
.services h3 { transition: translate 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.services li:hover h3 { translate: 14px 0; }
.services h3 { font-weight: 400; font-size: clamp(18px, 1.9vw, 27px); line-height: 1.25; letter-spacing: -0.01em; }

/* Contacto */
.card--contact {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--pad); align-items: start;
  padding: clamp(28px, 6.4vw, 92px) var(--pad);
}
.contact__intro .body { margin-top: clamp(20px, 3vw, 44px); max-width: 21em; }

.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 21px; row-gap: 14px;
}
.field { position: relative; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label, .field > .tel + .field__error { font-size: 14px; }
.field label { display: block; font-weight: 300; line-height: 1.4; }
.field input, .field textarea, .field select {
  width: 100%; border: 0; border-bottom: 1px solid rgba(59, 58, 58, 0.75);
  border-radius: 0; background: transparent; color: var(--ink);
  font: 300 16px/1.4 var(--font); padding: 8px 0 7px; height: 40px;
  -webkit-appearance: none; appearance: none;
}
.field textarea { height: auto; min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink);
}
.field [aria-invalid="true"] { border-bottom-color: var(--error); box-shadow: 0 1px 0 0 var(--error); }
.field__error { color: var(--error); font-size: 13px; line-height: 1.35; margin-top: 4px; font-weight: 400; }

.tel { display: flex; align-items: flex-end; gap: 6px; border-bottom: 1px solid rgba(59, 58, 58, 0.75); }
.tel:focus-within { border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
.tel__globe { flex: none; align-self: center; margin-top: 4px; }
.tel select {
  width: auto; flex: none; border: 0; box-shadow: none !important; padding-right: 2px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%233b3a3a' stroke-width='1.2'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 4px center;
  padding-right: 18px; cursor: pointer; font-size: 15px;
}
.tel input { border: 0; box-shadow: none !important; flex: 1; min-width: 0; }
.field [aria-invalid="true"] ~ *, .tel:has([aria-invalid="true"]) { }
.tel:has([aria-invalid="true"]) { border-bottom-color: var(--error); box-shadow: 0 1px 0 0 var(--error); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.pill {
  margin-top: 28px; width: min(293px, 100%); height: 43px;
  border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink);
  font: 300 16px/1 var(--font); letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.pill:hover:not(:disabled) { background: var(--ink); color: #fff; }
.pill:disabled { opacity: 0.55; cursor: progress; }
.form-note { margin-top: 12px; font-size: 13px; color: rgba(59, 58, 58, 0.85); }
.form-status { margin-top: 10px; min-height: 1.4em; font-size: 14px; font-weight: 400; }
.form-status--error { color: var(--error); }
.form-success {
  border: 1px solid var(--gold); border-radius: calc(var(--radius) - 4px);
  padding: clamp(24px, 3vw, 40px); background: #faf7f2;
}
.form-success h3 { font-weight: 400; font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.02em; }
.form-success p { margin-top: 10px; font-size: 18px; }
.form-success:focus { outline: none; }

/* ---------- Footer ---------- */
.footer {
  background: var(--dark); color: #fff;
  border-radius: var(--radius);
  padding: var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1.05fr);
  gap: var(--pad);
  align-items: start;
}
.footer__logo { align-self: center; max-width: 405px; }
.footer__logo img { width: 100%; height: auto; }
.footer__nav li a, .footer__contact a { text-decoration: none; }
.footer__nav li a { display: block; padding: 5px 0; font-weight: 300; font-size: 16px; }
.footer__nav li a:hover, .footer__contact a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer__contact { display: grid; gap: clamp(22px, 3vw, 42px); }
.footer__contact li { display: grid; grid-template-columns: 28px 1fr; gap: 18px; align-items: start; font-size: 14px; font-weight: 300; line-height: 1.6; }
.footer__contact svg { margin-top: -1px; }
.footer__copy { grid-column: 1 / -1; font-size: 14px; font-weight: 300; margin-top: clamp(12px, 3vw, 40px); }

/* ---------- Animaciones ---------- */
@keyframes rv { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: 0 0; } }
@keyframes rv-media { from { opacity: 0; translate: 0 44px; scale: 0.97; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes hero-zoom { from { scale: 1.3; } to { scale: 1.16; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 5px; } }

/* Entrada del hero (solo CSS, no depende de JS) */
.brand { animation: rv 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both; }
.menu-btn { animation: rv 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both; }
.hero__title { animation: rv 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.4s both; }
.hero__down { animation: rv 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.8s both; }

/* Entrada al hacer scroll: main.js marca cada bloque con .is-in al entrar en pantalla */
.js :is(.card, .footer) :is(.eyebrow, .lead, .title, .display, .body, .circle, .services li, .field, .pill, .form-note, .footer__logo, .footer__nav, .footer__contact li, .footer__copy) { opacity: 0; }
.js .card .card__media { opacity: 0; }
.js :is(.card, .footer).is-in :is(.eyebrow, .lead, .title, .display, .body, .circle, .services li, .field, .pill, .form-note, .footer__logo, .footer__nav, .footer__contact li, .footer__copy) {
  animation: rv 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--i, 0) * 90ms) both;
}
.js .card.is-in .card__media { animation: rv-media 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both; }

/* ---------- Tablet ---------- */
@media (max-width: 1000px) {
  .hero__title { max-width: 72%; }
  .footer { grid-template-columns: 1fr 1fr; }
  .footer__logo { grid-column: 1 / -1; }
}

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
  .card--split, .card--media-left, .card--contact { grid-template-columns: 1fr; }
  .card--split, .card--media-left { padding: 20px; gap: 22px; }
  .card--split .card__text, .card--media-left .card__text { padding: 0; }
  .card--media-left .card__media { order: 2; }
  .card--media-left .card__text { order: 1; }
  .card__media { min-height: 0; aspect-ratio: 16 / 10; }
  .card__media--sala img { object-position: 30% 50%; }
  .card__media--logros { aspect-ratio: 4 / 3; }
  .card__media--logros img { object-position: 50% 40%; }
  .card__media--exp img { object-position: 50% 35%; }
  .circle { --circle: 96px; }
  .circle--end { align-self: flex-start; }
  .card--split .card__text .body + .circle--end { margin-top: 24px; }
  .services li { grid-template-columns: 28px 1fr; padding: 18px 0; }
  .card--services { padding: 24px 20px 28px; }
  .card--contact { padding: 28px 20px 32px; gap: 18px; }
  .form-grid { grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .pill { width: 160px; }
  .footer { grid-template-columns: 1fr; gap: 24px; padding: 28px 20px; }
  .footer__logo { max-width: 290px; }
  .footer__contact li { grid-template-columns: 28px 1fr; gap: 14px; }
}
@media (max-width: 420px) {
  .form-grid { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
}
/* Portada en celulares: va después de la regla de tablet (max-width: 72%) para que no la pise.
   Alto automático para que el título no se salga hacia el logo en pantallas angostas (320 px). */
@media (max-width: 700px) {
  .hero { height: auto; min-height: 422px; }
  .hero__title { max-width: 100%; }
  .hero__down { margin-top: 24px; }
  .brand { width: min(210px, calc(100% - 110px)); }
}

@media (prefers-reduced-motion: reduce) {
  .js :is(.card, .footer) :is(.eyebrow, .lead, .title, .display, .body, .circle, .services li, .field, .pill, .form-note, .footer__logo, .footer__nav, .footer__contact li, .footer__copy),
  .js .card .card__media, .menu li { opacity: 1; translate: none; }
  .hero__media img { scale: 1.16; }
}

@media print {
  .menu, .menu-overlay, .menu-btn, .hero__down { display: none !important; }
  body { background: #fff; padding: 0; }
}
