/* assets/site.css — base tokens & components (no Tailwind build required) */

:root {
    --max-w: 1080px;
    --pad-x: 1rem;
    --fg: #111827; /* gray-900 */
    --fg-soft: #4b5563; /* gray-600 */
    --muted: #6b7280; /* gray-500 */
    --bg: #ffffff;
    --card: #ffffff;
    --border: #e5e7eb; /* gray-200 */
    --brand: #2563eb; /* blue-600 */
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Typography */
html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--fg);
    background: var(--bg);
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad-x);
}

.prose {
    line-height: 1.8;
    font-size: 1.125rem;
    color: #374151; /* gray-700 */
}

.prose h1, .prose h2, .prose h3, .prose h4 {
    color: #111827; /* gray-900 */
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h1 {
    font-size: 2.25rem;
}

.prose h2 {
    font-size: 1.875rem;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 0.5rem;
}

.prose h3 {
    font-size: 1.5rem;
}

.prose p {
    margin: 1.25rem 0;
}

.prose a {
    color: #d97706; /* amber-600 */
    text-decoration: underline;
    font-weight: 500;
}

.prose strong {
    color: #111827;
    font-weight: 600;
}

.prose blockquote {
    border-left: 4px solid #f59e0b; /* amber-500 */
    padding-left: 1.5rem;
    font-style: italic;
    color: #4b5563;
    background: rgba(254, 243, 199, 0.5); /* amber-50/50 */
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin: 1.5rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

.prose code {
    background: #fef3c7; /* amber-50 */
    color: #92400e; /* amber-800 */
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875em;
    font-weight: 500;
}

.prose pre {
    background: #1f2937; /* gray-800 */
    color: #f9fafb;
    padding: 1.25rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #374151;
}

.prose pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-weight: 400;
}

.prose ul, .prose ol {
    margin: 1.25rem 0;
    padding-left: 1.625rem;
}

.prose li {
    margin: 0.5rem 0;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.prose table {
    width: 100%;
    table-layout: auto;
    text-align: left;
    margin-top: 2rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    line-height: 1.7142857;
    border-collapse: collapse;
}

.prose thead {
    border-bottom: 1px solid #e5e7eb;
}

.prose thead th {
    color: #111827;
    font-weight: 600;
    vertical-align: bottom;
    padding: 0.75rem;
    background: #fef3c7;
}

.prose tbody tr {
    border-bottom: 1px solid #f3f4f6;
}

.prose tbody td {
    vertical-align: baseline;
    padding: 0.75rem;
}

/* Article Content Container Styles */
.article-content-container {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #f3f4f6;
    min-height: 200px;
    position: relative;
    z-index: 1;
}

@media (min-width: 640px) {
    .article-content-container {
        padding: 3rem;
    }
}

.decoration-circle {
    position: absolute;
    background: #fef3c7; /* amber-100 */
    border-radius: 9999px;
    opacity: 0.2;
    z-index: -1;
}

.decoration-circle.top-left {
    top: -0.5rem;
    left: -0.5rem;
    width: 4rem;
    height: 4rem;
}

.decoration-circle.bottom-right {
    bottom: -0.5rem;
    right: -0.5rem;
    width: 6rem;
    height: 6rem;
}

/* Comments Section */
.comments-section {
    max-width: 820px;
    margin: 3rem auto 0;
}

.comment-item {
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    list-style: none;
}

.comment-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.comment-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: #fef3c7; /* amber-100 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b45309; /* amber-700 */
    font-weight: 700;
    margin-right: 0.75rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.comment-author-info {
    display: flex;
    flex-direction: column;
}

.comment-author-name {
    font-weight: 700;
    color: #111827;
}

.comment-date {
    color: #9ca3af;
    font-size: 0.75rem;
}

.comment-content {
    white-space: pre-wrap;
    color: #374151;
    line-height: 1.6;
    padding-left: 0.25rem;
}

.load-more-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    background: #111827;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.load-more-btn:hover:not(:disabled) {
    background: #374151;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.load-more-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

/* Header & Footer */
.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .8);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.navbar a.logo {
    color: var(--fg);
    font-weight: 700;
}

.navbar nav a {
    margin-left: 1rem;
    color: var(--fg);
}

.navbar nav a.active {
    color: var(--brand);
}

footer.site {
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    padding: 2rem 0;
    color: var(--fg-soft);
    font-size: .95rem;
}

/* Cards & grid */
.grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 640px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: .75rem;
    padding: 1rem;
    transition: box-shadow .2s ease, transform .2s ease;
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.card h3 {
    margin: 0 0 .25rem;
    font-size: 1.1rem;
}

.card p {
    margin: .25rem 0;
}

.card .meta {
    color: var(--muted);
    font-size: .9rem;
}

/* Hero */
.hero {
    padding: 3rem 0 2rem;
    text-align: left;
}

.hero h1 {
    font-size: 2.25rem;
    margin: 0 0 .5rem;
}

.hero p {
    color: var(--fg-soft);
    margin: .25rem 0;
}

.hero .typed {
    color: var(--fg);
    font-weight: 600;
}

/* Utilities from old/globals.css */
@keyframes fade-shadow {
    0% {
        box-shadow: 0 0 1px rgba(0, 0, 0, 0);
    }
    100% {
        box-shadow: var(--shadow);
    }
}

.animate-fade-shadow {
    animation: fade-shadow 8s;
}

@keyframes blink {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.blinking-cursor {
    animation: blink 1s step-end infinite;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Article page */
.article {
    max-width: 760px;
    margin: 0 auto;
}

.article .title {
    font-size: 2rem;
    margin: 0 0 .75rem;
}

.article .meta {
    color: var(--muted);
    margin-bottom: 1rem;
    font-size: .95rem;
}

.article .content {
    line-height: 1.8;
}

.article .content img {
    max-width: 100%;
    height: auto;
    border-radius: .5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    border-radius: .5rem;
    padding: .5rem .9rem;
    background: var(--fg);
    color: #fff;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #000;
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 400px;
    color: var(--muted);
    animation: fadeIn 0.6s ease-out;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3.5px solid #f3f4f6;
    border-top-color: var(--brand);
    border-radius: 50%;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.loading-text {
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    animation: pulse 2s infinite;
}

/* Not Found Page */
.not-found-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh; /* Adjust for possible parent constraints */
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.not-found-code {
    font-size: clamp(8rem, 25vw, 16rem);
    font-weight: 900;
    line-height: 1;
    margin: 0;
    color: var(--fg);
    opacity: 0.05;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

.not-found-content {
    position: relative;
    z-index: 1;
    max-width: 400px;
    animation: fadeIn 0.8s ease-out;
}

.not-found-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--fg);
    letter-spacing: -0.025em;
}

.not-found-desc {
    color: var(--muted);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.not-found-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
