/* ============================================
   Pecka Cyber Theme - screen.css
   ============================================ */

/* --- Design Tokens --- */
:root {
    --color-primary: #FF1A75;
    --color-secondary: #764ba2;
    --color-bg: #FFFFFF;
    --color-fg: #020817;
    --color-muted-bg: #F8FAFC;
    --color-muted-text: #64748B;
    --color-border: #E2E8F0;
    --color-footer-bg: #111827;
    --color-card-bg: #FFFFFF;
    --color-nav-bg: #0B1120;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --container-max: 1280px;
    --container-narrow: 896px;
    --section-padding: 4rem;
    --radius: 0.5rem;
    --radius-md: 0.375rem;
}

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

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

body {
    font-family: var(--font-family);
    color: var(--color-fg);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

/* --- Layout --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.container-narrow {
    max-width: var(--container-narrow);
}

.section {
    padding: var(--section-padding) 0;
}

.section-muted {
    background: var(--color-muted-bg);
}

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

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.125rem; font-weight: 600; }

.section-title {
    font-size: 1.875rem;
    text-align: center;
    margin-bottom: 3rem;
}

.section-subtitle {
    color: var(--color-muted-text);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.text-muted {
    color: var(--color-muted-text);
}

.text-lg {
    font-size: 1.125rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.gradient-text {
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-bottom: 0.125rem;
    line-height: 1.15;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-primary);
    color: #FFFFFF;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-outline {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-fg);
}

.btn-outline:hover {
    background: var(--color-muted-bg);
}

.btn-outline-white {
    border: 1px solid #FFFFFF;
    background: transparent;
    color: #FFFFFF;
}

.btn-outline-white:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-white {
    background: #FFFFFF;
    color: #111827;
}

.btn-white:hover {
    background: rgba(255, 255, 255, 0.9);
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-group-center {
    justify-content: center;
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-nav-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #FFFFFF;
}

.site-logo:hover {
    color: var(--color-primary);
}

.desktop-nav {
    display: none;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #94A3B8;
    transition: color 0.2s;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link:hover,
.nav-active {
    color: var(--color-primary);
}

/* Desktop dropdown */
.nav-dropdown {
    position: relative;
}

button.nav-dropdown-trigger {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #94A3B8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-family) !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0;
    line-height: 1.6;
    letter-spacing: normal;
    text-transform: none;
}

.nav-dropdown-trigger:hover {
    color: var(--color-primary);
}

.dropdown-chevron {
    transition: transform 0.2s;
}

.nav-dropdown:hover .dropdown-chevron {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 160px;
    background: #1E293B !important;
    border: 1px solid #334155 !important;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    padding: 0.25rem 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    margin-top: 0.5rem;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.nav-dropdown-menu .dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94A3B8 !important;
    background: transparent !important;
    transition: color 0.15s, background 0.15s;
}

.nav-dropdown-menu .dropdown-item:hover {
    color: var(--color-primary) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Mobile menu */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
}

.icon-close {
    display: none;
}

.mobile-menu-open .icon-menu {
    display: none;
}

.mobile-menu-open .icon-close {
    display: block;
}

.mobile-menu {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--color-nav-bg);
    padding: 0.5rem 1rem;
}

.mobile-menu-open .mobile-menu {
    display: block;
}

.mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #94A3B8;
    border-radius: var(--radius-md);
    width: 100%;
    text-align: left;
}

.mobile-link:hover {
    color: var(--color-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mobile-accordion {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
}

.mobile-accordion-open .mobile-accordion {
    max-height: 200px;
}

.mobile-accordion-open .dropdown-chevron {
    transform: rotate(180deg);
}

.mobile-sub-link {
    padding-left: 2rem;
}

/* --- Footer --- */
.site-footer {
    background: var(--color-footer-bg);
    color: #d1d5db;
    padding: 3rem 0;
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.footer-brand {
    color: #FFFFFF;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-size: 0.875rem;
    color: #9ca3af;
}

.footer-heading {
    font-size: 0.875rem;
    font-weight: 600;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: #9ca3af;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: #FFFFFF;
}

.footer-bottom {
    border-top: 1px solid #1f2937;
    margin-top: 2rem;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

/* --- Grids --- */
.grid {
    display: grid;
    gap: 2rem;
    align-items: stretch;
}

.grid > a,
.grid > .card {
    height: 100%;
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }

/* --- Cards --- */
.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    background: var(--color-card-bg);
    display: flex;
    flex-direction: column;
}

.card .card-text {
    flex: 1;
}

.card-accent {
    border-left: 4px solid var(--color-primary);
}

.card-accent-purple {
    border-left: 4px solid var(--color-secondary);
}

.card-accent-blue {
    border-left: 4px solid #3b82f6;
}

.card-lg {
    padding: 2rem;
}

.card-hover {
    transition: box-shadow 0.2s;
}

.card-hover:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.card-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.card-icon-purple {
    color: var(--color-secondary);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--color-muted-text);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.card-link-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary);
}

.card-link-inline:hover {
    opacity: 0.8;
}

.card-link-inline-purple {
    color: var(--color-secondary);
}

/* --- Hero Section --- */
.hero {
    background: #111827;
    color: #FFFFFF;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, #111827, #1f2937, #111827);
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
}

.hero h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: #d1d5db;
    margin-bottom: 2rem;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Gradient CTA Section --- */
.gradient-section {
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    color: #FFFFFF;
}

.gradient-heading {
    font-size: 1.875rem;
    margin-bottom: 1rem;
}

.gradient-section .text-muted,
.gradient-section p {
    color: rgba(255, 255, 255, 0.8);
}

.gradient-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 1rem;
}

.gradient-card h3 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.gradient-card p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* --- Experience Grid (homepage) --- */
.experience-item {
    text-align: center;
}

.experience-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--color-primary);
    margin: 0 auto 1rem;
}

.experience-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.experience-text {
    font-size: 0.875rem;
    color: var(--color-muted-text);
}

/* --- Why Section (homepage gradient) --- */
.why-item {
    text-align: center;
}

.why-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.why-item p {
    color: rgba(255, 255, 255, 0.8);
}

/* --- Platform Module Cards --- */
.module-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    background: var(--color-card-bg);
}

.module-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.module-card p {
    font-size: 0.875rem;
    color: var(--color-muted-text);
    margin-bottom: 1.5rem;
}

.module-tier-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.module-list {
    margin-bottom: 1rem;
}

.module-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-muted-text);
    margin-bottom: 0.375rem;
}

.module-list .check-icon {
    width: 1rem;
    height: 1rem;
    color: #22c55e;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.module-list .lock-icon {
    width: 1rem;
    height: 1rem;
    color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* --- Post Card --- */
.post-card {
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    background: var(--color-card-bg);
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.post-card-research {
    border-left-color: #a855f7;
}

.post-card-guide {
    border-left-color: #3b82f6;
}

.post-card-link {
    display: block;
}

.post-card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.post-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.post-card:hover .post-card-title {
    color: var(--color-primary);
}

.post-card-excerpt {
    font-size: 0.875rem;
    color: var(--color-muted-text);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-date {
    font-size: 0.75rem;
    color: var(--color-muted-text);
}

/* --- Tag Badges --- */
.tag-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.tag-research { background: #f3e8ff; color: #7e22ce; }
.tag-guide { background: #dbeafe; color: #1d4ed8; }
.tag-paper { background: #f3e8ff; color: #7e22ce; }
.tag-conference { background: #fff7ed; color: #c2410c; }
.tag-beginner { background: #dcfce7; color: #15803d; }
.tag-intermediate { background: #fff7ed; color: #c2410c; }
.tag-advanced { background: #fee2e2; color: #dc2626; }
.tag-update { background: #f3e8ff; color: #7e22ce; }
.tag-blog { background: #f1f5f9; color: #475569; }
.tag-free { background: #dcfce7; color: #15803d; }
.tag-members { background: #fce7f3; color: #be185d; }

/* --- Single Post --- */
.post-header {
    padding: 3rem 0;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--color-muted-text);
}

.post-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--color-primary);
    z-index: 100;
    transition: width 0.1s ease;
}

/* Post content typography */
.gh-content {
    font-size: 1.125rem;
    line-height: 1.7;
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 1rem;
}

.gh-content > * + * {
    margin-top: 1.5rem;
}

.gh-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.gh-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.gh-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.gh-content a:hover {
    opacity: 0.8;
}

.gh-content blockquote {
    border-left: 4px solid rgba(255, 26, 117, 0.3);
    padding-left: 1rem;
    font-style: italic;
    color: var(--color-muted-text);
}

.gh-content ul,
.gh-content ol {
    margin-left: 1.5rem;
}

.gh-content ul {
    list-style: disc;
}

.gh-content ol {
    list-style: decimal;
}

.gh-content li + li {
    margin-top: 0.25rem;
}

.gh-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.875rem;
    position: relative;
}

.gh-content code {
    background: var(--color-muted-bg);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.gh-content pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

.gh-content img {
    border-radius: var(--radius);
    margin: 1rem 0;
}

.kg-width-wide {
    max-width: min(1040px, calc(100vw - 2rem));
    margin-left: max(calc((100% - 1040px) / 2), -4rem);
    margin-right: max(calc((100% - 1040px) / 2), -4rem);
}

.kg-width-full {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.kg-width-wide img,
.kg-width-full img {
    width: 100%;
}

.gh-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.gh-content th,
.gh-content td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.gh-content th {
    font-weight: 600;
    background: var(--color-muted-bg);
}

.gh-content strong {
    font-weight: 600;
}

/* Copy button on code blocks */
.copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--color-primary);
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s;
}

pre:hover .copy-button {
    opacity: 1;
}

/* --- TOC Sidebar --- */
.toc-sidebar {
    position: fixed;
    left: 20px;
    top: 120px;
    width: 260px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    background: var(--color-bg);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--color-primary);
    z-index: 40;
    display: none;
}

.toc-sidebar h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted-text);
    margin-bottom: 0.75rem;
}

.toc-sidebar a {
    display: block;
    padding: 0.375rem 0;
    font-size: 0.875rem;
    color: var(--color-muted-text);
    transition: color 0.2s;
    border-left: 2px solid transparent;
    padding-left: 0.5rem;
}

.toc-sidebar a:hover,
.toc-sidebar a.active {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
}

.toc-sidebar a.toc-h3 {
    padding-left: 1.25rem;
    font-size: 0.8125rem;
}

/* TOC collapsible sections */
.toc-section-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0;
    font-size: 0.875rem;
    color: var(--color-muted-text);
    cursor: pointer;
    border-left: 2px solid transparent;
    padding-left: 0.5rem;
    transition: color 0.2s;
    user-select: none;
}

.toc-section-header:hover,
.toc-section-header.active {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
}

.toc-collapse-icon {
    font-size: 0.6rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.toc-section.collapsed .toc-collapse-icon {
    transform: rotate(-90deg);
}

.toc-section-children {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s, opacity 0.3s;
    opacity: 1;
}

.toc-section.collapsed .toc-section-children {
    max-height: 0;
    opacity: 0;
}

/* Mobile TOC */
.toc-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(255, 26, 117, 0.4);
    z-index: 50;
    font-size: 1.25rem;
    align-items: center;
    justify-content: center;
}

.toc-mobile-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.toc-mobile-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.toc-mobile-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 70vh;
    background: var(--color-bg);
    border-radius: 1rem 1rem 0 0;
    padding: 1.5rem;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.toc-mobile-modal.active .toc-mobile-content {
    transform: translateY(0);
}

.toc-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-muted-bg);
}

.toc-mobile-header h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toc-mobile-close {
    font-size: 1.5rem;
    color: var(--color-muted-text);
    line-height: 1;
}

.toc-mobile-close:hover {
    color: var(--color-primary);
}

.toc-mobile-nav a {
    display: block;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--color-muted-text);
    border-left: 3px solid transparent;
    padding-left: 0.75rem;
}

.toc-mobile-nav a:hover,
.toc-mobile-nav a.active {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
}

.toc-mobile-nav a.toc-h3 {
    padding-left: 1.75rem;
    font-size: 0.8125rem;
}

/* --- Scroll to Top --- */
.scroll-to-top {
    display: none;
    position: fixed;
    bottom: 76px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(255, 26, 117, 0.4);
    z-index: 50;
    font-size: 1.25rem;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.2s;
}

.scroll-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-to-top:hover {
    transform: scale(1.05);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary);
}

.pagination a:hover {
    opacity: 0.8;
}

.pagination .page-number {
    font-size: 0.875rem;
    color: var(--color-muted-text);
}

/* --- Error Page --- */
.error-page {
    text-align: center;
    padding: 6rem 0;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.25rem;
    color: var(--color-muted-text);
    margin-bottom: 2rem;
}

/* --- Page Content (for Consulting, About) --- */
.page-content {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 1rem;
}

.page-content h1 {
    margin-bottom: 2rem;
}

.page-intro {
    font-size: 1.125rem;
    color: var(--color-muted-text);
    margin-bottom: 1.5rem;
}

/* --- Publications Cards (About page) --- */
.pub-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    background: var(--color-card-bg);
}

.pub-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.pub-authors {
    font-size: 0.75rem;
    color: var(--color-muted-text);
    margin-bottom: 0.5rem;
}

.pub-venue {
    font-size: 0.75rem;
    color: var(--color-muted-text);
    margin-bottom: 0.75rem;
}

.pub-links {
    display: flex;
    gap: 0.75rem;
}

.pub-links a {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-primary);
}

.pub-links a:hover {
    opacity: 0.8;
}

/* --- Connect Section --- */
.connect-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.connect-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-muted-text);
    transition: color 0.2s;
}

.connect-link:hover {
    color: var(--color-fg);
}

.connect-link svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* --- Print --- */
@media print {
    .site-header,
    .site-footer,
    .toc-sidebar,
    .toc-mobile-toggle,
    .scroll-to-top,
    .reading-progress {
        display: none !important;
    }
}

/* --- Responsive --- */
@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .header-container {
        padding: 0 1.5rem;
    }

    .btn-group {
        flex-direction: row;
    }

    .footer-container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 768px) {
    h1 { font-size: 2.25rem; }

    .hero h1 { font-size: 3.75rem; }
    .hero { padding: 8rem 0; }

    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }

    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .header-container {
        padding: 0 2rem;
    }

    .desktop-nav {
        display: flex;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .mobile-menu {
        display: none !important;
    }

    .footer-container {
        padding: 0 2rem;
    }
}

@media (min-width: 1280px) {
    .toc-sidebar {
        display: block;
    }
}

@media (max-width: 1279px) {
    .scroll-to-top {
        display: flex;
    }

    .toc-mobile-toggle {
        display: flex;
    }

    .toc-mobile-modal {
        display: block;
    }
}
