/* ============================================
   Gunpla Log — Landing Page Styles
   Tailwind CSS v3.4 + Custom Overrides
   ============================================ */

@tailwind base;
@tailwind components;
@tailwind utilities;

/* ====== Custom Properties ====== */
:root {
  --color-primary: #e63946;
  --color-primary-dark: #c1121f;
  --color-accent: #f4a261;
  --color-dark: #1d3557;
  --color-mid: #457b9d;
  --color-light: #f1faee;
  --color-bg: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-jp: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --font-zh: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --transition-default: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====== Base ====== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

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

/* Font overrides per language class */
.lang-ja body, .lang-ja .font-lang {
  font-family: var(--font-jp);
}
.lang-zh body, .lang-zh .font-lang {
  font-family: var(--font-zh);
}

/* ====== Utility Classes ====== */
.container-wide {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 768px) {
  .container-wide {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

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

.gradient-bg {
  background: linear-gradient(135deg, #1d3557 0%, #457b9d 50%, #1d3557 100%);
}

/* ====== Navbar ====== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: var(--transition-default);
}

.navbar.scrolled {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ====== Language Switcher ====== */
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: var(--transition-default);
}

.lang-btn:hover {
  border-color: var(--color-mid);
  background: rgba(69, 123, 157, 0.06);
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.375rem;
  min-width: 160px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: var(--transition-default);
  z-index: 60;
  overflow: hidden;
}

.lang-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.15s;
}

.lang-dropdown a:hover {
  background: #f3f4f6;
}

.lang-dropdown a.active {
  background: #eef2ff;
  color: var(--color-primary);
  font-weight: 600;
}

.lang-dropdown a .lang-code {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-left: auto;
}

/* ====== Hero Section ====== */
.hero {
  padding: 7rem 0 4rem;
  background: linear-gradient(160deg, #f8fafc 0%, #e0f2fe 50%, #fff1f2 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  background: rgba(230, 57, 70, 0.1);
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 540px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.app-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-dark);
  color: white;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 0.75rem;
  transition: var(--transition-default);
  text-decoration: none;
}

.app-store-badge:hover {
  background: #162a47;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 53, 87, 0.3);
}

.app-store-badge svg {
  width: 24px;
  height: 24px;
}

/* ====== Phone Mockup ====== */
.phone-mockup {
  position: relative;
  width: 280px;
  height: 560px;
  margin: 0 auto;
  background: #1a1a2e;
  border-radius: 2.5rem;
  padding: 0.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

.phone-mockup .screen {
  width: 100%;
  height: 100%;
  border-radius: 2rem;
  overflow: hidden;
  background: #f5f5f5;
}

.phone-mockup .screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #1a1a2e;
  border-radius: 0 0 1rem 1rem;
  z-index: 2;
}

/* ====== Section Common ====== */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: #f8fafc;
}

.section-dark {
  background: var(--color-dark);
  color: white;
}

.section-label {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: center;
}

/* ====== Feature Cards ====== */
.feature-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.75rem;
  transition: var(--transition-default);
}

.feature-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  border-color: #d1d5db;
  transform: translateY(-2px);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ====== Timeline ====== */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 1.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-accent));
}

@media (min-width: 768px) {
  .timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }
}

.timeline-item {
  position: relative;
  padding-left: 4rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .timeline-item {
    width: 50%;
    padding-left: 0;
    padding-right: 2.5rem;
  }
  .timeline-item:nth-child(even) {
    margin-left: 50%;
    padding-left: 2.5rem;
    padding-right: 0;
  }
}

.timeline-dot {
  position: absolute;
  left: 0.75rem;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--color-primary);
  border: 3px solid white;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 0 2px var(--color-primary);
}

@media (min-width: 768px) {
  .timeline-dot {
    left: auto;
    right: -0.75rem;
  }
  .timeline-item:nth-child(even) .timeline-dot {
    left: -0.75rem;
    right: auto;
  }
}

.timeline-content {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.timeline-content h4 {
  font-weight: 700;
  font-size: 1.0625rem;
  margin-bottom: 0.375rem;
}

.timeline-content p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ====== i18n Flags ====== */
.lang-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.lang-flag-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
}

.lang-flag-item .flag {
  font-size: 2rem;
  line-height: 1;
}

.lang-flag-item .label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.lang-flag-item .label.active {
  color: var(--color-primary);
  font-weight: 700;
}

/* ====== CTA Section ====== */
.cta-section {
  text-align: center;
  padding: 6rem 0;
}

.cta-section h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-section p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-section .app-store-badge {
  background: white;
  color: var(--color-dark);
  font-size: 1.0625rem;
  padding: 0.875rem 2rem;
}

.cta-section .app-store-badge:hover {
  background: #f1f5f9;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* ====== Footer ====== */
.footer {
  background: #0f172a;
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 0;
  font-size: 0.875rem;
}

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

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: white;
}

/* ====== Grid Layouts ====== */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ====== Image Placeholder ====== */
.img-placeholder {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.875rem;
  min-height: 200px;
}

/* ====== Animations ====== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ====== Mobile Menu ====== */
.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition-default);
}

.mobile-menu-btn.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.open span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

.nav-links {
  display: none;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-links-mobile {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1.5rem;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.nav-links-mobile.open {
  display: flex;
}

.nav-links-mobile a {
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
}

/* ====== Screenshot Gallery ====== */
.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .screenshot-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .screenshot-gallery {
    grid-template-columns: repeat(5, 1fr);
  }
}

.screenshot-gallery img {
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: var(--transition-default);
}

.screenshot-gallery img:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* ====== Stats ====== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.stat-label.light {
  color: rgba(255, 255, 255, 0.85);
}

/* ====== Misc ====== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: white;
  z-index: 100;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

/* Download count badge */
.download-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

/* ============================================
   Guides / Blog Section Styles
   ============================================ */

/* ====== Guide Cards ====== */
.guide-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  overflow: hidden;
  transition: var(--transition-default);
}
.guide-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  border-color: #d1d5db;
  transform: translateY(-2px);
}
.guide-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}
.guide-card-body {
  padding: 1.5rem;
}
.guide-card-body h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.guide-card-body p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}
.guide-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: #9ca3af;
}
.guide-card-meta .tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: rgba(230, 57, 70, 0.08);
  color: var(--color-primary);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
}

/* ====== Guides Grid ====== */
.guides-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 640px) {
  .guides-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .guides-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ====== Article Page ====== */
.article-page {
  padding-top: 7rem;
  padding-bottom: 4rem;
}
.article-header {
  margin-bottom: 3rem;
}
.article-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}
.article-meta .tag {
  padding: 0.125rem 0.5rem;
  background: rgba(230, 57, 70, 0.08);
  color: var(--color-primary);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
}
.article-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.8;
}
.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}
.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.article-body p {
  margin-bottom: 1.25rem;
  color: #374151;
}
.article-body ul, .article-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.article-body li {
  margin-bottom: 0.5rem;
}
.article-body strong {
  font-weight: 600;
  color: var(--color-text);
}
.article-body .tip-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin: 1.5rem 0;
}
.article-body .tip-box strong {
  color: #166534;
}
.article-body .cta-box {
  background: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
  color: white;
  border-radius: 1rem;
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
}
.article-body .cta-box h3 {
  color: white;
  margin-top: 0;
  font-size: 1.25rem;
}
.article-body .cta-box p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1.25rem;
}
.article-body .cta-box .app-store-badge {
  background: white;
  color: var(--color-dark);
  font-size: 0.9375rem;
  padding: 0.75rem 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-default);
}
.article-body .cta-box .app-store-badge:hover {
  background: #f1f5f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ====== Breadcrumb ====== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--color-mid);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb a:hover {
  color: var(--color-primary);
}
.breadcrumb .separator {
  color: #d1d5db;
}

/* ====== Table of Contents ====== */
.toc {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.toc h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  margin-top: 0;
}
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc li {
  margin-bottom: 0.375rem;
}
.toc a {
  font-size: 0.875rem;
  color: var(--color-mid);
  text-decoration: none;
  transition: color 0.15s;
}
.toc a:hover {
  color: var(--color-primary);
}

/* ====== Related Articles ====== */
.related-articles {
  border-top: 1px solid #e5e7eb;
  margin-top: 3rem;
  padding-top: 2rem;
}
.related-articles h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.related-articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .related-articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.related-item {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  transition: var(--transition-default);
}
.related-item:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.related-item a {
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9375rem;
}
.related-item a:hover {
  color: var(--color-primary);
}