:root {
    --primary: #16a34a;
    --primary-dark: #15803d;
    --primary-light: #4ade80;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.06);
    --radius: 1rem;
    --radius-sm: 0.5rem;
    --ease: 200ms cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.container {
    width: 100%;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* ── Navbar ── */

.site-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 0;
    transition: box-shadow var(--ease);
}

.site-navbar .container {
    display: flex;
    align-items: center;
}

.site-navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.site-brand {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text) !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
    transition: color var(--ease);
}

.site-brand:hover {
    color: var(--primary) !important;
}

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

/* ── Hero ── */

.hero {
    position: relative;
    background: linear-gradient(135deg, #052e16 0%, #14532d 45%, #166534 100%);
    color: white;
    padding: 6rem 0 7rem;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.375rem 0.875rem;
    border-radius: 2rem;
    margin-bottom: 1.75rem;
}

.hero-title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    color: white;
}

.hero-subtitle {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 0;
    max-width: 480px;
}

.hero-decoration {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.25;
}

.hero-blob-1 {
    width: 480px;
    height: 480px;
    background: #4ade80;
    top: -120px;
    right: -80px;
    animation: blob-float 9s ease-in-out infinite;
}

.hero-blob-2 {
    width: 360px;
    height: 360px;
    background: #22c55e;
    bottom: -100px;
    right: 28%;
    animation: blob-float 12s ease-in-out infinite reverse;
}

@keyframes blob-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-24px) scale(1.06); }
}

/* ── Feeds Section ── */

.feeds-section {
    padding: 5rem 0 6rem;
    background: var(--bg-alt);
}

.feeds-header {
    margin-bottom: 2.5rem;
}

.feeds-header h2 {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.feeds-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin: 0;
}

/* ── Feed Cards ── */

.feeds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.feed-card {
    --accent: var(--primary);
    --accent-soft: rgba(22, 163, 74, 0.1);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.375rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
    height: 100%;
    overflow: hidden;
}

.feed-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--accent-soft);
    opacity: 0;
    transition: opacity var(--ease);
    pointer-events: none;
}

.feed-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.feed-card:hover::after {
    opacity: 0.45;
}

.feed-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 2.875rem;
    height: 2.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: 0.75rem;
}

.feed-card-body {
    flex: 1;
    min-width: 0;
}

.feed-card-title {
    display: inline-block;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 0.5rem;
    color: var(--text);
}

.feed-card-desc {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

.feed-card-urlrow {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    max-width: 100%;
    flex-wrap: nowrap;
    min-width: 0;
}


.feed-card-url {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--bg-alt);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    flex: 1;
    min-width: 0;
    text-decoration: none;
}

.feed-card-url:hover {
    text-decoration: underline;
    color: var(--text-muted);
}

.copy-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: var(--text-muted);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: color var(--ease), background var(--ease), border-color var(--ease), transform var(--ease);
}

.copy-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.copy-btn:active {
    transform: scale(0.92);
}

.copy-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.copy-icon {
    display: block;
}

.copy-icon--done {
    display: none;
    color: #16a34a;
}

.copy-btn.copied .copy-icon--copy {
    display: none;
}

.copy-btn.copied .copy-icon--done {
    display: block;
}

.copy-btn.copied {
    color: #16a34a;
    border-color: #16a34a;
    background: rgba(22, 163, 74, 0.08);
}

/* Per-feed accent colors — green family */
.feed-card--emerald { --accent: #10b981; --accent-soft: rgba(16, 185, 129, 0.1); }
.feed-card--teal    { --accent: #14b8a6; --accent-soft: rgba(20, 184, 166, 0.1); }
.feed-card--lime    { --accent: #65a30d; --accent-soft: rgba(101, 163, 13, 0.12); }
.feed-card--green   { --accent: #22c55e; --accent-soft: rgba(34, 197, 94, 0.1); }
.feed-card--forest  { --accent: #15803d; --accent-soft: rgba(21, 128, 61, 0.1); }

/* ── Footer ── */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    background: var(--bg);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-logo {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
}

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

/* ── Error / Generic pages ── */

.page-container {
    padding: 4rem 0;
}

.page-container h1 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.text-danger {
    color: #dc2626 !important;
}

.page-container code {
    font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
    background: var(--bg-alt);
    padding: 0.1rem 0.35rem;
    border-radius: 0.35rem;
    font-size: 0.875em;
}

a {
    color: var(--primary);
}

/* ── Custom Feed Builder ── */

.custom-feed-section {
    padding: 5rem 0 6rem;
    background: var(--bg);
}

.custom-feed-builder {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem 2.25rem 2.25rem;
    max-width: 860px;
}

.custom-feed-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.custom-feed-divider::before,
.custom-feed-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.custom-feed-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.custom-feed-field label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.custom-feed-field--required label::after {
    content: " *";
    color: var(--primary);
}

.field-hint {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
}

.custom-feed-field input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-alt);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.custom-feed-field input:hover {
    border-color: #cbd5e1;
}

.custom-feed-field input:focus {
    border-color: var(--primary);
    background: var(--bg);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.custom-feed-field input::placeholder {
    color: #94a3b8;
}

.custom-feed-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.custom-feed-row + .custom-feed-row {
    margin-top: 1rem;
}

.custom-feed-field--wide {
    grid-column: span 2;
}

.custom-feed-actions {
    margin-top: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.28);
    letter-spacing: -0.01em;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.38);
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(22, 163, 74, 0.2);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.35);
}

.custom-feed-result {
    margin-top: 1.5rem;
    padding: 1.125rem 1.25rem;
    background: rgba(22, 163, 74, 0.05);
    border: 1.5px solid rgba(22, 163, 74, 0.18);
    border-radius: var(--radius-sm);
}

.custom-feed-result > label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 0.625rem;
}

/* ── Accessibility helpers ── */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Secondary button ── */

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6875rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--primary);
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--ease), background var(--ease), color var(--ease), transform var(--ease);
    letter-spacing: -0.01em;
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(22, 163, 74, 0.06);
}

.btn-secondary:active {
    transform: scale(0.97);
}

.btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.35);
}

/* ── Subscribe links ── */

.subscribe-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.625rem;
}

.subscribe-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.subscribe-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.875rem;
    height: 1.875rem;
    color: var(--text-muted);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: border-color var(--ease), background var(--ease), color var(--ease), transform var(--ease);
}

.subscribe-icon:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.subscribe-icon:active {
    transform: scale(0.94);
}

.subscribe-icon:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft, rgba(22, 163, 74, 0.25));
}

/* Brand-tinted hover for recognizability; subtle/monochrome at rest. */
.subscribe-default:hover {
    color: var(--accent, var(--primary));
    border-color: var(--accent, var(--primary));
    background: var(--accent-soft, rgba(22, 163, 74, 0.1));
}

.subscribe-overcast:hover {
    color: #fc7e0f;
    border-color: #fc7e0f;
    background: rgba(252, 126, 15, 0.1);
}

.subscribe-pocketcasts:hover {
    color: #f43e37;
    border-color: #f43e37;
    background: rgba(244, 62, 55, 0.1);
}

/* ── Live preview ── */

.preview-btn {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    padding: 0.2rem 0;
    cursor: pointer;
    transition: color var(--ease);
}

.preview-btn:hover {
    color: var(--accent, var(--primary));
}

.preview-btn:focus-visible {
    outline: none;
    color: var(--accent, var(--primary));
    text-decoration: underline;
}

.preview-btn::before {
    content: "▸ ";
}

.preview-btn[aria-expanded="true"]::before {
    content: "▾ ";
}

.feed-preview {
    margin-top: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.custom-feed-builder .feed-preview {
    margin-top: 1.5rem;
}

.feed-preview-count {
    margin: 0 0 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.feed-preview-status,
.feed-preview-error {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.feed-preview-error {
    color: #dc2626;
}

.feed-preview-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feed-preview-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.feed-preview-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.feed-preview-item-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.feed-preview-item-meta {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* ── Responsive ── */

@media (max-width: 576px) {
    .hero {
        padding: 3.5rem 0 4.5rem;
    }

    .feeds-section {
        padding: 3rem 0 4rem;
    }

    .custom-feed-section {
        padding: 3rem 0 4rem;
    }

    .custom-feed-builder {
        padding: 1.25rem;
    }

    .custom-feed-row {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }
}
