:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-strong: #e3ecf7;
  --border: rgba(214, 235, 200, 0.92);  
  --text: #0f172a;
  --muted: #51627a;
  --accent: #4f8ef7;
  --accent-strong: #7fb3ff;
  --accent-warm: #f18426;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
  --container: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
      background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.14), transparent 35%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 32%),
        linear-gradient(180deg, #f7faff 0%, var(--bg) 100%);
    color: var(--text);
    margin: 0;
    line-height: 1.5;
}

button,
input,
code {
    font: inherit;
}

a {
    color: inherit;
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    z-index: 999;
    background: #fff;
    padding: 0.75rem 1rem;
    border-radius: 12px;
}

.container {
    width: min(calc(100% - 2rem), var(--container));
    margin: 0 auto;
}

.site-header {
    padding: 2rem 0 1.25rem;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
    gap: 1.25rem;
}

.hero-copy,
.hero-card,
.controls,
.library-section,
.footer-inner,
.gradient-card,
.empty-state {
    background: var(--surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.hero-copy,
.hero-card,
.footer-inner,
.empty-state,
.library-section {
    border-radius: var(--radius);
    padding: 1.5rem;
}

.hero-card {
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.10), rgba(59, 130, 246, 0.06)), rgba(255, 255, 255, 0.92);
}

.eyebrow {
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.05;
    margin-bottom: 0.9rem;
}

.hero-text,
.hero-card p,
.footer-note,
.search-label,
.gradient-meta,
.empty-state p {
    color: var(--muted);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: #f3f7ff;
    border: 1px solid #e3edff;
    font-size: 0.95rem;
}

.controls-wrap {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 0.5rem 0 1rem;
    background: linear-gradient(to bottom, rgba(244, 249, 241, 0.98), rgba(244, 249, 241, 0.88), rgba(244, 249, 241, 0));
}

.controls {
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.search-field {
    flex: 1;
}

.search-label {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.search-field input {
    width: 100%;
    border: 1px solid #cfe0c7;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    background: #fff;
    color: var(--text);
}

.search-field input:focus,
.button:focus,
.gradient-preview:focus,
.copy-button:focus {
    outline: 3px solid rgba(92, 175, 71, 0.22);
    outline-offset: 1px;
}

.toolbar-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.button,
.copy-button {
    border: 1px solid #cfe0c7;
    background: #fff;
    color: var(--text);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.button:hover,
.copy-button:hover,
.gradient-preview:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(20, 35, 29, 0.08);
    border-color: rgba(92, 175, 71, 0.45);
}

.results-bar {
    padding-bottom: 1rem;
}

#results-count {
    margin-bottom: 0;
    font-weight: 600;
}

.library-section {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

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

.gradient-card {
    overflow: hidden;
    border-radius: var(--radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gradient-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(20, 35, 29, 0.12);
}

.gradient-preview {
    width: 100%;
    height: 180px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    display: block;
}

.card-body {
    padding: 1rem;
}

.gradient-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: #eef8e8;
    border: 1px solid #d6ebc8;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.gradient-title {
    font-size: 1.08rem;
    margin: 0 0 0.35rem;
}

.gradient-meta {
    font-size: 0.95rem;
    margin-bottom: 0.85rem;
}

.code-block {
    margin: 0;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: #f7fbf5;
    border: 1px solid #dbe8d4;
    overflow-x: auto;
    color: #234334;
    font-size: 0.92rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.gradient-index {
    font-size: 0.9rem;
    color: var(--muted);
}

.empty-state {
    text-align: center;
    margin-bottom: 1rem;
}

.site-footer {
    padding: 0 0 2rem;
}

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

.footer-inner p {
    margin-bottom: 0;
}

.alert-box {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    background-color: #14231d;
    color: #fff;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(20, 35, 29, 0.28);
    z-index: 1000;
}

body.compact-view .gradient-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

body.compact-view .gradient-preview {
    height: 140px;
}

body.compact-view .card-body {
    padding: 0.85rem;
}

body.compact-view .code-block {
    font-size: 0.84rem;
}

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

    .controls,
    .footer-inner,
    .card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-actions {
        width: 100%;
    }

    .button,
    .copy-button {
        flex: 1;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(calc(100% - 1rem), var(--container));
    }

    .site-header {
        padding-top: 1rem;
    }

    .hero-copy,
    .hero-card,
    .controls,
    .footer-inner,
    .empty-state,
    .library-section {
        padding: 1rem;
    }

    .gradient-grid {
        grid-template-columns: 1fr;
    }
}
