/**
 * Portfolio - Product-grade redesign (v10)
 * Apple / NVIDIA inspired: clean type, generous space, tasteful motion, depth.
 * Mobile-first. Performance-conscious: transform/opacity only, minimal blur.
 *
 * Type: Clash Display (headlines) + Inter (body), via Fontshare.
 * Palette kept: red accent on graduated dark. Light theme supported.
 */

@import url('https://api.fontshare.com/v2/css?f[]=clash-display@500,600,700&f[]=inter@400,500,600,700&display=swap');

/* =================================================================
   TOKENS
   ================================================================= */
.pf {
    --bg:        #07080c;
    --bg-2:      #0b0d13;
    --surface:   rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --border:    rgba(255, 255, 255, 0.09);
    --border-2:  rgba(255, 255, 255, 0.14);
    --text:      #f4f6f9;
    --muted:     #9aa1ad;
    --accent:    #ff2b2b;
    --accent-2:  #ff6161;
    --glow:      rgba(255, 43, 43, 0.30);

    --font-display: 'Clash Display', system-ui, sans-serif;
    --font-body:    'Inter', system-ui, -apple-system, sans-serif;

    --maxw: 1180px;
    --pad: 24px;
    --radius: 22px;
    --radius-sm: 14px;
    --ease: cubic-bezier(0.22, 0.68, 0.18, 1);

    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* Kill any header gap from the theme */
body:has(.pf) main,
main:has(.pf) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.pf *,
.pf *::before,
.pf *::after { box-sizing: border-box; }

.pf img { max-width: 100%; height: auto; display: block; }

.pf-container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding-left: var(--pad);
    padding-right: var(--pad);
}

/* Light theme */
body.light-theme .pf {
    --bg:        #ffffff;
    --bg-2:      #f4f5f8;
    --surface:   rgba(0, 0, 0, 0.025);
    --surface-2: rgba(0, 0, 0, 0.045);
    --border:    rgba(0, 0, 0, 0.09);
    --border-2:  rgba(0, 0, 0, 0.16);
    --text:      #0a0c12;
    --muted:     #5b626d;
    --glow:      rgba(255, 43, 43, 0.16);
}

/* =================================================================
   SHARED PRIMITIVES
   ================================================================= */
.pf-eyebrow,
.pf-kicker {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-2);
}
.pf-eyebrow { font-size: 14px; }

.pf-grad {
    background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pf-h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(30px, 4.5vw, 52px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 16px 0 0;
}

.pf-lead {
    font-size: clamp(16px, 2vw, 19px);
    color: var(--muted);
    max-width: 620px;
    margin: 18px auto 0;
}

/* Buttons */
.pf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 26px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border-radius: 100px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.pf-btn svg { flex-shrink: 0; }

.pf-btn--primary {
    background: linear-gradient(135deg, var(--accent) 0%, #d61414 100%);
    color: #fff;
    box-shadow: 0 8px 30px -8px var(--glow);
}
.pf-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px -10px var(--glow);
    color: #fff;
}

.pf-btn--ghost {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-2);
}
.pf-btn--ghost:hover {
    transform: translateY(-2px);
    background: var(--surface-2);
    border-color: var(--accent);
    color: var(--text);
}

.pf-btn--wa  { background: linear-gradient(135deg, #25d366, #128c7e); color: #fff; }
.pf-btn--li  { background: linear-gradient(135deg, #0a66c2, #004182); color: #fff; }
.pf-btn--wa:hover,
.pf-btn--li:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 14px 36px -12px rgba(0,0,0,0.5); }

/* Inline link */
.pf-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--accent);
    text-decoration: none;
    width: fit-content;
    transition: gap 0.25s var(--ease), color 0.25s var(--ease);
}
.pf-link span { transition: transform 0.25s var(--ease); }
.pf-link:hover { color: var(--accent-2); }
.pf-link:hover span { transform: translateX(5px); }

/* Tags */
.pf-tag {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.pf-tag:hover { border-color: var(--accent); background: var(--surface-2); }

/* =================================================================
   SCROLL REVEAL
   ================================================================= */
/* Hidden state applies only once JS arms the page, so no-JS shows everything. */
.pf.is-armed .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
    will-change: opacity, transform;
}
.pf.is-armed .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* =================================================================
   HERO
   ================================================================= */
.pf-hero {
    position: relative;
    padding-top: clamp(120px, 16vh, 190px);
    padding-bottom: clamp(60px, 8vh, 110px);
    text-align: center;
    background:
        radial-gradient(120% 80% at 50% -10%, var(--bg-2) 0%, var(--bg) 55%);
    overflow: hidden;
}

.pf-hero__glow {
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, 120%);
    height: 540px;
    background: radial-gradient(ellipse at center, var(--glow) 0%, transparent 68%);
    pointer-events: none;
    z-index: 0;
}

.pf-hero__inner { position: relative; z-index: 1; }

.pf-hero__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(44px, 9vw, 104px);
    line-height: 0.98;
    letter-spacing: -0.035em;
    margin: 22px 0 0;
    color: var(--text);
}

.pf-hero__sub {
    font-size: clamp(17px, 2.2vw, 21px);
    color: var(--muted);
    max-width: 640px;
    margin: 24px auto 0;
}

.pf-hero__cta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 36px;
}

.pf-stats {
    list-style: none;
    margin: 56px auto 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 48px;
    max-width: 820px;
}
.pf-stats li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.pf-stats b {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1;
    color: var(--text);
}
.pf-stats span { font-size: 13px; color: var(--muted); }

/* Hero product shot (floating transparent device mockup) */
.pf-hero__shot {
    position: relative;
    margin-top: clamp(36px, 7vh, 80px);
    z-index: 1;
    display: flex;
    justify-content: center;
}
.pf-hero__shot::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    width: 72%;
    height: 80%;
    background: radial-gradient(ellipse at center, var(--glow) 0%, transparent 68%);
    filter: blur(34px);
    z-index: -1;
    pointer-events: none;
}
.pf-hero__shot img {
    width: 100%;
    max-width: 880px;
}

/* =================================================================
   SECTION SHELL
   ================================================================= */
.pf-section {
    padding: clamp(80px, 12vh, 150px) 0;
    background: var(--bg);
}
.pf-section--alt { background: var(--bg-2); }

.pf-section__head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto clamp(48px, 7vh, 84px);
}

/* =================================================================
   LEAD CASE
   ================================================================= */
.pf-case {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
    padding: clamp(28px, 4vw, 48px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: clamp(40px, 6vh, 72px);
}

.pf-case__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pf-case__media::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    background: radial-gradient(ellipse at center, var(--glow) 0%, transparent 70%);
    filter: blur(34px);
    z-index: 0;
    pointer-events: none;
}
.pf-case__media img {
    position: relative;
    z-index: 1;
    width: auto;
    max-width: 100%;
    max-height: 480px;
}

.pf-case__body { display: flex; flex-direction: column; gap: 16px; }

.pf-case__badge {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.pf-case__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(26px, 3.5vw, 40px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0;
}
.pf-case__title a { color: var(--text); text-decoration: none; transition: color 0.25s var(--ease); }
.pf-case__title a:hover { color: var(--accent); }

.pf-case__line { font-size: 15px; color: var(--muted); margin: 0; line-height: 1.7; }
.pf-case__tag {
    display: inline-block;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
    margin-right: 8px;
}

.pf-metrics { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0; }
.pf-metric {
    flex: 1;
    min-width: 110px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pf-metric b {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 28px;
    line-height: 1;
    color: var(--accent);
}
.pf-metric span { font-size: 12px; color: var(--muted); }

.pf-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* Expandable full case study */
.pf-fullcase {
    margin-bottom: clamp(40px, 6vh, 72px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.pf-fullcase__toggle {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 30px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    color: var(--text);
    transition: background 0.25s var(--ease);
}
.pf-fullcase__toggle::-webkit-details-marker { display: none; }
.pf-fullcase__toggle:hover { background: var(--surface-2); }
.pf-fullcase__toggle svg {
    flex-shrink: 0;
    color: var(--accent);
    transition: transform 0.3s var(--ease);
}
.pf-fullcase[open] .pf-fullcase__toggle {
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.pf-fullcase[open] .pf-fullcase__toggle svg { transform: rotate(180deg); }

.pf-fullcase__body { padding: 10px 30px 34px; }
.pf-fullcase__body h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 22px;
    color: var(--text);
    margin: 30px 0 12px;
}
.pf-fullcase__body h3:first-child { margin-top: 18px; }
.pf-fullcase__body p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.78;
    margin: 0 0 14px;
    max-width: 780px;
}
.pf-fullcase__body ul { margin: 0; padding: 0; list-style: none; max-width: 820px; }
.pf-fullcase__body li {
    position: relative;
    padding-left: 22px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 12px;
}
.pf-fullcase__body li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

/* =================================================================
   PROJECT GRID
   ================================================================= */
.pf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.pf-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.pf-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-2);
    box-shadow: 0 30px 70px -40px rgba(0,0,0,0.7);
}

.pf-card__media {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 26px 6px;
    min-height: 200px;
    background: radial-gradient(120% 120% at 50% 0%, var(--bg-2) 0%, var(--bg) 100%);
}
.pf-card__media img {
    width: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.5s var(--ease);
}
.pf-card:hover .pf-card__media img { transform: translateY(-6px) scale(1.02); }

.pf-card__body { padding: 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.pf-card__badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}
.pf-card__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: -0.01em;
    margin: 0;
}
.pf-card__title a { color: var(--text); text-decoration: none; transition: color 0.25s var(--ease); }
.pf-card__title a:hover { color: var(--accent); }
.pf-card__desc { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.7; flex: 1; }
.pf-card .pf-link { margin-top: 4px; }

/* =================================================================
   HOW I WORK
   ================================================================= */
.pf-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.pf-step {
    position: relative;
    padding: 34px 30px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), background 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
/* Accent bar that sweeps in on the active / hovered step */
.pf-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.55s var(--ease);
}
.pf-step.is-active::before,
.pf-step:hover::before { transform: scaleX(1); }

.pf-step.is-active,
.pf-step:hover {
    transform: translateY(-6px);
    background: var(--surface-2);
    border-color: var(--border-2);
    box-shadow: 0 26px 60px -30px rgba(0,0,0,0.7), 0 0 50px -24px var(--glow);
}

.pf-step__num {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 22px;
    color: var(--accent);
    letter-spacing: 0.04em;
    transition: transform 0.45s var(--ease);
}
.pf-step.is-active .pf-step__num { transform: scale(1.1); transform-origin: left; }

.pf-step__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(22px, 3vw, 28px);
    margin: 14px 0 12px;
    color: var(--text);
}
.pf-step__desc { font-size: 15px; color: var(--muted); margin: 0; line-height: 1.7; }

/* =================================================================
   STACK
   ================================================================= */
.pf-stack {
    margin: 0 auto;
    border-top: 1px solid var(--border);
}
.pf-stack__row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.pf-stack__key {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-2);
}
.pf-stack__tags { display: flex; flex-wrap: wrap; gap: 10px; }

/* =================================================================
   CONTACT
   ================================================================= */
.pf-contact {
    position: relative;
    padding: clamp(90px, 14vh, 170px) 0;
    text-align: center;
    background: var(--bg-2);
    overflow: hidden;
}
.pf-contact__glow {
    position: absolute;
    bottom: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, 130%);
    height: 700px;
    background: radial-gradient(ellipse at center, var(--glow) 0%, transparent 65%);
    pointer-events: none;
}
.pf-contact > .pf-container { position: relative; z-index: 1; }
.pf-contact__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(32px, 6vw, 64px);
    line-height: 1.03;
    letter-spacing: -0.025em;
    color: var(--text);
    margin: 0;
}
.pf-contact__sub { font-size: clamp(16px, 2vw, 20px); color: var(--muted); margin: 18px auto 0; max-width: 540px; }
.pf-contact__cta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 40px;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 980px) {
    .pf-case { grid-template-columns: 1fr; }
    .pf-case__media { max-width: 460px; margin: 0 auto; }
    .pf-grid { grid-template-columns: 1fr 1fr; }
    .pf-steps { grid-template-columns: 1fr; gap: 16px; }
    .pf-step { padding: 28px 24px; }
}

@media (max-width: 680px) {
    .pf { --pad: 18px; }
    .pf-grid { grid-template-columns: 1fr; }
    .pf-stats { gap: 18px 28px; }
    .pf-stats li { flex: 0 0 40%; }
    .pf-stack__row { grid-template-columns: 1fr; gap: 12px; text-align: center; }
    .pf-stack__key { padding-top: 0; }
    .pf-stack__tags { justify-content: center; }
    .pf-hero__cta .pf-btn,
    .pf-contact__cta .pf-btn { flex: 1 1 100%; }
    .pf-case { padding: 22px; }
    .pf-metric { min-width: calc(50% - 7px); }
    .pf-fullcase__toggle,
    .pf-fullcase__body { padding-left: 20px; padding-right: 20px; }
}

/* =================================================================
   REDUCED MOTION + PARALLAX SAFETY
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
    .pf .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .pf [data-parallax] { transform: none !important; }
    .pf * { animation: none !important; }
}
