/* canclini.org Landingpage — Styles */
/* Design goals: large touch targets, light/dark mode, no external dependencies */

:root {
  --bg: #f5f5f7;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #e0e0e0;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --bg-card: #2a2a2a;
    --text: #e5e5e5;
    --text-muted: #999;
    --border: #404040;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --danger: #f87171;
    --danger-hover: #fca5a5;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

.page-header {
  text-align: center;
  margin-bottom: 2rem;
  width: 100%;
  max-width: var(--max-width);
}

.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: var(--max-width);
  margin-bottom: 2rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  min-height: 120px;
  justify-content: center;
}

.service-card:hover,
.service-card:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  outline: none;
}

.service-card:active {
  transform: scale(0.98);
}

.service-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.service-name {
  font-weight: 600;
  font-size: 1rem;
}

.service-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Touch targets: minimum 44x44px (WCAG 2.5.5) */
@media (pointer: coarse) {
  .service-card {
    min-height: 80px;
    padding: 1.25rem 1rem;
  }
  .service-icon {
    font-size: 1.75rem;
  }
}

.noscript-notice {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.5rem;
}

.logout-section {
  width: 100%;
  max-width: var(--max-width);
  text-align: center;
  margin-bottom: 2rem;
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.logout-btn:hover,
.logout-btn:focus-visible {
  background: var(--danger);
  color: var(--bg);
  outline: none;
}

.logout-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.page-footer {
  width: 100%;
  max-width: var(--max-width);
  text-align: center;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.security-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.version-info {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Small screens: single column */
@media (max-width: 480px) {
  .service-grid {
    grid-template-columns: 1fr 1fr;
  }
  .page-title {
    font-size: 1.5rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .service-card {
    transition: none;
  }
  .service-card:active {
    transform: none;
  }
}
