/* ==========================================================
   Apple App Store — Landing Page Template v5
   Design tokens, layout, and component styles
   ========================================================== */

/* --- Design Tokens --- */
:root {
  --color-bg: #ffffff;
  --color-bg-secondary: #f5f5f7;
  --color-text: #1d1d1f;
  --color-text-secondary: #86868b;
  --color-text-tertiary: #aeaeb2;
  --color-accent: #007aff;
  --color-accent-active: #0051d5;
  --color-divider: #d2d2d7;
  --color-bar-fill: #8e8e93;
  --color-stars: #ff9500;
  --shadow-icon: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  --shadow-screenshot: 0 4px 16px rgba(0, 0, 0, 0.1);
  --radius-sm: 10px;
  --radius-md: 13px;
  --radius-lg: 20px;
  --radius-icon: 22.37%;
  --radius-pill: 999px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", sans-serif;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  justify-content: center;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

::selection {
  background: rgba(0, 122, 255, 0.2);
}

/* --- App Shell --- */
.app-store {
  width: min(100%, 428px);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ==========================================================
   Navigation — frosted glass sticky bar
   ========================================================== */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--color-divider);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  padding: 0 8px;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--color-accent);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 150ms;
}

.nav-btn:active {
  opacity: 0.5;
}

.nav-right {
  display: flex;
  align-items: center;
}

/* ==========================================================
   App Header — icon, name, developer, GET button
   ========================================================== */
.app-header {
  display: flex;
  gap: 16px;
  padding: 16px 20px 20px;
  align-items: flex-start;
}

.app-icon-wrap {
  width: 118px;
  height: 118px;
  border-radius: var(--radius-icon);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-icon);
}

.app-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-meta-info {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.app-name {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.app-developer {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0 0 14px;
  font-weight: 500;
}

.app-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* GET button — compact Apple-style pill */
.get-btn {
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 6px 24px;
  font-size: 15px;
  font-weight: 700;
  min-width: 75px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  transition: transform 120ms cubic-bezier(0.25, 0.1, 0.25, 1), opacity 120ms;
}

.get-btn:active {
  transform: scale(0.96);
  opacity: 0.8;
}

/* Loading state */
.get-btn.loading {
  background: var(--color-bg-secondary);
  color: transparent;
  pointer-events: none;
  position: relative;
}

.get-btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: calc(50% - 9px);
  left: calc(50% - 9px);
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.get-btn.open-btn {
  background: var(--color-bg-secondary);
  color: var(--color-accent);
}

.in-app-label {
  font-size: 11px;
  color: var(--color-text-tertiary);
}

/* ==========================================================
   Info Strip — horizontal scrolling stats row
   ========================================================== */
.info-strip {
  padding: 0 20px;
  margin-bottom: 4px;
}

.info-scroll {
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 14px 0;
  border-top: 0.5px solid var(--color-divider);
  border-bottom: 0.5px solid var(--color-divider);
  scrollbar-width: none;
}

.info-scroll::-webkit-scrollbar {
  display: none;
}

.info-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  flex: 1;
  gap: 4px;
  padding: 0 8px;
}

.info-top {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}

.info-number {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.info-unit {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 700;
}

.info-label {
  font-size: 11px;
  color: var(--color-text-tertiary);
  text-align: center;
  white-space: nowrap;
}

.info-svg {
  color: var(--color-text-secondary);
}

.age-badge {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text-secondary);
  border: 1.5px solid var(--color-text-secondary);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 1.3;
}

.lang-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-secondary);
  border: 1.5px solid var(--color-text-secondary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.info-sep {
  width: 0.5px;
  height: 32px;
  background: var(--color-divider);
  flex-shrink: 0;
}

/* ==========================================================
   Sections — common styling for content blocks
   ========================================================== */
.section {
  padding: 20px;
  border-top: 0.5px solid var(--color-divider);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.section-head h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.see-all {
  font-size: 15px;
  font-weight: 400;
  color: var(--color-accent);
  flex-shrink: 0;
}

/* ==========================================================
   What's New
   ========================================================== */
.version-info {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0 0 8px;
}

.changelog p {
  margin: 0;
  line-height: 1.47;
}

/* ==========================================================
   Preview — screenshot carousel (edge-to-edge scroll)
   ========================================================== */
.preview {
  padding-left: 0;
  padding-right: 0;
}

.preview .section-head,
.preview .device-label {
  padding-left: 20px;
  padding-right: 20px;
}

.screenshot-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 20px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.screenshot-track::-webkit-scrollbar {
  display: none;
}

.screenshot-frame {
  margin: 0;
  flex-shrink: 0;
  width: 220px;
  aspect-ratio: 9 / 19.5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-screenshot);
  scroll-snap-align: start;
  background: var(--color-bg-secondary);
}

.screenshot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.device-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 600;
  padding-top: 4px;
}

.device-label svg {
  color: var(--color-text-secondary);
}

/* ==========================================================
   Description
   ========================================================== */
.desc-body p {
  margin: 0 0 8px;
  line-height: 1.47;
}

.desc-body p:last-child {
  margin-bottom: 0;
}

/* ==========================================================
   Ratings & Reviews
   ========================================================== */
.rating-overview {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 4px;
}

.rating-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 72px;
}

.rating-number {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.rating-max {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.rating-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 10px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bar-row span {
  font-size: 12px;
  color: var(--color-text-secondary);
  width: 10px;
  text-align: center;
  font-weight: 600;
  flex-shrink: 0;
  order: -1;
}

.bar-track {
  flex: 1;
  height: 4px;
  background: var(--color-divider);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--color-bar-fill);
  border-radius: 2px;
}

.rating-count {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: right;
  margin: 0 0 20px;
}

/* --- Review Card --- */
.review {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
}

.review-head {
  margin-bottom: 4px;
}

.review-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.review-title-row strong {
  font-size: 15px;
  font-weight: 600;
}

.review-stars {
  font-size: 11px;
  color: var(--color-stars);
  letter-spacing: 1px;
}

.review-date {
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.review-author {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0 0 8px;
}

.review-text {
  font-size: 15px;
  margin: 0;
  line-height: 1.4;
}

/* ==========================================================
   Events — in-app event card (dark card)
   ========================================================== */
.event-card {
  background: linear-gradient(145deg, #1c1c1e 0%, #2c2c2e 100%);
  border-radius: var(--radius-md);
  padding: 16px;
  color: #fff;
}

.event-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 8px;
}

.event-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}

.event-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 12px;
  line-height: 1.4;
}

.event-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

/* ==========================================================
   App Privacy — cards with icons
   ========================================================== */
.privacy-intro {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0 0 16px;
  line-height: 1.4;
}

.privacy-cards {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--color-divider);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.privacy-card {
  background: var(--color-bg-secondary);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.privacy-card-icon {
  flex-shrink: 0;
  width: 28px;
  display: flex;
  justify-content: center;
  color: var(--color-accent);
}

.privacy-card-body strong {
  font-size: 15px;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.privacy-card-body p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.35;
}

/* ==========================================================
   Information Table
   ========================================================== */
.info-table {
  margin: 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--color-divider);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row dt {
  font-size: 15px;
  color: var(--color-text-secondary);
}

.info-row dd {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
  text-align: right;
}

.accent-text {
  color: var(--color-accent);
}

/* ==========================================================
   Footer
   ========================================================== */
.store-footer {
  padding: 24px 20px 40px;
  border-top: 0.5px solid var(--color-divider);
}

.footer-dev {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.footer-dev-link {
  font-size: 15px;
  font-weight: 500;
}

.footer-dev-role {
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.footer-links a {
  font-size: 13px;
}

.footer-copy {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin: 0;
}
