/* Fonts are preconnected + loaded from the HTML <head> so they don't block render. */

:root {
    --bg-dark: #070913;
    --bg-surface: #0f132a;
    --bg-card: rgba(20, 26, 56, 0.45);
    
    --primary: #00f2fe;
    --primary-glow: rgba(0, 242, 254, 0.35);
    
    --secondary: #ff0844;
    --secondary-glow: rgba(255, 8, 68, 0.35);
    
    --accent: #ffd700;
    --accent-glow: rgba(255, 215, 0, 0.3);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 242, 254, 0.15);
    
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-spring: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-smooth: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Glowing Background Blobs */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.25;
    animation: blob-float 15s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 45vw;
    height: 45vw;
    background: var(--primary);
    animation-duration: 20s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--secondary);
    animation-duration: 25s;
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 60%;
    width: 30vw;
    height: 30vw;
    background: var(--accent);
    opacity: 0.12;
    animation-duration: 18s;
    animation-delay: -2s;
}

@keyframes blob-float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(8%, 10%) scale(1.15); }
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    z-index: -1;
    pointer-events: none;
}

/* Header & Navigation */
header {
    background: rgba(7, 9, 19, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.03em;
}

.logo span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    position: relative;
    padding: 0.25rem 0;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition-smooth);
}

nav a:hover, nav a.active {
    color: var(--text-main);
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

.btn-nav-action {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: #fff;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-spring);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
    text-decoration: none;
}

.btn-nav-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 8, 68, 0.4);
}

/* Layout Framework */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

/* Sized so the longest headline line still fits on one row at desktop.
   `balance` then shares the words evenly across rows at the widths where
   it does wrap, instead of stranding a single word on its own line. */
.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.45rem, 5.6vw, 3.4rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 auto 1.25rem;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

/* inline-block keeps the gradient tight to the glyphs (a full-width block
   would stretch it across the whole row), and still balances its own lines. */
.hero h1 span {
    background: linear-gradient(135deg, var(--primary) 30%, var(--secondary) 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    position: relative;
    text-wrap: balance;
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
    text-wrap: pretty;
}

/* Glass Card Component */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: var(--transition-spring);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* The Chaos Generator UI */
.generator-section {
    max-width: 750px;
    margin: 0 auto 5rem;
    position: relative;
}

.generator-section::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    z-index: -1;
    border-radius: 18px;
    opacity: 0.15;
    filter: blur(8px);
}

.generator-header {
    text-align: center;
    margin-bottom: 2rem;
}

.generator-header h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.generator-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 640px) {
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.filter-value {
    color: var(--primary);
    font-weight: 700;
}

/* Custom Sliders */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: var(--transition-smooth);
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    cursor: pointer;
    transition: var(--transition-spring);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #fff;
    box-shadow: 0 0 15px var(--primary);
}

/* Location Pills */
.location-pills {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

@media (max-width: 480px) {
    .location-pills {
        grid-template-columns: repeat(2, 1fr);
    }
}

.pill-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
    text-align: center;
}

.pill-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.pill-btn.active {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

/* Budget Pills */
.budget-pills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.budget-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition-smooth);
    text-align: center;
}

.budget-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.budget-btn.active {
    background: rgba(255, 8, 68, 0.15);
    border-color: var(--secondary);
    color: var(--secondary);
    box-shadow: 0 0 10px rgba(255, 8, 68, 0.15);
}

/* Generator Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
}

@media (max-width: 480px) {
    .action-buttons {
        flex-direction: column;
    }
}

.btn-generate {
    flex: 2;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: #fff;
    padding: 1.1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-spring);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-generate:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 35px rgba(255, 8, 68, 0.5);
}

.btn-generate:active {
    transform: translateY(0) scale(1);
}

.btn-chaos {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--accent);
    color: var(--accent);
    padding: 1.1rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-spring);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-chaos:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 0 25px var(--accent-glow);
}

/* ---------------------------------------------------------------
   Generator "rolling" feedback
   The roll takes ~1.2s, so the button has to visibly commit to the
   click: label swaps to a spinner, a shimmer sweeps the gradient, a
   progress bar fills, and a ticker flickers through candidate ideas.
   --------------------------------------------------------------- */

/* Button loading state */
.btn-generate .btn-loader,
.btn-chaos .btn-loader {
    display: none;
    align-items: center;
    gap: 0.6rem;
}

.btn-generate.is-loading .btn-label,
.btn-chaos.is-loading .btn-label {
    display: none;
}

.btn-generate.is-loading .btn-loader,
.btn-chaos.is-loading .btn-loader {
    display: inline-flex;
}

.btn-generate.is-loading,
.btn-chaos.is-loading {
    cursor: progress;
    transform: none;
}

/* Light sweeping across the button while it thinks */
.btn-generate.is-loading {
    background-image: linear-gradient(135deg, var(--primary), var(--secondary)),
                      linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%);
    background-size: 100% 100%, 220% 100%;
    background-repeat: no-repeat;
    animation: btn-sweep 0.9s linear infinite, btn-throb 0.9s ease-in-out infinite;
}

@keyframes btn-sweep {
    from { background-position: 0 0, -110% 0; }
    to   { background-position: 0 0,  110% 0; }
}

@keyframes btn-throb {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 242, 254, 0.35); }
    50%      { box-shadow: 0 0 38px rgba(255, 8, 68, 0.6); }
}

.btn-chaos.is-loading {
    background: rgba(255, 215, 0, 0.12);
    animation: btn-throb-chaos 0.6s ease-in-out infinite;
}

@keyframes btn-throb-chaos {
    0%, 100% { box-shadow: 0 0 10px var(--accent-glow); border-color: var(--accent); }
    50%      { box-shadow: 0 0 30px var(--accent-glow); border-color: #fff; }
}

/* Disabled (but not rolling) buttons shouldn't look clickable */
.btn-generate:disabled:not(.is-loading),
.btn-chaos:disabled:not(.is-loading) {
    opacity: 0.5;
    cursor: not-allowed;
}

/* The spinner itself */
.spinner {
    width: 1.05em;
    height: 1.05em;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    flex-shrink: 0;
    animation: spin 0.6s linear infinite;
}

.btn-chaos .spinner {
    border-color: rgba(255, 215, 0, 0.3);
    border-top-color: var(--accent);
}

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

/* Progress bar + slot ticker below the buttons */
.generator-status {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.generator-status[hidden] {
    display: none;
}

.generator-progress {
    height: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.generator-progress-bar {
    height: 100%;
    width: 0;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
    box-shadow: 0 0 12px var(--primary-glow);
    transition: width 0.1s linear;
}

.generator-ticker {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    min-height: 1.4em;
    letter-spacing: 0.02em;
}

.generator-ticker strong {
    color: var(--primary);
    font-weight: 700;
}

/* Each new title that lands in the ticker flickers in like a slot reel */
.generator-ticker.rolling strong {
    animation: slot-spin 0.1s linear;
}

@keyframes slot-spin {
    0%   { transform: translateY(-6px); opacity: 0.2; }
    100% { transform: translateY(0);    opacity: 1; }
}

.generator-ticker strong {
    display: inline-block;
}

.screen-shake {
    animation: screen-shake-anim 0.4s cubic-bezier(.36,.07,.19,.97) infinite;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes screen-shake-anim {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Respect users who asked the OS for less motion: keep the state changes
   (spinner swap, progress bar, ticker) but drop the shaking and throbbing. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .screen-shake { animation: none; }

    .spinner {
        animation: spin 0.8s linear infinite !important;
    }

    .generator-progress-bar {
        transition: width 0.1s linear !important;
    }
}

/* Weekly Challenge Section */
.challenge-section {
    margin-bottom: 5rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 2.5rem;
    position: relative;
    display: inline-block;
    text-wrap: balance;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.challenge-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
}

@media (max-width: 900px) {
    .challenge-grid {
        grid-template-columns: 1fr;
    }
}

.challenge-card {
    background: linear-gradient(135deg, rgba(20, 26, 56, 0.75), rgba(7, 9, 19, 0.9));
    border: 1px solid rgba(255, 215, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.challenge-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--accent);
    color: #000;
    padding: 0.4rem 0.8rem;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 20px;
    box-shadow: 0 0 15px var(--accent-glow);
}

.challenge-details h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.challenge-desc {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.challenge-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Submissions Live Feed */
.challenge-feed {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.feed-item {
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
    align-items: center;
}

.feed-media {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-info {
    flex-grow: 1;
}

.feed-user {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feed-user span {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

.feed-msg {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.feed-votes {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
}

.feed-votes:hover {
    transform: scale(1.05);
}

/* Grid of Cards */
.ideas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.idea-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.idea-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tag-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
}

.party-rating {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.idea-card h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    text-wrap: balance;
}

.idea-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    text-wrap: pretty;
}

.idea-card-meta {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.meta-val {
    color: var(--text-main);
    font-weight: 600;
}

.card-click-trigger {
    position: absolute;
    inset: 0;
    cursor: pointer;
    z-index: 2;
}

/* Modals / Custom Dialog */
dialog::backdrop {
    background: rgba(7, 9, 19, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

dialog[open] {
    animation: modal-zoom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

dialog[open]::backdrop {
    animation: backdrop-fade 0.3s ease both;
}

/* The zoom must only touch scale/opacity. A `translate()` here would be
   overwritten by the animation and knock the dialog off-centre. */
@keyframes modal-zoom {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes backdrop-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Centring is done by the browser: a modal <dialog> is `position: fixed`
   with `inset: 0`, so `margin: auto` centres it on both axes. */
.modal {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-main);
    border-radius: 20px;
    max-width: min(600px, 92vw);
    width: 100%;
    max-height: 90vh;
    position: fixed;
    inset: 0;
    margin: auto;
    padding: 0;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 242, 254, 0.1);
    overflow: hidden;
}

/* The column layout is scoped to [open]. Setting `display` on `.modal`
   itself would beat the UA's `dialog:not([open]) { display: none }` —
   author styles win over UA styles — and every closed dialog on the page
   would render permanently, with no way to dismiss it. */
.modal[open] {
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-close:hover {
    color: var(--secondary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

.modal-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.modal-meta-grid.two-cols {
    grid-template-columns: repeat(2, 1fr);
}

.modal-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-meta-item span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.modal-meta-item strong {
    font-size: 1rem;
    color: var(--primary);
}

.modal-section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tools-list {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.step-item {
    display: flex;
    gap: 1rem;
    line-height: 1.5;
}

.step-num {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.85rem;
}

.step-content {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Catalog Page CSS */
.search-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input-wrapper {
    flex-grow: 1;
    position: relative;
}

.search-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 1rem 1.5rem 1rem 3rem;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition-smooth);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--border-glow);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.category-filter-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Incubator Page CSS */
.incubator-hero {
    text-align: center;
    margin-bottom: 4rem;
}

.incubator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.incubator-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.incubator-card-author {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.incubator-card-author strong {
    color: var(--primary);
}

.incubator-votes-row {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vote-action-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    color: var(--text-main);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition-spring);
}

.vote-action-btn:hover {
    transform: scale(1.08);
}

.vote-action-btn.voted-hype {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.vote-action-btn.voted-chaos {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

.vote-action-btn.voted-bore {
    background: rgba(255, 8, 68, 0.15);
    border-color: var(--secondary);
    color: var(--secondary);
}

/* Footer style */
footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

footer p {
    margin-bottom: 0.5rem;
}

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

footer a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------
   Content / SEO landing sections
   --------------------------------------------------------------- */

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--primary);
    color: #000;
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 8px 0;
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    left: 0;
}

/* Visible focus ring everywhere (accessibility + Lighthouse) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.breadcrumbs li::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--border-color);
}

.breadcrumbs li:last-child::after {
    content: '';
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs [aria-current='page'] {
    color: var(--text-main);
    font-weight: 600;
}

/* Occasion hub: internal links into every idea cluster */
.occasion-section {
    margin-bottom: 5rem;
}

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

.occasion-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition-spring);
}

.occasion-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 0 25px var(--border-glow);
}

.occasion-emoji {
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.occasion-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    line-height: 1.3;
}

.occasion-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.occasion-card .occasion-count {
    margin-top: 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
}

/* Long-form prose blocks on the landing pages */
.prose {
    max-width: 760px;
    margin: 0 auto 5rem;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.75;
}

.prose h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.45rem, 2.6vw, 1.85rem);
    color: var(--text-main);
    margin: 2.5rem 0 1rem;
    line-height: 1.25;
    text-wrap: balance;
}

.prose h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--text-main);
    margin: 2rem 0 0.75rem;
    text-wrap: balance;
}

.prose p,
.prose li {
    text-wrap: pretty;
}

.prose p {
    margin-bottom: 1.15rem;
}

.prose ul, .prose ol {
    margin: 0 0 1.5rem 1.25rem;
}

.prose li {
    margin-bottom: 0.6rem;
    padding-left: 0.35rem;
}

.prose strong {
    color: var(--text-main);
}

.prose a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.prose a:hover {
    color: var(--secondary);
}

.lede {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 2.5rem;
    text-align: center;
    text-wrap: pretty;
}

/* FAQ accordion (mirrors the FAQPage structured data) */
.faq-section {
    max-width: 820px;
    margin: 0 auto 5rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.faq-item[open] {
    border-color: var(--border-glow);
}

.faq-item summary {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    list-style: none;
    color: var(--text-main);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
    line-height: 1;
    transition: var(--transition-smooth);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover {
    background: rgba(255, 255, 255, 0.03);
}

.faq-answer {
    padding: 0 1.5rem 1.35rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.faq-answer a {
    color: var(--primary);
    text-decoration: none;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* Tag chips on idea cards */
.idea-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.idea-tag {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    text-decoration: none;
}

a.idea-tag:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* "Related" internal-link cluster in the footer of landing pages */
.related-links {
    max-width: 820px;
    margin: 0 auto 4rem;
    text-align: center;
}

.related-links h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.related-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.related-chips a {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.related-chips a:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0, 242, 254, 0.08);
}

/* Footer nav columns */
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-nav a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Mobile nav wrapping */
@media (max-width: 720px) {
    .nav-container {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    nav {
        gap: 1.15rem;
        flex-wrap: wrap;
        font-size: 0.9rem;
    }

    main {
        padding: 2rem 1.25rem;
    }
}

