/* Web Kai — scroll chapters & layout (v3) */

:root {
  --section-max: 1240px;
  --section-pad-x: clamp(32px, 6vw, 96px);
  --scroll-cue-h: 108px;
  --section-indicator-w: 88px;
  --ease-chapter: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
}

.site-scroll {
  position: relative;
  z-index: 1;
}

/* --- Section shell ------------------------------------------------------ */

.section {
  position: relative;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 28px) 0 var(--scroll-cue-h);
  overflow-x: clip;
  overflow-y: visible;
  isolation: isolate;
}

.section:not(.is-active) .section-inner {
  opacity: 0.72;
  transform: translate3d(0, 12px, 0);
  transition:
    opacity 0.9s var(--ease-chapter),
    transform 1s var(--ease-chapter);
}

.section.is-active .section-inner {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.section.is-leaving .section-inner {
  opacity: 0.45;
  transform: translate3d(0, -16px, 0);
  transition-duration: 0.55s;
}

body.is-chapter-changing .bg-world {
  filter: saturate(1.08) brightness(1.02);
  transition: filter 1s var(--ease-chapter);
}

/* Per-section ambient light */
.section-ambient {
  position: absolute;
  inset: -10% -5%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.15s var(--ease-chapter);
}

.section.is-active .section-ambient {
  opacity: 1;
}

.section.is-leaving .section-ambient {
  opacity: 0.28;
  transition-duration: 0.5s;
}

body.is-chapter-changing .section.is-active .section-ambient {
  opacity: 0.55;
}

body.is-scroll-emphasized .section.is-active .section-ambient {
  opacity: 0.35;
}

body.is-scroll-emphasized .section.is-leaving .section-ambient {
  opacity: 0.12;
}

.section-ambient--hero {
  background:
    radial-gradient(ellipse 70% 55% at 72% 28%, rgba(118, 218, 242, 0.34), transparent 58%),
    radial-gradient(ellipse 50% 45% at 18% 72%, rgba(192, 162, 255, 0.26), transparent 55%),
    linear-gradient(108deg, transparent 44%, rgba(255, 255, 255, 0.22) 49.5%, transparent 55%);
}

.section-ambient--intro {
  background:
    radial-gradient(ellipse 65% 50% at 78% 38%, rgba(192, 162, 255, 0.3), transparent 58%),
    radial-gradient(ellipse 55% 40% at 22% 62%, rgba(118, 218, 242, 0.22), transparent 52%),
    linear-gradient(118deg, transparent 40%, rgba(255, 172, 218, 0.14) 49%, transparent 58%),
    linear-gradient(72deg, transparent 62%, rgba(138, 182, 255, 0.1) 63.5%, transparent 65%);
}

.section-ambient--svc01 {
  background:
    radial-gradient(ellipse 68% 52% at 82% 32%, rgba(138, 182, 255, 0.22), transparent 58%),
    radial-gradient(ellipse 48% 42% at 12% 68%, rgba(118, 218, 242, 0.12), transparent 50%);
}

.section-ambient--svc02 {
  background:
    radial-gradient(ellipse 70% 54% at 20% 36%, rgba(255, 172, 218, 0.18), transparent 58%),
    radial-gradient(ellipse 52% 44% at 85% 70%, rgba(192, 162, 255, 0.16), transparent 55%);
}

.section-ambient--svc03 {
  background:
    radial-gradient(ellipse 66% 50% at 75% 65%, rgba(162, 238, 198, 0.18), transparent 56%),
    radial-gradient(ellipse 50% 40% at 28% 28%, rgba(255, 232, 168, 0.12), transparent 52%);
}

.section-ambient--contact {
  background:
    radial-gradient(ellipse 60% 48% at 80% 55%, rgba(255, 232, 168, 0.16), transparent 55%),
    radial-gradient(ellipse 55% 45% at 25% 35%, rgba(118, 218, 242, 0.14), transparent 52%);
}

/* Reflection sweep on chapter enter */
.section-flash {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(255, 255, 255, 0.45) 47%,
    rgba(118, 218, 242, 0.2) 49%,
    rgba(255, 172, 218, 0.14) 51%,
    rgba(192, 162, 255, 0.18) 53%,
    transparent 62%
  );
  transform: translate3d(-120%, 0, 0) skewX(-8deg);
}

.section-flash.is-run {
  animation: sectionFlash 1.25s var(--ease-chapter) forwards;
}

body.is-scroll-emphasized .section-flash.is-run {
  animation-duration: 1.45s;
}

@keyframes sectionFlash {
  0% {
    opacity: 0;
    transform: translate3d(-120%, 0, 0) skewX(-8deg);
  }
  32% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(120%, 0, 0) skewX(-8deg);
  }
}

.section-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--section-max);
  margin: 0 auto;
  padding-left: var(--section-pad-x);
  padding-right: var(--section-pad-x);
}

.section-split {
  display: grid;
  width: 100%;
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.section-split--hero {
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
}

.section--hero .section-content--hero {
  max-width: none;
}

.section-split--intro,
.section-split--contact {
  grid-template-columns: minmax(0, 1fr) minmax(200px, 0.34fr);
}

.section-content {
  position: relative;
  max-width: 580px;
}

/* NO white box panels behind text */
.section-content::after,
.section-content::before,
.contact-stack::after,
.contact-stack::before,
.read-soft::before,
.text-scrim::before {
  display: none !important;
}

.section-content--service {
  padding-left: clamp(20px, 2.8vw, 32px);
  border-left: 1px solid rgba(8, 10, 14, 0.1);
  background: none;
}

.section-glow {
  display: none !important;
  opacity: 0 !important;
}

.section.is-active .section-glow,
.section.is-leaving .section-glow {
  display: none !important;
  opacity: 0 !important;
}

/* Visual column — light only, no box */
.section-visual {
  position: relative;
  min-height: min(44vh, 360px);
  pointer-events: none;
  background: none;
  mask-image: none;
  opacity: 0;
  transition: opacity 1.1s var(--ease-chapter);
}

.section-visual::before,
.section-visual::after {
  display: none;
}

.section.is-active .section-visual {
  opacity: 1;
}

.section-visual--intro,
.section-visual--contact {
  background: linear-gradient(
    155deg,
    rgba(118, 218, 242, 0.12) 0%,
    rgba(192, 162, 255, 0.08) 42%,
    transparent 82%
  );
  mask-image: linear-gradient(165deg, #000 12%, transparent 90%);
}

.section-visual--intro::after,
.section-visual--contact::after {
  display: block;
  content: "";
  position: absolute;
  inset: 8% 0 12% 35%;
  background: linear-gradient(
    108deg,
    transparent 38%,
    rgba(255, 255, 255, 0.35) 48%,
    rgba(118, 218, 242, 0.12) 50%,
    transparent 62%
  );
  opacity: 0;
  transform: translate3d(-8%, 0, 0);
  transition: opacity 1s var(--ease-chapter), transform 1.2s var(--ease-chapter);
}

.section.is-active .section-visual--intro::after,
.section.is-active .section-visual--contact::after {
  opacity: 1;
  transform: translate3d(6%, 0, 0);
}

/* Typography — readable without boxes */
.section-label {
  color: rgba(8, 10, 14, 0.68);
  font-weight: 500;
  letter-spacing: 0.3em;
}

.section--service .section-label {
  display: none;
}

.section-title,
.catchcopy {
  color: var(--text-strong);
  text-shadow: 0 1px 24px rgba(255, 255, 255, 0.55);
}

.section-body,
.hero-lead p {
  color: var(--text-body);
  line-height: 1.82;
  text-shadow: 0 1px 18px rgba(255, 255, 255, 0.45);
}

/* Giant number — one per service panel, never overlaps copy */
.section--hero .giant-number,
.section--service-intro .giant-number,
.section--contact .giant-number {
  display: none !important;
}

.section--service .giant-number {
  position: absolute;
  z-index: 0;
  top: auto;
  bottom: clamp(12%, 16vh, 22%);
  right: clamp(12px, 3vw, 48px);
  left: auto;
  transform: none;
  font-size: clamp(5.5rem, 16vw, 10rem);
  opacity: 0.18;
  line-height: 0.9;
}

.section--service .section-inner {
  z-index: 3;
}

/* Intro density */
.intro-cue {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: clamp(32px, 4.5vh, 48px);
}

.intro-cue__line {
  width: clamp(64px, 10vw, 120px);
  height: 1px;
  background: linear-gradient(90deg, var(--ir-cyan), var(--ir-pink), var(--ir-purple), transparent);
}

.intro-cue__dots {
  display: inline-flex;
  gap: 6px;
}

.intro-cue__dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(8, 10, 14, 0.28);
}

.intro-cue__dots i:first-child {
  background: linear-gradient(135deg, var(--ir-cyan), var(--ir-purple));
}

/* Contact */
.contact-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.8vh, 32px);
}

.section-footer {
  padding-top: clamp(18px, 2.5vh, 28px);
  border-top: 1px solid rgba(8, 10, 14, 0.14);
}

/* Scroll cue — bottom center only (indicator is separate) */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(28px, 4.2vh, 48px);
  transform: translate3d(-50%, 0, 0);
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: rgba(8, 10, 14, 0.72);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
}

.scroll-cue::before {
  content: "";
  position: absolute;
  inset: -6px -28px;
  border-radius: 999px;
  opacity: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(118, 218, 242, 0.22) 44%,
    rgba(255, 172, 218, 0.16) 52%,
    rgba(192, 162, 255, 0.2) 60%,
    transparent 72%
  );
  transform: translate3d(-120%, 0, 0);
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.scroll-cue__track {
  display: block;
  width: 1px;
  height: 44px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0.06), rgba(8, 10, 14, 0.42));
}

.scroll-cue__line {
  display: block;
  width: 100%;
  height: 14px;
  background: linear-gradient(180deg, var(--ir-cyan), var(--ir-purple));
  animation: scrollCueLine 2s ease-in-out infinite;
}

.scroll-cue__arrow {
  font-size: 1.1rem;
  transition: transform 0.55s var(--ease-chapter), color 0.55s var(--ease-chapter);
}

.scroll-cue__text,
.scroll-cue__label {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(8, 10, 14, 0.62);
}

.section--contact .scroll-cue {
  display: none;
}

body.is-chapter-changing .scroll-cue {
  opacity: 0.4;
  pointer-events: none;
}

@media (hover: hover) {
  .scroll-cue:hover {
    color: var(--text-strong);
  }

  .scroll-cue:hover::before {
    opacity: 1;
    animation: scrollCueGlow 1.1s var(--ease-chapter) forwards;
  }

  .scroll-cue:hover .scroll-cue__arrow {
    transform: translate3d(0, 6px, 0);
    color: var(--text-strong);
  }

  .scroll-cue:hover .scroll-cue__line {
    background: linear-gradient(180deg, var(--ir-cyan), var(--ir-pink), var(--ir-purple));
    box-shadow: 0 0 22px rgba(118, 218, 242, 0.42);
  }

  .scroll-cue:hover .scroll-cue__text,
  .scroll-cue:hover .scroll-cue__label {
    color: rgba(8, 10, 14, 0.88);
  }
}

@keyframes scrollCueGlow {
  from {
    transform: translate3d(-120%, 0, 0);
  }
  to {
    transform: translate3d(120%, 0, 0);
  }
}

@keyframes scrollCueLine {
  0% {
    transform: translate3d(0, -130%, 0);
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 240%, 0);
    opacity: 0.35;
  }
}

/* Section indicator — bottom right, never overlaps scroll cue */
.section-indicator,
.section-progress {
  position: fixed;
  right: clamp(20px, 4vw, 48px);
  bottom: clamp(22px, 3.5vh, 40px);
  left: auto;
  transform: none;
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  pointer-events: none;
  min-width: var(--section-indicator-w);
}

.section-indicator__count,
.section-progress__count {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: rgba(8, 10, 14, 0.68);
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.65);
}

.section-progress__track,
.section-progress__thumb {
  display: none;
}

.panel-chrome,
.panel-nav {
  display: none !important;
}

@media (max-width: 900px) {
  .section-split--hero,
  .section-split--intro,
  .section-split--contact {
    grid-template-columns: 1fr;
  }

  .section-visual {
    min-height: 120px;
  }

  .section--service .giant-number {
    font-size: clamp(4rem, 28vw, 6rem);
    bottom: 8%;
    opacity: 0.14;
  }

  .scroll-cue {
    bottom: clamp(36px, 5vh, 52px);
  }

  .section-indicator,
  .section-progress {
    right: clamp(16px, 4vw, 24px);
    bottom: clamp(18px, 3vh, 28px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .section:not(.is-active) .section-inner,
  .section.is-active .section-inner {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .section-flash,
  .scroll-cue__line {
    animation: none;
  }
}
