/* ==========================================================================
   Tsubusu (潰す) - Official Web Site Styling
   Clean, modern, accessible, responsive design system
   ========================================================================== */

:root {
  --primary: #00897b;
  --primary-hover: #00796b;
  --primary-light: #e0f2f1;
  --primary-dark: #004d40;
  
  --accent-gold: #f59e0b;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-card-hover: #fafafa;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --border-color: #e2e8f0;
  --border-focus: #00897b;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-main: #0b1120;
    --bg-surface: #131d31;
    --bg-subtle: #1e293b;
    --bg-card-hover: #1a253c;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-color: #27354f;
    --primary-light: #004d40;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  }
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navbar */
.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), #26a69a);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

.lang-switch {
  display: flex;
  align-items: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 2px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.lang-btn {
  background: none;
  border: none;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.lang-btn.active {
  background-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* Main Content */
main {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  .badge {
    color: #80cbc4;
  }
}

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

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
  border-color: var(--text-muted);
}

/* Interactive Demo Card */
.demo-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2.5rem auto;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
}

.demo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.demo-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-instruction {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.todo-item:hover {
  background-color: var(--bg-card-hover);
  transform: translateX(2px);
}

.todo-box-wrap {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.todo-box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  background-color: var(--bg-surface);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.todo-box svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transition: opacity 0.2s;
  color: white;
}

/* Squeeze (Tsubusu) animation effect */
.todo-item.completed .todo-box {
  background-color: var(--primary);
  border-color: var(--primary);
  height: 4px; /* Squeezed to ~15% height */
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(0, 137, 123, 0.4);
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Star Burst particles */
.star-particles {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.star-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: var(--accent-gold);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  opacity: 0;
}

@keyframes popStar {
  0% {
    transform: translate(-50%, -50%) translate(0, 0) scale(0) rotate(0deg);
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) scale(1.4) rotate(180deg);
    opacity: 0;
  }
}

.star-particles.animate .star-particle {
  animation: popStar 0.4s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

/* Content Pages (Privacy & Support) */
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.content-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.highlight-box {
  background-color: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

@media (prefers-color-scheme: dark) {
  .highlight-box {
    background-color: rgba(0, 137, 123, 0.15);
  }
}

.highlight-box h3 {
  color: var(--primary);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.highlight-box p {
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title:first-child {
  margin-top: 0;
}

.content-text {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1rem;
}

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

.feature-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  display: block;
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Contact Details Card */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.contact-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.contact-card-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.contact-card-value a {
  color: var(--primary);
  text-decoration: none;
}

.contact-card-value a:hover {
  text-decoration: underline;
}

/* FAQ Accordion / Item */
.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  background-color: var(--bg-surface);
  overflow: hidden;
}

.faq-question {
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  background-color: var(--bg-surface);
  transition: background-color var(--transition-fast);
}

.faq-question:hover {
  background-color: var(--bg-subtle);
}

.faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Footer */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* Utility for language switching */
.lang-content-ja {
  display: none;
}

body.lang-ja .lang-content-en {
  display: none;
}

body.lang-ja .lang-content-ja {
  display: block;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .nav-bar {
    height: auto;
    padding: 0.75rem 0;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .nav-links {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .content-card {
    padding: 1.5rem;
  }
  
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
