/* MBC Store — mobile app store UI (Play / App Store inspired) */
:root {
  color-scheme: light dark;
  --store-bg: #f5f5f7;
  --store-surface: #ffffff;
  --store-surface-2: #ebebef;
  --store-text: #1d1d1f;
  --store-text-muted: #6e6e73;
  --store-border: rgba(0, 0, 0, 0.08);
  --store-accent: #01875f;
  --store-accent-hover: #016b4c;
  --store-tab-active: #01875f;
  --store-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --store-radius: 14px;
  --store-radius-sm: 10px;
  --store-nav-h: 62px;
  --store-safe-bottom: env(safe-area-inset-bottom, 0px);
  --store-header-h: 56px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --store-bg: #000000;
  --store-surface: #1c1c1e;
  --store-surface-2: #2c2c2e;
  --store-text: #f5f5f7;
  --store-text-muted: #98989d;
  --store-border: rgba(255, 255, 255, 0.1);
  --store-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--store-bg);
  color: var(--store-text);
  -webkit-tap-highlight-color: transparent;
}

body.store-body {
  min-height: 100dvh;
  padding-bottom: calc(var(--store-nav-h) + var(--store-safe-bottom) + 8px);
}

.store-skip {
  position: absolute;
  left: -9999px;
}

.store-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  min-height: var(--store-header-h);
  background: color-mix(in srgb, var(--store-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--store-border);
}

.store-header-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--store-surface-2);
  color: var(--store-text);
  cursor: pointer;
  flex-shrink: 0;
}

.store-header.has-back .store-header-back {
  display: inline-flex;
}

.store-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.store-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.store-brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-search-wrap {
  flex: 1;
  max-width: 520px;
}

.store-search {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  background: var(--store-surface-2);
  color: var(--store-text);
}

.store-search:focus {
  outline: 2px solid var(--store-accent);
  outline-offset: 1px;
}

.store-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1rem 1.5rem;
}

.store-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 1.25rem 0 0.65rem;
}

.store-carousel {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.store-carousel::-webkit-scrollbar {
  display: none;
}

.store-feature-card {
  flex: 0 0 min(78vw, 280px);
  scroll-snap-align: start;
  border-radius: var(--store-radius);
  background: linear-gradient(135deg, var(--store-surface) 0%, var(--store-surface-2) 100%);
  border: 1px solid var(--store-border);
  box-shadow: var(--store-shadow);
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.store-feature-card:hover {
  transform: translateY(-1px);
}

.store-feature-top {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.store-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--store-surface-2);
  flex-shrink: 0;
}

.store-icon-sm {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.store-icon-grid {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.store-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.store-chip {
  border: 1px solid var(--store-border);
  background: var(--store-surface);
  color: var(--store-text-muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.store-chip.active {
  background: var(--store-text);
  color: var(--store-bg);
  border-color: transparent;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.85rem 0.5rem;
}

.store-grid-item {
  text-decoration: none;
  color: inherit;
  text-align: center;
}

.store-grid-item span {
  display: block;
  font-size: 0.72rem;
  line-height: 1.25;
  margin-top: 0.35rem;
  color: var(--store-text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.store-list-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--store-border);
  text-decoration: none;
  color: inherit;
}

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

.store-list-meta h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.store-list-meta p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--store-text-muted);
}

.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}

.store-btn:active {
  transform: scale(0.98);
}

.store-btn-install {
  background: var(--store-accent);
  color: #fff;
}

.store-btn-install:hover {
  background: var(--store-accent-hover);
}

.store-btn-secondary {
  background: var(--store-surface-2);
  color: var(--store-accent);
  font-weight: 600;
}

.store-btn-soon {
  background: var(--store-surface-2);
  color: var(--store-text-muted);
  cursor: default;
}

.store-detail-hero {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 0.5rem;
}

.store-detail-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
}

.store-detail-title h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.store-detail-title p {
  margin: 0.25rem 0 0;
  color: var(--store-text-muted);
  font-size: 0.9rem;
}

.store-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.store-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1rem 0;
}

.store-meta-cell {
  background: var(--store-surface);
  border: 1px solid var(--store-border);
  border-radius: var(--store-radius-sm);
  padding: 0.65rem 0.75rem;
}

.store-meta-cell strong {
  display: block;
  font-size: 0.95rem;
}

.store-meta-cell span {
  font-size: 0.72rem;
  color: var(--store-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.store-screenshots {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.75rem;
  scroll-snap-type: x mandatory;
}

.store-screenshot {
  flex: 0 0 auto;
  width: min(42vw, 180px);
  height: min(74vw, 320px);
  border-radius: 12px;
  object-fit: cover;
  scroll-snap-align: center;
  background: var(--store-surface-2);
  border: 1px solid var(--store-border);
}

.store-screenshot.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--store-text-muted);
  text-align: center;
  padding: 0.5rem;
}

.store-description {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--store-text);
  white-space: pre-wrap;
}

.store-category-tag {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--store-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.store-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  min-height: var(--store-nav-h);
  padding-bottom: var(--store-safe-bottom);
  background: color-mix(in srgb, var(--store-bg) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--store-border);
}

.store-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  border: none;
  background: transparent;
  color: var(--store-text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.35rem 0;
}

.store-tab-btn svg {
  width: 22px;
  height: 22px;
}

.store-tab-btn.active {
  color: var(--store-tab-active);
}

.store-empty {
  text-align: center;
  color: var(--store-text-muted);
  padding: 2rem 1rem;
}

.store-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--store-text-muted);
}

.store-settings-group {
  background: var(--store-surface);
  border: 1px solid var(--store-border);
  border-radius: var(--store-radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.store-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--store-border);
  font-size: 0.92rem;
}

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

.store-settings-row a {
  color: var(--store-accent);
  text-decoration: none;
}

.store-theme-toggle {
  border: 1px solid var(--store-border);
  background: var(--store-surface-2);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  color: var(--store-text);
  font-size: 0.82rem;
}

.store-bottom-nav .store-tab-btn {
  font-size: 0.55rem;
  padding: 0.3rem 0.15rem;
}

.store-about-hero {
  text-align: center;
  margin-bottom: 1.25rem;
}

.store-about-logo {
  border-radius: 18px;
  margin-bottom: 0.65rem;
}

.store-about-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.store-about-tagline {
  font-size: 0.88rem;
  color: var(--store-text-muted);
  line-height: 1.45;
  margin: 0 0 1rem;
}

.store-about-portrait {
  margin: 0 0 1rem;
}

.store-about-portrait img {
  width: 100%;
  max-width: 320px;
  border-radius: var(--store-radius);
  object-fit: cover;
}

.store-about-portrait figcaption {
  font-size: 0.78rem;
  color: var(--store-text-muted);
  margin-top: 0.5rem;
}

.store-about-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
}

.store-about-aliases {
  color: var(--store-text-muted);
  font-size: 0.88rem;
  margin: 0.2rem 0 0;
}

.store-about-block {
  margin-bottom: 1.75rem;
}

.store-about-callout {
  background: var(--store-surface);
  border: 1px solid var(--store-border);
  border-radius: var(--store-radius);
  padding: 1rem;
}

.store-about-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--store-accent);
  margin: 0 0 0.35rem;
}

.store-about-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.store-about-card {
  background: var(--store-surface);
  border: 1px solid var(--store-border);
  border-radius: var(--store-radius-sm);
  padding: 0.85rem 1rem;
}

.store-about-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.store-about-deck {
  font-size: 0.82rem;
  color: var(--store-text-muted);
  margin: 0 0 0.45rem;
}

.store-about-card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--store-accent);
  text-decoration: none;
}

.store-about-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.store-about-timeline li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--store-border);
  font-size: 0.9rem;
  line-height: 1.45;
}

.store-about-year {
  display: block;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--store-accent);
  margin-bottom: 0.15rem;
}

.store-about-list {
  padding-left: 1.1rem;
  line-height: 1.55;
  font-size: 0.9rem;
}

.store-about-list a {
  color: var(--store-accent);
}

.store-about-companies {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.store-about-company {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--store-surface);
  border: 1px solid var(--store-border);
  border-radius: var(--store-radius-sm);
  padding: 0.85rem;
}

.store-about-company h4 {
  margin: 0 0 0.2rem;
}

.store-about-cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.65rem;
}

.store-about-cert {
  border: 1px solid var(--store-border);
  border-radius: 10px;
  background: var(--store-surface);
  padding: 0.35rem;
  cursor: pointer;
  text-align: left;
}

.store-about-cert img {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.store-about-cert span {
  display: block;
  font-size: 0.62rem;
  margin-top: 0.35rem;
  line-height: 1.25;
  color: var(--store-text-muted);
}

.store-about-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.store-about-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.store-about-form input,
.store-about-form select,
.store-about-form textarea {
  font: inherit;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--store-border);
  background: var(--store-surface);
  color: var(--store-text);
}

.store-about-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.store-about-honey {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.store-about-resume-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.store-about-resume-link {
  display: block;
  padding: 0.65rem 0.85rem;
  background: var(--store-surface);
  border: 1px solid var(--store-border);
  border-radius: 10px;
  color: var(--store-accent);
  font-weight: 600;
  text-decoration: none;
}

.store-about-subhead {
  font-size: 0.95rem;
  margin: 1rem 0 0.35rem;
}

.store-about-motto {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--store-text-muted);
}

.store-about-footer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--store-text-muted);
  line-height: 1.45;
}

.store-about-footnote {
  font-size: 0.78rem;
  color: var(--store-text-muted);
  margin-top: 0.5rem;
}

.store-about-project-list {
  margin-top: 0.5rem;
}

@media (min-width: 768px) {
  .store-bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
    border-left: 1px solid var(--store-border);
    border-right: 1px solid var(--store-border);
  }

  .store-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}
