/* ═══════════════════════════════════════════
   KLYA — Page-specific styles + Animations
   File: assets/css/pages.css
   Richiede: variables.css, base.css, components.css
═══════════════════════════════════════════ */

/* ── Keyframes ── */
@keyframes fadeUp    { from { opacity:0; transform:translateY(32px); }  to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn    { from { opacity:0; }  to { opacity:1; } }
@keyframes scaleIn   { from { opacity:0; transform:scale(.94); }  to { opacity:1; transform:scale(1); } }
@keyframes slideLeft { from { opacity:0; transform:translateX(40px); }  to { opacity:1; transform:translateX(0); } }
@keyframes slideRight{ from { opacity:0; transform:translateX(-40px); } to { opacity:1; transform:translateX(0); } }
@keyframes float     { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-12px);} }
@keyframes pulse     { 0%,100%{box-shadow:0 0 0 0 rgba(201,166,107,.4);} 50%{box-shadow:0 0 0 12px rgba(201,166,107,0);} }
@keyframes gradFlow  { 0%{background-position:0% 50%;} 50%{background-position:100% 50%;} 100%{background-position:0% 50%;} }
@keyframes pageIn    { from{opacity:0;transform:translateX(30px);}  to{opacity:1;transform:translateX(0);} }

/* ── Scroll reveal ── */
.reveal { opacity:0; transform:translateY(28px); transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1); }
.reveal.from-left  { transform: translateX(-32px); }
.reveal.from-right { transform: translateX(32px); }
.reveal.scale      { transform: scale(.95); }
.reveal.visible    { opacity:1; transform:none; }
.reveal.d1 { transition-delay:.1s; } .reveal.d2 { transition-delay:.2s; }
.reveal.d3 { transition-delay:.3s; } .reveal.d4 { transition-delay:.4s; }
.reveal.d5 { transition-delay:.5s; }

/* ── Demo Banner ── */
#banner {
  background: linear-gradient(90deg, #b87333, var(--gold), #d4a853, var(--gold), #b87333);
  background-size: 300% 100%;
  animation: gradFlow 6s ease infinite;
  color: #fff; padding: 11px 20px; text-align: center;
  font-size: 13.5px; font-weight: 500; position: relative; z-index: 200;
}
#banner strong { font-weight: 700; }
#banner a { color: #fff; font-weight: 700; text-decoration: underline; cursor: pointer; margin-left: 8px; }
#banner-close {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: rgba(255,255,255,.8);
  font-size: 20px; cursor: pointer; line-height: 1; transition: color .2s;
}
#banner-close:hover { color: #fff; }

/* ── Header ── */
#hdr { position: sticky; top: 0; z-index: 100; height: 76px; transition: background .3s, box-shadow .3s; }
#hdr.scrolled { background: rgba(250,248,245,.97); backdrop-filter: blur(16px); box-shadow: 0 1px 0 var(--gold-light), 0 4px 24px rgba(44,40,38,.06); }
#hdr:not(.scrolled) { background: rgba(250,248,245,.85); backdrop-filter: blur(8px); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.nav-logo { font-family: var(--font-h); font-size: 30px; font-weight: 700; color: var(--gold); cursor: pointer; letter-spacing: -.5px; transition: opacity .2s; }
.nav-logo:hover { opacity: .8; }
.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a { font-size: 14.5px; font-weight: 500; color: var(--text-mid); transition: color .2s; position: relative; padding-bottom: 2px; }
.nav-links a::after { content:''; position:absolute; bottom:0; left:0; width:0; height:1.5px; background:var(--gold); transition:width .3s; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-dark); border-radius: 2px; transition: all .3s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ── */
.hero { min-height: 95vh; display: flex; align-items: center; position: relative; overflow: hidden; padding: 80px 0 60px; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width:100%; height:100%; object-fit:cover; opacity:.07; transform:scale(1.04); transition:transform 12s ease; }
.hero-bg::after { content:''; position:absolute; inset:0; background:linear-gradient(135deg, rgba(250,248,245,.98) 45%, rgba(250,248,245,.6) 100%); }
.hero-inner { position:relative; z-index:1; display:grid; grid-template-columns:1fr 1fr; gap:72px; align-items:center; }
.hero-text h1  { animation: fadeUp .9s .1s both; }
.hero-sub      { font-size: clamp(16px,1.8vw,20px); line-height:1.65; margin:24px 0 40px; animation: fadeUp .9s .25s both; }
.hero-actions  { display:flex; flex-direction:column; gap:18px; align-items:flex-start; animation: fadeUp .9s .4s both; }
.hero-btns     { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-visual   { position: relative; animation: scaleIn 1s .3s both; }
.hero-visual img { border-radius:16px; box-shadow:0 24px 80px rgba(44,40,38,.18); width:100%; aspect-ratio:4/3; }
.hero-visual-badge {
  position:absolute; bottom:-20px; left:-20px;
  background:#fff; border:1px solid var(--gold-light); border-radius:14px;
  padding:16px 20px; box-shadow:var(--shadow-lg);
  animation: float 4s ease-in-out infinite;
}
.hero-visual-badge .num { font-family:var(--font-h); font-size:28px; font-weight:700; color:var(--gold); }
.hero-visual-badge .lbl { font-size:12px; color:var(--text-mid); }
.hero-visual-dot {
  position:absolute; top:-16px; right:-16px;
  background:var(--gold); color:#fff; border-radius:50%;
  width:64px; height:64px; display:flex; align-items:center; justify-content:center;
  font-size:28px; animation: pulse 2.5s infinite;
}

/* ── Problem cards ── */
.problem-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; }
.problem-card {
  border-left: 3px solid var(--gold); padding: 36px 28px;
  background: #fff; border-radius: var(--r-card);
  box-shadow: var(--shadow); transition: var(--transition);
}
.problem-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.problem-icon { font-size: 36px; margin-bottom: 18px; }

/* ── Pillar (alternating 2-col) ── */
.pillar { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; margin-bottom: 100px; }
.pillar:last-child { margin-bottom: 0; }
.pillar.rev .pillar-img { order: -1; }
.pillar-img { position: relative; }
.pillar-img img { border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; aspect-ratio: 4/3; }
.pillar-accent {
  position: absolute; bottom: -16px; right: -16px;
  background: var(--gold-xlight); border: 1px solid var(--gold-light);
  border-radius: 10px; padding: 14px 18px;
  font-size: 13px; font-weight: 600; color: var(--gold-dark);
}
.pillar-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold-xlight); color: var(--gold-dark);
  font-size: 12px; font-weight: 700; padding: 6px 16px;
  border-radius: 20px; margin-bottom: 16px;
}

/* ── Stats row ── */
.stats-row {
  display: grid; grid-template-columns: repeat(4,1fr);
  border: 1px solid var(--gold-light); border-radius: var(--r-card);
  overflow: hidden; background: #fff; box-shadow: var(--shadow);
}
.stat-item { padding: 48px 32px; text-align: center; border-right: 1px solid var(--gold-light); transition: background .2s; }
.stat-item:last-child { border-right: none; }
.stat-item:hover { background: var(--gold-xlight); }
.stat-num { font-family:var(--font-h); font-size:clamp(40px,4vw,58px); font-weight:700; color:var(--gold); display:block; line-height:1; }
.stat-lbl { font-size: 13.5px; color: var(--text-mid); margin-top: 8px; }

/* ── Case study ── */
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; padding: 64px 0; border-bottom: 1px solid var(--gold-light); }
.case-grid:last-of-type { border-bottom: none; }
.case-grid.rev .case-img { order: -1; }
.case-img img { border-radius: 14px; box-shadow: var(--shadow-lg); width:100%; aspect-ratio:4/3; }
.case-quote { border-left: 3px solid var(--gold); padding: 16px 22px; background: var(--bg-secondary); border-radius: 0 var(--r-card) var(--r-card) 0; font-style: italic; font-size: 15px; margin: 20px 0; }
.case-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 24px 0; }
.m-box { border: 1px solid var(--gold-light); border-radius: var(--r-card); padding: 18px 12px; text-align: center; background: #fff; }
.m-val { font-family:var(--font-h); font-size: 26px; font-weight: 700; color: var(--gold); }
.m-lbl { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ── Ecosystem diagram ── */
.eco-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.eco-center-box { background: var(--gold); color: #fff; border-radius: var(--r-card); padding: 18px 56px; font-family: var(--font-h); font-size: 22px; font-weight: 700; text-align: center; box-shadow: 0 8px 32px rgba(201,166,107,.35); }
.eco-platform { background: var(--bg-dark); color: var(--gold); border: 2px solid var(--gold); border-radius: var(--r-card); padding: 14px 48px; font-family: var(--font-h); font-size: 20px; font-weight: 700; }
.eco-line { width: 2px; height: 28px; background: var(--gold-light); }
.eco-nodes { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.eco-node { border: 1.5px solid var(--gold-light); border-radius: var(--r-card); padding: 18px 22px; text-align: center; min-width: 150px; background: #fff; transition: var(--transition); cursor: pointer; }
.eco-node:hover { border-color: var(--gold); background: var(--gold-xlight); transform: translateY(-3px); box-shadow: var(--shadow); }
.eco-node .nt { font-family: var(--font-h); font-size: 16px; font-weight: 600; color: var(--text-dark); }
.eco-node .ns { font-size: 11.5px; color: var(--text-light); margin-top: 5px; line-height: 1.5; }
.eco-detail { max-width: 680px; margin: 32px auto 0; display: none; }
.eco-detail.vis { display: block; animation: fadeUp .3s both; }

/* ── Timeline ── */
.tl { display: flex; flex-direction: column; max-width: 680px; margin: 0 auto; }
.tl-item { display: flex; gap: 28px; position: relative; }
.tl-item:not(:last-child)::after { content:''; position:absolute; left:19px; top:44px; bottom:-20px; width:2px; background:var(--gold-light); }
.tl-dot { width:40px; height:40px; border-radius:50%; background:var(--gold); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12px; flex-shrink:0; box-shadow:0 4px 12px rgba(201,166,107,.3); }
.tl-body { padding-bottom: 44px; }
.tl-year { font-family:var(--font-h); font-size:19px; font-weight:600; color:var(--gold); margin-bottom:8px; }

/* ── Principles ── */
.principle { display:flex; gap:28px; padding:36px; border:1px solid var(--gold-light); border-radius:var(--r-card); margin-bottom:14px; background:#fff; transition:var(--transition); }
.principle:hover { border-color:var(--gold); box-shadow:var(--shadow); }
.pr-num { font-family:var(--font-h); font-size:52px; font-weight:700; color:var(--gold-light); line-height:1; flex-shrink:0; width:60px; }

/* ── Contact ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.contact-info-box { background: linear-gradient(145deg, var(--gold-xlight), var(--bg-secondary)); border: 1px solid var(--gold-light); border-radius: 14px; padding: 36px; }
.contact-divider { height: 1px; background: var(--gold-light); margin: 24px 0; }

/* ── Responsive page-level ── */
@media (max-width: 820px) {
  .nav-links { display:none; position:fixed; top:76px; left:0; right:0; background:var(--bg-primary); flex-direction:column; padding:28px 20px; gap:20px; border-bottom:1px solid var(--gold-light); box-shadow:var(--shadow-lg); align-items:flex-start; }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .nav-right .btn--outline { display: none; }
  .hero-inner { grid-template-columns:1fr; gap:48px; }
  .hero { min-height:auto; padding:60px 0; }
  .pillar, .pillar.rev { grid-template-columns:1fr; direction:ltr; gap:36px; }
  .pillar.rev .pillar-img { order:0; }
  .case-grid, .case-grid.rev { grid-template-columns:1fr; gap:36px; }
  .case-grid.rev .case-img { order:0; }
  .contact-grid { grid-template-columns:1fr; gap:48px; }
  .stats-row { grid-template-columns:1fr 1fr; }
  .stat-item { border-right:none; border-bottom:1px solid var(--gold-light); }
  .stat-item:nth-child(odd) { border-right:1px solid var(--gold-light); }
  .stat-item:nth-last-child(-n+2) { border-bottom:none; }
  .problem-grid { grid-template-columns:1fr; }
}
@media (max-width: 600px) {
  .principle { flex-direction: column; gap: 12px; }
}