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

/* Base */
:root {
    --color-bg: #ffffff;
    --color-text: #171717;
    --color-text-light: #737373;
    --color-text-lighter: #a3a3a3;
    --color-border: #e5e7eb;
    --color-accent: #ff6b35;
    --color-code-bg: #f9fafb;
    --color-code-gradient-start: #ffffff;
    --color-code-gradient-end: #fafbfc;
    --color-section-gradient-start: #ffffff;
    --color-section-gradient-mid: #fafbfc;
    --color-section-gradient-end: #ffffff;
    --color-footer-bg: #fafbfc;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0f172a;
        --color-text: #e2e8f0;
        --color-text-light: #cbd5e1;
        --color-text-lighter: #94a3b8;
        --color-border: #334155;
        --color-accent: #ff8c42;
        --color-code-bg: #1e293b;
        --color-code-gradient-start: #0f172a;
        --color-code-gradient-end: #1e293b;
        --color-section-gradient-start: #0f172a;
        --color-section-gradient-mid: #1e293b;
        --color-section-gradient-end: #0f172a;
        --color-footer-bg: #1e293b;
    }
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

code {
    font-family: var(--font-mono);
    background: var(--color-code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.2s var(--ease-out);
}

a:hover {
    opacity: 0.8;
}

/* Header */
header {
    padding: 40px 0 24px;
    text-align: center;
}

.no-break {
    white-space: nowrap;
}

.desktop-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 900px;
    margin: 0 auto;
}

.logo-mark {
    width: 320px;
    height: 320px;
    flex-shrink: 0;
}

.desktop-text {
    text-align: left;
    flex: 1;
    max-width: 600px;
}

.desktop-title {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    margin-bottom: 16px;
    color: var(--color-text);
    line-height: 1;
}

.desktop-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: 12px;
    line-height: 1.5;
    font-weight: 500;
}

.desktop-features {
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

.logo {
    max-width: 800px;
    width: 100%;
    height: auto;
}

.logo-full {
    display: block;
}

.mobile-header {
    display: none;
}

header h1 {
    margin-top: 24px;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--color-text-light);
    line-height: 1.4;
}

/* Sections */
section {
    padding: 48px 0;
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 48px;
    text-align: center;
    letter-spacing: -0.02em;
    position: relative;
}

section h2::after {
    content: '';
    display: block;
    width: 64px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), #ff8c42);
    margin: 20px auto 0;
    border-radius: 2px;
}

/* Intro */
.intro {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.intro .lead {
    font-size: 1.75rem;
    font-weight: 400;
    margin-bottom: 32px;
    line-height: 1.5;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.intro p:not(.lead) {
    color: var(--color-text-light);
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Code Example */
.code-example {
    background: linear-gradient(180deg, var(--color-code-gradient-start) 0%, var(--color-code-gradient-end) 100%);
    color: var(--color-text);
    padding: 56px 0;
}

.code-example pre {
    background: var(--color-code-bg);
    padding: 36px 28px;
    overflow-x: auto;
    max-width: 820px;
    margin: 0 auto;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    .code-example pre {
        box-shadow:
            0 1px 3px rgba(0, 0, 0, 0.3),
            0 8px 24px rgba(0, 0, 0, 0.4);
    }
}

.code-example pre code {
    background: transparent;
    padding: 0;
    display: block;
    line-height: 1.7;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--color-text);
}

.syntax-rust .hl-keyword {
    color: #d97706;
    font-weight: 600;
}

.syntax-rust .hl-type {
    color: #2563eb;
}

.syntax-rust .hl-fn {
    color: #059669;
}

.syntax-rust .hl-number {
    color: #dc2626;
}

.syntax-rust .hl-string {
    color: #7c3aed;
}

.syntax-rust .hl-comment {
    color: #9ca3af;
    font-style: italic;
}

.syntax-rust .hl-variable {
    color: var(--color-text);
}

.syntax-rust .hl-const {
    color: #404040;
    font-weight: 600;
}

.syntax-rust .hl-method {
    color: #0891b2;
}

.syntax-rust .hl-namespace {
    color: #ea580c;
}

.syntax-rust .hl-operator {
    color: #64748b;
}

.syntax-rust .hl-lifetime {
    color: #d97706;
    font-style: italic;
}

@media (prefers-color-scheme: dark) {
    .syntax-rust .hl-keyword {
        color: #fbbf24;
    }

    .syntax-rust .hl-type {
        color: #60a5fa;
    }

    .syntax-rust .hl-fn {
        color: #34d399;
    }

    .syntax-rust .hl-number {
        color: #f87171;
    }

    .syntax-rust .hl-string {
        color: #a78bfa;
    }

    .syntax-rust .hl-comment {
        color: #64748b;
    }

    .syntax-rust .hl-const {
        color: #e2e8f0;
    }

    .syntax-rust .hl-method {
        color: #22d3ee;
    }

    .syntax-rust .hl-namespace {
        color: #fb923c;
    }

    .syntax-rust .hl-operator {
        color: #94a3b8;
    }

    .syntax-rust .hl-lifetime {
        color: #fbbf24;
    }
}

/* Features */
.features {
    background: linear-gradient(180deg, var(--color-section-gradient-start) 0%, var(--color-section-gradient-mid) 50%, var(--color-section-gradient-end) 100%);
}

.features .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 48px;
    max-width: 960px;
    margin: 0 auto;
}

.feature {
    text-align: center;
    padding: 24px 16px;
    transition: transform 0.2s var(--ease-out);
}

.feature:hover {
    transform: translateY(-4px);
}

.feature h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.feature p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Crates */
.crates .container {
    max-width: 820px;
    margin: 0 auto;
}

.crate {
    padding: 32px 0;
    transition: all 0.2s var(--ease-out);
    margin-bottom: 40px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    align-items: start;
    position: relative;
    border-top: 3px solid var(--color-accent);
}

.crate:hover {
    border-top-color: #ff8c42;
}

.crate h3 {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    margin-bottom: 0;
    color: var(--color-text);
    font-weight: 600;
    text-align: left;
    padding-top: 4px;
    transition: color 0.2s var(--ease-out);
}

.crate:hover h3 {
    color: var(--color-accent);
}

.crate-content {
    text-align: left;
}

.crate p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 8px;
}

.crate p:last-child {
    margin-bottom: 0;
}

.coming-soon {
    display: inline-block;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--color-text-lighter);
    background: var(--color-code-bg);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    vertical-align: middle;
    margin-left: 8px;
    letter-spacing: 0.02em;
}

.repo-note {
    font-size: 0.85rem;
    color: var(--color-text-lighter);
    margin-top: 8px;
}

.repo-note a {
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    transition: color 0.2s var(--ease-out);
}

.repo-note a:hover {
    color: #ff8c42;
}

/* Install */
.install {
    text-align: center;
    background: linear-gradient(180deg, var(--color-section-gradient-start) 0%, var(--color-section-gradient-mid) 50%, var(--color-section-gradient-end) 100%);
}

.install h2 {
    margin-bottom: 48px;
}

.install pre {
    background: var(--color-code-bg);
    border-radius: 8px;
    padding: 24px 28px;
    margin-bottom: 32px;
    overflow-x: auto;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.install pre code {
    background: transparent;
    padding: 0;
    display: block;
    text-align: left;
}

.install p {
    color: var(--color-text-light);
    font-size: 1rem;
}

.install p a {
    margin: 0 8px;
}

/* Footer */
footer {
    padding: 64px 0 48px;
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.95rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-footer-bg);
}

footer .tagline {
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--color-text);
}

footer .license {
    font-size: 0.85rem;
    color: var(--color-text-lighter);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 0;
        position: relative;
        overflow: hidden;
    }

    /* ヘッダー全体の背景として炎マークを配置 */
    header::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 120%;
        height: 120%;
        background-image: url('hibana.svg');
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        opacity: 0.60;
        z-index: 0;
        pointer-events: none;
    }

    /* デスクトップ用のヘッダーを非表示 */
    .desktop-header {
        display: none;
    }

    /* モバイル用のレイアウトを表示 */
    .mobile-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 400px;
        padding: 60px 24px;
        position: relative;
        z-index: 1;
    }

    /* モバイルヘッダー内の炎マークは非表示 */
    .logo-icon {
        display: none;
    }

    .mobile-text {
        text-align: center;
        width: 100%;
        max-width: 600px;
    }

    .mobile-title {
        font-size: clamp(2.5rem, 10vw, 3.5rem);
        font-weight: 800;
        letter-spacing: 0.2em;
        margin-bottom: 24px;
        color: var(--color-text);
        font-family: var(--font-sans);
    }

    .mobile-subtitle {
        font-size: clamp(1rem, 4vw, 1.2rem);
        color: var(--color-text);
        margin-bottom: 16px;
        line-height: 1.6;
        font-weight: 500;
    }

    .mobile-features {
        font-size: clamp(0.8rem, 3.5vw, 0.95rem);
        color: var(--color-text-light);
        line-height: 1.8;
    }

    section {
        padding: 48px 0;
    }

    header h1 {
        font-size: 1.25rem;
        margin-top: 20px;
    }

    .logo {
        max-width: 100%;
        height: auto;
    }
    
    /* SVGのテキストが小さくなりすぎないよう、最小高さを確保 */
    header .logo {
        min-height: 120px;
    }

    .intro .lead {
        font-size: 1.35rem;
    }

    .features .container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .crate {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .crate h3 {
        text-align: center;
    }

    .crate-content {
        text-align: center;
    }

    .code-example pre {
        padding: 24px 20px;
    }

    footer {
        padding: 64px 0 48px;
    }
}
