/* ========================================
   17 Apps Experiment — Portal
   KaleidoFuture White Theme
   ======================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f0fdfa;
  --text: #1a365d;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --accent: #0d9488;
  --accent-light: #14b8a6;
  --accent-subtle: rgba(13, 148, 136, 0.08);
  --border: rgba(13, 148, 136, 0.15);
  --border-light: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 10px 25px rgba(13, 148, 136, 0.1), 0 4px 10px rgba(0, 0, 0, 0.04);
  --font: 'Space Grotesk', 'Noto Sans JP', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   Hero
   ======================================== */

.hero {
  position: relative;
  padding: 48px 0 40px;
  text-align: center;
  background: var(--bg);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-light), var(--accent), transparent);
}

.hero__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.hero__logo {
  height: 48px;
}

.hero__logo img {
  height: 100%;
  width: auto;
}

#lang-select {
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

#lang-select:hover {
  border-color: var(--accent);
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text);
}

.hero__subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 32px;
  background: var(--accent-subtle);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat__value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.stat__label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================
   Filters
   ======================================== */

.filters {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.filters .container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font);
  font-size: 14px;
  padding: 8px 20px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ========================================
   App Cards Grid
   ======================================== */

.apps {
  padding: 40px 0 56px;
  background: var(--bg-alt);
}

.apps__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Card */
.app-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}

.app-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.app-card__pain {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.app-card__source {
  display: block;
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 4px;
  font-style: italic;
  cursor: pointer;
  transition: color 0.2s;
}

.app-card__source:hover {
  color: var(--accent);
  text-decoration: underline;
}

.app-card__main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.app-card__icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.app-card__name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.app-card__solve {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--accent-subtle);
  border-radius: 6px;
}

.app-card__level {
  margin-bottom: 12px;
}

.app-card__dots {
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--accent);
}

.app-card__footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.app-card__libs {
  font-size: 0.72rem;
  color: var(--text-faint);
  font-family: 'Space Mono', monospace;
}

.app-card__cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  transition: color 0.2s;
}

.app-card:hover .app-card__cta {
  color: var(--accent-light);
}

/* Device Badges */
.device-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
}

.device-badge--mobile {
  background: rgba(13, 148, 136, 0.1);
  color: var(--accent);
}

.device-badge--desktop {
  background: rgba(26, 54, 93, 0.08);
  color: var(--text);
}

.device-badge--both {
  background: rgba(13, 148, 136, 0.06);
  color: var(--accent-light);
  border: 1px solid var(--border);
}

/* Card hidden state for filter */
.app-card.hidden {
  display: none;
}

/* ========================================
   Research Section
   ======================================== */

.research {
  background: var(--bg);
  padding: 56px 0;
  border-top: 1px solid var(--border-light);
}

.research h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.research p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 24px;
}

.research__links {
  display: flex;
  gap: 24px;
}

.research__links a {
  color: var(--accent);
  font-weight: 600;
  transition: color 0.2s;
}

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

/* ========================================
   Footer
   ======================================== */

.footer {
  padding: 28px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border-light);
}

.footer a {
  color: var(--accent);
  font-weight: 600;
}

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

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 900px) {
  .apps__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 32px 0 28px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px 24px;
  }

  .stat__value {
    font-size: 1.5rem;
  }

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

  .apps {
    padding: 28px 0 40px;
  }

  .research {
    padding: 40px 0;
  }
}
