/* ============================================================
   Visuals — animations + glass UI card styling
   ============================================================ */
@keyframes bk-float    { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-14px) } }
@keyframes bk-float2   { 0%,100% { transform: translateY(0) } 50% { transform: translateY(10px) } }
@keyframes bk-pulse    { 0%,100% { opacity: .35; r: 2.4 } 50% { opacity: 1; r: 3.6 } }
@keyframes bk-dash     { to { stroke-dashoffset: -240 } }
@keyframes bk-drift    { 0%,100% { transform: translate(0,0) } 50% { transform: translate(18px,-22px) } }
@keyframes bk-shimmer  { 0% { background-position: -200% 0 } 100% { background-position: 200% 0 } }
@keyframes bk-spin     { to { transform: rotate(360deg) } }
@keyframes bk-bar      { 0%,100% { transform: scaleY(.55) } 50% { transform: scaleY(1) } }
@keyframes bk-typing   { 0%,60%,100% { opacity:.3 } 30% { opacity:1 } }

@media (prefers-reduced-motion: reduce) {
  .neural-node, .float-card, .orb, .flow-line, .eq-bar, .ai-dot { animation: none !important; }
}

/* ---- Hero visual ---- */
.hero-visual { position: relative; width: 100%; height: 100%; min-height: 520px; }

/* background layer (mesh + orbs) sits further back and softly fades at the edges so
   nothing looks hard-cut at the corners */
.hero-bg {
  position: absolute;
  inset: -16% -14%;
  opacity: 0.78;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(72% 70% at 56% 46%, #000 46%, rgba(0,0,0,0.35) 74%, transparent 90%);
  mask-image: radial-gradient(72% 70% at 56% 46%, #000 46%, rgba(0,0,0,0.35) 74%, transparent 90%);
}
.neural-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.neural-node { transform-box: fill-box; transform-origin: center; }
.flow-line { stroke-dasharray: 5 8; animation: bk-dash 5s linear infinite; }

.orb {
  position: absolute; border-radius: 50%; filter: blur(50px); pointer-events: none;
  animation: bk-drift 14s ease-in-out infinite;
}

/* ---- Floating glass cards ---- */
.float-card {
  position: absolute;
  background: linear-gradient(180deg, rgba(13,24,46,0.85), rgba(7,16,38,0.82));
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 70px -30px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05) inset;
  padding: 16px;
  animation: bk-float 8s ease-in-out infinite;
}
.float-card.fc2 { animation: bk-float2 9s ease-in-out infinite; }

.fc-head { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
.fc-dot { width:8px; height:8px; border-radius:50%; }
.fc-title { font-family: var(--font-mono); font-size:11px; letter-spacing:.08em; color: var(--muted); text-transform:uppercase; }

/* equalizer / chart bars */
.eq { display:flex; align-items:flex-end; gap:6px; height:60px; }
.eq-bar { width:9px; border-radius:4px; background: linear-gradient(180deg, var(--cyan), var(--blue)); transform-origin:bottom; animation: bk-bar 1.6s ease-in-out infinite; }

/* code snippet */
.code-line { font-family: var(--font-mono); font-size:12px; line-height:1.9; white-space:nowrap; }
.tok-key { color: var(--violet); } .tok-fn { color: var(--cyan); } .tok-str { color:#7ee0a8; } .tok-mut { color: var(--muted-2); }

/* ai chat */
.ai-bubble { background: rgba(30,167,255,0.12); border:1px solid rgba(30,167,255,0.25); border-radius:12px 12px 12px 3px; padding:9px 12px; font-size:12.5px; color:#dbeeff; }
.ai-dot { width:6px; height:6px; border-radius:50%; background: var(--cyan); display:inline-block; animation: bk-typing 1.2s infinite; }

/* automation node row */
.node-pill { display:flex; align-items:center; gap:8px; padding:8px 11px; border-radius:10px; background: rgba(255,255,255,0.05); border:1px solid var(--border); font-size:12px; }
.node-ic { width:22px; height:22px; border-radius:6px; display:grid; place-items:center; color:#04111f; }

/* ---- Abstract cover art ---- */
.cover { position: relative; overflow: hidden; border-radius: inherit; }
.cover-grid { position:absolute; inset:0; background-image: linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px); background-size: 26px 26px; mask-image: radial-gradient(120% 100% at 30% 0%, #000, transparent 75%); }
.cover-shimmer { position:absolute; inset:0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.10) 50%, transparent 70%); background-size: 200% 100%; }
.hover-card:hover .cover-shimmer { animation: bk-shimmer 1.4s ease; }

/* ---- Terappin custom cover (mental-wellness / breathing motif) ---- */
@keyframes terappin-breathe { 0%,100% { transform: scale(1); opacity:.55; } 50% { transform: scale(1.16); opacity:1; } }
.terappin-rings { position:absolute; inset:0; display:grid; place-items:center; }
.terappin-rings .tr-ring { position:absolute; border-radius:50%; border:1.5px solid rgba(196,181,253,0.45); }
.terappin-rings .tr-ring.r1 { width:172px; height:172px; animation: terappin-breathe 5.5s ease-in-out infinite; }
.terappin-rings .tr-ring.r2 { width:118px; height:118px; border-color:rgba(167,139,250,0.6); animation: terappin-breathe 5.5s ease-in-out .5s infinite; }
.terappin-rings .tr-core {
  width:64px; height:64px; border-radius:50%;
  background: radial-gradient(circle at 38% 32%, #e6dcff, #8b5cf6 70%);
  box-shadow: 0 0 36px rgba(139,92,246,0.7), inset 0 0 14px rgba(255,255,255,0.5);
  animation: terappin-breathe 5.5s ease-in-out infinite;
}
.terappin-dot { position:absolute; border-radius:50%; filter:blur(1px); }
@media (prefers-reduced-motion: reduce) { .terappin-rings .tr-ring, .terappin-rings .tr-core { animation: none !important; } }

/* ---- App Studio screenshot rail (scrollbar-free, drag to scroll) ---- */
.app-shots {
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 92%, transparent 100%);
}
.app-shots::-webkit-scrollbar { display: none; width: 0; height: 0; }
.app-shots.dragging { cursor: grabbing; scroll-behavior: auto; }
.app-shots.dragging image-slot { pointer-events: none; }

/* ---- Modern "Showcase" layout: iPhone device frames ---- */
.app-showcase { padding: clamp(26px,3.4vw,46px); position: relative; overflow: hidden; }
.showcase-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; flex-wrap: wrap; position: relative; }
.showcase-feats { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 20px 0 26px; }
.showcase-feats .tag { font-size: 12.5px; padding: 7px 12px; }

.phone-frame {
  position: relative; flex-shrink: 0; scroll-snap-align: start;
  border-radius: 36px; padding: 7px;
  background: linear-gradient(165deg, #232f47, #0a0f1c 70%);
  border: 1px solid rgba(255,255,255,0.14);
}
.phone-frame::after { /* screen sheen */
  content: ""; position: absolute; inset: 7px; border-radius: 30px; pointer-events: none;
  background: linear-gradient(150deg, rgba(255,255,255,0.10), transparent 38%);
  z-index: 3;
}
.phone-frame image-slot { border-radius: 30px; display: block; background: #0a1326; }
.phone-island {
  position: absolute; top: 17px; left: 50%; transform: translateX(-50%);
  width: 72px; height: 21px; background: #04070e; border-radius: 999px; z-index: 4;
  border: 1px solid rgba(255,255,255,0.06);
}

/* ---- "Product page" layout (DaVinci-style) ---- */
.app-hero { padding: clamp(28px,4vw,58px); position: relative; overflow: hidden; }
.app-hero-top { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px,4vw,56px); align-items: center; position: relative; }
.app-hero-phones { position: relative; min-height: 470px; display: flex; align-items: center; justify-content: center; }
.app-hero-phones .phone-frame { position: absolute; }
.app-hero-phones .pf-back  { transform: rotate(-9deg) translateX(-46px) translateY(8px); opacity: .92; }
.app-hero-phones .pf-front { transform: rotate(7deg) translateX(52px); z-index: 3; }
.app-hero-meta { display: flex; gap: clamp(18px,3vw,34px); flex-wrap: wrap; margin-top: 26px; }
.app-hero-meta .mlabel { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 6px; }
.app-hero-meta .mval { font-family: var(--font-display); font-size: 19px; font-weight: 600; }

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: clamp(28px,3.5vw,44px); }
.feat-panel {
  position: relative; overflow: hidden; border-radius: 22px; padding: 26px 26px 0;
  min-height: 380px; border: 1px solid var(--border); display: flex; flex-direction: column;
}
.feat-panel h4 { font-family: var(--font-display); font-size: clamp(20px,1.7vw,25px); line-height: 1.08; font-weight: 600; position: relative; z-index: 2; }
.feat-panel .feat-visual { margin-top: auto; align-self: center; width: 100%; }

/* ---- "Spotlight" layout: centered hero + fanned phones ---- */
.app-spotlight { padding: clamp(34px,4.5vw,64px) clamp(24px,4vw,56px) clamp(20px,3vw,40px); position: relative; overflow: hidden; text-align: center; }
.spotlight-info { position: relative; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.spotlight-meta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.spotlight-meta .pill {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em;
  padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.spotlight-fan {
  display: flex; justify-content: center; align-items: flex-end;
  margin-top: clamp(34px,4vw,52px); padding: 14px 0 8px; position: relative; z-index: 2;
}
.spotlight-fan .phone-frame { margin: 0 -16px; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.spotlight-fan .phone-frame:nth-child(1) { transform: rotate(-9deg) translateY(30px); z-index: 1; }
.spotlight-fan .phone-frame:nth-child(2) { transform: rotate(-3deg) translateY(7px); z-index: 3; }
.spotlight-fan .phone-frame:nth-child(3) { transform: rotate(3deg) translateY(7px); z-index: 3; }
.spotlight-fan .phone-frame:nth-child(4) { transform: rotate(9deg) translateY(30px); z-index: 1; }
.app-spotlight:hover .spotlight-fan .phone-frame { margin: 0 -8px; }
.app-spotlight:hover .spotlight-fan .phone-frame:nth-child(1) { transform: rotate(-7deg) translateY(22px); }
.app-spotlight:hover .spotlight-fan .phone-frame:nth-child(4) { transform: rotate(7deg) translateY(22px); }

/* ---- AI Transformation: hero core ---- */
.ai-hero-core-wrap { display: flex; justify-content: center; }
.ai-core { position: relative; width: min(420px, 100%); aspect-ratio: 1; }
.ai-core-center { position: absolute; inset: 0; display: grid; place-items: center; }
@media (max-width: 1040px) {
  .ai-bento { grid-template-columns: 1fr 1fr !important; }
  .ai-bento-cell { grid-column: span 1 !important; }
}

/* ---- "Explore" layout: interactive feature tabs + live device ---- */
.app-explorer { padding: clamp(28px,4vw,56px); position: relative; overflow: hidden; }
.explorer-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: clamp(26px,3.4vw,40px); position: relative; }
.explorer-grid { display: grid; grid-template-columns: 0.8fr 1fr; gap: clamp(30px,4.5vw,64px); align-items: center; position: relative; }
.explorer-phone-wrap { display: flex; justify-content: center; }
.explorer-screen { position: relative; }
.explorer-screen image-slot { position: absolute; inset: 0; transition: opacity .55s ease; }
.explorer-tabs { display: flex; flex-direction: column; gap: 10px; }
.explorer-tab {
  display: flex; gap: 16px; align-items: center; text-align: left; width: 100%;
  padding: 18px 20px; border-radius: 16px; border: 1px solid transparent;
  background: rgba(255,255,255,0.03); transition: background .25s, border-color .25s, transform .25s;
  position: relative; overflow: hidden; cursor: pointer;
}
.explorer-tab:hover { background: rgba(255,255,255,0.06); }
.explorer-tab[data-active="true"] { background: rgba(255,255,255,0.075); border-color: var(--border-strong); }
.explorer-tab .etab-num {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600; width: 34px; height: 34px;
  border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
  border: 1px solid var(--border); color: var(--muted); transition: all .25s;
}
.explorer-tab h4 { font-family: var(--font-display); font-size: clamp(17px,1.6vw,20px); font-weight: 600; line-height: 1.15; }
.explorer-progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; }
.explorer-tab[data-active="true"] .explorer-progress { animation: etab-fill 4.2s linear forwards; }
.app-explorer.paused .explorer-progress { animation-play-state: paused; }
@keyframes etab-fill { from { width: 0; } to { width: 100%; } }

/* ---- "List" layout: condensed App Store list row ---- */
.app-list { display: flex; align-items: center; gap: clamp(18px,2.5vw,30px); padding: clamp(20px,2.6vw,32px); position: relative; overflow: hidden; }
.app-list-main { flex: 1; min-width: 0; }
.app-list-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-list-side { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; flex-shrink: 0; }
.app-list-thumbs { display: flex; gap: 8px; }
.app-list-thumbs image-slot { transition: transform .3s; }
.app-list:hover .app-list-thumbs image-slot { transform: translateY(-3px); }
