/* ==========================================================================
   bu-nyan Apps Showcase - Modern Portfolio LP Stylesheet
   ========================================================================== */

:root {
  /* Color Palette - Dark Mode Default */
  --bg-primary: #0b0f19;
  --bg-secondary: #131b2e;
  --bg-card: rgba(26, 36, 59, 0.75);
  --bg-card-hover: rgba(33, 46, 75, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.3);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --primary-light: #818cf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-cyan: #06b6d4;

  --glass-bg: rgba(15, 23, 42, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --card-shadow-hover: 0 20px 40px -15px rgba(99, 102, 241, 0.25);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.25);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.06);
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 20px 35px -10px rgba(99, 102, 241, 0.2);
}

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

html {
  scroll-behavior: smooth;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Meiryo", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent-emerald));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-icon-wrapper svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  background: linear-gradient(135deg, var(--text-main), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  display: block;
  margin-top: -3px;
  -webkit-text-fill-color: var(--text-dim);
}

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

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: var(--border-highlight);
  transform: translateY(-1px);
}

.btn-store-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: var(--transition);
}

.btn-store-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
  filter: brightness(1.1);
}

/* Hero Section */
.hero-section {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  max-width: 95%;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary-light);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
  line-height: 1.4;
  animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(99, 102, 241, 0); }
  50% { box-shadow: 0 0 18px rgba(99, 102, 241, 0.3); }
}

.hero-title {
  font-size: clamp(1.4rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.title-line {
  display: block;
}

.text-gradient {
  background: linear-gradient(135deg, #818cf8 0%, #38bdf8 50%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  max-width: 680px;
  margin: 0 auto 36px;
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.btn-primary-hero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 8px 24px var(--primary-glow);
  transition: var(--transition);
}

.btn-primary-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px var(--primary-glow);
  filter: brightness(1.1);
}

.btn-secondary-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
}

.btn-secondary-hero:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
}

/* Stats Ribbon */
.stats-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  max-width: 860px;
  margin: 0 auto;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--card-shadow);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Category Filter Tabs */
.filter-section {
  padding: 20px 0 36px;
  position: sticky;
  top: 72px;
  z-index: 90;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.filter-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 8px;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
  white-space: nowrap;
}

.filter-tab:hover {
  color: var(--text-main);
  border-color: var(--border-highlight);
}

.filter-tab.active {
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* App Showcase Grid */
.showcase-section {
  padding: 48px 0 80px;
}

.section-header {
  margin-bottom: 36px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-count {
  font-size: 0.95rem;
  color: var(--text-dim);
}

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

/* App Card */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.card-top {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  position: relative;
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-top-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.card-badge {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-bottom: 6px;
}

.app-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-catchphrase {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag-pill {
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Feature Highlights */
.app-highlights {
  list-style: none;
  margin-bottom: 18px;
  flex-grow: 1;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.45;
}

.highlight-bullet {
  color: var(--accent-emerald);
  font-size: 1rem;
  line-height: 1;
  margin-top: 1px;
}

/* Screenshots Preview Scroll */
.screens-preview-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.screen-thumb {
  width: 90px;
  height: 160px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #000;
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.screen-thumb:hover {
  transform: scale(1.04);
  border-color: var(--primary-light);
}

/* Card Actions */
.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.btn-open-modal {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--border-subtle);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-open-modal:hover {
  background: var(--border-highlight);
  color: var(--primary-light);
}

.btn-play-store {
  flex: 1.2;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: var(--transition);
}

.btn-play-store:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

/* About Developer Section */
.about-section {
  padding: 80px 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 44px;
  box-shadow: var(--card-shadow);
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 860px) {
  .about-card {
    grid-template-columns: 1fr;
    padding: 28px;
    gap: 28px;
  }
}

.about-avatar-wrap {
  text-align: center;
}

.about-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, var(--primary), var(--accent-emerald));
  box-shadow: 0 10px 30px var(--primary-glow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.about-avatar svg {
  width: 80px;
  height: 80px;
  color: #ffffff;
}

.about-dev-name {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.about-dev-role {
  color: var(--accent-emerald);
  font-size: 0.9rem;
  font-weight: 600;
}

.about-heading {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
}

.about-text {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 24px;
}

.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.feature-box {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
}

.feature-box-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.feature-box-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 32px;
}

.modal-backdrop.open .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: var(--transition);
  z-index: 10;
}

.modal-close-btn:hover {
  background: var(--border-highlight);
  color: var(--text-main);
  transform: rotate(90deg);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.modal-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title-group h2 {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 6px;
}

/* Gallery inside Modal */
.modal-gallery {
  margin-bottom: 28px;
}

.modal-gallery-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-screens-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.modal-screens-carousel img {
  height: 320px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
}

.modal-screens-carousel img:hover {
  transform: scale(1.02);
  border-color: var(--primary-light);
}

.modal-body-section {
  margin-bottom: 24px;
}

.modal-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-desc-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
  white-space: pre-line;
  background: var(--bg-primary);
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  max-height: 240px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* Site Footer */
.site-footer {
  padding: 60px 0 40px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: var(--transition);
}

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

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 640px) {
  .pc-only {
    display: none;
  }
  .hero-section {
    padding: 40px 0 32px;
  }
  .hero-badge span {
    font-size: 0.78rem;
  }
  .hero-description {
    font-size: 0.95rem;
    padding: 0 8px;
  }
  .stats-ribbon {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px 12px;
  }
  .stat-number {
    font-size: 1.5rem;
  }
  .stat-label {
    font-size: 0.75rem;
    text-align: center;
  }
  .apps-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .app-card {
    padding: 18px;
  }
  .header-inner {
    height: 60px;
  }
  .brand-sub {
    display: none;
  }
  .btn-store-nav span {
    display: none;
  }
  .btn-store-nav {
    padding: 8px 12px;
  }
  .modal-content {
    padding: 20px;
  }
  .modal-screens-carousel img {
    height: 240px;
  }
}
