/* === VOA - 無駄のない美しさ === */

:root {
    --black: #111;
    --gray: #555;
    --lightgray: #f5f5f5;
    --light: #e5e5e5;
    --bg: #fff;
}

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

/* Base */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    line-height: 1.8;
    color: var(--black);
    background: var(--bg);
    max-width: 720px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem 2rem;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
header {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: center;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--black);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-color: #fdfdfd;
    background-image:
        linear-gradient(var(--light) 1px, transparent 1px),
        linear-gradient(90deg, var(--light) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: center top;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.03), transparent 60%);
    z-index: -1;
    pointer-events: none;
}

/* Main Content */
main h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

main>p:first-of-type {
    color: var(--gray);
    margin-bottom: 3rem;
}

/* Article List */
h2 {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.articles {
    list-style: none;
}

.articles li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--light);
}

.articles li:first-child {
    border-top: 1px solid var(--light);
}

.articles time {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 0.25rem;
}

.articles a {
    font-weight: 500;
}

.small {
    font-size: 0.9rem;
}

/* Article Page */
article time {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

article h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.4;
}

article h2 {
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: var(--black);
    margin: 4rem 0 1rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--black);
}

article h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

article p {
    margin-bottom: 1rem;
}

article strong {
    font-weight: 600;
}

/* Paper Metadata */
.lead {
    font-size: 0.9rem;
    color: var(--gray);
}

/* Tables */
table {
    width: 100%;
    border: 1px solid var(--light);
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 1rem;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--light);
}

th {
    font-weight: 600;
    background: var(--lightgray);
}

tr:last-child td {
    border-bottom: none;
}

/* Stat Box */
.stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 2rem;
    padding: 0.6rem 0;
    margin: 1.2rem 0;
    border: 1px solid var(--light);
}

.stats>div {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.stats dt {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
}

.stats dd {
    font-weight: 600;
}

/* Callout Boxes */
.callout {
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--lightgray);
    font-size: 0.95rem;
}

.callout ul {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

.callout li {
    margin-bottom: 0.25rem;
}

/* Code Block */
.code-block {
    background: var(--bg);
    color: var(--black);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border: 1px solid var(--light);
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.7;
    font-family: 'Latin Modern Mono', 'Courier New', Consolas, monospace;
    white-space: pre;
}

.code-block code {
    font-family: inherit;
    font-weight: 600;
    background: none;
    padding: 0;
}

/* References */
.references {
    font-size: 0.9rem;
    line-height: 1.6;
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.references li {
    margin-bottom: 0.5rem;
    color: var(--gray);
}

.references em {
    font-style: italic;
}

/* Scientific Notation */
article sub,
article sup {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

article sup {
    top: -0.5em;
}

article sub {
    bottom: -0.25em;
}

/* Inline Code */
article code {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9em;
    background: #f4f4f4;
    padding: 0.1em 0.3em;
    border-radius: 2px;
}

/* Math Typography - Handled by KaTeX */
.equation {
    text-align: center;
    overflow-x: auto;
    padding: 0.1rem 0;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light);
    font-size: 0.75rem;
    text-align: center;
    color: var(--gray);
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 1.5rem 1rem;
    }

    main h1,
    article h1 {
        font-size: 1.25rem;
    }

    table {
        font-size: 0.875rem;
    }

    th,
    td {
        padding: 0.5rem;
    }
}