/* ============================================
   Analog Grand Prix - Shared Stylesheet
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #0A0E1A;
  --bg-secondary: #111827;
  --bg-card: #1A1F2E;
  --bg-card-hover: #242A3D;
  --gold-primary: #C9A84C;
  --gold-light: #E8D48B;
  --gold-dark: #8B7332;
  --text-primary: #F5F5F0;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --tier-gold: #C9A84C;
  --tier-silver: #C0C0C0;
  --tier-blue: #7C93C3;
  --tier-bronze: #CD7F32;
  --border-subtle: #2D3348;
  --border-gold: rgba(201, 168, 76, 0.3);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-primary); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--gold-light); }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: 'Noto Serif JP', serif; line-height: 1.3; }

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
section { padding: 80px 0; }

/* --- Navigation --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.nav.scrolled {
  background: rgba(10, 14, 26, 0.95);
  border-bottom-color: var(--border-subtle);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo { height: 36px; width: auto; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  color: var(--text-secondary); font-size: 0.85rem; letter-spacing: 0.05em;
  transition: color 0.3s; position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold-primary); }
.nav-links a.active::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: var(--gold-primary); border-radius: 1px;
}

/* Year switcher */
.year-switcher { display: flex; gap: 8px; margin-left: 24px; }
.year-switcher a, .year-switcher span {
  padding: 6px 16px; border-radius: 4px; font-size: 0.9rem;
  font-family: 'Noto Sans JP', sans-serif; font-weight: 500;
  border: 1px solid var(--text-muted); color: var(--text-primary);
  transition: all 0.3s; display: inline-block; text-align: center;
}
.year-switcher .active {
  background: var(--gold-primary); color: var(--bg-primary);
  border-color: var(--gold-primary); font-weight: 700;
}
.year-switcher a:hover { border-color: var(--gold-primary); color: var(--gold-primary); }

/* Mobile menu */
.hamburger {
  display: none; flex-direction: column; gap: 5px; cursor: pointer;
  background: none; border: none; padding: 8px;
}
.hamburger span {
  display: block; width: 24px; height: 2px; background: var(--text-primary);
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
  display: none; position: fixed; top: 64px; left: 0; right: 0;
  background: rgba(10, 14, 26, 0.98); padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
  flex-direction: column; gap: 16px;
}
.mobile-menu.open { display: flex; }
.mobile-menu > a { color: var(--text-secondary); font-size: 1rem; padding: 8px 0; }
.mobile-menu > a:hover { color: var(--gold-primary); }
.mobile-menu .year-switcher { margin-top: 8px; }
.mobile-menu .year-switcher a {
  color: var(--text-primary); font-size: 0.9rem; padding: 6px 16px;
  border: 1px solid var(--text-muted);
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links { display: none; }
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; text-align: center;
  padding: 120px 24px 80px;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 600px 600px at 20% 50%, rgba(201, 168, 76, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 80% 30%, rgba(201, 168, 76, 0.05) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}
.hero-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(201, 168, 76, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
}
.hero-content { position: relative; z-index: 1; }
.hero-logo { max-width: 520px; width: 80%; margin: 0 auto 32px; }
.hero-title {
  font-size: 1.5rem; font-weight: 400; letter-spacing: 0.15em;
  margin-bottom: 16px;
}
.hero-subtitle { color: var(--text-secondary); font-size: 0.95rem; letter-spacing: 0.1em; }
.hero-line {
  width: 60px; height: 1px; margin: 32px auto;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}
.scroll-indicator {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  color: var(--text-muted); font-size: 0.7rem; letter-spacing: 0.2em;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-dot {
  width: 4px; height: 4px; border-radius: 50%; background: var(--gold-primary);
  animation: bounce-down 1.5s ease-in-out infinite;
}

/* --- Section Heading --- */
.section-heading { text-align: center; margin-bottom: 48px; }
.section-heading h2 {
  font-size: 2rem; letter-spacing: 0.1em; margin-bottom: 12px;
}
.section-heading .subtitle {
  color: var(--text-secondary); font-size: 0.85rem; letter-spacing: 0.15em;
  text-transform: uppercase;
}
.section-heading .deco-line {
  width: 40px; height: 1px; margin: 16px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

/* --- Gold Text Utilities --- */
.gold-shimmer {
  background: linear-gradient(90deg, var(--gold-dark) 0%, var(--gold-light) 50%, var(--gold-dark) 100%);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gold-gradient-text {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-light) 50%, var(--gold-primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; padding-bottom: 0.1em;
}

/* --- Gold Divider --- */
.gold-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin: 48px 0;
}
.gold-divider .line {
  flex: 1; max-width: 120px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold));
}
.gold-divider .line:last-child {
  background: linear-gradient(90deg, var(--border-gold), transparent);
}
.gold-divider .diamond {
  width: 6px; height: 6px; background: var(--gold-primary);
  transform: rotate(45deg); opacity: 0.6;
}

/* --- About / Stats --- */
.about { background: var(--bg-secondary); }
.about-text { max-width: 720px; margin: 0 auto 48px; text-align: center; color: var(--text-secondary); font-size: 0.95rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat-card {
  text-align: center; padding: 32px 16px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 8px; transition: border-color 0.3s, transform 0.3s;
}
.stat-card:hover { border-color: var(--border-gold); transform: translateY(-4px); }
.stat-value { font-family: 'Noto Serif JP', serif; font-size: 2.5rem; color: var(--gold-primary); margin-bottom: 8px; }
.stat-label { color: var(--text-secondary); font-size: 0.85rem; }

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

/* --- Award Section --- */
.award-group { margin-bottom: 64px; }
.award-group-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 32px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border-subtle);
}
.award-group-logo { height: 100px; width: auto; }
.award-group-title { font-size: 1.3rem; color: var(--gold-primary); }

/* Product Card Grid */
.products-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
@media (max-width: 1024px) { .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .products-grid { grid-template-columns: 1fr; } }

/* Product Card */
.product-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 8px; overflow: hidden;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.product-card:hover {
  border-color: var(--border-gold); transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(201, 168, 76, 0.1);
}
.product-card-img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  cursor: pointer;
  transition: opacity 0.3s;
}
.product-card-img.contain {
  object-fit: contain; background: #161b2e; padding: 12px;
}
.product-card-img:hover { opacity: 0.9; }
.product-card-body { padding: 16px; }
.product-card-genre {
  display: inline-block; font-size: 0.7rem; color: var(--text-secondary);
  background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 4px;
  margin-bottom: 8px;
}
.product-card-name {
  font-family: 'Noto Serif JP', serif; font-size: 1rem; font-weight: 600;
  margin-bottom: 4px; color: var(--text-primary);
}
.product-card-maker { color: var(--gold-primary); font-size: 0.85rem; margin-bottom: 8px; }
.product-card-price { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 4px; }
.product-card-distributor { color: var(--text-muted); font-size: 0.75rem; }
.product-card-desc {
  color: var(--text-secondary); font-size: 0.8rem; line-height: 1.8;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Multi-image thumbnails */
.product-card-images { display: flex; gap: 4px; }
.product-card-images img {
  flex: 1; aspect-ratio: 1/1; object-fit: cover;
  cursor: pointer; border-radius: 4px;
}

/* Featured card (single product categories) */
.product-card.featured {
  grid-column: 1 / -1; display: grid;
  grid-template-columns: 1fr 1fr; gap: 0;
}
.product-card.featured .product-card-img { aspect-ratio: auto; height: 100%; }
@media (max-width: 600px) {
  .product-card.featured { grid-template-columns: 1fr; }
}

/* --- Award Badge --- */
.award-badge {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.badge-gold { background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary), var(--gold-light)); color: var(--bg-primary); }
.badge-bestcp { background: rgba(192, 192, 192, 0.15); color: var(--tier-silver); border: 1px solid rgba(192, 192, 192, 0.3); }
.badge-special-dev { background: rgba(124, 147, 195, 0.15); color: var(--tier-blue); border: 1px solid rgba(124, 147, 195, 0.3); }
.badge-special { background: rgba(205, 127, 50, 0.15); color: var(--tier-bronze); border: 1px solid rgba(205, 127, 50, 0.3); }
.badge-grandprix { background: rgba(201, 168, 76, 0.15); color: var(--gold-primary); border: 1px solid var(--border-gold); }
.badge-accessory { background: rgba(205, 127, 50, 0.1); color: var(--tier-bronze); border: 1px solid rgba(205, 127, 50, 0.2); }

/* --- Categories --- */
.categories-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 768px) { .categories-grid { grid-template-columns: repeat(2, 1fr); } }
.category-card {
  text-align: center; padding: 32px 16px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 8px; transition: border-color 0.3s, transform 0.3s;
}
.category-card:hover { border-color: var(--border-gold); transform: translateY(-4px); }
.category-icon { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--gold-primary); }
.category-icon svg { width: 100%; height: 100%; fill: currentColor; }
.category-name { font-size: 0.9rem; color: #ffffff; margin-bottom: 4px; }
.category-desc { font-size: 0.75rem; color: #ffffff; }

/* --- Judges --- */
.judges-section { background: var(--bg-secondary); }
.judges-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  max-width: 900px; margin: 0 auto;
}
.judge-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 8px; overflow: hidden; text-align: center;
  transition: border-color 0.3s;
}
.judge-card:hover { border-color: var(--border-gold); }
.judge-card-photo {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: top;
}
.judge-card-body { padding: 12px; }
.judge-card-role {
  font-size: 0.65rem; color: var(--gold-primary); letter-spacing: 0.08em;
  font-weight: 600; margin-bottom: 4px;
}
.judge-card-name { font-family: 'Noto Serif JP', serif; font-size: 1rem; margin-bottom: 6px; }
.judge-card-bio { color: var(--text-secondary); font-size: 0.72rem; line-height: 1.7; }

@media (max-width: 768px) {
  .judges-grid { grid-template-columns: repeat(2, 1fr) !important; max-width: 100%; }
}

/* --- Voting Stores --- */
.stores-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) { .stores-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stores-grid { grid-template-columns: 1fr; } }
.store-card {
  padding: 16px; background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 8px; transition: border-color 0.3s;
}
.store-card:hover { border-color: var(--border-gold); }
.store-name { font-size: 0.9rem; color: var(--text-primary); margin-bottom: 4px; }
.store-pref { font-size: 0.75rem; color: var(--text-muted); }

/* --- History / Timeline --- */
.timeline { position: relative; max-width: 800px; margin: 0 auto; }
.timeline::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 1px; background: var(--border-subtle); transform: translateX(-50%);
}
.timeline-item {
  position: relative; padding: 0 0 48px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
}
.timeline-item:nth-child(odd) .timeline-content { grid-column: 1; text-align: right; }
.timeline-item:nth-child(odd) .timeline-spacer { grid-column: 2; }
.timeline-item:nth-child(even) .timeline-spacer { grid-column: 1; }
.timeline-item:nth-child(even) .timeline-content { grid-column: 2; }
.timeline-dot {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold-primary); border: 2px solid var(--bg-primary);
  z-index: 1;
}
.timeline-year {
  font-family: 'Noto Serif JP', serif; font-size: 1.5rem;
  color: var(--gold-primary); margin-bottom: 4px;
}
.timeline-issue { color: var(--text-secondary); font-size: 0.75rem; margin-bottom: 8px; }
.timeline-title { font-size: 1rem; margin-bottom: 8px; }
.timeline-desc { color: var(--text-secondary); font-size: 0.85rem; }

@media (max-width: 768px) {
  .timeline::before { left: 20px; }
  .timeline-item { grid-template-columns: 1fr; padding-left: 48px; }
  .timeline-item .timeline-content { grid-column: 1 !important; text-align: left !important; }
  .timeline-item .timeline-spacer { display: none; }
  .timeline-dot { left: 20px; }
}

/* --- Footer --- */
.footer { background: var(--bg-secondary); border-top: 1px solid var(--border-subtle); padding: 48px 0 24px; }
.footer-row {
  display: flex; align-items: center; justify-content: center;
  gap: 32px; flex-wrap: wrap; margin-bottom: 32px;
  color: var(--text-secondary); font-size: 0.85rem;
}
.footer-row a { color: var(--gold-primary); }
.footer-row .sep { color: var(--border-subtle); }
.footer-bottom { text-align: center; padding-top: 24px; border-top: 1px solid var(--border-subtle); }
.footer-logo-ongen { height: 32px; width: auto; margin: 0 auto 12px; display: block; }
.footer-copyright { color: var(--text-muted); font-size: 0.75rem; }

/* --- Keyframe Animations --- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
@keyframes pulse-gold {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}
@keyframes glow-line {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Scroll Reveal --- */
[data-reveal] {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].revealed { opacity: 1; transform: translateY(0); }
[data-reveal="left"] { transform: translateX(-30px); }
[data-reveal="left"].revealed { transform: translateX(0); }
[data-reveal="right"] { transform: translateX(30px); }
[data-reveal="right"].revealed { transform: translateX(0); }
[data-reveal="scale"] { transform: scale(0.95); }
[data-reveal="scale"].revealed { transform: scale(1); }

/* --- 2025 Text-Only Product Cards (no images) --- */
.product-card-text {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: 20px;
  transition: border-color 0.3s, transform 0.3s;
  position: relative;
}
.product-card-text:hover {
  border-color: var(--border-gold); transform: translateY(-4px);
}
.product-card-text::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: linear-gradient(90deg, var(--gold-dark), var(--gold-primary), var(--gold-light));
  opacity: 0; transition: opacity 0.3s;
}
.product-card-text:hover::after { opacity: 1; }

/* --- Filter Tabs (2025) --- */
.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 32px; }
.filter-tab {
  padding: 6px 16px; border-radius: 20px; font-size: 0.8rem;
  border: 1px solid var(--border-subtle); color: var(--text-secondary);
  background: transparent; cursor: pointer; transition: all 0.3s;
}
.filter-tab:hover { border-color: var(--gold-primary); color: var(--gold-primary); }
.filter-tab.active { background: var(--gold-primary); color: var(--bg-primary); border-color: var(--gold-primary); font-weight: 700; }
