/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark Mode Colors */
    --bg-primary: #0a0e27;
    --bg-secondary: #151932;
    --bg-tertiary: #1e2239;
    --bg-card: #1a1f3a;
    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-gold: #fbbf24;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #2d3350;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
}

/* Utility Classes */
.gradient-text {
    color: var(--accent-primary);
    background: var(--gradient-2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header and Navigation */
header {
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.navbar {
    padding: 1.2rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
    font-weight: 800;
}

/* Apply gradient text effect - using utility for reusability */
.logo h1 {
    color: var(--accent-primary);
    background: var(--gradient-2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo .subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-menu a:hover {
    color: var(--accent-primary);
}

.nav-menu a.active {
    color: var(--accent-primary);
}

.nav-menu a.active::after,
.nav-menu a:hover::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-2);
}

/* Hero Section */
.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
    animation: pulse 4s ease-in-out infinite;
    will-change: opacity;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    padding: 2rem;
}

.hero h2 {
    font-size: 4rem;
    margin-bottom: 1rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--accent-primary);
    background: var(--gradient-2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInDown 1s ease;
}

.hero-subtitle {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 300;
    animation: fadeInUp 1s ease 0.2s both;
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
    animation: fadeIn 1s ease 0.4s both;
}

.tagline-ja {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    animation: fadeIn 1s ease 0.6s both;
}

.cta-button {
    display: inline-block;
    background: var(--gradient-2);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
    animation: fadeIn 1s ease 0.8s both;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.6);
}

/* Sections */
.section {
    padding: 100px 24px;
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title .en {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
    background: var(--gradient-2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title .ja {
    display: block;
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.alt-bg {
    background: var(--bg-secondary);
}

/* Philosophy Section */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.philosophy-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.philosophy-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 12px 32px rgba(0, 212, 255, 0.2);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.philosophy-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.philosophy-card .jp {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.philosophy-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* States Section */
.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.state-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.state-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.2);
}

.state-card.featured {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(0, 212, 255, 0.1) 100%);
    border: 2px solid var(--accent-primary);
}

.state-rank {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-gold);
    color: var(--bg-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
}

.state-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.state-population {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.state-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.state-badge {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    border: 1px solid var(--border-color);
}

/* Railway Section */
.railway-intro {
    text-align: center;
    margin-bottom: 4rem;
}

.large-text {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.large-text-ja {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.railway-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.railway-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.railway-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
}

.gauge-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.gauge-item {
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border-left: 4px solid var(--accent-primary);
}

.gauge-item strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.gauge-spec {
    display: inline-block;
    background: var(--accent-secondary);
    color: white;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.railway-card ul {
    list-style: none;
    padding-left: 0;
}

.railway-card ul li {
    padding: 0.8rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.railway-card ul li:last-child {
    border-bottom: none;
}

.operator-types {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.badge {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.railway-standards {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.railway-standards h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.railway-standards code {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
}

.standards-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.standard-link {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 14px 28px;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    font-weight: 600;
}

.standard-link:hover {
    background: var(--accent-secondary);
    color: white;
    border-color: var(--accent-secondary);
    transform: translateY(-2px);
}

/* Participate Section */
.participate-content {
    max-width: 1000px;
    margin: 0 auto;
}

.participate-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.participate-card.primary-cta {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(0, 212, 255, 0.15) 100%);
    border: 2px solid var(--accent-primary);
}

.participate-card h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

.participate-card .jp {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.participate-card ol {
    color: var(--text-secondary);
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.participate-card ol li {
    padding: 0.5rem 0;
}

.participate-card code {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-primary {
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.6);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

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

/* Organization Info */
.org-info {
    background: var(--bg-primary);
    text-align: center;
}

.org-desc {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.org-link {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    color: var(--accent-primary);
    text-decoration: none;
    padding: 1.5rem 3rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 2px solid var(--accent-primary);
    margin-bottom: 3rem;
    transition: all 0.3s ease;
}

.org-link:hover {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

.org-icon {
    font-size: 2rem;
}

.repo-structure {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.repo-structure h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-primary);
}

.repo-list {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.repo-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.repo-item:last-child {
    border-bottom: none;
}

.repo-icon {
    font-size: 1.5rem;
}

.repo-item code {
    font-family: 'Courier New', monospace;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 1rem;
}

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

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 4rem 24px 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.footer-section p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.footer-tagline {
    font-style: italic;
    color: var(--text-muted);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin: 0.8rem 0;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.footer-bottom p {
    margin: 0.5rem 0;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .nav-menu a {
        font-size: 0.9rem;
    }

    .hero h2 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .section-title .en {
        font-size: 2rem;
    }

    .philosophy-grid,
    .states-grid,
    .railway-grid,
    .participate-grid {
        grid-template-columns: 1fr;
    }

    .repo-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .repo-desc {
        grid-column: 1 / -1;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .cta-button {
        padding: 14px 28px;
        font-size: 1rem;
    }

    .section {
        padding: 60px 20px;
    }
}
