/* Site theme: tokens, page motion, premium surfaces */

:root {
    --site-bg: #f4f6fb;
    --site-bg-accent: #e8eef9;
    --site-surface: rgba(255, 255, 255, 0.92);
    --site-surface-solid: #ffffff;
    --site-border: rgba(15, 23, 42, 0.08);
    --site-border-strong: rgba(15, 23, 42, 0.12);
    --site-text: #0f172a;
    --site-text-muted: #64748b;
    --site-accent: #2563eb;
    --site-accent-soft: rgba(37, 99, 235, 0.1);
    --site-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --site-shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
    --site-shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.1);
    --site-radius-lg: 1.125rem;
    --site-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --site-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

body.has-site-header {
    color: var(--site-text);
    background-color: var(--site-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(244, 114, 182, 0.08), transparent),
        radial-gradient(ellipse 50% 30% at 0% 100%, rgba(37, 99, 235, 0.06), transparent);
    background-attachment: fixed;
}

.turbo-progress-bar {
  height: 2px;
  background: linear-gradient(90deg, #f472b6, var(--site-accent), #6366f1);
}

/* Premium typography */
.blog-page-title {
    color: var(--site-text);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.blog-page-header {
    position: relative;
    padding-bottom: 0.35rem;
}

.blog-page-header::after {
    content: "";
    display: block;
    width: 3rem;
    height: 3px;
    margin-top: 0.65rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--site-accent), #6366f1);
    opacity: 0.85;
}

.search-page .blog-page-header.text-center::after {
    margin-left: auto;
    margin-right: auto;
}

.blog-page-subtitle {
    color: var(--site-text-muted);
}

/* Cards & widgets */
.blog-widget,
.post-row,
.blog-article,
.article-toc-card {
    background: var(--site-surface);
    border-color: var(--site-border);
    box-shadow: var(--site-shadow-sm);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.post-row {
    border-radius: var(--site-radius-lg);
}

.post-row:hover {
    border-color: var(--site-border-strong);
    box-shadow: var(--site-shadow-md);
}

.blog-widget {
    border-radius: var(--site-radius-lg);
    transition: box-shadow 0.25s var(--site-ease-out), border-color 0.25s var(--site-ease-out);
}

.blog-widget:hover {
    box-shadow: var(--site-shadow-md);
}

.blog-article {
    border-radius: var(--site-radius-lg);
    box-shadow: var(--site-shadow-md);
}

.article-title {
    color: var(--site-text);
    letter-spacing: -0.025em;
}

.post-row-title a {
    color: var(--site-text);
    transition: color 0.2s ease;
}

/* Generic elevated panels (moments, contact, etc.) */
.site-panel,
body.has-site-header main .card {
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-lg);
    box-shadow: var(--site-shadow-sm);
    transition: box-shadow 0.25s var(--site-ease-out), transform 0.25s var(--site-ease-out);
}

body.has-site-header main .card:hover {
    box-shadow: var(--site-shadow-md);
}

.site-footer {
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top-color: var(--site-border) !important;
}

.site-header--solid,
.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--site-border);
}

.site-nav-link.active {
    background: var(--site-accent-soft);
    color: var(--site-accent);
}

.blog-google-search {
    background: var(--site-surface-solid);
    border-color: var(--site-border);
    box-shadow: var(--site-shadow-sm);
}

.blog-google-search:focus-within {
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.12);
}

.blog-google-search-submit {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
}

.blog-google-search-submit:hover {
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
}

.pagination-nav .btn {
    border-radius: 999px;
}

.search-tab {
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.search-tab.active {
    background: var(--site-accent-soft);
    color: var(--site-accent);
    box-shadow: var(--site-shadow-sm);
}

.timeline-list li {
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
    transition: background-color 0.2s ease;
}

.timeline-list li:hover {
    background: rgba(255, 255, 255, 0.65);
}

.timeline-list a {
    color: var(--site-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.timeline-list a:hover {
    color: var(--site-accent);
}

body.has-site-header main .form-control,
body.has-site-header main .form-select {
    border-color: var(--site-border);
    border-radius: 0.65rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.has-site-header main .form-control:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.has-site-header main .btn-primary {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border: none;
    border-radius: 999px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
    transition: transform 0.2s var(--site-ease-out), box-shadow 0.2s var(--site-ease-out);
}

body.has-site-header main .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

/* Dusk tokens & component overrides: site-theme-dusk.css */

/* Sidebar pulse + random post */
.blog-pulse-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.75rem;
    margin-bottom: 0.85rem;
}

.blog-pulse-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 0.65rem;
    border-radius: 0.65rem;
    background: var(--site-accent-soft);
}

.blog-pulse-value {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--site-text);
    line-height: 1.2;
}

.blog-pulse-label {
    font-size: 0.75rem;
    color: var(--site-text-muted);
}

.blog-random-post {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px dashed var(--site-border-strong);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s var(--site-ease-out);
}

.blog-random-post:hover {
    border-color: var(--site-accent);
    background: var(--site-accent-soft);
    transform: translateY(-1px);
}

.blog-random-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.blog-random-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.blog-random-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--site-accent);
}

.blog-random-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--site-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Article read progress */
.site-read-progress {
    position: fixed;
    top: var(--site-nav-height);
    left: 0;
    right: 0;
    height: 3px;
    z-index: 10050;
    pointer-events: none;
    background: transparent;
}

.site-read-progress span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f472b6, var(--site-accent), #6366f1);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.45);
    transition: width 0.08s linear;
}

/* Konami fun mode */
body.site-fun-mode.has-site-header {
    animation: site-fun-breathe 8s ease-in-out infinite;
}

@keyframes site-fun-breathe {
    0%, 100% { filter: saturate(1); }
    50% { filter: saturate(1.12) hue-rotate(8deg); }
}

.site-fun-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    background: var(--site-surface-solid);
    color: var(--site-text);
    font-size: 0.875rem;
    box-shadow: var(--site-shadow-lg);
    border: 1px solid var(--site-border);
    opacity: 0;
    z-index: 10060;
    transition: opacity 0.25s ease, transform 0.25s var(--site-ease-out);
    pointer-events: none;
}

.site-fun-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
