/* ============================================================
   PURPLE EPHRA AGENCIES — SPA OS UI
   Arched dock · Big Header · Seamless Fade · Pure CQW/CQH
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300&family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
  --bg:           #0B0515;
  --surface:      rgba(30, 15, 55, 0.45);
  --gold:         #D4AF37;
  --gold-dim:     rgba(212, 175, 55, 0.18);
  --gold-glow:    rgba(212, 175, 55, 0.35);
  --purple-mid:   rgba(58, 14, 92, 0.5);
  --accent:       #8E54E9;
  --text:         #FFFFFF;
  --muted:        #9A8DB0;
  --dock-height:  clamp(90px, 14vh, 120px);
  --header-height:clamp(120px, 20vh, 180px);

  /* Icon scale cascade: home=100%, adj=98% (-2%), outer=93% (-5% from adj) */
  --icon-home:    clamp(30px, 4vw, 36px);
  --icon-adj:     clamp(29.4px, 3.92vw, 35.2px); /* 98% */
  --icon-outer:   clamp(27.9px, 3.72vw, 33.48px); /* 93% */
  
  --wrap-home:    clamp(60px, 9vw, 80px);
  --wrap-adj:     clamp(58.8px, 8.82vw, 78.4px); /* 98% */
  --wrap-outer:   clamp(55.8px, 8.37vw, 74.4px); /* 93% */
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100vw; height: 100vh;
  overflow: hidden;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(58,14,92,0.55) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 110%, rgba(212,175,55,0.08) 0%, transparent 60%);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-smooth: always;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
h1,h2,h3,h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* ── App Shell ── */
.app-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: var(--header-height) 1fr var(--dock-height);
  overflow: hidden;
}

/* ── BIG HEADER ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  padding: clamp(1rem, 3vh, 2rem) clamp(1.5rem, 5vw, 4rem);
}
.header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.3rem, 1vh, 0.6rem);
  animation: floatBrand 8s ease-in-out infinite;
}
@keyframes floatBrand {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(5px); }
}
.brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  letter-spacing: -0.04em;
  color: var(--text);
  text-align: center;
  line-height: 1.0;
}
.brand-tagline {
  font-size: clamp(0.7rem, 1.6vw, 1rem);
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.9;
}

/* ── CONTENT AREA with Seamless Fade Mask ── */
.app-main {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 5vw, 5rem);
  /* Seamless fade: top bleeds into header, bottom into dock */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 10%,
    black 88%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 10%,
    black 88%,
    transparent 100%
  );
  /* Container query context */
  container-type: inline-size;
  container-name: main;
  scroll-behavior: smooth;
}
.app-main::-webkit-scrollbar { display: none; }

/* ── ARCHED FULL-WIDTH BOTTOM DOCK ── */
.arch-dock {
  position: relative;
  width: 100vw;
  overflow: visible;
}
.arch-svg {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 100%;
  /* Black shadow to ground the curve */
  filter: drop-shadow(0 -12px 40px rgba(0,0,0,0.9));
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}

.dock-items {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;       /* anchor to absolute bottom */
  justify-content: center;
  gap: clamp(0.1rem, 2.5vw, 2rem);
  padding: 0 clamp(0.5rem, 2vw, 2rem);
  padding-bottom: clamp(2px, 0.5vh, 6px); /* Flush to bottom */
  z-index: 2;
  width: 100%;
}

/* Outer items: Portfolio, Contact — smallest (90% of home) */
.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* anchor to bottom */
  gap: clamp(2px, 0.5vh, 5px);
  color: var(--muted);
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(0.7rem, 1.3vw, 0.85rem); /* Bigger labels */
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  flex: 1;
}
.dock-item:hover { color: var(--text); }
.dock-item.active { color: var(--gold); }

.dock-icon-wrap {
  /* Outer size (default) */
  width: var(--wrap-outer);
  height: var(--wrap-outer);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
.dock-item.active .dock-icon-wrap {
  background: var(--gold-dim);
  box-shadow: 0 0 20px var(--gold-glow);
}
.dock-item:not(.dock-home):hover .dock-icon-wrap {
  background: rgba(255,255,255,0.06);
  transform: translateY(-3px);
}
.dock-icon {
  /* Outer icon size */
  width: var(--icon-outer);
  height: var(--icon-outer);
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dock-item.active:not(.dock-home) .dock-icon { stroke-width: 2.5; }

/* Adjacent items: Services, Compliance — 5% bigger than outer */
.dock-item.dock-adj .dock-icon-wrap {
  width: var(--wrap-adj);
  height: var(--wrap-adj);
}
.dock-item.dock-adj .dock-icon {
  width: var(--icon-adj);
  height: var(--icon-adj);
}
.dock-item.dock-adj {
  font-size: clamp(0.75rem, 1.4vw, 0.9rem);
}

/* HOME — Elevated center, biggest */
.dock-home {
  flex: 1.5;
  position: relative;
  color: var(--gold);
  justify-content: flex-end;
}
.dock-home-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(3px, 0.6vh, 7px);
}
.dock-icon-home {
  width: var(--wrap-home);
  height: var(--wrap-home);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #F5DC72);
  box-shadow: 0 8px 36px var(--gold-glow), 0 0 0 2px rgba(212,175,55,0.45);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dock-home .dock-icon {
  stroke: var(--bg);
  width: var(--icon-home);
  height: var(--icon-home);
  stroke-width: 2.5;
}
.dock-home:hover .dock-icon-home {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 12px 48px var(--gold-glow);
}
.dock-home.active .dock-icon-home {
  box-shadow: 0 10px 40px var(--gold-glow), 0 0 0 3px rgba(212,175,55,0.55);
}
.dock-home span {
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  font-weight: 700;
  color: var(--gold);
}

/* ── Glass Cards ── */
.glass-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: clamp(16px, 3cqw, 32px);
  padding: clamp(1.5rem, 4cqw, 3rem);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
}
.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.3), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.glass-card:hover {
  border-color: rgba(255,255,255,0.12);
  background: rgba(45, 20, 80, 0.6);
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 24px 48px rgba(0,0,0,0.4);
}
.glass-card:hover::before { opacity: 1; }

/* ── Typography ── */
.label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(0.7rem, 1.4cqw, 0.85rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: clamp(0.5rem, 1.5cqw, 1rem);
}
.title-xl {
  font-size: clamp(2.5rem, 9cqw, 7rem);
  line-height: 1.0;
  letter-spacing: -0.04em;
  margin-bottom: clamp(1rem, 3cqw, 2.5rem);
}
.title-lg {
  font-size: clamp(2rem, 6cqw, 5rem);
  letter-spacing: -0.035em;
  margin-bottom: clamp(1.5rem, 4cqw, 3rem);
}
.title-md {
  font-size: clamp(1.15rem, 2.5cqw, 1.9rem);
  margin-bottom: clamp(0.5rem, 1.5cqw, 1rem);
}
.text-body {
  color: var(--muted);
  font-size: clamp(0.95rem, 1.7cqw, 1.25rem);
  line-height: 1.75;
  margin-bottom: clamp(1rem, 3cqw, 2rem);
  font-weight: 400;
  max-width: 70cqw;
}
.text-gold { color: var(--gold); }
.text-sm {
  font-size: clamp(0.75rem, 1.2cqw, 0.95rem);
  color: var(--muted);
}

/* ── Grid ── */
.grid { display: grid; gap: clamp(1rem, 2.5cqw, 2.5rem); grid-template-columns: 1fr; }
@container main (min-width: 540px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}
@container main (min-width: 800px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ── Tags ── */
.tag {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(0.62rem, 1.1cqw, 0.78rem);
  font-weight: 700;
  color: #B28DFF;
  background: rgba(142, 84, 233, 0.1);
  padding: 0.35rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(142, 84, 233, 0.22);
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}
.tag-gold {
  color: var(--gold);
  background: var(--gold-dim);
  border-color: rgba(212,175,55,0.3);
}

/* ── Button ── */
.btn-primary {
  background: var(--gold);
  color: var(--bg);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: clamp(0.9rem, 1.6cqw, 1.2rem);
  padding: clamp(0.85rem, 2cqw, 1.25rem) clamp(2rem, 4cqw, 4rem);
  border-radius: 100px;
  display: inline-flex; align-items: center; gap: 0.75rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 15px var(--gold-dim), inset 0 0 10px rgba(255,255,255,0.4);
}
.btn-primary:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 0 35px var(--gold-glow), 0 10px 25px rgba(212,175,55,0.4), inset 0 0 15px rgba(255,255,255,0.6);
  background: linear-gradient(135deg, var(--gold), #F5DC72);
}

/* ── Views ── */
.view {
  animation: viewIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes viewIn {
  0%   { opacity: 0; transform: translateY(clamp(16px, 4cqh, 50px)) scale(0.98); filter: blur(6px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ── Skeletons ── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.02) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s ease infinite;
  border-radius: 8px;
}
.skel-label  { height: clamp(0.8rem, 1.5cqw, 1rem); width: 20cqw; margin-bottom: clamp(0.5rem, 1.5cqw, 1rem); }
.skel-title  { height: clamp(2.5rem, 7cqw, 5rem); width: 80cqw; margin-bottom: clamp(1rem, 3cqw, 2rem); }
.skel-body   { height: clamp(1rem, 1.8cqw, 1.3rem); width: 70cqw; margin-bottom: 0.75rem; }
.skel-body-sm{ height: clamp(1rem, 1.8cqw, 1.3rem); width: 50cqw; margin-bottom: clamp(1.5rem, 4cqw, 3rem); }
.skel-card   { height: clamp(180px, 25cqh, 280px); width: 100%; border-radius: clamp(16px, 3cqw, 32px); }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Cinematic Preloader ── */
.preloader {
  position: fixed; inset: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(58,14,92,0.55) 0%, transparent 70%);
  z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(2.5rem, 6vh, 5rem);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.preloader.hidden { opacity: 0; pointer-events: none; }

/* Text Stage */
.loader-text-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* The single unified row of morph words */
.morph-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(0.4rem, 1.5vw, 1.2rem);
  transition: opacity 0.7s ease, filter 0.7s ease, transform 0.7s ease;
}

/* Each word block */
.morph-word {
  display: flex;
  align-items: baseline;
  overflow: hidden;
}

/* Anchor letter: P, E, A — always visible */
.morph-anchor {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  font-size: clamp(3.5rem, 10vw, 7rem);
  color: var(--gold);
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 0 0 30px var(--gold-glow);
  animation: anchorPulse 1.8s ease-in-out infinite alternate;
  flex-shrink: 0;
}
.morph-word:nth-child(2) .morph-anchor { animation-delay: 0.2s; }
.morph-word:nth-child(3) .morph-anchor { animation-delay: 0.4s; }

@keyframes anchorPulse {
  0%   { text-shadow: 0 0 15px var(--gold-dim); }
  100% { text-shadow: 0 0 55px var(--gold-glow); }
}

/* Suffix letters: 'urple', 'phra', 'gencies' */
/* Collapsed by default: zero-width, invisible */
.morph-suffix {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  font-size: clamp(3.5rem, 10vw, 7rem);
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  display: inline-block;
  /* Smooth expand/collapse transition */
  transition:
    max-width 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.5s ease;
  filter: blur(8px);
}

/* Expanded state — JS adds this class */
.morph-suffix.expanded {
  max-width: 600px;   /* large enough for 'gencies' at any scale */
  opacity: 1;
  filter: blur(0);
}
.morph-suffix.expanded:nth-of-type(2) { transition-delay: 0.1s; }

/* Stagger per word via JS data-index */
.morph-word[data-i="1"] .morph-suffix.expanded { transition-delay: 0.12s; }
.morph-word[data-i="2"] .morph-suffix.expanded { transition-delay: 0.24s; }

/* Evaporate: whole row dissolves upward */
.morph-row.evaporate {
  opacity: 0;
  filter: blur(16px);
  transform: translateY(clamp(-20px, -4vh, -50px)) scale(0.88);
  transition: opacity 0.8s ease, filter 0.8s ease, transform 0.8s ease;
}

/* ── Teardrop Seekbar ── */
.seekbar-track {
  width: clamp(200px, 40vw, 400px);
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  position: relative;
  overflow: visible;
}
.seekbar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(212,175,55,0.4), var(--gold), #F5DC72);
  border-radius: 4px;
  will-change: width;
  box-shadow: 0 0 12px var(--gold-dim);
}
.seekbar-droplet {
  position: absolute;
  top: 50%;
  left: 0%;
  /* Teardrop: rotated square with one rounded corner */
  width: clamp(12px, 2vw, 16px);
  height: clamp(16px, 2.5vw, 20px);
  background: linear-gradient(160deg, #F5DC72, var(--gold));
  border-radius: 50% 50% 50% 0;
  transform: translate(-50%, -50%) rotate(-45deg);
  box-shadow:
    0 0 14px var(--gold-glow),
    0 0 28px var(--gold-dim),
    0 0 0 1px rgba(212,175,55,0.3);
  will-change: left;
}
