/* css/style.css */

/* ===========================
   CSS Variables / Design Tokens
   =========================== */
:root {
    --color-primary:      hsl(215, 70%, 45%);
    --color-primary-dark: hsl(215, 70%, 35%);
    --color-primary-light:hsl(215, 70%, 55%);
    --color-accent:       hsl(200, 80%, 50%);
    --color-success:      hsl(145, 55%, 40%);
    --color-warning:      hsl(40,  90%, 50%);
    --color-danger:       hsl(355, 70%, 50%);

    --color-bg:           #ffffff;
    --color-bg-soft:      #f7f9fc;
    --color-bg-muted:     #eef2f7;
    --color-border:       #dde3ed;
    --color-text:         #1a2332;
    --color-text-muted:   #5a6a80;
    --color-text-light:   #8496ad;

    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-xl:  16px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);

    --nav-height: 60px;
    --sidebar-width: 220px;
    --content-max: 1100px;

    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-dark); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; color: var(--color-text); }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; color: var(--color-text-muted); }

p { margin-bottom: 0.9em; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.3em; }

code {
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 0.875em;
    background: var(--color-bg-muted);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    color: hsl(215, 60%, 35%);
}

pre {
    background: hsl(215, 20%, 15%);
    color: hsl(210, 15%, 88%);
    padding: 1rem 1.2rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0.8rem 0 1.2rem;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

del { color: var(--color-text-light); }

dl dt { font-weight: 600; margin-top: 0.8em; }
dl dd { margin-left: 1.2em; margin-bottom: 0.4em; color: var(--color-text-muted); }

img { max-width: 100%; height: auto; }

/* ===========================
   Navigation
   =========================== */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-brand:hover { color: var(--color-primary-dark); text-decoration: none; }
.nav-brand .brand-icon {
    width: 28px; height: 28px;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.8rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}
.nav-links a {
    display: block;
    padding: 0.35rem 0.7rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.nav-links a:hover { background: var(--color-bg-muted); color: var(--color-text); text-decoration: none; }

.nav-dl-btn {
    margin-left: auto;
    flex-shrink: 0;
}

/* ===========================
   Buttons
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.5em 1.1em;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    border: 1.5px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: white;
    box-shadow: 0 4px 12px hsla(215,70%,45%,0.35);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-outline:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
}

.btn-ghost {
    background: rgba(255,255,255,0.12);
    color: white;
    border-color: rgba(255,255,255,0.35);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.22);
    color: white;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.3em 0.75em;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75em 1.6em;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* ===========================
   Hero / Jumbotron
   =========================== */
.hero {
    background: linear-gradient(135deg, hsl(355, 65%, 22%) 0%, hsl(345, 55%, 18%) 60%, hsl(25, 60%, 16%) 100%);
    color: white;
    padding: 5rem 1.5rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;

    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero::after {
    content: '';
    position: absolute;
    top: -20%; left: -10%;
    width: 60%; height: 80%;
    background: radial-gradient(circle, hsla(40, 90%, 50%, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero-inner {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    z-index: 2;
}
.hero h1 {
    color: #ffffff;
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.hero-lead {
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 2.5rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.hero-lead strong {
    color: hsl(42, 95%, 65%);
    font-weight: 700;
}
.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.hero .btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: hsl(42, 90%, 75%);
    border-color: hsla(42, 80%, 60%, 0.4);
}
.hero .btn-ghost:hover {
    background: hsla(42, 80%, 60%, 0.15);
    color: hsl(42, 95%, 80%);
    border-color: hsla(42, 90%, 65%, 0.7);
    transform: translateY(-1px);
}
.hero-twitter {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}
.hero-twitter a { 
    color: hsl(42, 90%, 75%); 
    transition: color 0.2s ease;
}
.hero-twitter a:hover { 
    color: #ffffff; 
    text-decoration: underline;
}

.logo-win, .logo-merge {
    font-weight: 800;
    font-family: sans-serif;
    display: inline-block;
    position: relative;
}

.logo-win {
    background: linear-gradient(to bottom, #444, #000);
    -webkit-background-clip: text;
    color: transparent;
}

.logo-merge {
    background: linear-gradient(to bottom, #d32f2f, #8b0000);
    -webkit-background-clip: text;
    color: transparent;
}

.logo-win::after, .logo-merge::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    -webkit-text-stroke: 4px #fff;
    color: #fff;
}

.subtitle {
    font-size: .65em;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* ===========================
   Layout: sidebar + content
   =========================== */
.layout {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 3rem;
    align-items: start;
}

/* ===========================
   Sidebar Navigation
   =========================== */
.sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 1.5rem);
}
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav li { margin: 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    border-left: 2px solid transparent;
}
.sidebar-nav a:hover {
    background: var(--color-bg-soft);
    color: var(--color-text);
    text-decoration: none;
}
.sidebar-nav a.active {
    background: hsl(215, 70%, 95%);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    font-weight: 600;
}
.sidebar-nav i { width: 1.1em; text-align: center; font-size: 0.85em; }

/* ===========================
   Main Content
   =========================== */
.main-content {
    min-width: 0;
}

/* ===========================
   Section
   =========================== */
section {
    padding-top: 1.5rem;
    margin-bottom: 3.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1.5rem;
}
.section-header h2 {
    font-size: 1.4rem;
}
.section-header i {
    color: var(--color-primary);
    font-size: 1.1rem;
}

/* ===========================
   Download Tables
   =========================== */
.dl-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.dl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.dl-table caption {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--color-bg-soft);
    border-bottom: 1px solid var(--color-border);
    caption-side: top;
}

.dl-table thead th {
    background: var(--color-bg-soft);
    padding: 0.6rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
}

.dl-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
}
.dl-table tbody tr:last-child { border-bottom: none; }
.dl-table tbody tr:hover { background: var(--color-bg-soft); }

.dl-table td {
    padding: 0.65rem 1rem;
    vertical-align: middle;
}

/* Row type badges */
.dl-table tr.row-stable td {
    background: hsl(145, 55%, 97%);
    color: hsl(145, 55%, 30%);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.dl-table tr.row-prerelease td {
    background: hsl(40, 90%, 97%);
    color: hsl(35, 80%, 35%);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.dl-table tr.row-old td {
    background: hsl(210, 40%, 97%);
    color: hsl(210, 40%, 40%);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* version badge */
.version-badge {
    display: inline-block;
    font-family: 'Consolas', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    background: hsl(215, 70%, 94%);
    padding: 0.15em 0.5em;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* Download dropdown */
.dl-dropdown {
    position: relative;
    display: inline-block;
}
.dl-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.35em 0.75em;
    background: var(--color-bg);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--color-text);
}
.dl-dropdown-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: hsl(215, 70%, 98%);
}
.dl-dropdown-toggle i.chevron {
    font-size: 0.7em;
    transition: transform var(--transition);
}
.dl-dropdown.open .dl-dropdown-toggle i.chevron { transform: rotate(180deg); }

.dl-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 280px;
    background: white;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    padding: 0.4rem 0;
    animation: dropIn 0.15s ease;
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dl-dropdown.open .dl-dropdown-menu { display: block; }

.dl-dropdown-menu .menu-header {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-light);
    padding: 0.5rem 0.9rem 0.25rem;
}
.dl-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    color: var(--color-text);
    transition: background var(--transition), color var(--transition);
}
.dl-dropdown-menu a:hover {
    background: var(--color-bg-soft);
    color: var(--color-primary);
    text-decoration: none;
}
.dl-dropdown-menu .menu-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0.4rem 0;
}

/* Virus total link styling */
.dl-dropdown-menu a.virustotal {
    color: var(--color-text-muted);
    font-size: 0.78rem;
}
.dl-dropdown-menu a.virustotal:hover { color: var(--color-primary); }

/* Simple link button (no dropdown) */
.dl-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.35em 0.75em;
    background: var(--color-bg);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    transition: all var(--transition);
}
.dl-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    text-decoration: none;
}

/* ===========================
   Screenshots Grid
   =========================== */
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.screenshot-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1.5px solid var(--color-border);
    background: var(--color-bg-soft);
    transition: box-shadow var(--transition), transform var(--transition);
}
.screenshot-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.screenshot-item a {
    display: block;
    overflow: hidden;
}
.screenshot-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.screenshot-item:hover img { transform: scale(1.04); }
.screenshot-item h4 {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--color-text);
    text-align: center;
}

/* ===========================
   History / Changelog
   =========================== */
.history-entry {
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.history-entry-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    background: var(--color-bg-soft);
    cursor: pointer;
    user-select: none;
}
.history-entry-header:hover { background: var(--color-bg-muted); }
.history-version {
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}
.history-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.history-toggle {
    margin-left: auto;
    color: var(--color-text-light);
    font-size: 0.8rem;
    transition: transform var(--transition);
}
.history-entry.open .history-toggle { transform: rotate(180deg); }
.history-body {
    padding: 1rem 1.25rem;
    display: none;
    border-top: 1px solid var(--color-border);
}
.history-entry.open .history-body { display: block; }
.history-body h4 {
    margin-top: 0.9rem;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}
.history-body h4:first-child { margin-top: 0; }
.history-body ul {
    margin-bottom: 0.5rem;
}
.history-body li {
    font-size: 0.875rem;
    line-height: 1.65;
    margin-bottom: 0.3em;
}

/* Show more button */
.show-more-section {
    text-align: center;
    margin-top: 1rem;
}
.history-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

/* Collapsed older entries */
.history-older {
    display: none;
}
.history-older.visible {
    display: block;
}

/* ===========================
   Info section (jpver, 3way, etc.)
   =========================== */
.info-card {
    background: var(--color-bg-soft);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
.info-card h3 {
    margin-bottom: 0.75rem;
    color: var(--color-primary-dark);
    font-size: 1rem;
}

/* ===========================
   Alerts / badges
   =========================== */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    border-left: 3px solid;
}
.alert-warning {
    background: hsl(40,90%,97%);
    border-color: var(--color-warning);
    color: hsl(35,80%,30%);
}

/* ===========================
   Contact form area
   =========================== */
.contact-responses {
    background: var(--color-bg-soft);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
    background: var(--color-bg-soft);
    border-top: 1px solid var(--color-border);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.82rem;
}
.site-footer a { color: var(--color-text-muted); }
.site-footer a:hover { color: var(--color-primary); }

/* ===========================
   Responsive
   =========================== */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .hero { padding: 3rem 1rem 2.5rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .screenshots-grid { grid-template-columns: 1fr 1fr; }
    .nav-links { display: none; }
}

/* ===========================
   Histry page
   =========================== */

.history-archive-list {
    list-style: none;
    padding: 0;
}
.history-archive-list h3 {
    font-family: 'Consolas', monospace;
    font-size: 1.1rem;
    color: var(--color-primary);
    border-bottom: 1px dashed var(--color-border);
    padding-bottom: 0.3rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
}
.history-archive-list h3 .archive-date {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: normal;
}
.history-archive-list ul {
    margin-bottom: 1.5rem;
    padding-left: 1.2rem;
}
.history-archive-list li {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}
