/* ==========================================================================
   CIPHER — home "Featured Project Showcase"
   ========================================================================== */
.fw-sec { position: relative; isolation: isolate; overflow: hidden; background: linear-gradient(180deg, #f5f9ff 0%, #eaf2ff 100%); }
.fw-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fw-bg svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 70%; }
.fw-bg .a { fill: rgba(79,151,243,.08); } .fw-bg .b { fill: rgba(92,217,247,.1); }
.fw-bg .c { fill: none; stroke: rgba(47,111,232,.16); stroke-width: 1.5; stroke-dasharray: 6 10; vector-effect: non-scaling-stroke; }
.fw-bg i { position: absolute; border-radius: 50%; }
.fw-bg .o1 { width: 560px; height: 560px; top: 8%; inset-inline-end: -160px; background: radial-gradient(closest-side, rgba(47,111,232,.14), transparent); }
.fw-bg .o2 { width: 420px; height: 420px; bottom: -120px; inset-inline-start: -100px; background: radial-gradient(closest-side, rgba(92,217,247,.16), transparent); }
.fw-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 20px; margin-bottom: clamp(28px, 3.4vw, 46px); }
.fw-ht { display: grid; gap: 14px; justify-items: start; }
.fw-ht .lead { margin: 0; max-width: 52ch; }

.fw { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); grid-template-areas: "main side" "ctrl ctrl"; gap: 22px; align-items: stretch; }
.fw-main { grid-area: main; position: relative; border-radius: 34px; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, rgba(255,255,255,.95), rgba(240,246,255,.82)); box-shadow: 0 40px 80px -50px rgba(10,26,74,.45), inset 0 0 0 1px rgba(255,255,255,.95), 0 0 0 1px rgba(47,111,232,.1);
  transition: opacity .38s ease, transform .38s ease; }
.fw-main::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 55% at 70% 35%, rgba(92,217,247,.22), transparent 70%), radial-gradient(50% 50% at 10% 90%, rgba(47,111,232,.1), transparent 70%); }
.fw-main-in { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.fw-visual { position: relative; padding: 34px 34px 0; }
.fw-info { position: relative; display: grid; align-content: start; justify-items: start; gap: 12px; padding: 8px 36px 34px; }
.fw-title { margin: 0; font: 800 clamp(24px, 2.3vw, 32px)/1.3 var(--font-head); color: var(--navy-800); }
.fw-sum { margin: 0; color: var(--text-2); font-size: 16.5px; line-height: 1.8; max-width: 58ch; }
.fw-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.fw-btns .btn { min-height: 48px; }
.fw-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font: 700 12.5px/1.4 var(--font-head); }
.fw-badge svg { width: 14px; height: 14px; }
.fw-badge.is-real { color: #1f56d6; background: rgba(47,111,232,.1); box-shadow: inset 0 0 0 1px rgba(47,111,232,.22); }
.fw-badge.is-sample { color: #12286b; background: rgba(92,217,247,.18); box-shadow: inset 0 0 0 1px rgba(92,217,247,.45); }
.fw-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: #5b6b8f; }
.fw-meta span { display: inline-flex; align-items: center; gap: 6px; }
.fw-meta svg { width: 15px; height: 15px; color: var(--blue-500); }
.fw-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fw-tags li { padding: 5px 12px; border-radius: 999px; font: 600 12.5px var(--font-mono); color: #1f56d6; background: rgba(255,255,255,.9); box-shadow: inset 0 0 0 1px rgba(47,111,232,.16); }

/* ---- device mockups ---- */
.fw-dev { position: relative; width: 100%; aspect-ratio: 16 / 8.4; container-type: inline-size; transition: transform .7s cubic-bezier(.22,1,.36,1); }
.fw-main:hover .fw-dev { transform: translateY(-6px) rotateX(2deg); }
.fw-lap { position: absolute; left: 4%; width: 74%; top: 2%; transform: perspective(1400px) rotateY(-9deg) rotateX(4deg); transform-origin: 30% 50%; filter: drop-shadow(0 30px 34px rgba(10,26,74,.28)); }
[dir="rtl"] .fw-lap { left: auto; right: 4%; transform: perspective(1400px) rotateY(9deg) rotateX(4deg); }
.fw-scr { aspect-ratio: 16 / 10; border-radius: 1.6cqw 1.6cqw .4cqw .4cqw; border: 1.1cqw solid #111a33; background: #0a1a4a; overflow: hidden; }
.fw-par { width: 100%; height: 108%; transform: translateY(calc(var(--fwp, 0) * -4%)); }
.fw-par > * { width: 100%; height: 100%; }
.fw-img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.fw-base { height: 2.2cqw; margin: 0 -6%; border-radius: 0 0 2cqw 2cqw; background: linear-gradient(#e5ecf8, #a9b8d4); box-shadow: 0 1.4cqw 2cqw -1.2cqw rgba(10,26,74,.5); }
.fw-ph { position: absolute; z-index: 2; left: 4%; bottom: 6%; width: 19%; aspect-ratio: 9 / 19.5; border-radius: 3cqw; border: .9cqw solid #111a33; background: #0a1a4a; overflow: hidden; box-shadow: 0 2.6cqw 3.4cqw -1.6cqw rgba(10,26,74,.5); transform: rotate(-3deg); }
[dir="rtl"] .fw-ph { left: 4%; }
.fw-ph .nt { position: absolute; z-index: 2; top: .7cqw; left: 50%; width: 30%; height: 1.2cqw; margin-left: -15%; border-radius: 1cqw; background: #111a33; }
.fw-ph > :not(.nt) { width: 100%; height: 100%; }
.fw-img.top { object-position: top center; }
.fw-ped { position: absolute; z-index: 1; left: 1.5%; bottom: 0; width: 24%; aspect-ratio: 4; border-radius: 50%; background: linear-gradient(#ffffff, #cfdcf2); box-shadow: 0 1.4cqw 2.4cqw -1cqw rgba(10,26,74,.35), inset 0 -.5cqw 1cqw rgba(47,111,232,.18); }
.fw-dev.two-ph .fw-ph { left: 36%; bottom: 8%; width: 24%; transform: rotate(4deg); }
.fw-dev.two-ph .fw-ph.back { left: 56%; bottom: 14%; transform: rotate(-6deg); opacity: .9; z-index: 1; }
.fw-dev.two-ph .fw-ped { left: 34%; width: 44%; }
.fw-dev.mini { aspect-ratio: 16 / 10; }
.fw-dev.mini .fw-lap { left: 8% !important; right: auto !important; width: 84%; top: 6%; transform: perspective(900px) rotateY(-6deg) rotateX(3deg) !important; }
.fw-dev.mini.two-ph .fw-ph { left: 22%; width: 30%; } .fw-dev.mini.two-ph .fw-ph.back { left: 50%; }
.fw-dev.mini.two-ph .fw-ped { left: 18%; width: 64%; }

/* ---- side cards ---- */
.fw-side { grid-area: side; display: grid; gap: 22px; grid-auto-rows: 1fr; }
.fw-card { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; gap: 14px; padding: 18px; border-radius: 28px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,.9), rgba(240,246,255,.72)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 28px 56px -42px rgba(10,26,74,.45), inset 0 0 0 1px rgba(255,255,255,.9), 0 0 0 1px rgba(47,111,232,.1); transition: transform .45s cubic-bezier(.22,1,.36,1), box-shadow .45s; }
.fw-card:hover, .fw-card:focus-visible { transform: translateY(-5px); box-shadow: 0 36px 60px -38px rgba(31,86,214,.5), inset 0 0 0 1px #fff, 0 0 0 1px rgba(92,217,247,.5); }
.fw-card:focus-visible { outline: 3px solid rgba(47,111,232,.45); outline-offset: 3px; }
.fw-cv { border-radius: 18px; background: radial-gradient(70% 70% at 50% 40%, rgba(92,217,247,.25), transparent 70%), linear-gradient(160deg, #eef5ff, #dce9fd); padding: 8px; }
.fw-ct { display: grid; gap: 7px; justify-items: start; text-align: start; }
.fw-ct b { font: 800 17px/1.4 var(--font-head); color: var(--navy-800); }
.fw-ct small { font-size: 13.5px; line-height: 1.65; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fw-ct .fw-meta { font-size: 12.5px; }

/* ---- controls ---- */
.fw-ctrl { grid-area: ctrl; display: flex; align-items: center; justify-content: center; gap: 12px; }
.fw-nav { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--navy-800); background: #fff; border: 1px solid rgba(47,111,232,.18); box-shadow: 0 10px 20px -14px rgba(10,26,74,.4); transition: background .3s, color .3s; }
.fw-nav:hover { background: var(--navy-800); color: #fff; }
.fw-nav svg { width: 18px; height: 18px; } .fw-nav.prev svg { transform: scaleX(-1); }
.fw-dots { display: flex; gap: 8px; }
.fw-dots button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 99px; cursor: pointer; background: rgba(47,111,232,.25); transition: width .35s, background .35s; }
.fw-dots button.on { width: 30px; background: var(--blue-500); }
.fw-auto { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; margin-inline-start: 8px; border-radius: 999px; cursor: pointer; font: 600 13px var(--font-head); color: var(--navy-800); background: rgba(255,255,255,.8); border: 1px solid rgba(47,111,232,.16); }
.fw-auto svg { width: 15px; height: 15px; } .fw-auto[aria-pressed="true"] { background: var(--navy-800); color: #fff; }
.fw-swap .fw-main { opacity: 0; transform: translateY(10px) scale(.99); }
.fw-swap .fw-side { opacity: .4; transition: opacity .3s; }

/* ---- tablet ---- */
@media (max-width: 1180px) and (min-width: 901px) {
  .fw { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .fw-card { grid-template-columns: minmax(0, 1fr); }
  .fw-cv { max-width: 280px; }
}
/* ---- phone: independent layout ---- */
@media (max-width: 900px) {
  .fw { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "ctrl" "side"; gap: 16px; }
  .fw-head { align-items: start; }
  .fw-all { order: 3; width: 100%; justify-content: center; }
  .fw-main { border-radius: 26px; }
  .fw-visual { padding: 18px 14px 0; }
  .fw-info { padding: 6px 18px 22px; }
  .fw-sum { font-size: 15.5px; }
  .fw-btns { width: 100%; } .fw-btns .btn { flex: 1 1 100%; justify-content: center; min-height: 50px; }
  .fw-side { grid-auto-flow: column; grid-auto-columns: 82%; grid-auto-rows: auto; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; margin-inline: -2px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .fw-side::-webkit-scrollbar { display: none; }
  .fw-card { grid-template-columns: minmax(0, 1fr); scroll-snap-align: start; padding: 14px; border-radius: 22px; }
  .fw-auto span { display: none; } .fw-auto { width: 40px; padding: 0; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .fw-main, .fw-card, .fw-dev, .fw-par { transition: none; transform: none !important; } }
.fw-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.fw-cv { padding: 12px 10px; }
@media (max-width: 900px) { .fw-card { grid-template-columns: minmax(0, 1fr); } }

/* ---- desktop: the Works-page wave bands; phone keeps the showcase ---- */
.fw-bands { display: none; }
@media (min-width: 901px) {
  .fw-sec { padding-bottom: 0 !important; background: var(--bg); }
  .fw-sec .fw-bg { display: none; }
  .fw-sec #featured-work { display: none; }
  .fw-bands { display: block; margin-top: clamp(80px, 7vw, 120px); }
  .fw-bands .wband.last { padding-bottom: calc(clamp(70px, 7vw, 110px) + clamp(90px, 9vw, 150px)); }
  .fw-head { margin-bottom: 0; }
}
