/* Portfolio homepage (minimal monochrome, inspired by the cinematic portfolio reference).
 * Scoped to body.theme-portfolio so article/tag pages keep the original template. */

.theme-portfolio {
    --pf-bg: #ffffff;
    --pf-bg-muted: #f8f8f9;
    --pf-surface: #ffffff;
    --pf-field: #f3f3f5;
    --pf-text: #0a0a0a;
    --pf-muted: #5f6368;
    --pf-line: rgba(0, 0, 0, 0.08);
    --pf-accent: #0a0a0a;
    --pf-accent-text: #ffffff;
    --pf-info-bg: #eff6ff;
    --pf-info-line: #bfdbfe;
    --pf-info-text: #1e40af;
    --pf-header-bg: rgba(255, 255, 255, 0.82);
    --pf-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
    --pf-radius: 14px;

    margin: 0;
    background: var(--pf-bg);
    color: var(--pf-text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] .theme-portfolio {
    --pf-bg: #0b0b0c;
    --pf-bg-muted: #111113;
    --pf-surface: #161618;
    --pf-field: #1d1d20;
    --pf-text: #f4f4f5;
    --pf-muted: #a1a1aa;
    --pf-line: rgba(255, 255, 255, 0.1);
    --pf-accent: #f4f4f5;
    --pf-accent-text: #0b0b0c;
    --pf-info-bg: rgba(59, 130, 246, 0.1);
    --pf-info-line: rgba(96, 165, 250, 0.35);
    --pf-info-text: #93c5fd;
    --pf-header-bg: rgba(11, 11, 12, 0.8);
    --pf-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    background: var(--pf-bg);
}

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

html:has(.theme-portfolio) { scroll-padding-top: 72px; }

.pf-main { padding: 0; }
.pf-container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.theme-portfolio h1,
.theme-portfolio h2,
.theme-portfolio h3,
.theme-portfolio h4 { margin: 0; font-family: inherit; color: var(--pf-text); letter-spacing: -0.02em; }
.theme-portfolio p { margin: 0; }

/* ---------- Header ---------- */
.pf-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 60;
    background: var(--pf-header-bg);
    border-bottom: 1px solid var(--pf-line);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    transition: box-shadow .25s ease;
}
.pf-header.is-scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06); }
.pf-header__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 20px; }
.pf-logo { font-size: 20px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pf-text); }
.pf-nav { display: flex; align-items: center; gap: 30px; }
.pf-nav > a { position: relative; font-size: 15px; color: var(--pf-muted); transition: color .2s ease; }
.pf-nav > a:hover,
.pf-nav > a.is-active { color: var(--pf-text); }
.pf-nav > a.is-active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--pf-text);
}
.pf-theme { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--pf-field); }
.pf-theme button {
    width: 30px; height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--pf-muted);
    cursor: pointer; font-size: 13px; transition: background .2s ease, color .2s ease;
}
.pf-theme button[aria-pressed="true"] { background: var(--pf-surface); color: var(--pf-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

.pf-nav-toggle {
    display: none; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
    flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.pf-nav-toggle span { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--pf-text); transition: transform .25s ease, opacity .25s ease; }
.pf-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.pf-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.pf-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.pf-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 46px; padding: 0 26px; border-radius: 8px; border: 1px solid transparent;
    font: 600 15px/1 inherit; font-family: inherit; cursor: pointer;
    transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pf-btn:hover { transform: translateY(-2px); }
.pf-btn--light { background: #fff; color: #0a0a0a; }
.pf-btn--light:hover { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.pf-btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.75); }
.pf-btn--ghost:hover { background: #fff; color: #0a0a0a; }
.pf-btn--dark { background: var(--pf-accent); color: var(--pf-accent-text); }
.pf-btn--dark:hover { box-shadow: var(--pf-shadow); }
.pf-btn--block { width: 100%; }

/* ---------- Hero ---------- */
.pf-hero {
    position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; justify-content: center;
    overflow: hidden; color: #fff; text-align: center; isolation: isolate;
}
.pf-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; z-index: -2; transform: scale(1.04); animation: pf-zoom 18s ease-out forwards; }
.pf-hero__overlay { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 12, 18, 0.65) 0%, rgba(10, 12, 18, 0.45) 45%, rgba(10, 12, 18, 0.75) 100%); }
.pf-hero__content { padding: 120px 0 90px; }
.pf-hero__title { display: flex; flex-direction: column; font-size: clamp(44px, 8vw, 88px); font-weight: 300; line-height: 1.02; color: #fff !important; letter-spacing: -0.03em; }
.pf-gradient-text {
    background: linear-gradient(90deg, #ffffff 0%, #ffffff 40%, rgba(203, 213, 225, 0.75) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pf-hero__subtitle { max-width: 640px; margin: 26px auto 0 !important; font-size: clamp(17px, 2vw, 21px); line-height: 1.6; color: rgba(255, 255, 255, 0.88); }
.pf-hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 38px; }
.pf-scroll {
    position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, 0.8);
}
.pf-scroll i { animation: pf-bounce 1.8s ease-in-out infinite; }

/* ---------- Sections ---------- */
.pf-section { padding: 110px 0; background: var(--pf-bg); }
.pf-section--muted { background: var(--pf-bg-muted); }
.pf-section__head { max-width: 680px; margin: 0 auto 54px; text-align: center; }
.pf-section__head h2 { font-size: clamp(32px, 4.5vw, 48px); font-weight: 300; }
.pf-section__head p { margin-top: 16px; font-size: 18px; line-height: 1.65; color: var(--pf-muted); }

/* ---------- Portfolio ---------- */
.pf-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: -22px 0 40px; }
.pf-filter button {
    padding: 9px 18px; border: 1px solid var(--pf-line); border-radius: 999px; background: var(--pf-surface);
    color: var(--pf-muted); font: 500 14px/1 inherit; font-family: inherit; cursor: pointer; transition: all .2s ease;
}
.pf-filter button:hover { color: var(--pf-text); }
.pf-filter button.is-active { background: var(--pf-accent); border-color: var(--pf-accent); color: var(--pf-accent-text); }

.pf-works { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.pf-work {
    position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--pf-radius);
    background: var(--pf-surface); border: 1px solid var(--pf-line); transition: transform .3s ease, box-shadow .3s ease;
}
.pf-work[hidden] { display: none; }
.pf-work:hover { transform: translateY(-6px); box-shadow: var(--pf-shadow); }
.pf-work__media { position: relative; aspect-ratio: 648 / 378; overflow: hidden; background: var(--pf-field); }
.pf-work__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.pf-work:hover .pf-work__media img { transform: scale(1.06); }
.pf-work__play {
    position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%;
    background: rgba(255, 255, 255, 0.92); color: #0a0a0a; font-size: 18px; opacity: 0; transform: scale(.85);
    transition: opacity .3s ease, transform .3s ease;
}
.pf-work__play i { margin-left: 3px; }
.pf-work:hover .pf-work__play { opacity: 1; transform: scale(1); }
.pf-work__body { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 24px; flex: 1; }
.pf-work__body h3 { font-size: 19px; font-weight: 600; line-height: 1.35; }
.pf-work__link {
    display: flex; flex-direction: column; flex: 1; min-height: 100%; color: inherit;
    text-decoration: none; outline-offset: 4px;
}
.pf-work__body p { font-size: 15px; line-height: 1.6; color: var(--pf-muted); }
.pf-work__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.pf-pill { display: inline-flex; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--pf-accent); color: var(--pf-accent-text); }
.pf-pill--soft { background: var(--pf-field); color: var(--pf-muted); }

/* ---------- About ---------- */
.pf-about { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 72px; align-items: center; }
.pf-about__copy h2 { font-size: clamp(32px, 4.5vw, 48px); font-weight: 300; margin-bottom: 26px; }
.pf-about__copy p { font-size: 17px; line-height: 1.75; color: var(--pf-muted); margin-bottom: 18px; }
.pf-about__copy h3 { font-size: 20px; font-weight: 600; margin: 34px 0 18px; }
.pf-specialties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; padding: 0; list-style: none; }
.pf-specialties li { position: relative; padding-left: 18px; font-size: 15px; color: var(--pf-muted); }
.pf-specialties li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--pf-text); }
.pf-about__media { position: relative; }
.pf-about__media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 20px; box-shadow: var(--pf-shadow); }
.pf-badge {
    position: absolute; right: -18px; bottom: -18px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 116px; padding: 20px 22px; border-radius: 16px; background: var(--pf-accent); color: var(--pf-accent-text); box-shadow: var(--pf-shadow);
}
.pf-badge strong { font-size: 34px; font-weight: 700; line-height: 1; }
.pf-badge span { margin-top: 6px; font-size: 14px; opacity: .8; }

.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: 96px; padding-top: 64px; border-top: 1px solid var(--pf-line); }
.pf-stat { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.pf-stat strong { font-size: 36px; font-weight: 700; line-height: 1.1; margin-top: 8px; }
.pf-stat > span:last-child { font-size: 15px; color: var(--pf-muted); }
.pf-icon {
    display: inline-grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 12px;
    background: var(--pf-field); color: var(--pf-text); font-size: 19px;
}

/* ---------- Contact ---------- */
.pf-contact { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; align-items: start; }
.pf-card { padding: 36px; border-radius: 18px; background: var(--pf-surface); border: 1px solid var(--pf-line); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); }
.pf-card--outline { padding: 24px; box-shadow: none; }
.pf-card--outline h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.pf-card--outline p { font-size: 15px; line-height: 1.6; color: var(--pf-muted); }
.pf-form { display: flex; flex-direction: column; gap: 20px; }
.pf-form h3 { font-size: 22px; font-weight: 600; }
.pf-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pf-field { display: flex; flex-direction: column; gap: 8px; }
.pf-field label { font-size: 14px; font-weight: 500; color: var(--pf-text); }
.pf-req { color: #ef4444; }
.pf-field input,
.pf-field textarea {
    width: 100%; padding: 12px 14px; border: 1px solid transparent; border-radius: 10px; background: var(--pf-field);
    color: var(--pf-text); font: 400 15px/1.5 inherit; font-family: inherit; outline: none; box-shadow: none;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.pf-field textarea { resize: vertical; min-height: 130px; }
.pf-field input::placeholder,
.pf-field textarea::placeholder { color: var(--pf-muted); opacity: .75; }
.pf-field input:focus,
.pf-field textarea:focus { border-color: var(--pf-text); background: var(--pf-surface); box-shadow: 0 0 0 3px rgba(127, 127, 127, 0.15); }
.pf-field.has-error input,
.pf-field.has-error textarea { border-color: #ef4444; }
.pf-error { font-size: 13px; color: #ef4444; }
.pf-alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.pf-alert--success { background: rgba(16, 185, 129, 0.12); color: #047857; border: 1px solid rgba(16, 185, 129, 0.3); }
.pf-alert--error { background: rgba(239, 68, 68, 0.1); color: #b91c1c; border: 1px solid rgba(239, 68, 68, 0.3); }
html[data-theme="dark"] .pf-alert--success { color: #6ee7b7; }
html[data-theme="dark"] .pf-alert--error { color: #fca5a5; }
.pf-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.pf-contact__info { display: flex; flex-direction: column; gap: 24px; }
.pf-contact__info > h3 { font-size: 22px; font-weight: 600; }
.pf-contact__info > p { font-size: 16px; line-height: 1.7; color: var(--pf-muted); }
.pf-contact__list { display: flex; flex-direction: column; gap: 18px; margin: 0; padding: 0; list-style: none; }
.pf-contact__list li { display: flex; align-items: center; gap: 16px; }
.pf-contact__list small { display: block; font-size: 13px; color: var(--pf-muted); margin-bottom: 2px; }
.pf-contact__list a,
.pf-contact__list span:not(.pf-icon) { font-size: 16px; font-weight: 500; color: var(--pf-text); }
.pf-contact__list a:hover { text-decoration: underline; }
.pf-note { padding: 18px 20px; border-radius: 12px; background: var(--pf-info-bg); border: 1px solid var(--pf-info-line); color: var(--pf-info-text); font-size: 14px; line-height: 1.6; }
.pf-note a { color: inherit; text-decoration: underline; font-weight: 600; }

/* ---------- Footer ---------- */
.pf-footer { padding: 44px 0; background: var(--pf-bg); border-top: 1px solid var(--pf-line); }
.pf-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; }
.pf-footer__nav { display: flex; flex-wrap: wrap; gap: 24px; }
.pf-footer__nav a,
.pf-footer__social a { color: var(--pf-muted); font-size: 15px; transition: color .2s ease; }
.pf-footer__nav a:hover,
.pf-footer__social a:hover { color: var(--pf-text); }
.pf-footer__social { display: flex; gap: 16px; font-size: 18px; }
.pf-footer__social:empty { display: none; }
.pf-footer__copy { width: 100%; font-size: 14px; color: var(--pf-muted); text-align: center; padding-top: 18px; border-top: 1px solid var(--pf-line); }

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.pf-js .pf-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.pf-js .pf-reveal.is-visible { opacity: 1; transform: none; }

@keyframes pf-zoom { to { transform: scale(1); } }
@keyframes pf-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
    .pf-hero__bg, .pf-scroll i { animation: none; }
    .pf-js .pf-reveal { opacity: 1; transform: none; transition: none; }
    html:has(.theme-portfolio) { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .pf-works { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pf-about { gap: 48px; }
}

@media (max-width: 860px) {
    .pf-nav-toggle { display: inline-flex; }
    .pf-nav {
        position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
        padding: 8px 20px 18px; background: var(--pf-bg); border-bottom: 1px solid var(--pf-line); box-shadow: 0 18px 30px rgba(0, 0, 0, 0.08);
        opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease, visibility .2s;
    }
    .pf-nav.is-open { opacity: 1; visibility: visible; transform: none; }
    .pf-nav > a { padding: 14px 4px; border-bottom: 1px solid var(--pf-line); font-size: 16px; }
    .pf-nav > a.is-active::after { display: none; }
    .pf-theme { align-self: flex-start; margin-top: 14px; }

    .pf-about,
    .pf-contact { grid-template-columns: 1fr; }
    .pf-about__media { max-width: 460px; margin: 0 auto 18px; width: calc(100% - 18px); }
    .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; margin-top: 72px; }
    .pf-section { padding: 84px 0; }
}

@media (max-width: 600px) {
    .pf-container { width: calc(100% - 32px); }
    .pf-works { grid-template-columns: 1fr; }
    .pf-specialties { grid-template-columns: 1fr; }
    .pf-form__row { grid-template-columns: 1fr; }
    .pf-card { padding: 24px 20px; }
    .pf-hero__actions .pf-btn { flex: 1 1 100%; }
    .pf-badge { right: -10px; bottom: -14px; min-width: 96px; padding: 14px 16px; }
    .pf-badge strong { font-size: 28px; }
    .pf-footer__inner { flex-direction: column; text-align: center; }
}
