/* ============================================================
   Deen First Tech — Apps (mockup)
   Builds on ../home.css (tokens, header, buttons, tilt layers).
   ============================================================ */

/* the stars are a feature here: fuller than on the other pages */
.starfield { opacity: 0.9; }

/* the artwork layer, at any size: lifted in front of its tile */
.tilt { display: block; }
.tilt-tile, .tilt-shine { display: block; }

.tilt-fg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translateZ(var(--lift, 30px)) scale(0.92);
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

/* ---------------- Hero and shelf ---------------- */

.apps-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(140px, 18vw, 200px) var(--gutter) clamp(64px, 9vw, 110px);
  text-align: center;
}

/* the hero as a card, like the homepage, on a soft gold light instead of the live field */
.apps-hero { position: relative; }

.apps-hero::before {
  content: "";
  position: absolute;
  inset: 10% 10% 45%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  filter: blur(40px);
  pointer-events: none;
}

.apps-hero .hero-card { margin: 0 auto; text-align: left; }
.apps-hero h1 { font-size: clamp(2.6rem, 5.2vw, 4.4rem); margin-bottom: 22px; }
.apps-hero .lede { margin-bottom: 32px; }

/* this page's emblem: a gold app-icon frame with a star, on the same round
   medallion as the homepage, small enough that its corners clear the ring */
.hero-mark-apps {
  --mark-mask: url("/icons/apps-mask.webp");
  --mark-scale: 1.22;
  --mark-origin: 49.5% 47.1%;
}

.shelf {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(24px, 5vw, 64px);
  margin-top: clamp(48px, 7vw, 80px);
}

.shelf a {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.shelf-icon {
  display: block;
  perspective: 600px;
  margin-bottom: 14px;
  --lift: 26px;
}

.shelf-icon .tilt { width: 112px; height: 112px; }
.shelf-icon .tilt-tile,
.shelf-icon .tilt-shine { border-radius: 26px; }

.shelf a:hover .tilt-tile {
  box-shadow:
    0 30px 40px -20px rgba(0, 0, 0, 0.75),
    0 0 50px -6px color-mix(in srgb, var(--app) 70%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.shelf a:hover .tilt-shine { opacity: 0.9; }
.shelf b { font-weight: 500; font-size: 0.98rem; }
.shelf small { color: var(--ink-faint); font-size: 0.8rem; letter-spacing: 0.04em; }

/* ---------------- App rows ---------------- */

.app-rows {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  gap: clamp(24px, 3vw, 32px);
}

.app-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(32px, 5vw, 64px);
  border-radius: 32px;
  border: 1px solid var(--line);
  background:
    radial-gradient(60% 80% at 80% 50%, color-mix(in srgb, var(--app) 16%, transparent), transparent 70%),
    var(--surface);
  overflow: hidden;
  scroll-margin-top: 90px;
  transition: border-color 0.5s var(--ease);
}

.app-row:hover { border-color: color-mix(in srgb, var(--app) 45%, transparent); }

.app-row-flip { background:
    radial-gradient(60% 80% at 20% 50%, color-mix(in srgb, var(--app) 16%, transparent), transparent 70%),
    var(--surface); }
.app-row-flip .app-copy { order: 2; }

.app-status {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--app) 55%, transparent);
  color: color-mix(in srgb, var(--app) 70%, white);
  font-size: 0.78rem;
  margin-bottom: 20px;
}

.app-status-soon { border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent); }

.app-copy h2 { font-size: clamp(2.6rem, 5vw, 3.8rem); margin-bottom: 8px; }
.app-tag { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--ink); margin-bottom: 14px; }
.app-copy > p:not(.app-tag) { color: var(--ink-dim); max-width: 32em; }

.app-points {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 22px 0 4px;
}

.app-points li {
  position: relative;
  padding-left: 20px;
  color: var(--ink-dim);
  font-size: 0.92rem;
}

.app-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--app);
  box-shadow: 0 0 10px var(--app);
}

.app-copy .pill { margin-top: 26px; }

/* big tilt icon for each app */
.app-art {
  display: grid;
  place-items: center;
  min-height: 320px;
  perspective: 900px;
  --lift: 56px;
}

.app-art .tilt { width: 220px; height: 220px; }
.app-art .tilt-tile,
.app-art .tilt-shine { border-radius: 50px; }

.app-art .tilt-tile {
  box-shadow:
    0 50px 70px -30px rgba(0, 0, 0, 0.8),
    0 0 90px -20px color-mix(in srgb, var(--app) 60%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.app-row:hover .tilt-shine { opacity: 0.9; }

/* Tajri: three screenshots fanned out, leaning with the cursor */
.phones {
  position: relative;
  height: 470px;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.phone {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 190px;
  height: auto;
  border-radius: 26px;
  box-shadow: 0 40px 60px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform-origin: center;
  transition: transform 0.8s var(--ease);
}

/* JS gives each screenshot a place in the lineup: centre, left, right, or
   hidden behind; scrolling moves them through it */
.phone {
  opacity: 0;
  transition: transform 0.8s var(--ease), opacity 0.6s var(--ease), filter 0.6s var(--ease);
}

.phone[data-pos="c"] {
  opacity: 1;
  z-index: 3;
  transform: translate(-50%, -50%) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--float, 0px)) translateZ(40px);
}

.phone[data-pos="l"],
.phone[data-pos="r"] { opacity: 1; z-index: 2; filter: brightness(0.7); }

.phone[data-pos="l"] {
  transform: translate(-50%, -50%) rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + 16deg)) translateX(-62%) translateZ(-40px) scale(0.86);
}

.phone[data-pos="r"] {
  transform: translate(-50%, -50%) rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) - 16deg)) translateX(62%) translateZ(-40px) scale(0.86);
}

.phone[data-pos="h"] {
  z-index: 1;
  transform: translate(-50%, -50%) translateZ(-160px) scale(0.7);
}

.app-row:hover .phone[data-pos="l"],
.app-row:hover .phone[data-pos="r"] { filter: brightness(0.85); }

/* which screenshot is in front */
.phone-dots {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}

/* each dot is a button with a bigger tap area than it looks */
.phone-dots button {
  position: relative;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background 0.4s, width 0.4s var(--ease);
}

.phone-dots button::after { content: ""; position: absolute; inset: -10px -6px; }
.phone-dots button:hover { background: color-mix(in srgb, var(--app) 60%, var(--line-strong)); }
.phone-dots button.is-on { width: 22px; background: var(--app); }

/* the lineup can be dragged sideways; vertical swipes still scroll the page */
.phones { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.phones.is-dragging { cursor: grabbing; }

/* ---------------- Tajri's logo, floating over its card's corner ----------------
   Like the goose and minaret on the websites page: the artwork without its
   white tile, hanging off the top-right edge. */

.app-row-wrap { position: relative; }

.row-mascot {
  position: absolute;
  top: -58px;
  right: -22px;
  width: clamp(104px, 12vw, 148px);
  z-index: 2;
  pointer-events: none;
  transition-delay: 0.25s;
}

.row-mascot img {
  display: block;
  width: 100%;
  height: auto;
  filter:
    drop-shadow(0 18px 22px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 28px color-mix(in srgb, #6e71fb 45%, transparent));
  animation: mascot-float 6s ease-in-out infinite;
}

@keyframes mascot-float {
  0%, 100% { transform: translate(0, 0) rotate(8deg); }
  50%      { transform: translate(-6px, -10px) rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) { .row-mascot img { animation: none; transform: rotate(6deg); } }

@media (max-width: 520px) {
  .row-mascot { top: -40px; right: -6px; width: 88px; }
}

/* The blanket's wide silhouette floats without an app-icon tile. */
.row-mascot-blanket { top: -55px; width: clamp(160px, 18vw, 230px); }
.row-mascot-blanket img {
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 28px rgba(122, 111, 224, 0.35));
}
@media (max-width: 520px) {
  .row-mascot-blanket { top: -40px; width: 150px; }
}

/* ---------------- Also designed ---------------- */

.also { padding-top: clamp(72px, 10vw, 120px); }

.also-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: clamp(28px, 4vw, 44px);
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.also h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 8px; }
.also p { color: var(--ink-dim); margin-bottom: 20px; }

.also-icons { display: flex; gap: 22px; }
.also-icon { display: block; perspective: 500px; --lift: 22px; }
.also-icon .tilt { width: 92px; height: 92px; }
.also-icon .tilt-tile,
.also-icon .tilt-shine { border-radius: 21px; }

/* ---------------- Responsive ---------------- */

@media (max-width: 860px) {
  .app-row { grid-template-columns: 1fr; text-align: left; }
  .app-row-flip .app-copy { order: 0; }
  .app-art { min-height: 260px; order: -1; }
  .app-art .tilt { width: 170px; height: 170px; }
  .phones { height: 380px; order: -1; }
  .phone { width: 160px; }
  .also-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 760px) {
  .apps-hero h1 { font-size: 2.35rem; }
}

@media (max-width: 520px) {
  .shelf { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
  .shelf-icon .tilt { width: 84px; height: 84px; }
  .shelf-icon .tilt-tile,
  .shelf-icon .tilt-shine { border-radius: 20px; }
  .phone { width: 130px; }
  .phones { height: 320px; }
}
