/* =========================================================
   PalaceChat v5 — Light & Airy Landing
   Palette: warm cream + accessible orange + soft sky
   Type: Fraunces (display) + Outfit (body)
   ========================================================= */

:root {
  /* Accessible orange palette — AA contrast on cream/white */
  --orange-50:  #FFF4EC;
  --orange-100: #FFE4D1;
  --orange-200: #FFC9A0;
  --orange-400: #FF8A3D;
  --orange-500: #E5651C;   /* primary — passes AA on white */
  --orange-600: #C24F0F;   /* primary hover — extra contrast */
  --orange-700: #9C3E08;

  /* Supporting hues */
  --cream:    #FFF9F3;
  --cream-2:  #FFF2E4;
  --sky:      #D9ECFF;
  --mint:     #DFF5E6;
  --pink:     #FFD9E4;

  /* Ink */
  --ink:      #2A1A0E;
  --ink-soft: #5A4636;
  --ink-mute: #8B7866;

  /* UI */
  --line:     #F1DDC4;
  --shadow-soft: 0 24px 60px -20px rgba(229, 101, 28, 0.25);
  --shadow-pop:  0 14px 40px -12px rgba(229, 101, 28, 0.45);

  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

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

html, body { height: 100%; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background:
    radial-gradient(ellipse 800px 600px at 85% -10%, var(--orange-100) 0%, transparent 60%),
    radial-gradient(ellipse 600px 500px at -10% 30%, var(--sky) 0%, transparent 60%),
    radial-gradient(ellipse 700px 500px at 50% 110%, var(--cream-2) 0%, transparent 70%),
    var(--cream);
  min-height: 100%;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.6  0 0 0 0 0.4  0 0 0 0 0.2  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  z-index: 0;
}

/* Ambient blobs */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite;
}
.blob-1 { width: 340px; height: 340px; background: var(--orange-200); top: -80px; right: -60px; }
.blob-2 { width: 280px; height: 280px; background: var(--sky);        bottom: 10%; left: -60px; animation-delay: -6s; }
.blob-3 { width: 220px; height: 220px; background: var(--pink);       top: 45%;    right: 25%; animation-delay: -12s; opacity: 0.4; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(20px, -30px) scale(1.08); }
}

/* ============== NAV ============== */
.nav {
  position: relative;
  z-index: 10;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.nav-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(229, 101, 28, 0.25));
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
}
.nav-brand:hover .nav-logo { transform: rotate(-8deg) scale(1.1); }

.nav-title {
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.nav-version {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  background: var(--orange-500);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  transform: translateY(-2px);
}

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

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--orange-600); }

.nav-cta {
  background: var(--ink);
  color: var(--cream) !important;
  padding: 10px 20px;
  border-radius: 999px;
  transition: all 0.3s ease;
}
.nav-cta:hover {
  background: var(--orange-600);
  color: white !important;
  transform: translateY(-2px);
}

/* ============== HERO ============== */
.hero {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 40px 100px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 80px;
  align-items: center;
}

.hero-copy { animation: rise 0.9s cubic-bezier(.16,1,.3,1) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 28px;
  box-shadow: 0 4px 16px -8px rgba(229, 101, 28, 0.2);
}

.badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange-500);
  box-shadow: 0 0 0 4px var(--orange-100);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--orange-100); }
  50%      { box-shadow: 0 0 0 8px rgba(229, 101, 28, 0.08); }
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 5.2vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 28px;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--orange-600);
}

.hero-title-accent {
  display: inline-block;
  position: relative;
  color: var(--orange-600);
}
.hero-title-accent::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 6%;
  height: 28%;
  background: var(--orange-100);
  z-index: -1;
  border-radius: 4px;
  transform: rotate(-1deg);
}

.hero-lede {
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 540px;
  margin-bottom: 40px;
}

/* CTA buttons */
.cta-row {
  display: flex;
  flex-wrap: nowrap;    /* fuerza una sola línea en desktop */
  gap: 10px;
  margin-bottom: 24px;  /* typo corregido */
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;             /* antes 14 */
  padding: 14px 18px;    /* antes 16px 28px */
  border-radius: var(--radius-md);
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(.34,1.56,.64,1);
  border: 2px solid transparent;
  flex: 1 1 0;           /* los 3 comparten el ancho disponible */
  min-width: 0;          /* permite shrink sin overflow */
  justify-content: center;
}

.btn-icon { width: 24px; height: 24px; flex-shrink: 0; }

.btn-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}
.btn-sub  { font-size: 0.7rem; font-weight: 400; opacity: 0.8; letter-spacing: 0.03em; }
.btn-name { font-size: 1.05rem; font-weight: 700; }

.btn-primary {
  background: var(--orange-500);
  color: white;
  box-shadow: var(--shadow-pop);
}
.btn-primary:hover {
  background: var(--orange-600);
  transform: translateY(-3px);
  box-shadow: 0 20px 50px -12px rgba(229, 101, 28, 0.6);
}

.btn-secondary {
  background: white;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 4px 16px -8px rgba(0,0,0,0.1);
}
.btn-secondary:hover {
  border-color: var(--orange-500);
  color: var(--orange-600);
  transform: translateY(-3px);
}

.btn-tertiary {
  background: #FFF59D;
  color: var(--ink);
  border-color: #FFE082;
  box-shadow: 0 4px 16px -8px rgba(0,0,0,0.1);
}
.btn-tertiary:hover {
  background: #FFF176;
  border-color: var(--orange-500);
  color: var(--orange-600);
  transform: translateY(-3px);
  box-shadow: 0 20px 50px -12px rgba(251, 192, 45, 0.4);
}

.docs-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}
.docs-link svg { width: 16px; height: 16px; transition: transform 0.3s; }
.docs-link:hover {
  color: var(--orange-600);
  border-bottom-color: var(--orange-500);
}
.docs-link:hover svg { transform: translateX(4px); }

/* ============== HERO VISUAL ============== */
.hero-visual {
  position: relative;
  animation: rise 1s cubic-bezier(.16,1,.3,1) 0.15s both;
}

.hero-frame {
  position: relative;
  border-radius: var(--radius-lg);
  transform: rotate(1.5deg);
  transition: transform 0.6s cubic-bezier(.34,1.56,.64,1);
}
.hero-frame:hover { transform: rotate(0) scale(1.02); }

.hero-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle at 50% 50%, var(--orange-200) 0%, transparent 70%);
  filter: blur(40px);
  opacity: 0.6;
  z-index: -1;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

/* Floating decorations */
.floaty {
  position: absolute;
  font-size: 2.5rem;
  filter: drop-shadow(0 8px 20px rgba(229, 101, 28, 0.3));
  animation: float 5s ease-in-out infinite;
}
.floaty-1 {
  top: -10px;
  left: -10px;
  width: 70px; height: 70px;
  animation-delay: -1s;
}
.floaty-1 img { width: 100%; height: 100%; }
.floaty-2 {
  bottom: 40px;
  right: -10px;
  animation-delay: -2.5s;
}
.floaty-3 {
  top: 45%;
  left: -15px;
  animation-delay: -4s;
}
.floaty-4 {
  top: 10%;
  right: -10px;
  animation-delay: -3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-14px) rotate(4deg); }
}

/* ============== FOOTER ============== */
.footer {
  position: relative;
  z-index: 2;
  border-top: 1px dashed var(--line);
  margin-top: 40px;
  padding: 40px;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Socials */
.socials {
  display: flex;
  gap: 14px;
}

.social {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 4px 12px -6px rgba(0,0,0,0.08);
}
.social svg { width: 20px; height: 20px; }
.social:hover {
  background: var(--orange-500);
  color: white;
  border-color: var(--orange-500);
  transform: translateY(-4px) rotate(-4deg);
  box-shadow: var(--shadow-pop);
}

/* Credits */
.credits {
  text-align: center;
  font-size: 0.875rem;
  color: var(--ink-mute);
  line-height: 1.9;
}
.credits p { margin: 0; }
.credits strong {
  color: var(--ink-soft);
  font-weight: 600;
}

/* ============== RESPONSIVE ============== */
/* Vuelven a apilarse cuando el hero ya es 1 columna */
@media (max-width: 960px) {
  .cta-row { flex-wrap: wrap; }
  .btn { flex: 1 1 200px; }
}

  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-lede { margin-left: auto; margin-right: auto; }
  .cta-row { justify-content: center; }
  .hero-visual { max-width: 520px; margin: 0 auto; }
}

@media (max-width: 640px) {
  .nav { padding: 20px; }
  .nav-links { gap: 18px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .hero { padding: 20px 20px 60px; }
  .hero-title { font-size: 2.4rem; }
  .footer { padding: 30px 20px; }
  .floaty-1 { width: 50px; height: 50px; top: -15px; left: -10px; }
  .floaty-2, .floaty-3, .floaty-4 { font-size: 1.8rem; }
}
