/* ============================================================
   5.1 FOLD-IN HEADLINE TEXT
   ============================================================ */
.fold-text {
  display: inline;
}
.fold-text .fc-word {
  display: inline-flex;
  white-space: nowrap;
}
.fold-text .fc-char-wrap {
  display: inline-block;
  perspective: 700px;
  overflow: visible;
}
.fold-text .fc-char {
  display: inline-block;
  transform-origin: top center;
  transform: rotateX(-92deg);
  opacity: 0;
  position: relative;
  will-change: transform, opacity;
}
.fold-text .fc-char::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11,12,16,0.55), transparent 70%);
  opacity: 1;
  pointer-events: none;
}
.fold-text.is-revealed .fc-char {
  animation: foldOpen 0.65s var(--ease-out) forwards;
}
.fold-text.is-revealed .fc-char::after {
  animation: creaseFade 0.65s var(--ease-out) forwards;
}
@keyframes foldOpen {
  0%   { transform: rotateX(-92deg); opacity: 0; }
  55%  { opacity: 1; }
  100% { transform: rotateX(0deg); opacity: 1; }
}
@keyframes creaseFade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .fold-text .fc-char { transform: none; opacity: 0; transition: opacity 0.4s ease; }
  .fold-text.is-revealed .fc-char { opacity: 1; animation: none; }
  .fold-text .fc-char::after { display: none; }
}

/* ============================================================
   5.2 SCROLL-EXPAND HERO MEDIA
   ============================================================ */
.scroll-expand {
  position: relative;
  height: 320vh;
}
.scroll-expand-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.scroll-expand-frame {
  position: relative;
  width: 92%;
  max-width: 1040px;
  aspect-ratio: 16/9;
  border-radius: 32px;
  overflow: hidden;
  clip-path: inset(0% round 32px);
  background: var(--bg-raised);
  will-change: clip-path;
}
.scroll-expand-frame img,
.scroll-expand-frame video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.scroll-expand-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11,12,16,0.92) 0%, rgba(11,12,16,0.15) 55%, transparent 100%);
  opacity: 0;
  will-change: opacity;
}
.scroll-expand-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  will-change: transform, opacity;
}
.scroll-expand-title h2 { font-size: clamp(1.8rem, 5vw, 3.2rem); max-width: 14ch; }
.scroll-expand-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: clamp(24px, 5vw, 56px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(16px);
  will-change: transform, opacity;
}
.scroll-expand-caption h3 { font-size: clamp(1.3rem, 2.6vw, 1.9rem); margin: 0; max-width: 26ch; }
@media (prefers-reduced-motion: reduce) {
  .scroll-expand { height: auto; }
  .scroll-expand-stage { position: relative; height: auto; padding: 40px 0; }
  .scroll-expand-frame { clip-path: none !important; border-radius: 24px; }
  .scroll-expand-scrim { opacity: 1 !important; }
  .scroll-expand-title { position: relative; opacity: 1 !important; transform: none !important; padding: 32px 24px; }
  .scroll-expand-caption { position: relative; opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   5.3 PIXEL-DISSOLVE REVEAL
   ============================================================ */
.pixel-swap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg-raised);
  cursor: pointer;
  border: 1px solid var(--line);
}
.pixel-swap-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: clamp(20px, 4vw, 40px);
}
.pixel-swap-layer.is-before { background: linear-gradient(160deg, #1c1f26, #0B0C10); z-index: 1; }
.pixel-swap-layer.is-after {
  background: linear-gradient(160deg, #2a2110, #0B0C10);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.2s linear;
}
.pixel-swap.is-revealed .pixel-swap-layer.is-after { opacity: 1; }
.pixel-swap-label {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  max-width: 20ch;
}
.pixel-swap-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.pixel-swap-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  pointer-events: none;
}
.pixel-swap-grid .cell {
  background: var(--bg);
  transform: scale(1) rotate(0deg);
  transform-origin: center;
  opacity: 1;
  will-change: transform, opacity;
}
.pixel-swap.is-revealed .pixel-swap-grid .cell {
  animation: pixelOut 0.5s var(--ease-out) forwards;
  animation-delay: var(--cell-delay, 0s);
}
.pixel-swap:not(.is-revealed) .pixel-swap-grid .cell.was-revealed {
  animation: pixelIn 0.5s var(--ease-out) forwards;
  animation-delay: var(--cell-delay, 0s);
}
@keyframes pixelOut {
  0% { opacity: 1; transform: scale(1) rotate(0deg); }
  100% { opacity: 0; transform: scale(0.3) rotate(12deg); }
}
@keyframes pixelIn {
  0% { opacity: 0; transform: scale(0.3) rotate(-12deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.pixel-swap-hint {
  position: absolute;
  top: 20px; right: 20px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(11,12,16,0.5);
}
@media (prefers-reduced-motion: reduce) {
  .pixel-swap-grid { display: none; }
  .pixel-swap-layer.is-after { transition: opacity 0.5s ease; }
}

/* ============================================================
   5.4 SCROLL-STACKING CARDS
   ============================================================ */
.scroll-stack { position: relative; }
.scroll-stack-item {
  position: sticky;
  top: 100px;
  margin-bottom: 24px;
}
.scroll-stack-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: var(--bg-alt);
  padding: clamp(28px, 4vw, 56px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  will-change: transform, filter;
  transition: transform 0.2s ease-out, filter 0.2s ease-out;
  transform-origin: top center;
}
.scroll-stack-index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.scroll-stack-body h3 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
.scroll-stack-body p { max-width: 46ch; margin: 0; }
.scroll-stack-cta { align-self: center; }
@media (max-width: 720px) {
  .scroll-stack-card { grid-template-columns: 1fr; text-align: left; }
  .scroll-stack-cta { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-stack-item { position: relative; top: auto; }
  .scroll-stack-card { transform: none !important; filter: none !important; }
}

/* ============================================================
   5.5 SERVICE PICKER WHEEL
   ============================================================ */
.wheel-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
}
.option-wheel {
  position: relative;
  height: 420px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 22%, black 78%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 22%, black 78%, transparent);
}
.option-wheel-track {
  position: absolute;
  left: 0; right: 0; top: 50%;
  will-change: transform;
}
.option-wheel-item {
  height: 64px;
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--muted-2);
  cursor: pointer;
  transform-origin: left center;
  transition: color 0.35s var(--ease-out), transform 0.35s var(--ease-out), filter 0.35s var(--ease-out), opacity 0.35s var(--ease-out);
  padding-left: 4px;
  white-space: nowrap;
}
.option-wheel-item:focus-visible { outline-offset: 4px; }
.option-wheel-item.is-active {
  color: var(--cream);
  transform: translateX(6px) scale(1.06);
}
.option-wheel-item.is-active .option-wheel-num { color: var(--accent-2); }
.option-wheel-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted-2);
  margin-right: 14px;
  transition: color 0.3s;
}
.option-wheel-rail {
  position: absolute;
  left: 0; top: 50%;
  width: 26px; height: 1px;
  background: var(--accent);
  transform: translateY(-50%);
}

.wheel-panel {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 48px);
  background: var(--bg-alt);
  min-height: 420px;
  position: relative;
}
.wheel-panel-content { display: none; animation: panelIn 0.5s var(--ease-out); }
.wheel-panel-content.is-active { display: block; }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.wheel-panel h3 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
.wheel-panel ul { list-style: none; padding: 0; margin: 20px 0; }
.wheel-panel li {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--cream);
  font-size: 0.94rem;
  display: flex;
  gap: 10px;
}
.wheel-panel li::before { content: "→"; color: var(--accent); flex-shrink: 0; }

@media (max-width: 820px) {
  .wheel-layout { grid-template-columns: 1fr; }
  .option-wheel { height: 300px; }
  .option-wheel-item { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .option-wheel-track { transition: none !important; }
}

/* ============================================================
   5.6 INTERACTIVE FOLDER REVEAL
   ============================================================ */
.folder-wrap {
  display: flex;
  justify-content: center;
  padding: 40px 0 100px;
}
.folder {
  position: relative;
  width: 280px;
  height: 200px;
  cursor: pointer;
}
.folder-paper {
  position: absolute;
  left: 10px; right: 10px;
  top: 18px;
  height: 160px;
  background: var(--bg-alt);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 16px;
  transform: translateY(0) rotate(0deg);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
.folder-paper span.tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.folder-paper p { font-size: 0.82rem; color: var(--cream); margin: 8px 0 0; }
.folder-paper.p1 { z-index: 1; }
.folder-paper.p2 { z-index: 2; }
.folder-paper.p3 { z-index: 3; }
.folder.is-open .folder-paper.p1 { transform: translate(-58px, -46px) rotate(-14deg); box-shadow: 0 20px 30px rgba(0,0,0,0.4); }
.folder.is-open .folder-paper.p2 { transform: translate(0px, -66px) rotate(2deg); box-shadow: 0 24px 34px rgba(0,0,0,0.4); }
.folder.is-open .folder-paper.p3 { transform: translate(58px, -46px) rotate(14deg); box-shadow: 0 20px 30px rgba(0,0,0,0.4); }
.folder-back {
  position: absolute;
  inset: 0;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 14px 14px 4px 4px;
  z-index: 4;
}
.folder-front {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 110px;
  background: linear-gradient(160deg, var(--accent), #d88a34);
  border-radius: 4px 4px 14px 14px;
  z-index: 5;
  transform-origin: bottom center;
  transition: transform 0.5s var(--ease-out);
  display: flex;
  align-items: flex-end;
  padding: 14px 18px;
}
.folder-front span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--bg);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.folder.is-open .folder-front { transform: perspective(400px) rotateX(-24deg); }
.folder-caption {
  text-align: center;
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
@media (prefers-reduced-motion: reduce) {
  .folder-paper, .folder-front { transition: none; }
}

/* ============================================================
   5.7 TILTING PROFILE CARD
   ============================================================ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}
.tilt-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 1px;
  perspective: 900px;
}
.tilt-card-inner {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
  border: 1px solid var(--line-strong);
  padding: 26px;
  transform-style: preserve-3d;
  transition: transform 0.15s var(--ease-out);
  overflow: hidden;
}
.tilt-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), var(--accent) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  filter: blur(20px);
}
.tilt-card:hover .tilt-glow { opacity: 0.18; }
.tilt-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(247,242,232,0.16) 48%, transparent 62%);
  transform: translateX(var(--sheen-x, -120%));
  transition: transform 0.15s ease-out;
  pointer-events: none;
}
.tilt-avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, #2a2d34, #14161a);
  margin-bottom: 18px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--muted-2);
  transform: translateZ(30px);
}
.tilt-name { font-family: var(--font-display); font-size: 1.25rem; margin: 0; transform: translateZ(28px); position: relative; }
.tilt-title { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; margin: 6px 0 14px; transform: translateZ(24px); position: relative; }
.tilt-status { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); margin-bottom: 16px; transform: translateZ(20px); position: relative; }
.tilt-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
.tilt-contact { transform: translateZ(24px); position: relative; }
@media (max-width: 640px), (hover: none) {
  .tilt-card-inner { transform: none !important; }
  .tilt-sheen, .tilt-glow { display: none; }
}

/* ============================================================
   5.8 FLOWING MARQUEE MENU
   ============================================================ */
.flow-menu { border-top: 1px solid var(--line); }
.flow-menu-row {
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.flow-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(20px, 4vw, 40px) 4px;
  position: relative;
  z-index: 2;
}
.flow-menu-link .fm-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 4rem);
  color: var(--cream);
  transition: color 0.3s ease, transform 0.3s ease;
}
.flow-menu-link .fm-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted-2);
}
.flow-menu-row:hover .fm-title { color: var(--bg); transform: translateX(10px); }

.flow-menu-marquee {
  position: absolute;
  left: 0; right: 0;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease-inout);
}
.flow-menu-row.enter-top .flow-menu-marquee { transform: translateY(-101%); }
.flow-menu-row:hover .flow-menu-marquee,
.flow-menu-row.is-hover .flow-menu-marquee { transform: translateY(0%); }

.flow-menu-track {
  display: flex;
  align-items: center;
  height: 100%;
  width: max-content;
  animation: marqueeScroll 14s linear infinite;
}
.flow-menu-row:hover .flow-menu-track,
.flow-menu-row.is-hover .flow-menu-track { animation-play-state: running; }
.flow-menu-track { animation-play-state: paused; }
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.flow-menu-track span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.8rem, 6vw, 4rem);
  color: var(--bg);
  padding: 0 24px;
  white-space: nowrap;
}
.flow-menu-track .fm-thumb {
  width: 70px; height: 46px;
  border-radius: 8px;
  background: var(--bg);
  opacity: 0.85;
  flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) {
  .flow-menu-marquee { transition: none; }
  .flow-menu-track { animation: none; }
}

/* ============================================================
   5.9 MULTI-STEP FORM (STEPPER)
   ============================================================ */
.stepper-head {
  display: flex;
  align-items: center;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.step-indicator:last-child { flex: 0; }
.step-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
  position: relative;
}
.step-dot.is-active { border-color: var(--accent); color: var(--accent); }
.step-dot.is-done { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.step-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: none;
}
.step-dot.is-active + .step-label { color: var(--cream); }
.step-line {
  flex: 1;
  height: 1px;
  background: var(--line-strong);
  margin: 0 6px;
  position: relative;
  overflow: hidden;
}
.step-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.step-line.is-filled::after { transform: scaleX(1); }

.step-panels { position: relative; min-height: 320px; }
.step-panel {
  display: none;
  animation: stepIn 0.45s var(--ease-out);
}
.step-panel.is-active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.95rem;
  transition: border-color 0.25s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) { .checkbox-grid { grid-template-columns: 1fr; } }
.check-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
}
.check-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check-card input { accent-color: var(--accent); width: 16px; height: 16px; }
.check-card span { font-size: 0.9rem; }

.step-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
}
.step-confirm {
  text-align: center;
  padding: 40px 0;
}
.step-confirm .icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.6rem;
}
