/* Product showcase for /apps/ — extends legal page tokens */

.page-apps {
  --apps-max: 70rem;
  --apps-phone-radius: 1.15rem;
  --bfs-wash: #1a3a42;
  --bfs-glow: rgba(91, 160, 175, 0.35);
  --bfs-ink: #e8f4f6;
  --upc-wash: #2a1214;
  --upc-glow: rgba(196, 48, 54, 0.32);
  --upc-ink: #f7ecec;
  --ct-wash: #0f2a28;
  --ct-glow: rgba(45, 140, 130, 0.34);
  --ct-ink: #e6f5f3;
}

@media (prefers-color-scheme: light) {
  .page-apps {
    --bfs-wash: #d9eef1;
    --bfs-glow: rgba(56, 120, 132, 0.2);
    --bfs-ink: #123038;
    --upc-wash: #f5e4e4;
    --upc-glow: rgba(170, 40, 48, 0.18);
    --upc-ink: #3a1416;
    --ct-wash: #dcefec;
    --ct-glow: rgba(28, 110, 100, 0.18);
    --ct-ink: #0f2e2b;
  }
}

.page-apps body,
body.page-apps {
  overflow-x: hidden;
}

body.page-apps {
  background:
    radial-gradient(ellipse 70% 50% at 15% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 8%, rgba(120, 140, 180, 0.08), transparent 50%),
    var(--bg);
}

.page-apps .wrap {
  max-width: calc(var(--apps-max) + 4rem);
}

/* ——— Intro ——— */
.apps-intro {
  max-width: 38rem;
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
  animation: apps-rise 0.75s ease both;
}

.apps-intro .eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.apps-intro h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.apps-intro .lede {
  margin: 0;
  font-size: clamp(1.02rem, 1.8vw, 1.14rem);
  color: var(--muted);
  line-height: 1.65;
}

.apps-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}

.apps-jump a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  padding-bottom: 0.08rem;
}

.apps-jump a:hover {
  color: var(--accent);
}

/* ——— Product sections ——— */
.product {
  --product-wash: var(--bfs-wash);
  --product-glow: var(--bfs-glow);
  --product-ink: var(--bfs-ink);
  position: relative;
  margin: 0 calc(50% - 50vw);
  width: 100vw;
  padding: clamp(2.5rem, 6vw, 4.25rem) 0;
  color: var(--product-ink);
  overflow: hidden;
  isolation: isolate;
}

.product + .product {
  margin-top: 0;
}

.product::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 55% 70% at 78% 40%, var(--product-glow), transparent 62%),
    linear-gradient(160deg, color-mix(in srgb, var(--product-wash) 92%, #000) 0%, var(--product-wash) 55%, color-mix(in srgb, var(--product-wash) 80%, #000) 100%);
}

.product--bfs {
  --product-wash: var(--bfs-wash);
  --product-glow: var(--bfs-glow);
  --product-ink: var(--bfs-ink);
  animation: apps-rise 0.8s ease 0.06s both;
}

.product--upc {
  --product-wash: var(--upc-wash);
  --product-glow: var(--upc-glow);
  --product-ink: var(--upc-ink);
  animation: apps-rise 0.8s ease 0.12s both;
}

.product--cotimer {
  --product-wash: var(--ct-wash);
  --product-glow: var(--ct-glow);
  --product-ink: var(--ct-ink);
  animation: apps-rise 0.8s ease 0.18s both;
}

.product-inner {
  max-width: var(--apps-max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: center;
}

@media (min-width: 900px) {
  .product-inner {
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(2rem, 5vw, 4rem);
  }

  .product--flip .product-inner {
    grid-template-columns: 0.95fr 1.05fr;
  }

  .product--flip .product-visual {
    order: 2;
  }

  .product--flip .product-copy {
    order: 1;
  }
}

/* ——— Visual plane ——— */
.product-visual {
  position: relative;
  min-height: clamp(18rem, 42vw, 26rem);
  display: grid;
  place-items: center;
}

.product-feature {
  position: absolute;
  inset: 8% 2% auto;
  width: min(100%, 36rem);
  max-height: 55%;
  object-fit: cover;
  object-position: center;
  border-radius: 0.85rem;
  opacity: 0.88;
  filter: saturate(1.05);
  mask-image: linear-gradient(180deg, #000 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent 100%);
  animation: apps-feature-in 1s ease 0.15s both;
}

.product-phones {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(0.55rem, 2vw, 1rem);
  padding-top: clamp(3rem, 8vw, 5rem);
  perspective: 900px;
}

.phone {
  width: min(34vw, 11.25rem);
  flex: 0 0 auto;
  border-radius: var(--apps-phone-radius);
  overflow: hidden;
  background: #0a0a0a;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 18px 40px -12px rgba(0, 0, 0, 0.55);
  transform-origin: 50% 100%;
  animation: apps-phone-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.phone:nth-child(1) {
  animation-delay: 0.18s;
  transform: translateY(0.65rem) rotate(-4.5deg);
}

.phone:nth-child(2) {
  width: min(38vw, 12.5rem);
  z-index: 2;
  animation-delay: 0.28s;
  transform: translateY(0);
}

.phone:nth-child(3) {
  animation-delay: 0.38s;
  transform: translateY(0.85rem) rotate(4.5deg);
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

@media (min-width: 900px) {
  .phone:nth-child(1) {
    width: 11.25rem;
  }

  .phone:nth-child(2) {
    width: 12.75rem;
  }

  .phone:nth-child(3) {
    width: 11.25rem;
  }
}

/* ——— Copy ——— */
.product-copy {
  color: var(--product-ink);
}

.product-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1rem;
}

.product-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.72rem;
  object-fit: cover;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.45);
}

.product-brand h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2.05rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: inherit;
}

.product-tag {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
  opacity: 0.92;
}

.product-body {
  margin: 0 0 1.15rem;
  font-size: 1.02rem;
  line-height: 1.68;
  max-width: 34rem;
  opacity: 0.9;
}

.product-body + .product-body {
  margin-top: -0.45rem;
}

.product-points {
  margin: 0 0 1.4rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
  max-width: 32rem;
}

.product-points li {
  margin: 0;
  padding: 0 0 0 1.15rem;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.45;
  opacity: 0.92;
}

.product-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 1px;
  background: color-mix(in srgb, currentColor 70%, transparent);
  transform: rotate(45deg);
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin: 0 0 0.85rem;
}

.btn-store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.72rem 1.2rem;
  border-radius: 0.35rem;
  text-decoration: none;
  color: #0e0d0b;
  background: var(--accent);
  border: 1px solid transparent;
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    background 0.15s ease;
}

.btn-store:hover {
  filter: brightness(1.06);
  text-decoration: none;
}

.btn-store:focus-visible {
  outline: 2px solid var(--product-ink);
  outline-offset: 3px;
}

.btn-store-ghost {
  color: var(--product-ink);
  background: transparent;
  border-color: color-mix(in srgb, var(--product-ink) 35%, transparent);
}

.btn-store-ghost:hover {
  background: color-mix(in srgb, var(--product-ink) 10%, transparent);
  filter: none;
}

.product-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  font-size: 0.88rem;
}

.product-legal a {
  color: color-mix(in srgb, var(--product-ink) 78%, transparent);
}

.product-legal a:hover {
  color: var(--product-ink);
}

.page-apps .footer-note {
  margin-top: clamp(2rem, 5vw, 3rem);
}

@keyframes apps-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes apps-phone-in {
  from {
    opacity: 0;
    transform: translateY(1.5rem) scale(0.96);
  }
  to {
    opacity: 1;
  }
}

@keyframes apps-feature-in {
  from {
    opacity: 0;
    transform: scale(1.04);
  }
  to {
    opacity: 0.88;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .apps-intro,
  .product,
  .phone,
  .product-feature {
    animation: none !important;
  }

  .phone:nth-child(1),
  .phone:nth-child(3) {
    transform: none;
  }
}
