/* ==========================================================================
   Safin Premium Portfolio - Main Stylesheet
   ========================================================================== */

/* Design Tokens & CSS Custom Properties */
:root {
    /* Color Palette */
    --bg-color: #0A0A0B;
    --surface: #131314;
    --surface-container: #201f20;
    --surface-container-low: #1c1b1c;
    --surface-container-lowest: #0e0e0f;
    --surface-container-high: #2a2a2b;
    --surface-container-highest: #353436;

    --primary: #F2F2F2;
    /* Off-White */
    --secondary: #D4AF37;
    /* Muted Gold */
    --tertiary: #64748B;
    /* Slate Blue */

    --text-on-surface: #e5e2e3;
    --text-on-surface-variant: #c4c7c8;

    --border-color: rgba(255, 255, 255, 0.05);
    --border-color-hover: rgba(255, 255, 255, 0.15);

    /* Typography Scales */
    --font-display: 'Hanken Grotesk', sans-serif;
    --font-body: 'Manrope', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing Scales */
    --container-max: 1440px;
    --section-padding-desktop: 120px;
    --section-padding-mobile: 64px;
    --gutter: 32px;

    /* Shape Roundness */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 8px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-smooth: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-fast: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ==========================================================================
   Global Reset & Base Settings
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-color);
    scrollbar-width: thin;
    scrollbar-color: var(--tertiary) var(--surface-container-lowest);
    overflow-x: hidden;
    /* Prevent horizontal page scroll globally */
}

body {
    background-color: var(--bg-color);
    color: var(--text-on-surface);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar Customization for Webkit Browsers */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--surface-container-lowest);
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Custom Text Selection Highlight */
::selection {
    background-color: var(--secondary);
    color: #3c2f00;
}

/* Reset buttons and links */
a {
    color: inherit;
    text-decoration: none;
}

button {
    background: none;
    border: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

/* ==========================================================================
   Custom Atmospheric Decorative Styles
   ========================================================================== */


/* Ambient Glowing Orbs in the background */
.ambient-glow {
    position: absolute;
    border-radius: var(--radius-full);
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.06;
}

.glow-1 {
    top: 15%;
    right: -10%;
    width: 600px;
    height: 600px;
    background-color: var(--secondary);
}

.glow-2 {
    top: 55%;
    left: -10%;
    width: 500px;
    height: 500px;
    background-color: var(--tertiary);
}

/* Metallic Text Gradients */
.metallic-text {
    background: linear-gradient(135deg, #ffffff 0%, #b5b5b5 50%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline;
    padding-bottom: 0.1em;
}

/* Typing effect cursor */
.typing-cursor {
    display: inline-block;
    width: 2.5px;
    height: 0.9em;
    background-color: #ffe600;
    margin-left: 6px;
    vertical-align: middle;
    animation: blink-cursor 0.8s step-end infinite;
    box-shadow: 0 0 10px rgba(255, 230, 0, 0.9);
}

@keyframes blink-cursor {

    from,
    to {
        background-color: transparent;
        box-shadow: none;
    }

    50% {
        background-color: #ffe600;
        box-shadow: 0 0 10px rgba(255, 230, 0, 0.9);
    }
}

/* Standardized Typography Labels */
.mono-label {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.gold-accent {
    color: var(--secondary);
}

/* ==========================================================================
   Navigation Bar (Glassmorphic & Sticky)
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 10, 11, 0.75);
    transition: var(--transition-fast);
}

.navbar.scrolled {
    height: 70px;
    background: rgba(10, 10, 11, 0.9);
}

.nav-container {
    max-width: var(--container-max);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--primary);
    transition: var(--transition-fast);
}

.nav-logo:hover {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-on-surface-variant);
    padding: 8px 0;
    position: relative;
    transition: var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary);
    transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    width: 100%;
}

.nav-cta-btn {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--bg-color);
    background-color: var(--primary);
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary);
    transition: var(--transition-smooth);
}

.nav-cta-btn:hover {
    background-color: transparent;
    color: var(--secondary);
    border-color: var(--secondary);
}

/* Mobile Navigation Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
}

.nav-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition-fast);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    min-h: 100vh;
    min-height: 100vh;
    padding-top: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    overflow: hidden;
}

.hero-container {
    max-width: var(--container-max);
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 10;
}

.hero-label {
    margin-bottom: 24px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(40px, 7.5vw, 80px);
    font-weight: 600;
    line-height: 0.95;
    letter-spacing: -0.04em;
    margin-bottom: 40px;
}

.hero-details {
    display: flex;
    gap: 48px;
    align-items: flex-start;
    max-width: 900px;
    margin-bottom: 56px;
}

.accent-line {
    width: 96px;
    height: 1px;
    background-color: var(--secondary);
    margin-top: 16px;
    flex-shrink: 0;
}

.hero-desc {
    font-family: var(--font-body);
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 300;
    color: var(--text-on-surface-variant);
    max-width: 650px;
}

.btn-explore-works {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary);
    position: relative;
    padding-bottom: 4px;
}

.btn-explore-works::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--secondary);
    transform: scaleX(0.4);
    transform-origin: left;
    transition: var(--transition-smooth);
}

.btn-explore-works:hover::after {
    transform: scaleX(1.0);
}

.btn-explore-works .icon-arrow {
    font-size: 18px;
    transition: var(--transition-smooth);
}

.btn-explore-works:hover .icon-arrow {
    transform: translateX(8px);
    color: var(--secondary);
}

/* Scroll Mouse Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
    transition: var(--transition-fast);
}

.scroll-indicator:hover {
    opacity: 1;
}

.scroll-mouse {
    width: 20px;
    height: 32px;
    border: 1px solid var(--tertiary);
    border-radius: 10px;
    position: relative;
}

.scroll-wheel {
    width: 2px;
    height: 6px;
    background-color: var(--secondary);
    border-radius: var(--radius-full);
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollMouseWheel 1.6s infinite ease-out;
}

.scroll-text {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tertiary);
}

@keyframes scrollMouseWheel {
    0% {
        opacity: 0;
        top: 4px;
    }

    30% {
        opacity: 1;
    }

    80% {
        opacity: 0;
        top: 16px;
    }

    100% {
        opacity: 0;
        top: 16px;
    }
}

/* ==========================================================================
   Selected Works (Asymmetric Gallery Grid)
   ========================================================================== */
.projects-section {
    background-color: var(--surface-container-lowest);
    padding: var(--section-padding-desktop) var(--gutter);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-container {
    max-width: var(--container-max);
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 80px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5.5vw, 48px);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--primary);
}

.header-right {
    max-width: 400px;
}

.section-intro {
    font-size: 15px;
    color: var(--text-on-surface-variant);
    text-align: right;
    font-family: var(--font-body);
}

/* Symmetrical 2x2 Grid Layout with Asymmetric Rhythm */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 96px;
    /* Pronounced premium gap between left and right columns */
    row-gap: 120px;
    /* Generous vertical spacing to accommodate the stagger */
    max-width: 1200px;
    /* Widened slightly to keep card dimensions beautiful with the larger gap */
    margin: 0 auto;
}

/* Base Card Styling */
.project-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.project-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--surface);
    transition: var(--transition-smooth);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: var(--transition-smooth);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 11, 0.4);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-fast);
}

.overlay-icon {
    font-size: 32px;
    color: var(--secondary);
    transform: scale(0.6) translate(-10px, 10px);
    transition: var(--transition-smooth);
}

/* Hover States for Cards */
.project-card:hover .project-image-wrapper {
    border-color: var(--secondary);
}

.project-card:hover .project-image {
    filter: grayscale(0%);
    transform: scale(1.04);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-card:hover .overlay-icon {
    transform: scale(1) translate(0, 0);
}

/* Project Metadata */
.project-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-category {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--secondary);
}

.project-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--primary);
    transition: var(--transition-fast);
}

.project-card:hover .project-title {
    color: var(--secondary);
}

/* Card Sizing Layout Alignment (Symmetrical 2x2 Grid with Elegant Stagger) */
.project-card {
    grid-column: span 1;
    margin: 0 auto !important;
    /* Reset default margins and center */
    max-width: 500px;
    /* Refined smaller size to look extremely crisp and premium */
    width: 100%;
}

.project-card .project-image-wrapper {
    aspect-ratio: 16 / 10;
    /* Clean, premium, and consistent aspect ratio for the grid */
}

/* Offset the right column (even items) lower than the left column on desktop */
@media (min-width: 769px) {
    .projects-grid>*:nth-child(even) {
        margin-top: 100px !important;
        /* Elegant vertical shift for high-end gallery rhythm */
    }
}

/* ==========================================================================
   Contact Section (Split Form / Social Columns)
   ========================================================================== */
.contact-section {
    padding: var(--section-padding-desktop) var(--gutter);
}

.grid-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 120px;
    align-items: center;
}

.contact-desc {
    font-size: 18px;
    font-weight: 300;
    color: var(--text-on-surface-variant);
    margin: 32px 0 64px 0;
    max-width: 440px;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.contact-method-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--surface);
    transition: var(--transition-smooth);
}

.contact-method-card:hover {
    border-color: var(--secondary);
    transform: translateY(-4px);
    background-color: rgba(19, 19, 20, 0.9);
}

.contact-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(100, 116, 139, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--secondary);
    transition: var(--transition-fast);
}

.contact-method-card:hover .contact-icon-box {
    border-color: var(--secondary);
}

.contact-text-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--text-on-surface-variant);
}

.contact-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary);
}

/* Contact Form Styling */
.contact-form-container {
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 48px;
    position: relative;
    transition: var(--transition-smooth);
}

.contact-form-container:hover {
    border-color: var(--border-color-hover);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-label {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-on-surface-variant);
}

.form-input,
.form-textarea {
    width: 100%;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--primary);
    outline: none;
    cursor: text;
    /* Restore native text pointer */
    transition: var(--transition-fast);
}

.form-textarea {
    resize: none;
}

.form-input:focus,
.form-textarea:focus {
    border-bottom-color: var(--secondary);
}

/* Placeholders spacing */
.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Premium Submit CTA */
.btn-submit {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: 100%;
    background-color: var(--primary);
    color: var(--bg-color);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 20px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.btn-submit:hover {
    background-color: var(--secondary);
    color: #3c2f00;
    transform: translateY(-3px);
}

.btn-submit-icon {
    font-size: 18px;
    transition: var(--transition-fast);
}

.btn-submit:hover .btn-submit-icon {
    transform: translateX(4px) rotate(-10deg);
}

/* ==========================================================================
   Footer Area
   ========================================================================== */
.footer {
    background-color: var(--surface-container-lowest);
    border-top: 1px solid var(--border-color);
    padding: 80px var(--gutter);
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--primary);
}

.footer-copy {
    font-size: 14px;
    color: var(--text-on-surface-variant);
}

.footer-socials {
    display: flex;
    gap: 32px;
}

.social-link {
    font-size: 15px;
    color: var(--text-on-surface-variant);
    opacity: 0.75;
    transition: var(--transition-fast);
}

.social-link:hover {
    color: var(--secondary);
    opacity: 1;
}

.footer-credits {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.credits-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--text-on-surface-variant);
}

.credits-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.indicator-line {
    width: 32px;
    height: 1px;
    background-color: var(--secondary);
}

.indicator-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--secondary);
}

/* ==========================================================================
   Animation Utilities & Reveal on Scroll
   ========================================================================== */
/* Entrance Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUpAnimation 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

@keyframes fadeInUpAnimation {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* JavaScript Reveal on Scroll class */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal.delay-1 {
    transition-delay: 0.15s;
}

.scroll-reveal.delay-2 {
    transition-delay: 0.3s;
}

/* ==========================================================================
   Responsive Adaptations & Media Queries
   ========================================================================== */

/* Laptops & Tablets (Max 1024px) */
@media (max-width: 1024px) {
    :root {
        --section-padding-desktop: 80px;
        --gutter: 24px;
    }

    .projects-grid {
        row-gap: 80px;
    }

    .card-tall {
        margin-top: 0;
    }

    .card-wide {
        margin-top: 0;
    }

    .grid-two-columns {
        gap: 60px;
    }

    .contact-form-container {
        padding: 32px;
    }
}

/* Tablets (Max 768px) */
@media (max-width: 768px) {
    :root {
        --section-padding-desktop: 64px;
    }


    /* Banish off-screen elements on mobile for pure layout responsiveness */
    .ambient-glow {
        display: none !important;
        /* Prevents overflow-x scroll & improves scrolling frame rates */
    }

    .nav-container {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Navigation drawer overlay */
    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        gap: 40px;
        transform: translateX(-100%);
        transition: var(--transition-smooth);
        backdrop-filter: blur(20px);
    }

    .nav-links.mobile-open {
        transform: translateX(0);
    }

    .nav-link {
        font-size: 16px;
    }

    .nav-toggle {
        display: flex;
        position: relative;
        z-index: 105;
        /* Keeps toggle button layering fully interactive */
    }

    .nav-toggle.open .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.open .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.open .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-cta-btn {
        display: none;
        /* Hide top CTA on tablets/phones to preserve space */
    }

    /* Hero Adjustments */
    .accent-line {
        display: none;
    }

    .hero-details {
        margin-bottom: 40px;
    }

    /* Grid Adaptations */
    .projects-grid {
        grid-template-columns: 1fr;
        /* Single column */
        row-gap: 64px;
    }

    .project-card {
        grid-column: span 1 !important;
    }

    .project-image-wrapper {
        aspect-ratio: 16 / 10 !important;
    }

    /* Contact Split Adapts */
    .grid-two-columns {
        grid-template-columns: 1fr;
        gap: 64px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 48px;
    }

    .section-intro {
        text-align: left;
    }
}

/* Mobile Phones (Max 480px) */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 16px;
    }

    .hero-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .projects-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .contact-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .footer-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 32px;
    }

    .footer-credits {
        align-items: flex-start;
    }

    .footer-socials {
        flex-wrap: wrap;
        gap: 16px 24px;
    }

    .contact-form-container {
        padding: 24px;
    }
}