/* ═══════════════════════════════════════════════
   PREMIUM TEMPLATES SECTION — EquiCode Portfolio
   Vanilla CSS · Dark mode · Responsive
═══════════════════════════════════════════════ */

/* ── SECTION BASE ── */
#templates {
    padding: 110px 0 120px;
    background: var(--c-bg);
    position: relative;
    overflow: hidden;
}

/* Background decorations */
#templates::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 40% at 80% 10%, rgba(249, 115, 22, .07) 0%, transparent 65%),
        radial-gradient(ellipse 45% 45% at 15% 85%, rgba(59, 130, 246, .06) 0%, transparent 60%);
    pointer-events: none;
}

#templates::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
    opacity: .4;
}

.templates-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ── SECTION HEADER ── */
.templates-header {
    text-align: center;
    margin-bottom: 72px;
}

.templates-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px;
    border-radius: 100px;
    border: 1px solid rgba(249, 115, 22, .28);
    background: rgba(249, 115, 22, .07);
    font-size: .7rem;
    font-weight: 700;
    color: var(--c-cyan);
    letter-spacing: .16em;
    text-transform: uppercase;
    margin-bottom: 24px;
    font-family: 'JetBrains Mono', monospace;
}

.templates-eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-cyan);
    animation: blink 2s infinite;
}

.templates-title {
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.05;
    color: var(--c-text);
    margin-bottom: 18px;
    font-family: 'Outfit', sans-serif;
}

.templates-title .hl {
    background: linear-gradient(90deg, var(--c-cyan), var(--c-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.templates-subtitle {
    font-size: 1rem;
    color: var(--c-muted);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.75;
}

/* ── GRID ── */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 22px;
    margin-bottom: 72px;
}

/* ── CARD ── */
.template-card {
    border-radius: 20px;
    overflow: hidden;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition:
        transform .35s cubic-bezier(.34, 1.2, .64, 1),
        border-color .3s ease,
        box-shadow .35s ease;
    position: relative;
}

.template-card:hover {
    transform: translateY(-10px);
    border-color: var(--c-border2);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, .45),
        0 0 0 1px rgba(249, 115, 22, .15);
}



/* ── CARD PREVIEW ── */
.card-preview {
    height: 210px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Glow on hover */
.card-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .4s ease;
    background: radial-gradient(ellipse at 50% 50%, var(--card-accent, rgba(249,115,22,.2)) 0%, transparent 70%);
}
.template-card:hover .card-preview::before { opacity: 1; }

/* Browser chrome mockup */
.card-chrome {
    position: absolute;
    top: 14px; left: 14px; right: 14px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(8px);
    z-index: 2;
}

.chrome-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
}

.chrome-bar {
    flex: 1;
    height: 7px;
    border-radius: 4px;
    background: rgba(255,255,255,.07);
    margin-left: 6px;
}

/* Preview icon */
.card-icon {
    font-size: 3.8rem;
    position: relative;
    z-index: 1;
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
    filter: drop-shadow(0 8px 24px rgba(0,0,0,.3));
    color: aqua;
}
.template-card:hover .card-icon { transform: scale(1.15) translateY(-4px); }

/* Color strip */
.card-palette {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    display: flex;
}
.palette-swatch { flex: 1; }

/* Hover overlay with sections list */
.card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 44px 20px 16px;
    opacity: 0;
    transition: opacity .3s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 3;
}
.template-card:hover .card-overlay { opacity: 1; }

.overlay-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--c-cyan);
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.overlay-section {
    font-size: .75rem;
    color: rgba(255,255,255,.65);
    display: flex;
    align-items: center;
    gap: 6px;
}

.overlay-section::before {
    content: '▸';
    color: var(--c-cyan);
    font-size: .6rem;
}

/* ── CARD BODY ── */
.card-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* Tags */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.card-tag {
    padding: 3px 9px;
    border-radius: 6px;
    font-size: .68rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(249, 115, 22, .08);
    border: 1px solid rgba(249, 115, 22, .2);
    color: var(--c-cyan);
    transition: background .2s, border-color .2s;
}
.template-card:hover .card-tag {
    background: rgba(249, 115, 22, .13);
    border-color: rgba(249, 115, 22, .35);
}

/* Title area */
.card-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--c-text);
    font-family: 'Outfit', sans-serif;
    margin: 0;
}

.card-niche {
    font-size: .75rem;
    color: var(--c-hint);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 1px;
}

/* Description */
.card-desc {
    font-size: .84rem;
    color: var(--c-muted);
    line-height: 1.7;
    margin: 0;
}

/* Stack */
.card-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.stack-pill {
    padding: 2px 8px;
    border-radius: 5px;
    font-size: .68rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(59, 130, 246, .08);
    border: 1px solid rgba(59, 130, 246, .2);
    color: var(--c-violet);
}

/* Card footer */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--c-border);
    margin-top: auto;
}

.card-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--c-cyan);
    font-family: 'JetBrains Mono', monospace;
}

.card-actions {
    display: flex;
    gap: 7px;
}

.btn-demo {
    padding: 7px 16px;
    border-radius: 9px;
    font-size: .75rem;
    font-weight: 700;
    text-decoration: none;
    transition: all .22s ease;
    border: 1px solid var(--c-border2);
    color: var(--c-muted);
    background: transparent;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
}
.btn-demo:hover {
    color: var(--c-text);
    border-color: rgba(255,255,255,.25);
    background: rgba(255,255,255,.04);
}

.btn-get {
    padding: 7px 16px;
    border-radius: 9px;
    font-size: .75rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--c-cyan2), var(--c-violet2));
    color: #fff;
    border: none;
    transition: transform .2s, box-shadow .2s, opacity .2s;
    box-shadow: 0 4px 14px rgba(249, 115, 22, .3);
}
.btn-get:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 6px 20px rgba(249, 115, 22, .45);
}

/* ── CTA BOTTOM ── */
.templates-cta {
    padding: 52px 44px;
    border-radius: 24px;
    background: linear-gradient(135deg,
        rgba(249, 115, 22, .07) 0%,
        rgba(59, 130, 246, .07) 100%);
    border: 1px solid rgba(249, 115, 22, .18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.cta-text h3 {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--c-text);
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
}

.cta-text p {
    font-size: .92rem;
    color: var(--c-muted);
    line-height: 1.7;
    max-width: 420px;
}

.cta-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.cta-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--c-cyan2), var(--c-violet2));
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 6px 22px rgba(249, 115, 22, .28);
}
.cta-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(249, 115, 22, .4);
}

.cta-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 12px;
    border: 1px solid var(--c-border2);
    color: var(--c-muted);
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    transition: color .2s, border-color .2s, background .2s;
}
.cta-btn-secondary:hover {
    color: var(--c-text);
    border-color: var(--c-cyan);
    background: rgba(249, 115, 22, .05);
}

/* ── REVEAL ANIMATION ── */
.tpl-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .65s ease, transform .65s ease;
}
.tpl-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── LIGHT MODE overrides ── */
[data-theme="light"] .template-card {
    background: #fff;
    border-color: rgba(0,0,0,.08);
    box-shadow: 0 2px 12px rgba(0,0,0,.06)
    color:white;
}
[data-theme="light"] .template-card:hover {
    box-shadow: 0 20px 50px rgba(0,0,0,.12), 0 0 0 1px rgba(234,88,12,.2);
    border-color: rgba(234,88,12,.3);
}
[data-theme="light"] .card-chrome {
    background: rgba(0,0,0,.04);
    border-color: rgba(0,0,0,.06);
}
[data-theme="light"] .card-overlay {
    background: rgba(255,255,255,.82);
}
[data-theme="light"] .overlay-section { color: white; }
[data-theme="light"] .templates-cta {
    background: linear-gradient(135deg, rgba(249,115,22,.05), rgba(59,130,246,.05));
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    #templates { padding: 80px 0 90px; }
    .templates-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
    .templates-cta { flex-direction: column; padding: 36px 28px; }
    .cta-actions { width: 100%; }
    .cta-btn-primary, .cta-btn-secondary { flex: 1; justify-content: center; }
}

@media (max-width: 600px) {
    #templates { padding: 60px 0 70px; }
    .templates-grid { grid-template-columns: 1fr; }
    .templates-header { margin-bottom: 48px; }
    .templates-title { font-size: 2rem; }
}