/* ============================================================
   Custom Web Applications — flagship immersive page (ink theme)
   ============================================================ */

section { padding: 6.5rem 0; }

/* ---------- 1. hero (pinned WebGL dive) ---------- */
.hero { padding: 0; }
.hero-stage {
  position: relative;
  height: calc(100vh - var(--nav-h));
  min-height: 640px;
  overflow: hidden;
  background: radial-gradient(ellipse 120% 90% at 50% 0%, var(--ink-600) 0%, var(--ink-800) 55%, var(--ink-900) 100%);
}
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 50%, transparent 45%, rgba(8, 16, 25, 0.55) 100%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 780px;
  text-align: center;
  align-items: center;
  margin-inline: auto;
}
.hero-copy h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 1.2rem;
}
.hero-copy h1 em {
  font-style: normal;
  color: var(--amber);
}
.hero-sub {
  margin: 1.5rem 0 2.2rem;
  max-width: 62ch;
  color: var(--text-dim);
  font-size: 1.08rem;
}
.cta-group { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.scroll-hint svg { width: 16px; height: 16px; animation: hint-bob 1.8s ease-in-out infinite; }
@keyframes hint-bob {
  50% { transform: translateY(6px); }
}

/* dive captions — hidden until the scroll sequence activates them */
.dive-captions { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.dive-caption {
  position: absolute;
  top: 50%;
  left: clamp(1.5rem, 8vw, 8rem);
  translate: 0 -50%;
  max-width: 340px;
  opacity: 0;
}
.dive-caption .num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--amber);
}
.dive-caption h3 { font-size: 1.9rem; margin: 0.5rem 0; }
.dive-caption p { color: var(--text-dim); font-size: 0.98rem; }

.dive-progress {
  position: absolute;
  right: clamp(1.2rem, 4vw, 3rem);
  top: 50%;
  translate: 0 -50%;
  width: 2px;
  height: 180px;
  background: rgba(240, 235, 218, 0.15);
  border-radius: 2px;
  z-index: 2;
  opacity: 0;
}
.dive-progress i {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: top;
  transform: scaleY(0);
  background: var(--amber);
  border-radius: 2px;
}

/* ---------- 2. overview ---------- */
.overview { background: var(--ink-800); }
.overview-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.icon-badge.lg { width: 58px; height: 58px; border-radius: 16px; margin-bottom: 1.4rem; }
.icon-badge.lg svg { width: 28px; height: 28px; }
.overview-copy h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 1.2rem; }
.overview-copy p { color: var(--text-dim); margin-bottom: 1rem; max-width: 58ch; }

.stat-strip { display: grid; gap: 1.1rem; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.7rem;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 1.1rem;
  align-items: center;
  transition: border-color 0.25s var(--ease-out);
}
.stat-card:hover { border-color: var(--amber); }
.stat-icon {
  grid-row: span 2;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  color: var(--amber);
  border: 1px solid var(--line-strong);
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-label { color: var(--text-faint); font-size: 0.88rem; }

@media (min-width: 640px) and (max-width: 1023px) {
  .stat-strip { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 3. capabilities ---------- */
.capabilities { background: var(--ink-900); border-block: 1px solid var(--line); }
.capabilities .section-head { margin-bottom: 3rem; }
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.cap-card { display: flex; flex-direction: column; gap: 0.9rem; }
.cap-card:hover {
  border-color: var(--amber);
  transform: translateY(-5px);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.8);
}
.cap-card h3 { font-size: 1.15rem; }
.cap-card p { color: var(--text-dim); font-size: 0.93rem; }

/* ---------- 4. process ---------- */
.process .section-head { margin-bottom: 4rem; }
.timeline { position: relative; }
.rail {
  position: absolute;
  left: 27px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(240, 235, 218, 0.12);
  border-radius: 2px;
}
.rail i {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: top;
  transform: scaleY(0);
  background: linear-gradient(var(--amber), var(--coral));
  border-radius: 2px;
}
.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 2.6rem;
}
.step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.6rem;
  align-items: start;
}
.step .marker {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-faint);
  background: var(--ink-800);
  border: 1px solid var(--line-strong);
  position: relative;
  z-index: 1;
  transition: color 0.4s, border-color 0.4s, background-color 0.4s, box-shadow 0.4s;
}
.step.is-active .marker {
  color: var(--ink-900);
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--amber) 18%, transparent);
}
.step-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  align-items: start;
  transition: border-color 0.4s;
}
.step.is-active .step-body { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
.step-body h3 { font-size: 1.2rem; margin-bottom: 0.35rem; }
.step-body p { color: var(--text-dim); font-size: 0.95rem; }

@media (min-width: 1024px) {
  .timeline { padding-top: 1rem; }
  .rail { left: 50%; translate: -50% 0; }
  .steps { gap: 3.4rem; }
  .step {
    grid-template-columns: 1fr 56px 1fr;
    gap: 2.2rem;
    align-items: center;
  }
  .step .marker { grid-column: 2; }
  .step:nth-child(odd) .step-body { grid-column: 1; grid-row: 1; }
  .step:nth-child(even) .step-body { grid-column: 3; grid-row: 1; }
}

/* ---------- 5. use cases ---------- */
.use-cases {
  overflow-x: clip; /* cards GSAP-slide in from the side; never widen the page */ background: var(--ink-900); border-block: 1px solid var(--line); }
.use-cases .section-head { margin-bottom: 3rem; }
.uc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.uc-card { display: flex; flex-direction: column; gap: 0.8rem; }
.uc-card:hover {
  border-color: var(--olive);
  transform: translateY(-5px);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.8);
}
.uc-card .tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.26rem 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--olive) 55%, transparent);
  color: var(--olive);
}
.uc-card .uc-head { display: flex; align-items: center; gap: 0.8rem; }
.uc-card .icon-badge { background: color-mix(in srgb, var(--olive) 12%, transparent); color: var(--olive); }
.uc-card h3 { font-size: 1.12rem; }
.uc-card p { color: var(--text-dim); font-size: 0.93rem; }

/* ---------- 6. mid CTA ---------- */
.mid-cta { padding: 5rem 0; }
.mid-cta-card {
  background: var(--cream);
  color: #142430;
  border-radius: var(--radius-lg);
  padding: clamp(2.2rem, 5vw, 3.8rem);
  display: grid;
  grid-template-columns: 1.6fr auto;
  gap: 2.5rem;
  align-items: center;
}
.mid-cta-card h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
.mid-cta-card p { color: rgba(20, 36, 48, 0.75); margin-top: 0.9rem; max-width: 58ch; }
.trust-list {
  list-style: none;
  padding: 0;
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.6rem;
}
.trust-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
}
.trust-list svg { width: 17px; height: 17px; color: var(--olive); }

/* ---------- 6.5 examples player ---------- */
.examples .section-head { margin-bottom: 3rem; }
.player-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-900);
}
.stage-item {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
}
.stage-item.is-active { opacity: 1; }
.stage-item .poster {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 90% at 30% 20%, color-mix(in srgb, var(--tint, var(--amber)) 22%, transparent), transparent 60%),
    linear-gradient(160deg, var(--ink-600), var(--ink-900) 75%);
}
.stage-item .poster::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(240, 235, 218, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 235, 218, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
}
.stage-item .stage-info {
  position: relative;
  text-align: center;
  padding: 1.5rem;
}
.stage-item .play-btn {
  width: 84px;
  height: 84px;
  margin: 0 auto 1.4rem;
  border-radius: 50%;
  border: 1px solid rgba(240, 235, 218, 0.35);
  background: rgba(8, 16, 25, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--cream);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), background-color 0.25s, border-color 0.25s;
}
.stage-item .play-btn:hover { transform: scale(1.07); border-color: var(--amber); background: rgba(232, 163, 61, 0.2); }
.stage-item .play-btn svg { width: 30px; height: 30px; margin-left: 4px; }
.stage-item h3 { font-size: 1.4rem; }
.stage-item .stage-note {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.player-rail {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.2rem;
}
.car-btn {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s, color 0.2s;
}
.car-btn:hover { border-color: var(--amber); color: var(--amber); }
.car-btn svg { width: 20px; height: 20px; }

.thumbs {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.thumbs::-webkit-scrollbar { display: none; }
.thumb {
  position: relative;
  flex: none;
  width: 190px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: linear-gradient(160deg, var(--ink-600), var(--ink-900));
  cursor: pointer;
  padding: 0;
  transition: border-color 0.25s, opacity 0.25s;
  opacity: 0.6;
}
.thumb:hover { opacity: 0.9; }
.thumb.is-active { border-color: var(--amber); opacity: 1; }
.thumb .t-tint {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 90% at 30% 20%, color-mix(in srgb, var(--tint, var(--amber)) 26%, transparent), transparent 65%);
}
.thumb .t-label {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cream);
  line-height: 1.3;
}
.thumb .t-dur {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(8, 16, 25, 0.75);
  color: var(--text-dim);
}

/* ---------- 7. tech stack ---------- */
.tech { background: var(--ink-900); border-block: 1px solid var(--line); }
.tech .section-head { margin-bottom: 2.6rem; }
.tech-rows { display: grid; gap: 1.4rem; }
.tech-row-label {
  width: min(var(--container), 100% - 3rem);
  margin: 0 auto -0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.tech-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: default;
  transition: border-color 0.25s;
}
.tech-item:hover { border-color: var(--line-strong); }
.tech-item .logo {
  width: 26px;
  height: 26px;
  background-color: rgba(240, 235, 218, 0.5);
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
  transition: background-color 0.25s;
}
.tech-item:hover .logo { background-color: var(--brand, var(--cream)); }
.tech-item span {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.25s;
}
.tech-item:hover span { color: var(--text); }

/* ---------- 8. why synexian ---------- */
.why-syn .section-head { margin-bottom: 3rem; }
.diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}
.diff-card {
  padding: 2.2rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.diff-card:hover { border-color: var(--coral); transform: translateY(-4px); }
.diff-card .icon-badge { background: color-mix(in srgb, var(--coral) 12%, transparent); color: var(--coral); width: 52px; height: 52px; }
.diff-card h3 { font-size: 1.4rem; }
.diff-card p { color: var(--text-dim); font-size: 0.98rem; }

/* ---------- 9. FAQ ---------- */
.faq { background: var(--ink-900); border-top: 1px solid var(--line); }
.faq .section-head { margin-bottom: 2.6rem; }
.faq-list { max-width: 820px; display: grid; gap: 0.9rem; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.25s;
}
.faq-item.open { border-color: var(--line-strong); }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  background: none;
  border: none;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
}
.faq-q .chev {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--amber);
  transition: transform 0.3s var(--ease-out);
}
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease-out);
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a > div { overflow: hidden; }
.faq-a p {
  padding: 0 1.5rem 1.35rem;
  color: var(--text-dim);
  font-size: 0.96rem;
  max-width: 68ch;
}

/* ---------- 10. footer CTA ---------- */
.footer-cta {
  background:
    radial-gradient(ellipse 90% 120% at 50% 110%, color-mix(in srgb, var(--amber) 14%, transparent), transparent 60%),
    var(--ink-800);
  text-align: center;
  padding: 7.5rem 0;
}
.footer-cta-inner { max-width: 720px; }
.footer-cta h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); }
.footer-cta p { color: var(--text-dim); margin: 1.2rem auto 2.2rem; max-width: 58ch; }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .overview-grid { grid-template-columns: 1fr; }
  .cap-grid, .uc-grid { grid-template-columns: repeat(2, 1fr); }
  .diff-grid { grid-template-columns: 1fr; }
  .mid-cta-card { grid-template-columns: 1fr; }
  .dive-caption { left: 1.5rem; max-width: 280px; }
}
@media (max-width: 680px) {
  section { padding: 4.5rem 0; }
  .cap-grid, .uc-grid { grid-template-columns: 1fr; }
  .hero-stage { min-height: 560px; }
  .dive-caption { top: auto; bottom: 5.5rem; translate: 0 0; }
  .thumb { width: 150px; }
}
