@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9f9f9;
  --text-primary: #111111;
  --text-secondary: #555555;
  --border-color: #dddddd;
  --accent-color: #000000;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --transition-speed: 0.3s;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --border-color: #333333;
    --accent-color: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.6);
  }
}

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

body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

a:hover {
  color: var(--text-secondary);
}

ul {
  list-style: none;
}

/* Header */
header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 32px;
  width: auto;
  display: block;
}

nav ul {
  display: flex;
  gap: 2rem;
}

nav a {
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-color);
  transition: width var(--transition-speed) ease;
}

nav a:hover::after {
  width: 100%;
}

/* Main */
main {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* Hero Section */
.hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  animation: fadeIn 1s ease-out;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* Sections */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  text-align: center;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
}

.app-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
}

/* Clickable Thumbnail */
.app-link {
  display: block;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 2rem;
  transition: transform var(--transition-speed) ease;
}

.app-link:hover {
  transform: scale(1.02);
}

.app-link:hover .app-placeholder img {
  opacity: 0.9;
}

.app-placeholder {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0; /* Handled by .app-link margin */
  color: var(--text-secondary);
  font-size: 0.9rem;
  background-color: var(--bg-primary);
  overflow: hidden;
  transition: border-color var(--transition-speed);
}

.app-link:hover .app-placeholder {
  border-color: var(--accent-color);
}

.app-placeholder img {
  width: 100%;
  height: auto;
  display: block;
}

.app-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.app-card p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  flex-grow: 1;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background-color: var(--accent-color);
  color: var(--bg-primary);
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  transition: opacity var(--transition-speed);
}

.btn:hover {
  opacity: 0.8;
  color: var(--bg-primary);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--accent-color);
}
.btn-outline:hover {
  background-color: var(--accent-color);
  color: var(--bg-primary);
}

/* App Details Layout */
.app-header {
  text-align: center;
  margin-bottom: 4rem;
}

.app-header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.detail-section {
  margin-bottom: 4rem;
  padding: 3rem;
  background-color: var(--bg-secondary);
  border-radius: 24px;
}

.detail-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  display: inline-block;
}

/* Tabs for App Details */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.tab-btn {
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all var(--transition-speed);
  font-family: inherit;
}

.tab-btn.active, .tab-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
  display: block;
}

/* Lists and Text elements in Details */
.feature-list {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  list-style-type: disc;
}

.feature-list li {
  margin-bottom: 0.8rem;
  color: var(--text-secondary);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.info-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 12px;
}

.info-card h4 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.copyright {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* App Icon and Badge Styling */
.app-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.app-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: #333;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.status-badge.dev {
  background-color: #555;
}

.store-badges {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.store-badge {
  display: flex;
  align-items: center;
  transition: transform var(--transition-speed);
}

.store-badge:hover {
  transform: scale(1.05);
}

.store-badge img {
  height: 40px;
  width: auto;
  display: block;
}

/* 
 * Precision alignment based on actual image bounds:
 * The Google Play PNG (646x250) has transparent padding (top/bottom).
 * Its actual content height is 192px (76.8% of the image).
 * To match the Apple badge's solid 40px height: 40 / 0.768 = 52.08px.
 */
.store-badge img[alt*="Google Play"] {
  height: 52px;
}

.social-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px; /* バッジの視覚的な高さ40pxと完全に同期 */
  width: 40px;
  background-color: #000;
  border-radius: 8px; /* ストアバッジの角丸に似せる */
  transition: transform var(--transition-speed);
  flex-shrink: 0;
}

.social-badge:hover {
  transform: scale(1.05);
}

.social-badge svg {
  fill: #fff;
  width: 18px;
  height: 18px;
}


/* Contact Form */
.contact-container {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition-speed);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* Profile Table */
.profile-table {
  width: 100%;
  max-width: 800px;
  margin: 3rem auto 0;
  border-collapse: collapse;
  text-align: left;
}

.profile-table th, .profile-table td {
  padding: 1.2rem;
  border-bottom: 1px solid var(--border-color);
}

.profile-table th {
  width: 30%;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

.profile-table td {
  font-size: 1rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Mobile Responsiveness --- */

/* Hamburger Button */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  width: 44px;
  height: 44px;
  position: relative;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  margin: 5px auto;
  transition: all var(--transition-speed);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  /* Hamburger Animation */
  .mobile-menu-toggle.is-active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .mobile-menu-toggle.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-toggle.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .header-container {
    padding: 1rem 1.5rem;
  }

  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--bg-primary);
    box-shadow: -4px 0 16px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
  }

  nav.is-active {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    width: 100%;
  }

  nav a {
    font-size: 1.2rem;
  }

  /* Hero Section */
  .hero {
    min-height: 60vh;
    padding: 4rem 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }

  .hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }

  /* Containers & Spacing */
  .container {
    padding: 3rem 1.5rem;
  }

  .section-title {
    font-size: 1.6rem;
    margin-bottom: 2rem;
  }

  .app-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .app-card {
    padding: 1.5rem;
  }

  /* Detail Pages */
  .detail-section {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .detail-section h2 {
    font-size: 1.4rem;
  }

  .app-header h1 {
    font-size: 2.2rem;
  }

  .app-header p {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .tabs {
    gap: 0.5rem;
  }

  .tab-btn {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }

  /* Profile Table */
  .profile-table th {
    width: 40%;
    padding: 1rem 0.5rem;
  }

  .profile-table td {
    padding: 1rem 0.5rem;
  }

  /* Footer */
  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
  }

  /* App Detail Specifics */
  .app-detail-hero .lead {
    font-size: 1rem;
    line-height: 1.5;
  }
  
  .app-detail-hero .tagline {
    font-size: 0.9rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Profile Table Mobile Flip */
  .profile-table {
    display: block;
  }

  .profile-table tr {
    display: grid;
    grid-template-columns: 1fr;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
  }

  .profile-table th, .profile-table td {
    display: block;
    width: 100% !important;
    padding: 0.25rem 0;
    border: none;
  }

  .profile-table th {
    font-size: 0.8rem;
    color: var(--text-secondary);
  }

  /* Form spacing on mobile */
  .contact-container {
    padding: 0;
  }

  /* Inline utility overrides */
  div[style*="padding: 2rem"], div[style*="padding: 3rem"] {
    padding: 1.5rem !important;
  }
}
