:root {
    --bg: #f5f2eb;
    --surface: #edeae1;
    --card: #ffffff;
    --ink: #1a1814;
    --ink2: #4a4640;
    --ink3: #7a7570;
    --accent: #c0392b;
    --accent2: #2563a8;
    --accent3: #1a7a40;
    --border: #d5d0c5;
    --code-bg: #1e1c18;
    --code-text: #e8e4dc;
    --mono: 'JetBrains Mono', monospace;
    --serif: 'Shippori Mincho', serif;
    --sans: 'Noto Sans JP', sans-serif;
    --tag-html: #c0392b;
    --tag-css: #2563a8;
    --tag-js: #a0720a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.75;
    font-size: 14px;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--ink);
    color: #ccc;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 32px 0;
}

.sidebar-logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
}

.sidebar-logo span {
    font-family: var(--mono);
    font-size: 11px;
    color: #888;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 4px;
}

.sidebar-logo strong {
    font-family: var(--serif);
    font-size: 18px;
    color: #fff;
    font-weight: 700;
}

.sidebar-logo a {
    text-decoration: none;
    color: inherit;
}

.nav-group {
    margin-bottom: 8px;
}

.nav-group-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 3px;
    color: #777;
    text-transform: uppercase;
    padding: 8px 24px 4px;
}

.nav-group-label a {
    color: inherit;
    text-decoration: none;
}

.nav-group>a {
    display: block;
    padding: 6px 24px;
    color: #999;
    text-decoration: none;
    font-size: 13px;
    transition: all .15s;
    border-left: 2px solid transparent;
}

.nav-group>a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent);
}

.main {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.main-title {
    background: var(--ink);
    color: #fff;
    padding: 64px 60px;
    position: relative;
    overflow: hidden;
}

.main-title::after {
    content: '"hig"';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--mono);
    font-size: 120px;
    color: rgba(255, 255, 255, 0.04);
    line-height: 1;
}

.main-title-tag {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 16px;
}

.main-title h1 {
    font-family: var(--serif);
    font-size: 38px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.main-title p {
    color: #aaa;
    font-size: 15px;
    max-width: 500px;
}

.content {
    padding: 60px;
    max-width: 900px;
}

.section {
    margin-bottom: 80px;
}

.section>h2 {
    font-family: var(--serif);
    font-size: 26px;
    color: var(--ink);
    margin-bottom: 8px;
    line-height: 1.3;
}

.section-intro {
    color: var(--ink2);
    font-size: 14px;
    margin-bottom: 10px;
    max-width: 640px;
    border-left: 3px solid var(--border);
    padding-left: 16px;
}

.tag-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.tag-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 14px;
}

.tag-table .tag-name {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent);
    font-weight: bold;
    white-space: nowrap;
    width: 140px;
}

.tag-table .desc {
    color: var(--ink2);
}

.tag-table tr:hover td {
    background: var(--surface);
}

.sub p {
    margin-bottom: 1.5em;
}

.sub ul {
    margin-left: 20px;
    margin-bottom: 1.5em;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.ref-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ref-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.ref-card h4 {
    font-family: var(--serif);
    font-size: 18px;
    color: var(--ink);
    margin-bottom: 16px;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
}

.ref-card .tag-table td {
    padding: 8px 0;
    font-size: 13px;
}

.ref-card .tag-table .tag-name {
    width: 80px;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

@media (max-width: 840px) {
    .layout {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .main-title {
        padding: 40px 24px;
    }

    .main-title::after {
        display: none;
    }

    .main-title h1 {
        font-size: 30px;
    }

    .content {
        padding: 40px 24px;
    }

    .tag-table tr {
        display: block;
        border-bottom: 1px solid var(--border);
    }

    .tag-table td {
        display: block;
        width: 100%;
        border: none;
        padding: 8px 0;
    }

    .tag-table .tag-name {
        white-space: normal;
    }

    .tag-table tr:hover td {
        background: none;
    }
}