:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #3b82f6;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.025em;
}
.logo svg { width: 28px; height: 28px; color: var(--primary); }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }
.nav-cta {
    background: var(--primary);
    color: white !important;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}
.nav-cta:hover { background: var(--primary-hover); }

@media (max-width: 768px) {
    .nav-links { display: none; }
}

/* Hero Section */
.hero {
    padding: 6rem 0;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid var(--border);
}
.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}
.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}
.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Sections */
.section { padding: 5rem 0; }
.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    letter-spacing: -0.025em;
}

/* Grid Layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
}
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.card-body { padding: 1.5rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* Tool Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3rem 0;
}
@media (min-width: 1024px) {
    .main-grid { grid-template-columns: 450px 1fr; }
}

/* Editor */
.editor-section {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

/* Forms */
.form-group { margin-bottom: 1.5rem; position: relative; }
label {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.char-count { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }
input[type="text"], input[type="url"], textarea, select {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--bg);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
textarea { resize: vertical; min-height: 100px; }
.help-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Tabs */
.tabs { display: flex; gap: 0.25rem; background: var(--border); padding: 0.25rem; border-radius: var(--radius-lg); }
.tab {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}
.tab:hover { color: var(--text-main); }
.tab.active {
    background: var(--surface);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

/* Code Block */
.code-block {
    margin: 0;
    padding: 1.5rem;
    background: #0f172a;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Social Previews */
.preview-container {
    background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 10px, #f8fafc 10px, #f8fafc 20px);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    padding: 2rem;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.social-preview-box {
    background: white;
    text-align: left;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.preview-img-container {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.preview-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.img-placeholder svg { width: 32px; height: 32px; margin-bottom: 0.5rem; opacity: 0.5; }

/* Platform Specific Previews */
.preview-facebook, .preview-linkedin { width: 500px; max-width: 100%; }
.preview-facebook .preview-content, .preview-linkedin .preview-content { padding: 10px 12px; background: #f2f3f5; }
.preview-facebook .preview-domain, .preview-linkedin .preview-domain { font-size: 12px; color: #606770; text-transform: uppercase; margin-bottom: 2px; }
.preview-facebook .preview-title, .preview-linkedin .preview-title { font-size: 16px; font-weight: 600; color: #1d2129; margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.preview-facebook .preview-desc, .preview-linkedin .preview-desc { font-size: 14px; color: #606770; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.preview-twitter { width: 504px; max-width: 100%; border-radius: 16px; border: 1px solid #cfd9de; box-shadow: none; }
.preview-twitter .preview-img-container { border-bottom: 1px solid #cfd9de; }
.preview-twitter .preview-content { padding: 12px; background: white; }
.preview-twitter .preview-domain { font-size: 15px; color: #536471; margin-bottom: 2px; }
.preview-twitter .preview-title { font-size: 15px; color: #0f1419; font-weight: 400; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.preview-twitter .preview-desc { display: none; }

.preview-discord { width: 432px; max-width: 100%; background: #2f3136; border-radius: 4px; border-left: 4px solid var(--primary); box-shadow: none; display: flex; flex-direction: column-reverse; }
.preview-discord .preview-content { padding: 16px; background: #2f3136; }
.preview-discord .preview-domain { font-size: 12px; color: #b9bbbe; margin-bottom: 8px; }
.preview-discord .preview-title { font-size: 16px; font-weight: 600; color: #00b0f4; margin-bottom: 8px; }
.preview-discord .preview-desc { font-size: 14px; color: #dcddde; line-height: 1.375; }
.preview-discord .preview-img-container { border-bottom: none; border-radius: 4px; margin: 0 16px 16px 16px; width: auto; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--success);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; }
}
.footer-title {
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-size: 1.125rem;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 0.75rem; }
.footer ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.footer ul li a:hover { color: var(--primary); }
.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Prose for Blog/Static Pages */
.prose { max-width: 800px; margin: 4rem auto; }
.prose h1 { font-size: 2.5rem; margin-bottom: 1.5rem; font-weight: 800; }
.prose h2 { font-size: 1.875rem; margin-top: 3rem; margin-bottom: 1rem; font-weight: 700; }
.prose h3 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; font-weight: 600; }
.prose p { margin-bottom: 1.5rem; font-size: 1.125rem; color: #334155; }
.prose ul, .prose ol { margin-bottom: 1.5rem; padding-left: 1.5rem; font-size: 1.125rem; color: #334155; }
.prose li { margin-bottom: 0.5rem; }
.prose pre { background: #0f172a; padding: 1.5rem; border-radius: 8px; overflow-x: auto; margin-bottom: 1.5rem; }
.prose code { font-family: monospace; color: #e2e8f0; }
.prose a { color: var(--primary); text-decoration: underline; }

/* Testimonials */
.testimonial {
    padding: 2rem;
    text-align: center;
}
.testimonial p { font-style: italic; color: var(--text-muted); margin-bottom: 1.5rem; }
.testimonial-author { font-weight: 600; color: var(--text-main); }
.testimonial-role { font-size: 0.875rem; color: var(--text-muted); }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 600;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.icon-box {
    width: 48px;
    height: 48px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.icon-box svg { width: 24px; height: 24px; }
