/* =====================================================
   DOCTOR HARTON - Portfolio Site
   Exact replica of peterharton.com design
   ===================================================== */

/* CSS Variables */
:root {
    --bg-color: #fadcd2;
    --text-color: #1a1a1a;
    --text-light: #666;
    --white: #fff;
    --black: #000;
    --font-primary: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1400px;
    --grid-gap: 20px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
    line-height: 1.2;
}

/* Container */
.capped {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* =====================================================
   HEADER
   ===================================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 0;
    background: transparent;
}

.main-header .capped {
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand {
    display: block;
}

.brand-img img {
    height: 60px;
    width: auto;
}

.brand-text {
    display: none;
}

/* =====================================================
   HERO SECTION - Video Background with Text Mask
   ===================================================== */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
}

.hero-content {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.vimeo-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vimeo-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 177.78vh;
    height: 100vh;
    min-width: 100%;
    min-height: 56.25vw;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

/* Text mask overlay - video shows through text */
.hero-text-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.hero-text-mask svg {
    width: 80%;
    max-width: 1200px;
    height: auto;
}

/* Alternative: CSS Text Mask approach */
.hero-text-css {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-family: 'Roboto', sans-serif;
    font-size: clamp(80px, 15vw, 200px);
    font-weight: 900;
    line-height: 0.9;
    text-align: center;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    background-color: var(--bg-color);
    mix-blend-mode: screen;
    pointer-events: none;
}

/* Canvas-based text mask (matches original) */
.hero-canvas-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

#hero-canvas {
    width: 100%;
    height: 100%;
}

/* Scroll down indicator */
.pager-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.pager-down button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.pager-down button:hover {
    opacity: 1;
}

.icon-down::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--text-color);
    border-bottom: 2px solid var(--text-color);
    transform: rotate(45deg);
}

/* =====================================================
   PORTFOLIO GRID
   ===================================================== */
.portfolio-section {
    padding: 60px 0;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gap);
    list-style: none;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
}

.portfolio-link {
    display: block;
    position: relative;
}

.portfolio-thumbnail {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background-color: #ddd;
}

.portfolio-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.portfolio-link:hover .portfolio-thumbnail img {
    transform: scale(1.05);
}

.portfolio-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: var(--white);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-link:hover .portfolio-title {
    opacity: 1;
}

.portfolio-title h3 {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portfolio-title h3 span {
    display: block;
}

.portfolio-title h3 span:first-child {
    font-weight: 700;
}

/* Staff Pick Badge */
.staff-pick {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    z-index: 5;
}

/* =====================================================
   CONTENT SECTIONS (Footer Info)
   ===================================================== */
.content-section {
    margin: 64px 0;
    padding: 0 20px;
    text-align: center;
}

.section-title {
    font-family: Roboto, -apple-system, "system-ui", sans-serif;
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.section-link {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    font-variant-ligatures: none;
    text-transform: uppercase;
    margin: 8px 0;
}

.section-link a {
    display: inline-block;
    padding: 2px 5px;
}

/* About Section */
.about-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.about-section p {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    font-variant-ligatures: none;
    text-transform: uppercase;
    margin-bottom: 20px;
    text-align: center;
}

.about-image {
    max-width: 100%;
    margin: 30px auto 0;
}

/* Icon Image */
.icon-section {
    text-align: center;
    padding: 40px 20px;
}

.icon-section img {
    max-width: 240px;
    margin: 0 auto;
}

/* =====================================================
   FOOTER
   ===================================================== */
.main-footer {
    padding: 40px 0 20px;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    list-style: none;
    margin-bottom: 30px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.social-links .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.social-links svg.social-icon {
    width: 32px;
    height: 32px;
    fill: var(--text-color);
    display: block;
}

.social-links a:hover svg {
    opacity: 0.7;
}

.footer-copyright {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-style: normal;
    font-weight: 300;
    font-variant-ligatures: none;
    color: var(--text-light);
    padding: 20px;
}

/* Scroll to top */
.pager-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pager-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.pager-to-top button {
    background: var(--text-color);
    border: none;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    transition: opacity 0.3s ease;
}

.pager-to-top button:hover {
    opacity: 0.8;
}

.icon-up::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-left: 2px solid var(--white);
    border-top: 2px solid var(--white);
    transform: rotate(45deg);
    margin-top: 4px;
}

/* =====================================================
   MAGNIFIC POPUP CUSTOMIZATION
   ===================================================== */
.mfp-bg {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1042 !important;
    background: var(--bg-color) !important;
    opacity: 0.97 !important;
}

.mfp-wrap {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1043 !important;
    overflow-y: auto !important;
}

.mfp-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    min-height: 100% !important;
    padding: 100px 20px 40px !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

@media (max-width: 768px) {
    .mfp-container {
        padding: 60px 15px 30px !important;
    }
}

.mfp-content {
    position: relative !important;
    display: inline-block !important;
    vertical-align: top !important;
    margin: 0 auto !important;
    text-align: left !important;
    z-index: 1045 !important;
}

.mfp-iframe-holder .mfp-content {
    max-width: 900px;
    width: 100%;
    line-height: 0;
}

.mfp-iframe-scaler {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding-top: 0;
    overflow: visible;
}

.mfp-scale {
    position: relative;
    width: 100%;
}

.fitframe-wrap {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    overflow: hidden;
    background: #000;
}

.fitframe-wrap iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* Close button */
.mfp-close {
    color: var(--text-color) !important;
    font-size: 30px !important;
    font-weight: 300 !important;
    opacity: 0.7;
    position: absolute !important;
    top: -35px !important;
    right: 0 !important;
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
    text-align: center;
    background: none !important;
    border: none;
    cursor: pointer;
}

.mfp-close:hover {
    opacity: 1;
}

/* Title/Credits below video */
.mfp-title {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    font-variant-ligatures: none;
    line-height: 1.8;
    color: var(--text-color);
    padding: 20px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mfp-title p {
    margin: 0;
}

/* Gallery Navigation Arrows - Simple circular with < > */
.mfp-arrow {
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 50px !important;
    height: 50px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 1px solid var(--text-color) !important;
    border-radius: 50% !important;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    z-index: 1046;
    font-family: inherit !important;
}

.mfp-arrow:hover {
    opacity: 1;
}

/* Override default arrow pseudo-elements completely */
.mfp-arrow:before,
.mfp-arrow:after,
.mfp-arrow .mfp-b,
.mfp-arrow .mfp-a {
    content: none !important;
    display: none !important;
    border: none !important;
    background: none !important;
}

.mfp-arrow-left {
    left: 20px !important;
    right: auto !important;
}

.mfp-arrow-right {
    right: 20px !important;
    left: auto !important;
}

/* Create chevron arrows using :before */
.mfp-arrow-left:before {
    content: '' !important;
    display: block !important;
    width: 12px !important;
    height: 12px !important;
    border: none !important;
    border-left: 1.5px solid var(--text-color) !important;
    border-bottom: 1.5px solid var(--text-color) !important;
    transform: rotate(45deg) !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    margin-top: -6px !important;
    margin-left: -4px !important;
    background: transparent !important;
}

.mfp-arrow-right:before {
    content: '' !important;
    display: block !important;
    width: 12px !important;
    height: 12px !important;
    border: none !important;
    border-right: 1.5px solid var(--text-color) !important;
    border-top: 1.5px solid var(--text-color) !important;
    transform: rotate(45deg) !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    margin-top: -6px !important;
    margin-left: -8px !important;
    background: transparent !important;
}

/* Preloader */
.mfp-preloader {
    color: var(--text-color);
    text-align: center;
}

/* Gallery mode specific */
.mfp-gallery .mfp-content {
    max-width: 900px;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 500px;
    }

    .hero-text img {
        max-width: 90%;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .portfolio-title {
        opacity: 1;
    }

    .section-title {
        font-size: 24px;
    }

    .main-header {
        padding: 15px 0;
    }

    .brand-img img {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .capped {
        padding: 0 15px;
    }

    .hero {
        min-height: 400px;
    }
}

/* =====================================================
   LAZY LOADING
   ===================================================== */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy.loaded {
    opacity: 1;
}

/* Loading placeholder */
.placeholder {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
