/* ===== Custom Properties ===== */
:root {
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --border: #e2e8f0;
  --card-bg: #f8fafc;
  --badge-ios-bg: #dbeafe;
  --badge-ios-text: #1e40af;
  --badge-android-bg: #dcfce7;
  --badge-android-text: #166534;
  --radius: 12px;
  --max-prose: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-subtle: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
    --border: #1e293b;
    --card-bg: #1e293b;
    --badge-ios-bg: #172554;
    --badge-ios-text: #93c5fd;
    --badge-android-bg: #14532d;
    --badge-android-text: #86efac;
  }
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

/* ===== Site Header ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.site-brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.back-link {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ===== Main ===== */
main {
  flex: 1;
}

/* ===== INDEX: Hero ===== */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 3.5rem;
  max-width: 640px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  margin-bottom: 1.75rem;
  line-height: 1.7;
}

.hero-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}

.hero-contact:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ===== INDEX: Apps Grid ===== */
.apps-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.app-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
}

.app-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
  text-decoration: none;
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.app-name {
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.3;
}

.platform-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.platform-badge.ios {
  background: var(--badge-ios-bg);
  color: var(--badge-ios-text);
}

.platform-badge.android {
  background: var(--badge-android-bg);
  color: var(--badge-android-text);
}

.app-description {
  font-size: 0.8375rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.app-policy-link {
  font-size: 0.775rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 0.5rem;
}

/* ===== POLICY PAGES ===== */
.policy-wrapper {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.policy-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.policy-header h1 {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.policy-app-name {
  font-size: 1rem;
  color: var(--text-muted);
}

.policy-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.policy-section h2 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}

.policy-section p {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.75;
}

.policy-conclusion {
  margin-top: 1.5rem;
  padding: 1.125rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-subtle);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.policy-conclusion p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.7;
}

/* ===== Site Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
}

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

.site-footer a {
  color: var(--text-muted);
}

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

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .policy-header h1 {
    font-size: 1.5rem;
  }
}
