/* ===================================================================
   NorthMountain.Uk — Portfolio styles
   Reuses main.css chrome (header, footer, buttons, container, bg).
   Uses the site theme variables, so it adapts to light/dark.
   Per-case accent is passed inline as --cat.
   =================================================================== */

.pf-page { position: relative; }

/* ── HERO ─────────────────────────────────────────── */
.pf-hero { padding: clamp(3rem, 8vw, 6rem) 0 2.5rem; }
.pf-hero__inner { max-width: 820px; }
.pf-tag {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--accent);
    background: var(--accent-soft); border: 1px solid var(--border);
    padding: 6px 14px; border-radius: 999px; margin-bottom: 1.25rem;
}
.pf-tag .pulse {
    width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 10px var(--accent); animation: pf-pulse 1.7s infinite;
}
@keyframes pf-pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.pf-hero h1 { font-size: var(--text-5xl); line-height: var(--leading-tight); letter-spacing: -0.02em; margin: 0 0 1rem; }
.pf-hero h1 em {
    font-style: normal;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pf-hero p { font-size: var(--text-lg); color: var(--text-muted); max-width: 640px; line-height: var(--leading-normal); }

/* search + filters */
.pf-search {
    position: relative; max-width: 440px; margin: 1.75rem 0 1.25rem;
}
.pf-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-subtle); }
.pf-search input {
    width: 100%; padding: 13px 16px 13px 46px; font: inherit; font-size: var(--text-sm);
    color: var(--text); background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); transition: border-color .2s, background .2s;
}
.pf-search input:focus { outline: none; border-color: var(--accent); background: var(--surface-strong); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    font: inherit; font-size: var(--text-xs); font-weight: 500; cursor: pointer;
    color: var(--text-muted); background: var(--surface); border: 1px solid var(--border);
    padding: 7px 15px; border-radius: 999px; transition: color .2s, border-color .2s, background .2s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { color: var(--bg); background: var(--accent); border-color: var(--accent); }

/* ── LISTING GRID ─────────────────────────────────── */
.pf-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem; margin: 2.5rem 0;
}
.pf-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
    transition: transform .3s var(--ease-out-expo), border-color .3s, box-shadow .3s;
}
.pf-card:hover { transform: translateY(-4px); border-color: var(--cat); box-shadow: var(--shadow-hover); }
.pf-card.is-hidden { display: none; }
.pfc-cover {
    position: relative; display: flex; align-items: center; justify-content: center;
    height: 140px; text-decoration: none;
    background:
        radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--cat) 22%, transparent), transparent 70%),
        var(--surface-strong);
    border-bottom: 1px solid var(--border);
}
.pfc-ico { color: var(--cat); }
.pfc-ico svg { width: 44px; height: 44px; }
.pfc-region {
    position: absolute; top: 12px; right: 12px;
    font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em;
    color: var(--text); background: color-mix(in srgb, var(--cat) 16%, transparent);
    border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px;
}
.pfc-body { padding: 1.25rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.pfc-cat { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cat); }
.pfc-body h2 { font-size: var(--text-lg); line-height: var(--leading-snug); margin: 2px 0; }
.pfc-body h2 a { color: var(--text); text-decoration: none; }
.pfc-body h2 a:hover { color: var(--cat); }
.pfc-body > p { font-size: var(--text-sm); color: var(--text-muted); margin: 0; }
.pfc-kpis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 0.75rem; }
.pfc-kpi {
    font-size: var(--text-xs); color: var(--text-muted);
    background: var(--surface-strong); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 5px 10px;
}
.pfc-kpi b { color: var(--text); }
.pfc-link {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 0.6rem;
    font-size: var(--text-sm); font-weight: 600; color: var(--cat); text-decoration: none;
}
.pfc-link svg { transition: transform .2s; }
.pfc-link:hover svg { transform: translateX(4px); }
.no-results { display: none; grid-column: 1 / -1; text-align: center; color: var(--text-muted); padding: 2rem 0; }

/* ── BREADCRUMB ───────────────────────────────────── */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--text-muted); padding: 1.5rem 0 0.5rem; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { color: var(--text-subtle); }

/* ── CASE HEAD ────────────────────────────────────── */
.case-head { padding: 1.5rem 0 0.5rem; }
.case-kicker {
    display: inline-block; font-family: var(--font-mono); font-size: 0.75rem;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--cat);
    background: color-mix(in srgb, var(--cat) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--cat) 30%, transparent);
    padding: 5px 13px; border-radius: 999px; margin-bottom: 1rem;
}
.case-head h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); line-height: var(--leading-tight); letter-spacing: -0.02em; margin: 0 0 0.85rem; }
.case-task { font-size: var(--text-lg); color: var(--text-muted); max-width: 760px; line-height: var(--leading-normal); }
.case-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.25rem; }
.meta-chip { font-size: var(--text-sm); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 12px; }
.meta-chip b { color: var(--cat); font-weight: 600; }

/* ── DASHBOARD ────────────────────────────────────── */
.dash {
    margin: 1.75rem 0; background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-soft);
}
.dash-bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--surface-strong); border-bottom: 1px solid var(--border); }
.dash-dots { display: flex; gap: 6px; }
.dash-dots span { width: 11px; height: 11px; border-radius: 50%; }
.dash-dots .d1 { background: #ff5f57; } .dash-dots .d2 { background: #febc2e; } .dash-dots .d3 { background: #28c840; }
.dash-title { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.dash-live { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: var(--text-xs); color: #28c840; }
.dash-live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #28c840; box-shadow: 0 0 8px #28c840; animation: pf-pulse 1.6s infinite; }
.dash-body { padding: 1.5rem; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 1.4rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; }
.kpi-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-subtle); margin-bottom: 9px; }
.kpi-val { font-size: 1.7rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; color: var(--text); }
.kpi-delta { font-size: var(--text-xs); margin-top: 8px; font-weight: 600; }
.kpi-delta.up { color: #2bb673; } .kpi-delta.down { color: #e05656; } .kpi-delta.neutral { color: var(--text-subtle); }
[data-theme="dark"] .kpi-delta.up { color: #69f0ae; }

/* charts */
.charts { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.chart-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px 14px; }
.chart-box h4 { font-size: var(--text-sm); font-weight: 600; color: var(--text); margin: 0 0 3px; }
.chart-box .csub { font-size: var(--text-xs); color: var(--text-subtle); margin: 0 0 12px; }
.chart-wrap { position: relative; height: 240px; }

/* findings */
.findings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 1.4rem; }
.find-card { border-radius: var(--radius-md); padding: 18px 20px; border: 1px solid var(--border); }
.find-card.conc { background: color-mix(in srgb, var(--accent) 7%, transparent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.find-card.reco { background: color-mix(in srgb, #2bb673 6%, transparent); border-color: color-mix(in srgb, #2bb673 22%, transparent); }
.find-card h5 { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 12px; }
.find-card.conc h5 { color: var(--accent); } .find-card.reco h5 { color: #2bb673; }
[data-theme="dark"] .find-card.reco h5 { color: #69f0ae; }
.find-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.find-list li { font-size: var(--text-sm); color: var(--text-muted); padding-left: 22px; position: relative; line-height: var(--leading-normal); }
.find-list li::before { content: ''; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 2px; }
.find-card.conc .find-list li::before { background: var(--accent); }
.find-card.reco .find-list li::before { background: #2bb673; }
[data-theme="dark"] .find-card.reco .find-list li::before { background: #69f0ae; }
.find-list li b { color: var(--text); font-weight: 600; }

/* ── CASE CTA + RELATED ───────────────────────────── */
.case-cta, .pf-cta {
    margin: 2.5rem 0; text-align: center; padding: 2.75rem 2rem;
    background: linear-gradient(135deg, var(--surface), var(--surface-strong));
    border: 1px solid var(--border-strong); border-radius: var(--radius-xl);
}
.case-cta h3, .pf-cta h3 { font-size: var(--text-2xl); margin: 0 0 0.6rem; }
.case-cta p, .pf-cta p { color: var(--text-muted); max-width: 520px; margin: 0 auto 1.5rem; }

.related { margin: 2.5rem 0 4rem; }
.related > h2 { font-size: var(--text-xl); margin: 0 0 1.25rem; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.rel-card { padding: 1.25rem 1.4rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--cat); border-radius: var(--radius-md); }
.rc-cat { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cat); }
.rel-card h3 { font-size: var(--text-base); line-height: var(--leading-snug); margin: 6px 0 10px; }
.rel-card h3 a { color: var(--text); text-decoration: none; }
.rel-card h3 a:hover { color: var(--cat); }
.rc-link { font-size: var(--text-sm); font-weight: 600; color: var(--cat); text-decoration: none; }

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 860px) {
    .kpis { grid-template-columns: 1fr 1fr; }
    .charts { grid-template-columns: 1fr; }
    .findings { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .kpis { grid-template-columns: 1fr; }
    .dash-body { padding: 1.1rem; }
}
