/* ==================================================
   Portfolio page -- stats card + "Our Portfolio" intro.
   Same brand tokens as the homepage (orange / ink / Apple font).
   Isolated with all:revert so legacy portfolio.css / style.css rules
   for .stats-* / .portfolio-heading can't bleed in. Every rule below is
   scoped under its section root so it outranks the reset.
   SVG children are excluded from the reset: all:revert erases a
   path's geometry (its "d" attribute).
   ================================================== */
.pf-stats, .pf-stats *:not(svg *),
.pf-intro, .pf-intro *:not(svg *) { all: revert; box-sizing: border-box; }

.pf-stats, .pf-intro {
    --pi-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
    --pi-orange: #ff5e14;
    --pi-orange-light: #ff7c3d;
    --pi-ink: #14161a;
    --pi-muted: #6b7280;
    --pi-line: #e9eaee;
    font-family: var(--pi-font);
}

.pf-stats svg, .pf-stats svg *,
.pf-intro svg, .pf-intro svg * {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Stats: one floating card overlapping the hero ---------- */
.pf-stats {
    position: relative;
    z-index: 5;
    display: block;
    margin-top: -56px;
    padding: 0 20px;
    background: linear-gradient(180deg, transparent 0, transparent 56px, #fff 56px);
}

.pf-stats .pf-stats-card {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 1080px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--pi-line);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(20, 22, 26, 0.12);
    padding: 26px 10px;
}

.pf-stats .pf-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 4px 16px;
}

.pf-stats .pf-stat + .pf-stat { border-left: 1px solid var(--pi-line); }

.pf-stats .pf-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 94, 20, 0.1);
    color: var(--pi-orange);
}

.pf-stats .pf-stat-icon svg { display: block; width: 21px; height: 21px; }

.pf-stats .pf-stat-body { text-align: left; }

.pf-stats .pf-stat-num {
    display: block;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--pi-ink);
}

.pf-stats .pf-stat-num .pf-stat-suffix { color: var(--pi-orange); font-weight: 700; }

.pf-stats .pf-stat-label {
    display: block;
    margin-top: 5px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--pi-muted);
}

/* ---------- Intro: brutalist -- caption row, statement, giant marquee ---------- */
.pf-intro {
    display: block;
    overflow: hidden;
    background: #fff;
    padding: 84px 0 0;
    --pi-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.pf-intro .pf-intro-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    max-width: 1180px;
    margin: 0 auto 26px;
    padding: 0 24px;
}

.pf-intro .pf-intro-cap {
    font-family: var(--pi-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--pi-ink);
}

.pf-intro .pf-intro-cap-r { color: var(--pi-muted); text-align: right; }

.pf-intro .pf-intro-body {
    display: block;
    max-width: 720px;
    margin: 0 auto;
    padding: 44px 24px 72px;
    text-align: center;
}

.pf-intro .pf-intro-text {
    display: block;
    margin: 0;
    font-size: 15.5px;
    font-weight: 300;
    line-height: 1.75;
    letter-spacing: 0;
    color: var(--pi-muted);
}

/* Giant marquee band -- runs right to left */
.pf-intro .pf-marq {
    display: block;
    overflow: hidden;
    border-top: 2px solid var(--pi-ink);
    border-bottom: 2px solid var(--pi-ink);
    background: #fff;
}

.pf-intro .pf-marq-track {
    display: flex;
    width: max-content;
    animation: pfMarq 34s linear infinite;
}

.pf-intro .pf-marq:hover .pf-marq-track { animation-play-state: paused; }

.pf-intro .pf-marq-group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.pf-intro .pf-marq-word {
    display: block;
    padding: 0.06em 0.22em 0.02em;
    font-size: clamp(44px, 8.2vw, 124px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--pi-ink);
}

.pf-intro .pf-marq-word.is-outline {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--pi-ink);
}

.pf-intro .pf-marq-dot {
    display: block;
    flex: 0 0 auto;
    width: clamp(12px, 1.9vw, 26px);
    height: clamp(12px, 1.9vw, 26px);
    background: var(--pi-orange);
    transform: rotate(45deg);
}

@keyframes pfMarq {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
}

/* ---------- Tablet ---------- */
@media (max-width: 992px) {
    .pf-stats .pf-stat { flex-direction: column; gap: 10px; text-align: center; padding: 4px 8px; }
    .pf-stats .pf-stat-body { text-align: center; }
    .pf-stats .pf-stat-num { font-size: 26px; }
}

/* ---------- Mobile: 2x2 card, compact type ---------- */
@media (max-width: 768px) {
    .pf-stats { margin-top: -36px; padding: 0 16px; background: linear-gradient(180deg, transparent 0, transparent 36px, #fff 36px); }
    .pf-stats .pf-stats-card { grid-template-columns: 1fr 1fr; padding: 6px 0; border-radius: 18px; }
    .pf-stats .pf-stat { padding: 18px 8px; gap: 8px; }
    .pf-stats .pf-stat + .pf-stat { border-left: 0; }
    .pf-stats .pf-stat:nth-child(even) { border-left: 1px solid var(--pi-line); }
    .pf-stats .pf-stat:nth-child(n+3) { border-top: 1px solid var(--pi-line); }
    .pf-stats .pf-stat-icon { flex-basis: 34px; width: 34px; height: 34px; }
    .pf-stats .pf-stat-icon svg { width: 16px; height: 16px; }
    .pf-stats .pf-stat-num { font-size: 22px; }
    .pf-stats .pf-stat-label { font-size: 11px; margin-top: 3px; }

    .pf-intro { padding-top: 52px; }
    .pf-intro .pf-intro-top { justify-content: center; margin-bottom: 22px; padding: 0 16px; }
    .pf-intro .pf-intro-cap { font-size: 10px; letter-spacing: 1px; }
    .pf-intro .pf-intro-cap-r { display: none; }
    .pf-intro .pf-intro-body { padding: 30px 16px 48px; }
    .pf-intro .pf-intro-text { font-size: 13.5px; line-height: 1.7; }
    .pf-intro .pf-marq-word { font-size: clamp(40px, 12.5vw, 64px); }
    .pf-intro .pf-marq-word.is-outline { -webkit-text-stroke-width: 1.2px; }

}

/* The intro supplies its own top spacing; drop the legacy section padding */
#portfolio-section.case-study-area { padding-top: 0; }

/* One consistent 16px page gutter on phones/tablets for the sections below */
@media (max-width: 768px) {
    #portfolio-section .portfolio-container { padding-left: 16px !important; padding-right: 16px !important; }
}
