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

:root {
  --bg: #0f0f12;
  --bg2: #17171d;
  --bg3: #1e1e27;
  --surface: #22222e;
  --border: rgba(255,255,255,0.07);
  --text: #f0f0f5;
  --text2: #9898b0;
  --text3: #5e5e72;
  --accent1: oklch(75% 0.26 270);
  --accent2: oklch(75% 0.26 200);
  --accent3: oklch(75% 0.26 145);
  --font-en: 'Space Grotesk', sans-serif;
  --font-ja: 'Noto Sans JP', sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
}

[data-theme="light"] {
  --bg: #f5f5f8;
  --bg2: #ebebf2;
  --bg3: #e2e2ec;
  --surface: #ffffff;
  --border: rgba(0,0,0,0.08);
  --text: #0f0f18;
  --text2: #525270;
  --text3: #9898b2;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-en);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

::selection { background: var(--accent1); color: #fff; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 99px; }

/* ---------- HEADER ---------- */
header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(16px, 4vw, 48px);
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}

.header-logo {
  font-size: 18px; font-weight: 700; letter-spacing: -0.5px;
  color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.header-logo .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent1);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; transition: all 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent1); background: var(--bg3); }

.lang-toggle {
  height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text2); cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px;
  transition: all 0.15s; font-family: var(--font-en);
}
.lang-toggle:hover { color: var(--text); border-color: var(--accent1); }

/* ---------- HERO ---------- */
.hero {
  padding: clamp(60px, 10vw, 120px) clamp(16px, 4vw, 48px) clamp(40px, 6vw, 80px);
  max-width: 900px; margin: 0 auto;
}
.hero-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text3); margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(36px, 7vw, 72px); font-weight: 700;
  line-height: 1.05; letter-spacing: -2px; margin-bottom: 20px;
}
.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: clamp(15px, 2vw, 18px); color: var(--text2);
  line-height: 1.7; max-width: 520px;
}
.hero-sub.ja { font-family: var(--font-ja); font-size: 14px; margin-top: 4px; }

/* ---------- MAIN ---------- */
.main {
  max-width: 1000px; margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 80px;
}

/* ---------- SECTION HEADER ---------- */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.section-title {
  font-size: 13px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text3);
}

/* ---------- FILTERS ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  height: 30px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text2); font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: var(--font-en);
  transition: all 0.15s; white-space: nowrap;
}
.filter-chip:hover { border-color: var(--text3); color: var(--text); }
.filter-chip.active { background: var(--accent1); border-color: var(--accent1); color: #fff; }

/* ---------- APP CARDS ---------- */
.apps-list { display: flex; flex-direction: column; gap: 16px; }

.app-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 32px;
  display: flex; align-items: center; gap: 24px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.app-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--card-color, var(--accent1)) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.app-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-color, var(--accent1));
  box-shadow: 0 8px 40px -8px color-mix(in srgb, var(--card-color, var(--accent1)) 30%, transparent);
}
.app-card:hover::before { opacity: 0.04; }

.app-icon {
  font-size: 40px; width: 68px; height: 68px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--card-color, var(--accent1)) 15%, var(--bg2));
  border: 1px solid color-mix(in srgb, var(--card-color, var(--accent1)) 25%, transparent);
}

.app-body { flex: 1; min-width: 0; }
.app-name { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 2px; }
.app-name-ja { font-size: 12px; color: var(--text3); font-family: var(--font-ja); margin-bottom: 8px; }
.app-tagline { font-size: 14px; color: var(--text2); line-height: 1.5; margin-bottom: 12px; }
.app-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  height: 22px; padding: 0 10px; border-radius: 99px;
  font-size: 11px; font-weight: 500;
  background: var(--bg3); color: var(--text3);
  display: flex; align-items: center;
}

.app-cta { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

.btn-primary {
  height: 40px; padding: 0 20px; border-radius: 10px;
  border: none; background: var(--card-color, var(--accent1));
  color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--font-en); transition: opacity 0.15s, transform 0.15s;
  text-decoration: none; display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.85; transform: scale(0.98); }

.btn-ghost {
  height: 36px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text2); font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: var(--font-en);
  transition: all 0.15s; white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--text3); color: var(--text); }

.app-updated { font-size: 11px; color: var(--text3); }

/* ---------- EMPTY ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty-state .emoji { font-size: 40px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; }

/* ---------- CHANGELOG ---------- */
.changelog-section { margin-top: 60px; }
.changelog-list { display: flex; flex-direction: column; }
.changelog-item {
  display: flex; gap: 20px; padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.changelog-item:last-child { border-bottom: none; }
.changelog-date { font-size: 11px; font-weight: 600; letter-spacing: 0.5px; color: var(--text3); min-width: 60px; padding-top: 2px; }
.changelog-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent1); margin-top: 5px; flex-shrink: 0; }
.changelog-text { font-size: 14px; color: var(--text2); line-height: 1.5; }
.changelog-text .ja-line { font-family: var(--font-ja); font-size: 12px; color: var(--text3); margin-top: 2px; }

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 32px clamp(16px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.footer-left { font-size: 13px; color: var(--text3); }
.footer-social { display: flex; gap: 8px; }
.social-link {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text2); display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 16px; transition: all 0.15s;
}
.social-link:hover { color: var(--text); border-color: var(--accent1); }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 24px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-header { padding: 28px 28px 0; display: flex; align-items: flex-start; gap: 20px; }
.modal-icon { font-size: 44px; width: 72px; height: 72px; border-radius: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.modal-title-block { flex: 1; }
.modal-title { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.modal-title-ja { font-size: 13px; color: var(--text3); font-family: var(--font-ja); margin-top: 2px; }
.modal-tagline { font-size: 14px; color: var(--text2); margin-top: 8px; line-height: 1.5; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text2); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.15s;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px 28px 28px; }
.modal-desc { font-size: 15px; color: var(--text2); line-height: 1.7; margin-bottom: 24px; }
.modal-desc.ja { font-family: var(--font-ja); font-size: 13px; color: var(--text3); margin-top: -16px; margin-bottom: 24px; }
.modal-features-title { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3); margin-bottom: 12px; }
.modal-features { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.modal-feature { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text2); }
.modal-feature .check { width: 20px; height: 20px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.modal-feature .ja-feat { font-family: var(--font-ja); font-size: 11px; color: var(--text3); margin-left: 4px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn-primary { flex: 1; justify-content: center; font-size: 15px; height: 48px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
  .app-card { flex-direction: column; align-items: flex-start; padding: 20px; }
  .app-cta { flex-direction: row; align-items: center; width: 100%; justify-content: flex-start; }
  .app-updated { display: none; }
}
