/* 
  Castle Man Studio - Premium Design System
  Theme: Royal Gothic Monochrome (Ink & Parchment)
*/

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400&display=swap');

@font-face {
    font-family: 'CloisterBlack';
    src: url('../assets/Fonts/cloister_black/CloisterBlack.ttf') format('truetype');
}

@font-face {
    font-family: 'PirataOne';
    src: url('../assets/Fonts/pirata_one/PirataOne-Regular.ttf') format('truetype');
}

:root {
    --bg-dark: #080808;
    --bg-light: #f5f5f5;
    --text-dark: #111111;
    --text-light: #e8e8e8;
    --accent: #ffffff;
    --border-ink: rgba(255, 255, 255, 0.05);
    --border-ink-dark: rgba(0, 0, 0, 0.05);
    --transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    background-image: url('../assets/images/bg-texture.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Texture Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Gradient Blur Blobs (The Glow Effect) */
.glow-blob {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.blob-1 { top: -10%; left: -10%; }
.blob-2 { bottom: -10%; right: -10%; }

/* Typography */
h2, h3 {
    font-family: 'PirataOne', serif;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 700;
}

.gothic-font {
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 0.3em;
}

p {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    opacity: 0.7;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
    position: relative;
    z-index: 1;
}

section {
    padding: 12rem 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Sections with high contrast */
.section-light {
    background-color: var(--bg-light);
    color: var(--text-dark);
    position: relative;
}

/* Hero Section Refinement */
.hero {
    height: 100vh;
    text-align: center;
    position: relative;
    background: radial-gradient(circle at center, #151515 0%, #080808 100%);
}

.hero h1 {
    font-family: 'CloisterBlack', serif;
    font-size: clamp(1.5rem, 8.5vw, 12rem);
    margin-bottom: 0.5rem;
    line-height: 1.1;
    display: block;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    letter-spacing: -0.02em;
    text-transform: none;
}

.hero .subtitle {
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.5rem);
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    opacity: 0.5;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1.2rem 3rem;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 0.4em;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    background: transparent;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.btn:hover {
    background: var(--accent);
    color: var(--bg-dark);
    transform: translateY(-8px) rotateX(10deg) rotateY(5deg);
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.1), 0 10px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 5px 10px rgba(255, 255, 255, 0.2);
    transition: transform 0.1s ease;
}

.btn-dark {
    border-color: var(--text-dark);
    color: var(--text-dark);
}

.btn-dark:hover {
    background: var(--text-dark);
    color: var(--bg-light);
    transform: translateY(-8px) rotateX(10deg) rotateY(-5deg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2), 0 10px 15px rgba(0, 0, 0, 0.1);
}

.btn-dark:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
}

/* Services Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 6rem;
    margin-top: 6rem;
}

.card {
    padding: 3rem 2rem;
    border-top: 1px solid var(--border-ink);
    transition: background 0.5s ease, border-radius 0.5s ease, box-shadow 0.5s ease, padding 0.5s ease;
    position: relative;
    transform-style: preserve-3d;
    text-align: center;
}

@media (max-width: 1024px) {
    .card:active {
        border-top-color: var(--accent);
    }
}

@media (min-width: 1025px) {
    .card {
        padding: 4rem 2.5rem;
        border-radius: 10px;
    }
    
    .card:hover {
        border-top-color: transparent;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.01) 100%);
        border-radius: 175px 175px 10px 10px; /* Gothic Arch Window */
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 2px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 30px 60px rgba(0,0,0,0.8), inset 0 0 20px rgba(255,255,255,0.05);
        z-index: 10;
    }
}

.card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: var(--transition);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation */
.logo-container {
    background: #000; /* Pure black, no transparency */
    padding: 2.5rem 2rem 4.5rem 2rem;
    clip-path: polygon(0% 0%, 100% 0%, 100% 85%, 50% 100%, 0% 85%);
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 110; /* Highest layer */
    border: none;
    position: fixed;
    top: 0;
    left: 4rem;
    cursor: pointer;
}

nav {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100px;
    z-index: 100;
    display: flex;
    justify-content: flex-end; /* Move links to the right */
    align-items: center;
    padding: 0 4rem;
    background: transparent;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 3rem;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.logo-container.nav-hidden {
    transform: translateY(-110%);
}

.nav-links a {
    color: inherit;
    text-decoration: none;
    font-size: 0.8rem;
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.5;
}

/* Social Icons Hover */
[title="Instagram"]:hover, [title="Facebook"]:hover, [title="LinkedIn"]:hover, [title="YouTube"]:hover, [title="ArtStation"]:hover {
    opacity: 1 !important;
    transform: translateY(-3px);
    text-shadow: 0 0 15px rgba(255,255,255,0.3);
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 101;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 1px;
    background-color: var(--accent);
    transition: 0.3s;
}

@media (max-width: 1024px) {
    .container { padding: 0 3rem; }
    section { padding: 8rem 0; }
    .grid { gap: 4rem; }
    nav { 
        padding: 2rem 3rem; 
        position: fixed;
    }

    nav.nav-hidden {
        transform: translateY(-100%);
    }

    .nav-links.nav-hidden {
        transform: translateY(-120%);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .container { padding: 0 1.5rem; }
    section { padding: 6rem 0; }
    
    .hero h1 { 
        letter-spacing: 0.1em;
        white-space: normal;
    } 
    
    nav {
        padding: 0 1.5rem;
        height: 80px;
        position: fixed;
        background: transparent;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, border-bottom 0.3s ease;
        border-bottom: 1px solid transparent;
    }

    nav.nav-scrolled {
        background: rgba(8, 8, 8, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .menu-toggle {
        display: flex;
        z-index: 115; /* Ensure it's clickable above the menu */
    }

    .logo-container {
        left: 1.5rem;
        padding: 1.5rem 1rem 3rem 1rem;
    }

    .logo-container img {
        height: 60px !important; /* Slightly smaller for mobile */
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 100%;
        background: #000;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        z-index: 105;
        transition: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .nav-links.active {
        right: 0;
    }

    /* Hamburger Animation */
    .menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
