/* --- RESET & VARIABLES --- */
:root {
    /* Orange Palette */
    --bg-color: #0a0500; /* Very dark orange-black */
    --text-primary: #f0f0f0;
    --text-secondary: #b08050;
    --accent-orange: #ff8c00; /* Dark Orange */
    --accent-gold: #ffd700; /* Gold/Yellow Orange */
    --accent-red: #ff4500; /* Orange Red */
    
    --glass-bg: rgba(20, 10, 0, 0.75);
    --glass-border: rgba(255, 140, 0, 0.2);
    
    --font-mono: 'Fira Code', 'Courier New', monospace;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* Scrollbar Styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--accent-orange); border-radius: 4px; }

/* --- BACKGROUND CANVAS --- */
#canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, transparent 0%, #000 120%);
}

/* --- UI COMPONENTS --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    font-family: var(--font-mono);
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
    background: rgba(255, 140, 0, 0.1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--accent-orange);
    color: #000;
    box-shadow: 0 0 25px var(--accent-orange);
}

.section-title {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    color: #fff;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-orange);
    margin: 10px auto;
    box-shadow: 0 0 10px var(--accent-orange);
}

/* --- HEADER --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(10, 5, 0, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-orange);
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.9rem;
    font-family: var(--font-mono);
    opacity: 0.8;
}

.nav-links a:hover {
    opacity: 1;
    color: var(--accent-gold);
    text-shadow: 0 0 8px var(--accent-orange);
}

/* --- HERO SECTION --- */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.hero-content h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-content h1 span {
    color: var(--accent-orange);
    text-shadow: 0 0 20px rgba(255, 69, 0, 0.5);
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* --- SERVICES (3D TILT CARDS) --- */
#services {
    padding: 64px 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    perspective: 1000px;
}

.tilt-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(0) rotateY(0);
    transition: transform 0.1s ease-out, border-color 0.3s;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tilt-card:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(255, 140, 0, 0.15);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--accent-orange);
    margin-bottom: 1.5rem;
    transform: translateZ(30px);
    display: inline-block;
    transform-origin: center;
    animation: icon-float 3.6s ease-in-out infinite;
    will-change: transform, filter;
}

.tilt-card:hover .card-icon {
    animation-duration: 1.4s;
    filter: drop-shadow(0 0 10px rgba(255, 140, 0, 0.55));
}

.card-grid .tilt-card:nth-child(1) .card-icon {
    animation-name: icon-bounce;
    animation-delay: 0s;
}

.card-grid .tilt-card:nth-child(2) .card-icon {
    animation-name: icon-swing;
    animation-delay: 0.2s;
}

.card-grid .tilt-card:nth-child(3) .card-icon {
    animation-name: icon-float;
    animation-delay: 0.35s;
}

.card-grid .tilt-card:nth-child(4) .card-icon {
    animation-name: icon-pulse;
    animation-delay: 0.5s;
}

.card-grid .tilt-card:nth-child(5) .card-icon {
    animation-name: icon-spin-soft;
    animation-delay: 0.65s;
}

.card-grid .tilt-card:nth-child(6) .card-icon {
    animation-name: icon-orbit;
    animation-delay: 0.8s;
}

@keyframes icon-float {
    0%, 100% { transform: translateZ(30px) translateY(0); }
    50% { transform: translateZ(30px) translateY(-6px); }
}

@keyframes icon-bounce {
    0%, 100% { transform: translateZ(30px) translateY(0); }
    25% { transform: translateZ(30px) translateY(-7px); }
    55% { transform: translateZ(30px) translateY(2px); }
}

@keyframes icon-swing {
    0%, 100% { transform: translateZ(30px) rotate(0deg); }
    25% { transform: translateZ(30px) rotate(-7deg); }
    75% { transform: translateZ(30px) rotate(7deg); }
}

@keyframes icon-pulse {
    0%, 100% { transform: translateZ(30px) scale(1); }
    50% { transform: translateZ(30px) scale(1.12); }
}

@keyframes icon-spin-soft {
    0%, 100% { transform: translateZ(30px) rotate(0deg); }
    50% { transform: translateZ(30px) rotate(10deg); }
}

@keyframes icon-orbit {
    0%, 100% { transform: translateZ(30px) translateX(0) translateY(0); }
    25% { transform: translateZ(30px) translateX(3px) translateY(-5px); }
    75% { transform: translateZ(30px) translateX(-3px) translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
    .card-icon,
    .tilt-card:hover .card-icon {
        animation: none;
        filter: none;
    }
}

.card-title {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #fff;
    transform: translateZ(20px);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    transform: translateZ(15px);
    flex-grow: 1;
}

.card-link {
    font-family: var(--font-mono);
    color: var(--accent-gold);
    font-size: 0.8rem;
    transform: translateZ(25px);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- PORTFOLIO SWEEP GALLERY --- */
#portfolio {
    position: relative;
    padding: 0;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.8), transparent);
}

.portfolio-pin {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: stretch;
}

.portfolio-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 88px 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100vh;
}

.portfolio-title {
    margin-bottom: 0;
    text-align: left;
}

.portfolio-title::after {
    margin: 10px 0 0;
}

.portfolio-subtitle {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    font-family: var(--font-mono);
    letter-spacing: 0.2px;
}

.portfolio-viewport {
    width: 100%;
    overflow: hidden;
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 0;
}

.gallery-track {
    display: flex;
    gap: 20px;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.gallery-item {
    flex: 0 0 clamp(240px, 62vw, 560px);
    height: min(clamp(220px, 56vh, 560px), var(--portfolio-card-max-h, 56vh));
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: transform 0.35s ease, opacity 0.35s ease, border-color 0.35s ease;
    transform-origin: center bottom;
    opacity: 0.72;
}

.gallery-item.is-active {
    opacity: 1;
    border-color: rgba(255, 215, 0, 0.75);
    box-shadow: 0 0 28px rgba(255, 140, 0, 0.22);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: grayscale(40%) contrast(110%);
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: grayscale(0%) contrast(100%);
}

.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    background: linear-gradient(0deg, #000 0%, transparent 100%);
    pointer-events: none;
}

.item-overlay h3 {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 5px;
}

.item-overlay p {
    color: var(--accent-orange);
    font-weight: bold;
}

/* Tech/Geek Section - Code Viz */
#tech-stack {
    padding: 56px 0;
    text-align: center;
}

.code-block-display {
    background: #1a0d00;
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: 8px;
    display: inline-block;
    text-align: left;
    font-family: var(--font-mono);
    color: #dcdcaa;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    position: relative;
}

/* --- BLOG SECTION --- */
#blog {
    padding: 56px 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.blog-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.blog-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-4px);
    box-shadow: 0 0 24px rgba(255, 140, 0, 0.14);
}

.blog-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--accent-orange);
}

.blog-card h3 {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    line-height: 1.4;
    color: #fff;
}

.blog-card p {
    color: var(--text-secondary);
    font-size: 0.94rem;
    flex-grow: 1;
}

.blog-link {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-gold);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-link:hover {
    color: #fff;
}

/* --- BLOG DETAIL PAGE --- */
.blog-page {
    min-height: 100vh;
    padding: 108px 20px 64px;
}

.blog-article {
    max-width: 860px;
    margin: 0 auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: clamp(1.2rem, 2.8vw, 2rem);
    box-shadow: 0 0 30px rgba(255, 140, 0, 0.08);
}

.blog-detail-meta {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--accent-orange);
    margin-bottom: 0.9rem;
}

.blog-article h1 {
    font-family: var(--font-mono);
    line-height: 1.3;
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    margin-bottom: 1rem;
}

.blog-article p {
    color: #e5d8c9;
    margin-bottom: 1rem;
}

.blog-article h2 {
    font-family: var(--font-mono);
    color: #fff;
    margin: 1.4rem 0 0.7rem;
    font-size: clamp(1.1rem, 2.4vw, 1.35rem);
}

.blog-page-nav {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 1.6rem;
    flex-wrap: wrap;
}

.blog-page-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    color: var(--accent-gold);
    font-size: 0.82rem;
}

.blog-page-link:hover {
    color: #fff;
}

/* --- Page Transition Animation --- */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1600;
    background: radial-gradient(circle at 50% 45%, rgba(255, 140, 0, 0.22), rgba(10, 5, 0, 0.95) 58%);
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

body.page-enter main,
body.page-enter .blog-page {
    opacity: 0;
    transform: translateY(16px) scale(0.992);
}

main,
.blog-page {
    transition: opacity 0.45s ease, transform 0.45s ease;
}

body.is-transitioning::after {
    opacity: 1;
    transform: scale(1);
}

body.is-transitioning main,
body.is-transitioning .blog-page {
    opacity: 0;
    transform: translateY(-10px) scale(0.988);
}

/* --- CONTACT SECTION (TABS) --- */
#contact {
    padding: 64px 0;
    position: relative;
}

.contact-wrapper {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    max-width: 800px;
    margin: 0 auto;
    backdrop-filter: blur(15px);
    overflow: hidden;
    box-shadow: 0 0 50px rgba(255, 69, 0, 0.1);
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    padding: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--accent-orange);
    border-bottom: 3px solid var(--accent-orange);
    background: rgba(255, 140, 0, 0.05);
}

.tab-content {
    padding: 40px;
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-orange);
}

.form-control {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    color: #fff;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* --- TOAST NOTIFICATION --- */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(20, 10, 0, 0.95);
    border-left: 4px solid var(--accent-orange);
    color: #fff;
    padding: 15px 25px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    animation: slideIn 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 300px;
}

/* --- CURSOR FOLLOWER --- */
.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1200;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-gold);
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.8);
}

.cursor-ring {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 140, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.35);
    mix-blend-mode: screen;
}

body.cursor-active .cursor-dot,
body.cursor-active .cursor-ring {
    opacity: 1;
}

@media (hover: none), (pointer: coarse) {
    .cursor-dot,
    .cursor-ring {
        display: none;
    }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* --- FOOTER --- */
footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: #050200;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    #hero {
        height: auto;
        min-height: 82vh;
        padding: 88px 0 24px;
    }
    .hero-content h1 {
        font-size: 2.8rem;
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }
    .section-title {
        line-height: 1.22;
        margin-bottom: 2rem;
    }
    .card-title,
    .blog-card h3,
    .blog-article h1,
    .blog-article h2 {
        line-height: 1.28;
    }
    #services { padding: 40px 0 52px; }
    .nav-links { display: none; } /* Mobile nav hidden for demo */
    .portfolio-content { padding: 84px 16px 20px; }
    .portfolio-title { font-size: 2rem; }
    .gallery-track { gap: 14px; }
    .gallery-item { flex-basis: 82vw; height: min(52vh, var(--portfolio-card-max-h, 52vh)); }
    #blog { padding: 52px 0; }
    .blog-page { padding: 98px 14px 44px; }
    .blog-page-nav { flex-direction: column; }
    .tabs-header { flex-direction: column; }
    .tab-btn { border-bottom: 1px solid var(--glass-border); border-left: 4px solid transparent; text-align: left; }
    .tab-btn.active { border-bottom: 1px solid var(--glass-border); border-left: 4px solid var(--accent-orange); }
}
