/* === Custom Properties === */
:root {
  --color-bg: #faf7f2;
  --color-surface: #f0ebe3;
  --color-text: #2d2a26;
  --color-text-secondary: #8a8480;
  --color-accent: #e8604c;
  --color-accent-hover: #d44f3c;
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max-width: 720px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
}

/* === Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === Base === */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

ul {
  list-style: none;
}

/* === Skip Link === */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-xs) var(--space-sm);
  font-weight: 600;
  z-index: 100;
  border-radius: 0 0 4px 4px;
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

/* === Nav === */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md);
}

.site-nav__logo {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-nav__logo-img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.site-nav__logo:hover {
  color: var(--color-text);
}

.site-nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.site-nav__link:hover,
.site-nav__link--active {
  color: var(--color-text);
}

/* === Hero (Homepage) === */
.hero {
  min-height: 100vh;
  display: flex;
  position: relative;
  overflow: hidden;
}

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md);
  padding-top: 0;
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero__accent {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: url('/images/hero-accent.png') no-repeat bottom right;
  background-size: cover;
  opacity: 0.35;
  pointer-events: none;
}

.hero__title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.hero__tagline {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin-bottom: var(--space-xl);
  max-width: 480px;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  min-height: 44px;
  transition: background 0.15s ease;
  align-self: flex-start;
}

.hero__cta:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

/* === Apps Listing === */
.apps-listing {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md);
}

.apps-listing h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xl);
}

.apps-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.apps-list__item {
  border-bottom: 1px solid var(--color-surface);
}

.apps-list__item:last-child {
  border-bottom: none;
}

.apps-list__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  color: var(--color-text);
  min-height: 44px;
}

.apps-list__link:hover {
  color: var(--color-text);
}

.apps-list__link:hover .apps-list__name {
  color: var(--color-accent);
}

.apps-list__icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  flex-shrink: 0;
}

.apps-list__icon-fallback {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.apps-list__info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.apps-list__name {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.apps-list__tagline {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.apps-list__date {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.apps-listing__empty {
  padding: var(--space-3xl) 0;
  text-align: center;
  color: var(--color-text-secondary);
}

/* === App Detail === */
.app-detail {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md);
}

.app-detail__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.app-detail__icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  flex-shrink: 0;
}

.app-detail__icon-fallback {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.app-detail__meta h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.app-detail__tagline {
  color: var(--color-text-secondary);
  margin-top: var(--space-xs);
}

.app-detail__date {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: var(--space-xs);
}

.app-detail__store {
  margin-bottom: var(--space-xl);
}

.app-detail__badge img {
  height: 40px;
  width: auto;
}

.app-detail__coming-soon {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: var(--space-xl);
}

.app-detail__body {
  margin-bottom: var(--space-xl);
}

.app-detail__legal {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-surface);
}

.app-detail__legal ul {
  display: flex;
  gap: var(--space-lg);
}

.app-detail__legal a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.app-detail__legal a:hover {
  color: var(--color-accent);
}

/* === About Page === */
.about-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md);
}

.about-page__header {
  margin-bottom: var(--space-xl);
}

.about-page__header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.about-page__intro {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  max-width: 55ch;
}

/* === Legal Pages === */
.legal-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md);
}

.legal-page__breadcrumb {
  margin-bottom: var(--space-lg);
}

.legal-page__breadcrumb a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.legal-page__breadcrumb a:hover {
  color: var(--color-accent);
}

.legal-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xl);
}

/* === Prose (shared content styling) === */
.prose {
  max-width: 65ch;
}

.prose p {
  margin-bottom: var(--space-sm);
}

.prose h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.prose h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
}

.prose ul,
.prose ol {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-md);
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: var(--space-xs);
}

.prose strong {
  font-weight: 600;
}

/* === Footer === */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-md) var(--space-lg);
  text-align: center;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* === Responsive (≤640px) === */
@media (max-width: 640px) {
  .hero {
    min-height: 80vh;
  }

  .apps-list__link {
    flex-direction: column;
    align-items: flex-start;
  }

  .apps-list__icon,
  .apps-list__icon-fallback {
    width: 48px;
    height: 48px;
    border-radius: 11px;
    font-size: 1.25rem;
  }

  .app-detail__header {
    flex-direction: column;
  }

  .app-detail__icon,
  .app-detail__icon-fallback {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    font-size: 1.75rem;
  }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}
