/* Rhein.io design system - 1:1 port from Tailwind + shadcn */

:root {
    --background: 0 0% 3.9%;
    --foreground: 0 0% 98%;
    --muted: 0 0% 14.9%;
    --muted-foreground: 0 0% 63.9%;
    --popover: 0 0% 3.9%;
    --popover-foreground: 0 0% 98%;
    --card: 0 0% 3.9%;
    --card-foreground: 0 0% 98%;
    --border: 0 0% 14.9%;
    --input: 0 0% 14.9%;
    --primary: 0 0% 98%;
    --primary-foreground: 0 0% 9%;
    --secondary: 0 0% 14.9%;
    --secondary-foreground: 0 0% 98%;
    --accent: 0 0% 14.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --ring: 0 0% 83.1%;
    --radius: 0.5rem;
}

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

html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
    min-height: 100vh;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    line-height: 1.6;
    font-size: 16px;
}

/* Gradient text (blue-500 to teal-400) */
.gradient-text {
    background: linear-gradient(to right, #3b82f6, #2dd4bf);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

a { color: hsl(var(--primary)); text-decoration: none; }
a:hover { opacity: 0.8; }

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.site-header {
    position: fixed; top: 0; z-index: 50;
    width: 100%;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--background) / 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.site-header .container {
    display: flex; align-items: center; justify-content: space-between;
    height: 3.5rem;
}
.header-left { display: flex; align-items: center; gap: 1.5rem; }
.brand-name {
    font-weight: 700; font-size: 1.25rem;
    background: linear-gradient(to right, #3b82f6, #2dd4bf);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.brand-tagline {
    font-size: 0.75rem; color: hsl(var(--muted-foreground));
    display: none;
}
@media (min-width: 640px) { .brand-tagline { display: block; } }

.nav-links { display: none; align-items: center; gap: 2rem; }
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-links a {
    font-size: 0.875rem; font-weight: 500;
    color: hsl(var(--foreground));
    transition: opacity 0.15s;
    position: relative;
}
.nav-links a::after {
    content: ''; position: absolute; bottom: -0.25rem; left: 0;
    width: 100%; height: 2px;
    background: hsl(var(--primary) / 0.6);
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.15s;
}
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { transform: scaleX(1); }

.header-right { display: flex; align-items: center; gap: 0.75rem; }
.social-icon { color: hsl(var(--muted-foreground)); transition: color 0.15s; }
.social-icon:hover { color: hsl(var(--primary)); }
.social-icon svg { width: 1.25rem; height: 1.25rem; }

.header-spacer { height: 3.5rem; }

/* Main */
.main-gradient {
    min-height: calc(100vh - 3.5rem);
    background: linear-gradient(to bottom, hsl(var(--background)), hsl(var(--background) / 0.95));
}

/* Sections */
.section { padding: 2rem 0; }
.section-lg { padding: 4rem 0; }
.sections-wrap { display: flex; flex-direction: column; gap: 5rem; padding: 2rem 0 5rem; }

/* Eyebrow */
.eyebrow {
    font-size: 0.875rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: hsl(var(--primary) / 0.8);
}

/* Section title */
.section-title {
    font-size: 1.875rem; font-weight: 700;
    margin: 0.75rem 0;
}

/* Hero */
.hero-section { position: relative; overflow: hidden; padding: 4rem 0; }
.hero-content { display: flex; flex-direction: column; gap: 1.5rem; }
.hero-align-left { text-align: left; align-items: flex-start; }
.hero-align-center { text-align: center; align-items: center; }
.hero-title {
    font-size: 3.75rem; font-weight: 700; line-height: 1.1;
    background: linear-gradient(to right, #3b82f6, #2dd4bf);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
@media (max-width: 768px) { .hero-title { font-size: 2.25rem; } }
.hero-subtitle {
    font-size: 1.25rem; color: hsl(var(--muted-foreground));
    max-width: 56rem;
}
.hero-body {
    font-size: 1.125rem; color: hsl(var(--muted-foreground));
    max-width: 56rem;
}
.hero-badges { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    border-radius: 9999px;
    background: hsl(var(--primary) / 0.1);
    padding: 0.5rem 1rem;
    font-size: 0.875rem; font-weight: 500;
    color: hsl(var(--primary));
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; }
.cta-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    border-radius: 0.5rem; padding: 0.75rem 1.5rem;
    font-size: 0.875rem; font-weight: 600;
    background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
    transition: opacity 0.15s;
}
.cta-primary:hover { opacity: 0.9; }
.cta-secondary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    border-radius: 0.5rem; padding: 0.75rem 1.5rem;
    font-size: 0.875rem; font-weight: 600;
    background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
    transition: opacity 0.15s;
}
.cta-secondary:hover { opacity: 0.8; }
.cta-outline {
    display: inline-flex; align-items: center; gap: 0.5rem;
    border-radius: 0.5rem; padding: 0.75rem 1.5rem;
    font-size: 0.875rem; font-weight: 600;
    border: 1px solid hsl(var(--primary) / 0.3);
    color: hsl(var(--primary));
    transition: background 0.15s;
}
.cta-outline:hover { background: hsl(var(--primary) / 0.1); }

/* List sections */
.list-columns { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .list-columns { grid-template-columns: 1fr 1fr; } }
.list-vertical { display: flex; flex-direction: column; gap: 1rem; }
.list-card {
    background: hsl(var(--card) / 0.5);
    border: 1px solid hsl(var(--border) / 0.5);
    border-radius: 0.75rem; padding: 1.5rem;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.15s;
}
.list-card:hover { border-color: hsl(var(--primary) / 0.5); }
.list-card h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; color: hsl(var(--card-foreground)); }
.list-card p { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }

/* Markdown section */
.markdown-section { max-width: 56rem; }
.markdown-section h1, .markdown-section h2, .markdown-section h3 { margin: 1.5rem 0 0.75rem; }
.markdown-section h1 { font-size: 1.875rem; }
.markdown-section h2 { font-size: 1.5rem; }
.markdown-section h3 { font-size: 1.25rem; }
.markdown-section p { margin: 0.75rem 0; line-height: 1.7; color: hsl(var(--foreground)); }
.markdown-section ul, .markdown-section ol { margin: 0.75rem 0 0.75rem 1.5rem; }
.markdown-section li { margin: 0.25rem 0; }
.markdown-section strong { font-weight: 600; }
.markdown-section code {
    font-family: "SF Mono", "Fira Code", monospace;
    background: hsl(var(--muted)); padding: 0.125rem 0.375rem;
    border-radius: 0.25rem; font-size: 0.875em;
}
.markdown-section pre {
    background: hsl(var(--muted)); border: 1px solid hsl(var(--border));
    border-radius: 0.5rem; padding: 1rem; overflow-x: auto;
    font-family: "SF Mono", "Fira Code", monospace; font-size: 0.85rem;
}
.markdown-section pre code { background: none; padding: 0; }
.markdown-section blockquote {
    border-left: 3px solid hsl(var(--primary) / 0.4);
    padding-left: 1rem; color: hsl(var(--muted-foreground));
    margin: 1rem 0;
}
.markdown-muted {
    background: hsl(var(--card) / 0.4);
    border: 1px solid hsl(var(--border) / 0.4);
    border-radius: 0.75rem; padding: 2rem;
}

/* Projects */
.projects-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .projects-grid { grid-template-columns: 1fr 1fr; } }
.project-card {
    background: hsl(var(--card) / 0.4);
    border: 1px solid hsl(var(--border) / 0.4);
    border-radius: 0.75rem; padding: 1.5rem;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; flex-direction: column; gap: 1rem;
}
.project-card h3 { font-size: 1.25rem; font-weight: 600; color: hsl(var(--card-foreground)); }
.project-card p { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
    display: inline-flex; border-radius: 9999px;
    background: hsl(var(--secondary) / 0.6);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem; font-weight: 500;
    color: hsl(var(--secondary-foreground));
}

/* Callout */
.callout {
    border-radius: 1rem; border: 1px solid;
    padding: 2.5rem 2rem;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; flex-direction: column; gap: 1.5rem;
}
.callout-accent {
    border-color: hsl(var(--primary) / 0.3);
    background: hsl(var(--primary) / 0.1);
    color: hsl(var(--foreground));
}
.callout-title { font-size: 1.5rem; font-weight: 600; }
.callout-body { font-size: 1rem; }
.callout-cta {
    display: inline-flex; align-items: center; gap: 0.5rem;
    border-radius: 0.5rem; padding: 0.75rem 1.25rem;
    font-size: 0.875rem; font-weight: 600;
    background: hsl(var(--background) / 0.1); color: hsl(var(--foreground));
    transition: background 0.15s;
    align-self: flex-start;
}
.callout-cta:hover { background: hsl(var(--background) / 0.2); }
@media (min-width: 768px) {
    .callout { flex-direction: row; align-items: center; justify-content: space-between; }
    .callout-cta { align-self: center; }
}

/* Timeline */
.timeline-item {
    position: relative; padding-left: 2rem;
    border-left: 1px solid hsl(var(--border) / 0.4);
    padding-bottom: 1.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute; left: -0.375rem; top: 0.25rem;
    width: 0.75rem; height: 0.75rem;
    border-radius: 50%; background: hsl(var(--primary));
}
.timeline-item h3 { font-size: 1.125rem; font-weight: 600; }
.timeline-item .period { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.timeline-highlights { margin-top: 0.75rem; }
.timeline-highlights li {
    font-size: 0.875rem; color: hsl(var(--muted-foreground));
    display: flex; align-items: flex-start; gap: 0.5rem;
    margin: 0.5rem 0;
}

/* Pill groups */
.pill-groups-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .pill-groups-grid { grid-template-columns: 1fr 1fr; } }
.pill-group-card {
    border: 1px solid hsl(var(--border) / 0.4);
    background: hsl(var(--card) / 0.3);
    border-radius: 0.75rem; padding: 1.5rem;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pill-group-card h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; }

/* Grouped list */
.grouped-list-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .grouped-list-grid { grid-template-columns: 1fr 1fr; } }
.grouped-list-card {
    background: hsl(var(--card) / 0.4);
    border: 1px solid hsl(var(--border) / 0.4);
    border-radius: 0.75rem; padding: 1.5rem;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.grouped-list-card h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.grouped-list-card ul { list-style: none; padding: 0; }
.grouped-list-card li {
    font-size: 0.875rem; color: hsl(var(--muted-foreground));
    display: flex; align-items: flex-start; gap: 0.5rem;
    margin: 0.5rem 0;
}
.grouped-list-dot {
    margin-top: 0.25rem; width: 0.375rem; height: 0.375rem;
    border-radius: 50%; background: hsl(var(--primary)); flex-shrink: 0;
}

/* Footer */
.site-footer {
    border-top: 1px solid hsl(var(--border));
    background: hsl(var(--background) / 0.5);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.site-footer .container { padding-top: 2rem; padding-bottom: 2rem; }
.footer-grid {
    display: grid; grid-template-columns: 1fr; gap: 2rem;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr; } }
.footer-brand h3 { font-weight: 700; font-size: 1.125rem; }
.footer-tagline {
    font-size: 0.875rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: hsl(var(--primary) / 0.8); margin-top: 0.25rem;
}
.footer-desc {
    font-size: 0.875rem; color: hsl(var(--muted-foreground));
    max-width: 28rem; margin-top: 0.75rem;
}
.footer-contact h3 { font-weight: 700; font-size: 1.125rem; margin-bottom: 1rem; }
.footer-contact-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-contact-link {
    display: flex; align-items: center; gap: 0.5rem;
    color: hsl(var(--muted-foreground)); font-size: 0.875rem;
    transition: color 0.15s;
}
.footer-contact-link:hover { color: hsl(var(--primary)); }
.footer-contact-icon {
    background: hsl(var(--primary) / 0.1);
    border-radius: 9999px; padding: 0.375rem;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.footer-contact-link:hover .footer-contact-icon { background: hsl(var(--primary) / 0.2); }
.footer-contact-icon svg { width: 1rem; height: 1rem; color: hsl(var(--primary)); }
.footer-copyright {
    margin-top: 2rem; padding-top: 2rem;
    border-top: 1px solid hsl(var(--border));
    text-align: center; font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

/* Blog list */
.blog-list { display: flex; flex-direction: column; gap: 1rem; }
.blog-card {
    background: hsl(var(--card) / 0.5);
    border: 1px solid hsl(var(--border) / 0.5);
    border-radius: 0.75rem; padding: 1.5rem;
    transition: border-color 0.15s;
}
.blog-card:hover { border-color: hsl(var(--primary) / 0.5); }
.blog-card h3 { font-size: 1.125rem; }
.blog-card h3 a { color: hsl(var(--foreground)); }
.blog-card h3 a:hover { color: hsl(var(--primary)); }
.blog-card p { font-size: 0.875rem; color: hsl(var(--muted-foreground)); margin: 0.5rem 0; }
.blog-card time { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }

/* Single post */
.post-single { max-width: 56rem; }
.post-single h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.post-single time { font-size: 0.85rem; color: hsl(var(--muted-foreground)); }
.post-content { margin-top: 1.5rem; line-height: 1.7; }
.back-link { display: inline-block; margin-top: 1.5rem; color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.empty-state { color: hsl(var(--muted-foreground)); padding: 2rem; text-align: center; }

/* Admin - minimal */
.admin-body { background: hsl(var(--background)); }
.admin-nav {
    background: hsl(var(--popover));
    border-bottom: 1px solid hsl(var(--border));
    padding: 0.75rem 2rem;
    display: flex; justify-content: space-between; align-items: center;
}
.admin-logo { font-weight: 700; color: hsl(var(--primary)) !important; }
.admin-nav-links { display: flex; gap: 1.25rem; align-items: center; }
.admin-nav-links a { color: hsl(var(--muted-foreground)); font-size: 0.85rem; }
.admin-nav-links a:hover { color: hsl(var(--primary)); }
.admin-logout { color: hsl(var(--destructive)) !important; }
.admin-view-site { color: hsl(var(--primary)) !important; }
.admin-content { max-width: 960px; margin: 0 auto; padding: 2rem; }
.admin-content h1 { margin-bottom: 1.5rem; }
.admin-content h2 { margin: 1.5rem 0 1rem; font-size: 1.2rem; }

.login-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%; max-width: 360px;
}
.login-card h1 { color: hsl(var(--primary)); margin-bottom: 1.5rem; text-align: center; }
.login-card form { display: flex; flex-direction: column; gap: 0.75rem; }

input, textarea, select {
    background: hsl(var(--input));
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    width: 100%;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: hsl(var(--ring)); }
.btn {
    display: inline-block; background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
    padding: 0.625rem 1.25rem; border: none; border-radius: var(--radius);
    font-weight: 600; cursor: pointer; font-size: 0.875rem; text-decoration: none; text-align: center;
}
.btn:hover { opacity: 0.9; }
.btn-secondary {
    display: inline-block; background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
    padding: 0.625rem 1.25rem; border: 1px solid hsl(var(--border));
    border-radius: var(--radius); font-size: 0.875rem; text-decoration: none;
}
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; margin-bottom: 0.25rem; font-size: 0.85rem; color: hsl(var(--muted-foreground)); }
.form-row-inline { display: flex; gap: 1rem; margin-bottom: 1rem; }
.form-row-inline > div { flex: 1; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.form-inline { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; align-items: flex-end; flex-wrap: wrap; }
.form-inline > * { flex: 0 0 auto; }
.field-error { color: hsl(var(--destructive)); font-size: 0.85rem; margin: 0.5rem 0; }

.data-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.data-table th { text-align: left; color: hsl(var(--muted-foreground)); font-size: 0.8rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid hsl(var(--border)); }
.data-table td { padding: 0.625rem 0.75rem; border-bottom: 1px solid hsl(var(--border)); }
.data-table a { color: hsl(var(--primary)); }

.badge { padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-draft { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.badge-published { background: hsl(var(--primary) / 0.1); color: hsl(var(--primary)); }
.badge-scheduled { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge-trash { background: rgba(248, 113, 113, 0.15); color: hsl(var(--destructive)); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: hsl(var(--card)); border: 1px solid hsl(var(--border));
    border-radius: var(--radius); padding: 1.25rem; text-align: center;
}
.stat-number { display: block; font-size: 2rem; font-weight: 700; color: hsl(var(--primary)); }
.stat-label { color: hsl(var(--muted-foreground)); font-size: 0.85rem; }

.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.danger-link { color: hsl(var(--destructive)) !important; }
.revisions { margin: 1.5rem 0; }

.media-upload { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; align-items: flex-end; flex-wrap: wrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
.media-card {
    background: hsl(var(--card)); border: 1px solid hsl(var(--border));
    border-radius: var(--radius); padding: 1rem; text-align: center;
}
.media-icon { font-size: 0.8rem; color: hsl(var(--muted-foreground)); margin-bottom: 0.5rem; }
.media-card p { font-size: 0.85rem; margin-bottom: 0.25rem; word-break: break-all; }
.media-card small { color: hsl(var(--muted-foreground)); font-size: 0.75rem; }

@media (max-width: 640px) {
    .container { padding: 0 1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row-inline { flex-direction: column; }
    .admin-nav { flex-direction: column; gap: 0.5rem; }
    .admin-nav-links { flex-wrap: wrap; justify-content: center; }
}
