/* ═══════════════════════════════════════════
   Gravatar Proxy - Claude-inspired Design
   ═══════════════════════════════════════════ */

:root {
    /* Claude-style warm palette */
    --bg-page: #FAF8F5;
    --bg-card: #FFFFFF;
    --bg-subtle: #F5F1EC;
    --bg-code: #2A2420;

    --text-primary: #1C1917;
    --text-secondary: #6B6560;
    --text-tertiary: #9E9892;
    --text-inverse: #F5F1EC;

    --accent: #CC785C;
    --accent-hover: #B8674D;
    --accent-soft: rgba(204, 120, 92, 0.08);
    --accent-glow: rgba(204, 120, 92, 0.18);

    --border: rgba(0, 0, 0, 0.07);
    --border-strong: rgba(0, 0, 0, 0.12);

    --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', ui-serif, Georgia, serif;
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', Consolas, monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 999px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.08);
    --shadow-glow: 0 0 0 4px var(--accent-soft);

    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ═══════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════ */

.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ═══════════════════════════════════════════
   Header
   ═══════════════════════════════════════════ */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 36px 0;
    margin-bottom: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 550;
    font-size: 1.05rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    user-select: none;
}

.logo svg {
    transition: transform var(--transition-smooth);
}

.logo:hover svg {
    transform: rotate(-8deg) scale(1.08);
}

nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.925rem;
    font-weight: 480;
    transition: color var(--transition-fast);
    padding: 4px 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nav-icon {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

nav a:hover .nav-icon {
    opacity: 1;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--accent);
    border-radius: 1px;
    transition: width var(--transition-smooth);
}

nav a:hover {
    color: var(--text-primary);
}

nav a:hover::after {
    width: 100%;
}

.github-link {
    padding: 8px 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    background: var(--bg-card);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.github-link::after {
    display: none;
}

.github-link:hover {
    background: var(--text-primary);
    color: var(--bg-card);
    border-color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.github-link:hover .nav-icon {
    opacity: 1;
}

/* Language switch — globe icon */
.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: color var(--transition-smooth), background var(--transition-smooth);
    padding: 5px;
    border-radius: var(--radius-sm);
}

.lang-switch svg {
    transition: transform var(--transition-smooth), color var(--transition-smooth);
}

.lang-switch:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.lang-switch:hover svg {
    animation: globe-spin 0.55s ease-out;
}

.lang-switch:active svg {
    transform: scale(0.88);
}

@keyframes globe-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════
   Hero Section
   ═══════════════════════════════════════════ */

.hero {
    text-align: center;
    padding: 32px 0 96px;
    max-width: 720px;
    margin: 0 auto;
    animation: heroIn 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 18px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 530;
    margin-bottom: 36px;
    letter-spacing: 0.01em;
}

.badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(1.5); }
}

h1 {
    font-family: var(--font-serif);
    font-size: 3.6rem;
    line-height: 1.12;
    font-weight: 580;
    margin-bottom: 28px;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.72;
    font-weight: 420;
}

.actions {
    display: flex;
    gap: 14px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-weight: 520;
    font-size: 0.975rem;
    text-decoration: none;
    transition: all var(--transition-smooth);
    cursor: pointer;
    letter-spacing: -0.005em;
}

.btn-primary {
    background-color: var(--accent);
    color: #FFFFFF;
    box-shadow: 0 4px 16px rgba(204, 120, 92, 0.28);
    border: none;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(204, 120, 92, 0.35);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background-color: var(--bg-subtle);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════
   Usage Section
   ═══════════════════════════════════════════ */

.usage {
    padding: 88px 0;
    border-top: 1px solid var(--border);
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    font-weight: 580;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 420;
    max-width: 480px;
    margin: 0 auto;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 36px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 34px;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    background: radial-gradient(ellipse at top right, var(--accent-soft), transparent 70%);
    transition: opacity var(--transition-smooth);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.card:hover::before {
    opacity: 1;
}

.card-highlight {
    border-color: rgba(204, 120, 92, 0.25);
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(204, 120, 92, 0.08);
}

.card-highlight::before {
    opacity: 0.5;
    background: radial-gradient(ellipse at top right, var(--accent-soft), transparent 65%);
}

.card-highlight:hover {
    border-color: rgba(204, 120, 92, 0.35);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(204, 120, 92, 0.12);
}

.card-icon {
    width: 46px;
    height: 46px;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
    transition: all var(--transition-fast);
}

.card-highlight .card-icon {
    background: var(--accent);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(204, 120, 92, 0.2);
}

.card-body {
    flex-shrink: 0;
}

.card h3 {
    font-size: 1.22rem;
    margin-bottom: 12px;
    font-weight: 560;
    letter-spacing: -0.01em;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.975rem;
    margin-bottom: 0;
    line-height: 1.65;
}

.card strong {
    color: var(--accent);
    font-weight: 560;
}

.card .code-block {
    margin-top: auto;
}

.code-block {
    background: var(--bg-subtle);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    word-break: break-all;
    line-height: 1.5;
}

.card-highlight .code-block {
    background: #F2EDE8;
    border-color: rgba(204, 120, 92, 0.15);
    color: var(--text-primary);
}

.card-highlight .code-block code {
    font-weight: 510;
}

/* Code Example - warm dark theme */
.code-example {
    background: var(--bg-code);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-top: 36px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.06);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #A09890;
    font-size: 0.85rem;
    font-weight: 500;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #C8C0B8;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.825rem;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.15);
}

.copy-btn.copied {
    background: var(--accent);
    border-color: var(--accent);
    color: #FFFFFF;
}

pre {
    padding: 28px 24px;
    overflow-x: auto;
}

pre code {
    font-family: var(--font-mono);
    color: #D8D0C8;
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ═══════════════════════════════════════════
   Demo Section
   ═══════════════════════════════════════════ */

.demo-section {
    padding: 88px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.demo-section h2 {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    font-weight: 580;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.demo-intro {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 52px;
    font-weight: 420;
}

.demo-container {
    display: flex;
    justify-content: center;
    gap: 80px;
}

.demo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 240px;
}

.avatar-wrapper {
    flex-shrink: 0;
    padding: 6px;
    border-radius: 50%;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.avatar-wrapper.highlight {
    background: linear-gradient(135deg, var(--accent), #D4896E);
    box-shadow: 0 8px 32px rgba(204, 120, 92, 0.2);
}

.avatar-wrapper:hover {
    transform: scale(1.06);
}

.avatar-wrapper.highlight:hover {
    box-shadow: 0 12px 40px rgba(204, 120, 92, 0.3);
}

.demo-avatar {
    width: 136px;
    height: 136px;
    border-radius: 50%;
    display: block;
    background-color: var(--bg-subtle);
    border: 4px solid var(--bg-card);
}

/* Demo status area */
.demo-status {
    flex-shrink: 0;
    height: 155px;
    width: 100%;
    padding: 16px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-xs);
    box-sizing: border-box;
}

.status-pending {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.status-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-ok {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2D7A3F;
    font-weight: 560;
    font-size: 1rem;
}

.status-error {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #C53030;
    font-weight: 560;
    font-size: 0.925rem;
}

/* Info rows inside demo-status */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.info-label {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    font-weight: 450;
    flex-shrink: 0;
}

.info-value {
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 510;
    font-family: var(--font-mono);
    text-align: right;
    word-break: break-all;
    line-height: 1.4;
}

.info-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 560;
    font-family: var(--font-sans);
}

.info-badge.badge-hit {
    background: #E6F4EA;
    color: #1D7A34;
}

.info-badge.badge-miss {
    background: #FFF3E0;
    color: #B85C10;
}

.info-badge.badge-dynamic {
    background: #F3E8FF;
    color: #7B3FA3;
}

.info-na {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-style: italic;
    opacity: 0.7;
    margin-top: 4px;
}

.demo-retry {
    padding: 12px 28px !important;
    font-size: 0.9rem !important;
}

.demo-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    background: var(--bg-card);
    padding: 7px 22px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    margin-top: auto;
    flex-shrink: 0;
}

.demo-label.highlight-label {
    background: var(--accent);
    color: #FFFFFF;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(204, 120, 92, 0.18);
}

/* ═══════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════ */

footer {
    padding: 72px 0 52px;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-weight: 420;
}

.disclaimer {
    max-width: 460px;
    line-height: 1.6;
    font-size: 0.825rem;
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    header {
        padding: 24px 0;
        margin-bottom: 40px;
        flex-direction: column;
        gap: 18px;
    }

    nav {
        gap: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .lang-switch {
        padding: 3px;
    }

    h1 {
        font-size: 2.4rem;
    }

    .subtitle {
        font-size: 1.05rem;
    }

    .hero {
        padding: 16px 0 56px;
    }

    .actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .usage {
        padding: 56px 0;
    }

    .demo-container {
        flex-direction: column;
        gap: 36px;
        align-items: center;
    }

    .demo-item {
        width: 100%;
        max-width: 260px;
    }

    .demo-section h2 {
        margin-bottom: 12px;
    }

    .demo-intro {
        margin-bottom: 36px;
        font-size: 0.95rem;
    }

    .code-example {
        border-radius: var(--radius-lg);
    }

    pre code {
        font-size: 0.78rem;
    }
}

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

    .card {
        padding: 28px 24px;
    }

    .demo-avatar {
        width: 108px;
        height: 108px;
    }
}
