/* ==========================================================================
   APPS — App Store-inspired aesthetic for /apps and /apps/<slug>
   --accent is set per-app inline so each card gets a tinted CTA.
   ========================================================================== */

.apps-body {
  --accent: #5b5bd6;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --ink: #111113;
  --ink-soft: #5e6066;
  --rule: #e7e7ea;
  background: var(--bg);
}

/* The site-wide `section` rule (style.css) forces white bg + 10rem side margins + 4rem padding
   onto every <section>. On the apps listing we own the layout via .apps-shell, so reset section
   defaults *only inside .apps-shell*. The detail page (.appdetail) keeps its own section
   styling (each .appdetail__section is its own card with bg + border + padding). */
.apps-shell section {
  margin: 0;
  padding: 0;
  background: transparent;
}

.apps-shell,
.appdetail {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
}

/* HERO */
.apps-hero {
  padding: 1.5rem 0 1rem;
}
.apps-eyebrow,
.apps-feature__eyebrow,
.apps-story__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0 0 0.4rem;
}
.apps-hero h1 {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.6rem;
}
.apps-subhead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 640px;
  line-height: 1.55;
}

/* FEATURED CARD — fixed equal-height columns so the body never leaves a white gap */
.apps-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 0;
  height: 320px;                 /* lock card height; image + body both fill it */
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  margin: 1.5rem 0 2rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid var(--rule);
}
.apps-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}
.apps-feature__art {
  position: relative;
  height: 100%;
  overflow: hidden;
}
.apps-feature__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.apps-feature__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.45));
}
.apps-feature__body {
  padding: 2rem 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  box-sizing: border-box;
}
.apps-feature__body h2 {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 0.4rem;
  color: var(--ink);
}
.apps-feature__tagline {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
  line-height: 1.45;
}
.apps-feature__cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.apps-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
}
.apps-pill--ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

/* ROW HEADER — tight to feature card above */
.apps-row {
  margin-top: 0.5rem;
}
.apps-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 1rem;
}
.apps-row__head h2 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.apps-row__head p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 0.9rem;
}

/* APP CARDS */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.apps-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.appcard {
  --accent: #5b5bd6;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.9rem;
  align-items: center;
  padding: 0.9rem;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.appcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
  text-decoration: none;
}
.appcard__icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, white), #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.appcard__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.appcard__meta h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.15rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.appcard__category {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.appcard__tagline {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin: 0 0 0.55rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.appcard__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.appcard__rating {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 500;
}
.appcard__rating .fas.fa-star {
  color: #f59e0b;
  margin-right: 0.2rem;
}
.appcard__get {
  background: var(--accent);
  color: #fff;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* STORY STRIP — re-apply after the .apps-body section reset above. */
.apps-body .apps-story {
  margin: 3.5rem 0 1rem;
  padding: 2.5rem;
  border-radius: 22px;
  background: linear-gradient(135deg, #111, #1f1f24);
  color: #f8f8f9;
}
.apps-story__inner {
  max-width: 720px;
}
.apps-story h2 {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0.4rem 0 1rem;
  letter-spacing: -0.015em;
}
.apps-story p {
  color: #c9c9d0;
  line-height: 1.65;
  margin: 0 0 0.9rem;
}
.apps-story__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  color: #f8f8f9;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 2px;
}
.apps-story__cta:hover {
  color: #fff;
  border-bottom-color: #fff;
  text-decoration: none;
}

/* FOOTER */
.apps-footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   APP DETAIL
   ========================================================================== */
.appdetail__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0.5rem 0 1.5rem;
}
.appdetail__back:hover {
  text-decoration: underline;
  color: var(--accent);
}

.appdetail__head {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 1.75rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 22px;
  padding: 1.75rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}
.appdetail__icon {
  width: 168px;
  height: 168px;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, white), #fff);
}
.appdetail__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.appdetail__meta h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--ink);
}
.appdetail__sub {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0 0 1.1rem;
}
.appdetail__developer {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.9rem 0 0;
}
.appdetail__cta-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.appdetail__get {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.appdetail__get:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  text-decoration: none;
  color: #fff;
}
.appdetail__get--ghost {
  background: #e9e9ec;
  color: #6c6c72;
  cursor: not-allowed;
}
.appdetail__get--ghost:hover {
  transform: none;
  filter: none;
}
.appdetail__share {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f0f0f3;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.appdetail__share:hover {
  background: #e3e3e8;
}

/* STAT STRIP */
.appdetail__stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin: 1.5rem 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 1.1rem 0;
  text-align: center;
}
.appdetail__stat {
  border-right: 1px solid var(--rule);
  padding: 0 1rem;
}
.appdetail__stat:last-child {
  border-right: none;
}
.appdetail__stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.appdetail__stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.2rem;
  letter-spacing: -0.01em;
}
.appdetail__stat-value--sm {
  font-size: 1rem;
}
.appdetail__stat-value span {
  color: #f59e0b;
}
.appdetail__stat-meta {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin: 0;
}

/* SCREENSHOTS */
.appdetail__shots {
  margin: 2rem 0;
}
.appdetail__shots-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0.25rem 1rem;
  scrollbar-width: none;
}
.appdetail__shots-track::-webkit-scrollbar { display: none; }
.appdetail__shot {
  flex: 0 0 auto;
  width: min(82vw, 280px);
  margin: 0;
  scroll-snap-align: start;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--rule);
  background: #000;
  aspect-ratio: 9 / 19.5;
}
.appdetail__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* SECTIONS */
.appdetail__section {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 1.6rem 1.75rem;
  margin: 1rem 0;
}
.appdetail__section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.appdetail__desc {
  color: #2c2c33;
  line-height: 1.65;
  font-size: 1rem;
  margin: 0 0 1rem;
}
.appdetail__highlights {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.5rem 1rem;
}
.appdetail__highlights li {
  font-size: 0.94rem;
  color: #2c2c33;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.4;
}
.appdetail__highlights .fas.fa-check-circle {
  color: var(--accent);
  margin-top: 3px;
}
.appdetail__tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.appdetail__links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.appdetail__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.appdetail__link:hover {
  text-decoration: underline;
  color: var(--accent);
}

.appdetail__whatsnew-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.appdetail__version {
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.appdetail__whatsnew p {
  color: #2c2c33;
  line-height: 1.6;
  margin: 0;
}

.appdetail__info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem 2rem;
  margin: 0;
}
.appdetail__info > div {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.appdetail__info dt {
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.appdetail__info dd {
  color: var(--ink);
  font-size: 0.9rem;
  margin: 0;
  font-weight: 500;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .apps-feature {
    grid-template-columns: 1fr;
    height: auto;                /* let stacked layout breathe */
  }
  .apps-feature__art {
    height: 220px;
  }
  .apps-hero h1 { font-size: 2rem; }
  .appdetail__head {
    grid-template-columns: 120px 1fr;
    padding: 1.25rem;
    gap: 1.1rem;
  }
  .appdetail__icon {
    width: 120px;
    height: 120px;
    border-radius: 26px;
  }
  .appdetail__meta h1 { font-size: 1.65rem; }
  .appdetail__stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem 0;
  }
  .appdetail__stat:nth-child(3) { border-right: none; }
  .appdetail__stat:nth-child(4),
  .appdetail__stat:nth-child(5) {
    border-top: 1px solid var(--rule);
    padding-top: 0.85rem;
    margin-top: 0.3rem;
  }
  .appdetail__stat:nth-child(4) { border-right: 1px solid var(--rule); }
  .apps-body .apps-story { padding: 2rem 1.5rem; }
  .apps-story h2 { font-size: 1.55rem; }
}

@media (max-width: 540px) {
  .apps-shell, .appdetail { padding: 0.75rem 1rem 4rem; }
  .apps-hero h1 { font-size: 1.7rem; }
  .apps-subhead { font-size: 0.95rem; }
  .apps-feature__body { padding: 1.25rem 1.25rem 1.5rem; }
  .apps-feature__body h2 { font-size: 1.5rem; }
  .appdetail__head {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .appdetail__icon {
    width: 110px; height: 110px; margin: 0 auto 0.4rem 0;
  }
  .appdetail__meta h1 { font-size: 1.5rem; }
  .appdetail__cta-row { flex-direction: row; }
  .appdetail__get { flex: 1; justify-content: center; }
  .appdetail__section { padding: 1.25rem 1.1rem; }
  .appdetail__shot { width: 78vw; }
  .appcard {
    grid-template-columns: 72px 1fr;
  }
  .appcard__icon { width: 72px; height: 72px; border-radius: 16px; }
}
