/* SwaymoonWorks — App Store Today layout (public). */

:root {
  --as-bg: #fff;
  --as-bg-elevated: #f5f5f7;
  --as-text: #1d1d1f;
  --as-text-secondary: #6e6e73;
  --as-text-tertiary: #86868b;
  --as-blue: #0071e3;
  --as-blue-fill: #0071e3;
  --as-hairline: rgba(0, 0, 0, 0.12);
  --as-nav-h: 52px;
  --as-max: 980px;
  --as-gutter: 22px;
  --as-radius-xl: 28px;
  --as-radius-lg: 20px;
  --as-radius-md: 16px;
  --as-radius-icon: 22%;
  --as-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  --as-font: "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB",
    "Source Han Sans SC", "Noto Sans CJK SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --as-display: "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Source Han Sans SC", "Noto Sans CJK SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --as-bg: #000;
    --as-bg-elevated: #1c1c1e;
    --as-text: #f5f5f7;
    --as-text-secondary: #a1a1a6;
    --as-text-tertiary: #6e6e73;
    --as-blue: #0a84ff;
    --as-blue-fill: #0a84ff;
    --as-hairline: rgba(255, 255, 255, 0.16);
    --as-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--as-font);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  color: var(--as-text);
  background: var(--as-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--as-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font: inherit;
  color: inherit;
}

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

.as-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Top nav ---------- */
.as-topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--as-nav-h);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--as-bg) 72%, transparent);
  border-bottom: 1px solid var(--as-hairline);
}

.as-topnav-inner {
  max-width: var(--as-max);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--as-gutter);
  display: flex;
  align-items: center;
  gap: 18px;
}

.as-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--as-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.as-brand:hover { text-decoration: none; opacity: 0.85; }
.as-brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.as-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.as-tabs::-webkit-scrollbar { display: none; }

.as-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--as-text-secondary);
  padding: 6px 12px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.as-tab:hover { color: var(--as-text); text-decoration: none; }
.as-tab.is-active {
  color: var(--as-text);
  background: var(--as-bg-elevated);
  font-weight: 600;
}

.as-topnav-spacer { flex: 1; }

.as-top-link {
  color: var(--as-text-secondary);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.as-top-link:hover { color: var(--as-text); text-decoration: none; }

/* ---------- Main canvas ---------- */
.as-main {
  flex: 1;
  width: 100%;
  max-width: var(--as-max);
  margin: 0 auto;
  padding: 18px var(--as-gutter) 64px;
}

.as-date {
  margin: 8px 0 0;
  color: var(--as-text-tertiary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.as-large-title {
  margin: 2px 0 22px;
  font-family: var(--as-display);
  font-size: clamp(34px, 8vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.as-section {
  margin: 0 0 28px;
}

.as-section-head {
  margin: 8px 0 14px;
}
.as-section-title {
  margin: 0;
  font-family: var(--as-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.as-section-lead {
  margin: 6px 0 0;
  color: var(--as-text-secondary);
  font-size: 17px;
  max-width: 36em;
}

/* ---------- Hero / feature story ---------- */
.as-story {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--as-radius-xl);
  min-height: min(62vh, 540px);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--as-shadow);
  background:
    linear-gradient(160deg, #1c1c3a 0%, #3a1c4a 40%, #c94b2a 78%, #f2a65a 100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.as-story:hover { text-decoration: none; color: #fff; }
.as-story:active { transform: scale(0.985); }

.as-story-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.as-story-eyebrow {
  position: absolute;
  top: 22px;
  left: 22px;
  right: 22px;
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.88;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.as-story-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 72px 24px 26px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.78));
}

.as-story-title {
  margin: 0 0 6px;
  font-family: var(--as-display);
  font-size: clamp(26px, 5.5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.as-story-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  opacity: 0.92;
  max-width: 30em;
}

.as-story.is-feature {
  min-height: 320px;
  border-radius: var(--as-radius-lg);
}

.as-story.is-feature .as-story-title {
  font-size: clamp(22px, 4vw, 28px);
}

/* ---------- Mini pair ---------- */
.as-mini-grid {
  display: grid;
  gap: 14px;
}
@media (min-width: 720px) {
  .as-mini-grid { grid-template-columns: 1fr 1fr; }
}

.as-mini {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--as-radius-lg);
  min-height: 220px;
  color: #fff;
  text-decoration: none;
  box-shadow: var(--as-shadow);
  background: linear-gradient(145deg, #0a84ff, #5e5ce6);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.as-mini:hover { text-decoration: none; color: #fff; }
.as-mini:active { transform: scale(0.98); }
.as-mini-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.as-mini-body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 56px 18px 18px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.65));
}
.as-mini-eyebrow {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.85;
}
.as-mini-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.as-mini-sub {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.3;
}

/* ---------- Shelf ---------- */
.as-shelf-wrap { margin: 0 calc(-1 * var(--as-gutter)); }
.as-shelf-head {
  padding: 0 var(--as-gutter);
  margin-bottom: 12px;
}
.as-shelf {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(248px, 72vw);
  gap: 12px;
  overflow-x: auto;
  padding: 0 var(--as-gutter) 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.as-shelf::-webkit-scrollbar { display: none; }
@media (min-width: 900px) {
  .as-shelf { grid-auto-columns: minmax(260px, 30%); }
}

.as-shelf-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--as-radius-md);
  background: var(--as-bg-elevated);
  padding: 14px;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.as-shelf-card:hover { text-decoration: none; color: inherit; }
.as-shelf-card:active { transform: scale(0.985); }
.as-shelf-card-top {
  display: flex;
  gap: 12px;
  align-items: center;
}
.as-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--as-radius-icon);
  object-fit: cover;
  background: #d2d2d7;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.as-icon-sm {
  width: 52px;
  height: 52px;
}
.as-shelf-copy { min-width: 0; }
.as-shelf-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.as-shelf-sub {
  margin: 2px 0 0;
  color: var(--as-text-secondary);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.as-get {
  appearance: none;
  border: 0;
  background: rgba(0, 113, 227, 0.12);
  color: var(--as-blue);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 980px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.as-get:hover { text-decoration: none; filter: brightness(1.05); }
@media (prefers-color-scheme: dark) {
  .as-get { background: rgba(10, 132, 255, 0.2); }
}

/* ---------- App list ---------- */
.as-list {
  border-radius: var(--as-radius-lg);
  background: var(--as-bg-elevated);
  overflow: hidden;
}
.as-list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--as-hairline);
  transition: background 0.15s ease;
}
.as-list-row:last-child { border-bottom: 0; }
.as-list-row:hover { text-decoration: none; color: inherit; background: color-mix(in srgb, var(--as-text) 4%, transparent); }
.as-list-copy { min-width: 0; flex: 1; }
.as-list-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.as-list-sub {
  margin: 2px 0 0;
  color: var(--as-text-secondary);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Catalog (Games / Apps) ---------- */
.as-catalog {
  display: grid;
  gap: 0;
  border-radius: var(--as-radius-lg);
  background: var(--as-bg-elevated);
  overflow: hidden;
}

/* ---------- Detail ---------- */
.as-detail-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 8px 0 28px;
}
.as-detail-icon {
  width: 120px;
  height: 120px;
  border-radius: 26%;
  object-fit: cover;
  box-shadow: var(--as-shadow);
  background: var(--as-bg-elevated);
}
.as-detail-name {
  margin: 0;
  font-family: var(--as-display);
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.as-detail-sub {
  margin: 8px 0 0;
  color: var(--as-text-secondary);
  font-size: 17px;
}
.as-detail-dev {
  margin: 6px 0 0;
  color: var(--as-text-tertiary);
  font-size: 13px;
}
.as-detail-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.as-get-lg {
  padding: 10px 18px;
  font-size: 15px;
}
.as-brand-mark {
  object-fit: contain;
}
.as-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.as-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--as-text) 8%, transparent);
  color: var(--as-text-secondary);
  font-size: 12px;
  font-weight: 500;
}
.as-list-pub {
  display: block;
  margin-top: 2px;
  color: var(--as-text-tertiary);
  font-size: 12px;
}
.as-shots {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.as-shot {
  flex: 0 0 auto;
  scroll-snap-align: start;
  border-radius: 16px;
  overflow: hidden;
  background: var(--as-bg-elevated);
  box-shadow: var(--as-shadow);
}
.as-shot img {
  display: block;
  height: min(420px, 62vh);
  width: auto;
  max-width: min(280px, 72vw);
  object-fit: cover;
}
.as-detail-promo {
  margin: 0 0 16px;
  color: var(--as-text-secondary);
  font-size: 17px;
  line-height: 1.45;
}
.as-detail-section {
  margin: 0 0 28px;
  padding-top: 8px;
  border-top: 1px solid var(--as-hairline);
}
.as-detail-section h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.as-detail-text {
  margin: 0;
  color: var(--as-text-secondary);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.as-info {
  margin: 0;
}
.as-info-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--as-hairline);
  font-size: 13px;
}
.as-info-row dt {
  color: var(--as-text-tertiary);
  margin: 0;
}
.as-info-row dd {
  margin: 0;
  color: var(--as-text-secondary);
  word-break: break-word;
}
.as-info-row a {
  color: var(--as-link, #0a84ff);
  text-decoration: none;
}
.as-info-row a:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .as-info-row { grid-template-columns: 1fr; gap: 4px; }
  .as-detail-hero { align-items: flex-start; }
  .as-detail-icon { width: 96px; height: 96px; }
}

/* ---------- Empty ---------- */
.as-empty {
  padding: 48px 8px;
  text-align: center;
  color: var(--as-text-secondary);
}
.as-empty h2 {
  margin: 0 0 8px;
  color: var(--as-text);
  font-size: 22px;
}
.as-empty p { margin: 0; font-size: 15px; }

/* ---------- Footer ---------- */
.as-footer {
  border-top: 1px solid var(--as-hairline);
  background: var(--as-bg-elevated);
  padding: 36px var(--as-gutter) 48px;
}
.as-footer-inner {
  max-width: var(--as-max);
  margin: 0 auto;
}
.as-footer-bread {
  color: var(--as-text-tertiary);
  font-size: 12px;
  margin-bottom: 22px;
}
.as-footer-bread a { color: var(--as-text-secondary); }
.as-footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
@media (max-width: 720px) {
  .as-footer-cols { grid-template-columns: 1fr; }
}
.as-footer-heading {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--as-text);
}
.as-footer-col a {
  display: block;
  color: var(--as-text-secondary);
  font-size: 12px;
  margin: 0 0 8px;
  text-decoration: none;
}
.as-footer-col a:hover { text-decoration: underline; }
.as-footer-copy {
  margin-top: 28px;
  color: var(--as-text-tertiary);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

@media (prefers-reduced-motion: reduce) {
  .as-story,
  .as-mini,
  .as-shelf-card {
    transition: none;
  }
  .as-story:active,
  .as-mini:active,
  .as-shelf-card:active {
    transform: none;
  }
}
