/* ==========================================================================
   STAIRION — Global Styles (homepage + shared)
   ========================================================================== */

/* Base reset / box sizing */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background: var(--dark);
  color: var(--ink);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root{
  --brand:#0EA5FF;
  --brand-2:#5EC6FF;
  --ink:#EAF2FF;
  --ink-muted:#CFE8FF;
  --dark:#0B1320;
  --dark-2:#0F172A;
  --radius:16px;
  --shadow:0 12px 40px rgba(0,0,0,.25);
  --yellow:#FDE047;
  --neon:#E8FF3A;

  /* animation timings (kept in sync with site.js) */
  --cycle: 3s;   /* total phrase cycle and gradient sweep duration */
  --fade: 420ms; /* cross-fade duration for phrase exit */
}

/* Layout helpers */
.container{ max-width:1200px; margin:0 auto; padding:0 20px; }
.section{ padding:54px 0; background:linear-gradient(180deg,transparent,rgba(255,255,255,.02) 12%,transparent 24%); }
.section .muted{ color:var(--ink-muted); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header{
  position:sticky; top:0; z-index:50;
  background:rgba(11,19,32,.9);
  backdrop-filter:saturate(160%) blur(8px);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.bar{ display:flex; align-items:center; justify-content:space-between; min-height:88px; }
.brand{ display:flex; align-items:center; text-decoration:none; }
.brand-logo{ height:56px; width:auto; display:block; object-fit:contain; }
@media (max-width:768px){ .brand-logo{ height:48px; } }

.menu{ display:flex; gap:22px; align-items:center; }
.menu a{
  color:var(--ink); text-decoration:none; opacity:.9; position:relative; padding:6px 2px;
}
.menu a:hover{ opacity:1; }
.menu a::after{
  content:""; position:absolute; left:0; right:0; bottom:-6px; height:2px; background:currentColor;
  transform:scaleX(0); transform-origin:left;
  transition:transform .6s cubic-bezier(.22,.61,.36,1); opacity:.7;
}
.menu a:hover::after{ transform:scaleX(1); }

/* --------------------------------------------------------------------------
   Hero base + size modifiers
   -------------------------------------------------------------------------- */
.hero{
  position:relative; overflow:hidden;
  background:linear-gradient(180deg,var(--dark),var(--dark-2));
  display:flex; align-items:center;
}
.hero .inner{ position:relative; z-index:2; padding:56px 0 42px; }
.title{
  font-size:48px; line-height:1.1; margin:0 0 12px; letter-spacing:-.01em; max-width:920px;
}
.lead{ color:var(--ink-muted); margin:0; }

/* Size modifiers */
.hero--home { min-height: 48vh; }
.hero--narrow { min-height: 24vh; padding-top: 18px; }
.hero--narrow .inner { padding: 28px 0 22px; }
.hero--narrow #hero-canvas { opacity: .35; }
.hero--narrow .layer.glow { opacity: .55; }

/* Optional gradient treatment for H1 */
.title-gradient{
  background: linear-gradient(90deg, #ffffff, rgba(255,255,255,.92) 55%, var(--brand));
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent; color:transparent;
}

/* Rotating phrases (smooth cross-fade + reverse gradient sweep) */
.flip{
  display:block; margin:6px 0 10px;
  font-size:24px; line-height:1.35; min-height:1.7em; position:relative;
}
.flip .phrase{
  position:absolute; left:0; top:0;
  opacity:0; transform:translateY(6px);
  transition: opacity var(--fade) ease, transform var(--fade) ease;
  color: var(--ink);
}
.flip .phrase.active{
  opacity:1; transform:translateY(0);
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--yellow));
  background-size: 200% 100%;
  background-position: 100% 50%; /* start at right */
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent; color:transparent;
  animation: gradientSweepRL var(--cycle) ease-in-out infinite,
             sheen          var(--cycle) ease-in-out infinite;
  will-change: background-position, filter;
}
.flip .phrase.leaving{ opacity:0; transform:translateY(-6px); }

/* Single-row layout: text left, button right */
.hero-row{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap; margin-top:12px;
}
.hero-row .flip, .hero-row .journey-text{ flex:1 1 auto; }
.hero-row .cta{ flex:0 0 auto; margin-top:0; white-space:nowrap; }

/* CTA – pill style + subtle motion */
.cta{
  --cta-bg1: var(--brand);
  --cta-bg2: var(--brand-2);
  display:inline-block;
  padding:12px 20px;
  border-radius:999px;
  color:#fff; text-decoration:none;
  background: linear-gradient(180deg, var(--cta-bg2), var(--cta-bg1));
  border:1px solid rgba(255,255,255,.18);
  box-shadow: 0 4px 12px rgba(14,165,255,.25), inset 0 1px 0 rgba(255,255,255,.25);
  position:relative; overflow:hidden;
  opacity:0; transform:translateX(8px);
  animation: heroCtaIn .6s ease .25s forwards;
}
.cta::after{
  content:""; position:absolute; inset:0 0 auto 0; height:45%;
  background: linear-gradient(180deg, rgba(255,255,255,.25), rgba(255,255,255,0));
  border-top-left-radius:inherit; border-top-right-radius:inherit;
  pointer-events:none;
}
.cta:hover{ transform: translateY(-2px); box-shadow: 0 10px 24px rgba(14,165,255,.32), inset 0 1px 0 rgba(255,255,255,.3); }
.cta:focus-visible{ outline:2px solid rgba(232,255,58,.9); outline-offset:2px; }
@keyframes heroCtaIn{ to{ opacity:1; transform:none; } }

/* Hero visual layers */
.layer{ position:absolute; inset:0; pointer-events:none; }
.layer.glow{
  background:
    radial-gradient(40% 30% at 20% 30%, rgba(14,165,255,.26), transparent 60%),
    radial-gradient(30% 30% at 80% 20%, rgba(99,102,241,.20), transparent 60%),
    radial-gradient(28% 26% at 60% 80%, rgba(59,130,246,.16), transparent 60%);
  filter:blur(30px); opacity:.8;
  animation: glowFloat 16s ease-in-out infinite alternate;
}
@keyframes glowFloat{ 0%{ transform: translate3d(-4px,-2px,0); } 100%{ transform: translate3d(6px,3px,0); } }
.layer.orbit{ opacity:.22; }
.layer.orbit::before,.layer.orbit::after{
  content:""; position:absolute; left:50%; top:50%; width:1100px; height:1100px;
  border:1px solid rgba(255,255,255,.12); border-radius:50%;
  transform:translate(-50%,-50%) rotate(0deg);
  animation: spin 36s linear infinite;
}
.layer.orbit::after{ width:760px; height:760px; animation-duration:44s; opacity:.7; }
@keyframes spin{
  0%{   transform: translate(calc(-50% + 0px),  calc(-50% + 0px)) rotate(0deg); }
  50%{  transform: translate(calc(-50% + 6px),  calc(-50% + 3px)) rotate(180deg); }
  100%{ transform: translate(calc(-50% + 0px),  calc(-50% + 0px)) rotate(360deg); }
}
#hero-canvas{ position:absolute; inset:0; width:100%; height:100%; opacity:.6; }

/* Journey text — same animation & direction as flip */
.journey-text{
  display:inline-block;
  font-size:28px; font-weight:700; line-height:1.25; letter-spacing:.2px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 42%, var(--yellow) 100%);
  background-size: 200% 100%;
  background-position: 100% 50%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: gradientSweepRL var(--cycle) ease-in-out infinite,
             sheen          var(--cycle) ease-in-out infinite;
  will-change: background-position, filter;
}

/* Shared gradient sweep (right -> left) */
@keyframes gradientSweepRL{
  0%{   background-position: 100% 50%; }
  50%{  background-position:   0% 50%; }
  100%{ background-position: 100% 50%; }
}
/* Subtle glow pulse */
@keyframes sheen{
  0%,100%{ filter: drop-shadow(0 0 0 rgba(232,255,58,0)); }
  50%{    filter: drop-shadow(0 0 6px rgba(232,255,58,.22)); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .flip .phrase.active, .flip .phrase.leaving, .journey-text{ animation: none; }
  .layer.orbit::before,.layer.orbit::after{ animation:none; }
  #hero-canvas{ display:none; }
  .flip .phrase{ transition:none; }
}

/* --------------------------------------------------------------------------
   Homepage pillars & cards
   -------------------------------------------------------------------------- */
.pillars{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
@media (max-width:900px){ .pillars{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:640px){ .pillars{ grid-template-columns:1fr; } }
.card{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  border-radius:var(--radius);
  padding:16px;
  transition:transform .35s ease, box-shadow .35s ease, border-color .25s ease;
}
.card:hover{
  transform:translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,.25),
              0 0 0 1px rgba(232,255,58,.18) inset,
              0 8px 24px rgba(14,165,255,.18);
  border-color: rgba(232,255,58,.45);
}
.card-head{ display:flex; align-items:center; gap:14px; margin-bottom:8px; }
.card-head h3{ margin:0; font-size:18px; line-height:1.25; }
.card p{ margin:0; color:var(--ink-muted); }
@media (max-width:640px){ .card-head{ gap:12px; } .card-head h3{ font-size:17px; } }
.icon{ display:flex; align-items:center; justify-content:center; width:80px; height:80px; margin:0; border-radius:16px; background:transparent; overflow:visible; }
.icon object,.icon img{ width:76px; height:76px; display:block; }

/* Reveal utility */
.reveal{ opacity:0; transform:translateY(10px); transition:opacity .8s cubic-bezier(.22,.61,.36,1), transform .8s cubic-bezier(.22,.61,.36,1); }
.reveal.visible{ opacity:1; transform:none; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer{ border-top: 1px solid rgba(255,255,255,.08); background: var(--dark); color: var(--ink-muted); font-size: 0.95rem; }
.site-footer .footer-row{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 0; flex-wrap:wrap; }
.footer-brand img{ height:22px; width:auto; display:block; opacity:.9; }
.legal-links{ display:flex; align-items:center; gap:16px; }
.legal-links a{ color:var(--ink-muted); text-decoration:none; }
.legal-links a:hover{ color:var(--ink); text-decoration: underline; }
.social-linkedin{ display:inline-flex; gap:8px; align-items:center; color: var(--ink-muted); }
.social-linkedin svg{ fill:#0A66C2; }
.social-linkedin:hover svg{ filter:brightness(1.15); }
.social-linkedin:hover{ color: var(--ink); }
.copyright{ opacity:.8; }
