@import "tailwindcss";
@plugin "@tailwindcss/typography";

@theme {
    --color-brand-dark: #0B0D11;
    --color-brand-panel: #151921;
    --color-brand-accent: #dd4132;
    --color-brand-cyan: #22D3EE;
    --color-brand-red: #E11D48;

    --font-sans: Sora, ui-sans-serif, sans-serif, system-ui;
    --font-serif: "IBM Plex Mono", ui-monospace, monospace;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;

    /* Animation keyframes */
    --animate-reveal: reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    --animate-fade-in: fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    --animate-slide-up: slide-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    --animate-slide-left: slide-left 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    --animate-slide-right: slide-right 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    --animate-scale-in: scale-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;

    @keyframes reveal {
        from {
            opacity: 0;
            transform: translateY(30px);
        }

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

    @keyframes fade-in {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    @keyframes slide-up {
        from {
            opacity: 0;
            transform: translateY(40px);
        }

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

    @keyframes slide-left {
        from {
            opacity: 0;
            transform: translateX(40px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    @keyframes slide-right {
        from {
            opacity: 0;
            transform: translateX(-40px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    @keyframes scale-in {
        from {
            opacity: 0;
            transform: scale(0.95);
        }

        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    @keyframes scan-sweep {
        0% {
            transform: translateX(-100%) skewX(-15deg);
        }
        100% {
            transform: translateX(200%) skewX(-15deg);
        }
    }
}

@utility animate-scan-sweep {
    animation: scan-sweep 1.5s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@utility text-massive {
    line-height: 0.9;
    letter-spacing: -0.04em;
}

@utility text-stroke {
    -webkit-text-stroke: 1px var(--theme-text-stroke);
    color: transparent;
}

@utility text-stroke-dark {
    -webkit-text-stroke: 1px var(--theme-text-stroke-inverted);
    color: transparent;
}

@utility skill-tag {
    @apply text-[10px] font-mono font-bold uppercase tracking-wider px-3 py-2 border border-[var(--theme-border-strong)] text-[var(--theme-text-secondary)] hover:border-brand-accent hover:text-[var(--theme-text-primary)] transition-all duration-300 cursor-default select-none;
}

@utility btn-primary {
    @apply bg-brand-accent text-brand-dark px-8 py-4 text-xs font-bold uppercase tracking-widest hover:bg-[var(--theme-text-primary)] hover:text-[var(--theme-bg-primary)] transition-all duration-300 inline-block rounded-full;
}

@utility btn-ghost {
    @apply border border-[var(--theme-border-strong)] text-[var(--theme-text-primary)] px-8 py-4 text-xs font-bold uppercase tracking-widest hover:border-brand-accent hover:bg-brand-accent/5 transition-all duration-300 inline-block rounded-full;
}

@utility grid-overlay {
    background-size: 100px 100px;
    background-image: linear-gradient(to right, var(--theme-grid-line) 1px, transparent 1px);
    pointer-events: none;
    z-index: 0;
}

/* ===== THEME SYSTEM ===== */

/* Dark mode (default) */
:root {
    --vh-full: 100vh;
    --vh-full: 100dvh;
    
    /* Theme colors - Dark mode defaults */
    --theme-bg-primary: #0B0D11;
    --theme-bg-secondary: #151921;
    --theme-bg-tertiary: #1E293B;
    --theme-text-primary: #ffffff;
    --theme-text-secondary: #94A3B8;
    --theme-text-muted: #64748B;
    --theme-text-subtle: #475569;
    --theme-border-primary: rgba(255, 255, 255, 0.1);
    --theme-border-secondary: rgba(255, 255, 255, 0.05);
    --theme-border-strong: rgba(255, 255, 255, 0.2);
    --theme-overlay: rgba(11, 13, 17, 0.8);
    --theme-overlay-heavy: rgba(11, 13, 17, 0.98);
    --theme-grid-line: rgba(255, 255, 255, 0.03);
    --theme-hover-bg: rgba(255, 255, 255, 0.02);
    --theme-hover-bg-strong: rgba(255, 255, 255, 0.05);
    --theme-text-stroke: rgba(255, 255, 255, 0.15);
    --theme-text-stroke-inverted: rgba(0, 0, 0, 0.15);
    --theme-scrollbar-track: #0B0D11;
    --theme-scrollbar-thumb: #334155;
    --theme-code-bg: rgba(255, 77, 0, 0.1);
    --theme-blockquote-bg: linear-gradient(135deg, rgba(255, 77, 0, 0.05), rgba(21, 25, 33, 0.8));
    --theme-divider: rgba(255, 255, 255, 0.1);
    --theme-decorative-opacity: 0.02;
    --theme-card-overlay: rgba(11, 13, 17, 0.3);
    --theme-card-gradient: rgba(11, 13, 17, 0.6);
    --theme-hero-gradient-top: rgba(11, 13, 17, 0.8);
    --theme-hero-gradient-side: rgba(11, 13, 17, 0.4);
}

/* Light mode */
[data-theme="light"] {
    --theme-bg-primary: #FAFAFA;
    --theme-bg-secondary: #F1F3F5;
    --theme-bg-tertiary: #E9ECEF;
    --theme-text-primary: #0B0D11;
    --theme-text-secondary: #475569;
    --theme-text-muted: #64748B;
    --theme-text-subtle: #94A3B8;
    --theme-border-primary: rgba(0, 0, 0, 0.1);
    --theme-border-secondary: rgba(0, 0, 0, 0.05);
    --theme-border-strong: rgba(0, 0, 0, 0.15);
    --theme-overlay: rgba(250, 250, 250, 0.9);
    --theme-overlay-heavy: rgba(250, 250, 250, 0.98);
    --theme-grid-line: rgba(0, 0, 0, 0.04);
    --theme-hover-bg: rgba(0, 0, 0, 0.02);
    --theme-hover-bg-strong: rgba(0, 0, 0, 0.05);
    --theme-text-stroke: rgba(0, 0, 0, 0.2);
    --theme-text-stroke-inverted: rgba(255, 255, 255, 0.15);
    --theme-scrollbar-track: #FAFAFA;
    --theme-scrollbar-thumb: #CBD5E1;
    --theme-code-bg: rgba(221, 65, 50, 0.08);
    --theme-blockquote-bg: linear-gradient(135deg, rgba(221, 65, 50, 0.05), rgba(241, 243, 245, 0.9));
    --theme-divider: rgba(0, 0, 0, 0.08);
    --theme-decorative-opacity: 0.04;
    --theme-card-overlay: rgba(250, 250, 250, 0.15);
    --theme-card-gradient: rgba(250, 250, 250, 0.4);
    --theme-hero-gradient-top: rgba(250, 250, 250, 0.5);
    --theme-hero-gradient-side: rgba(250, 250, 250, 0.2);
}

/* Theme transition for smooth switching */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease, 
                color 0.3s ease,
                box-shadow 0.3s ease !important;
}

/* Base Styles */
body {
    background-color: var(--theme-bg-primary);
    color: var(--theme-text-primary);
    overflow-x: hidden;
}

/* Smooth scroll behavior - disabled on mobile for better performance */
html {
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    html {
        scroll-behavior: auto;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--theme-scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--theme-scrollbar-thumb);
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-brand-accent);
}

/* ===== SCROLL ANIMATION SYSTEM ===== */

/* Base animation classes - elements start hidden */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Slide up variant */
.animate-on-scroll.slide-up {
    transform: translateY(40px);
}

/* Slide left variant (comes from right) */
.animate-on-scroll.slide-left {
    transform: translateX(40px);
}

/* Slide right variant (comes from left) */
.animate-on-scroll.slide-right {
    transform: translateX(-40px);
}

/* Scale in variant */
.animate-on-scroll.scale-in {
    transform: scale(0.95);
}

/* Fade only */
.animate-on-scroll.fade-in {
    transform: none;
}

/* Active state - when element is in view */
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Stagger delay classes for sequential animations */
.stagger-1 {
    transition-delay: 0.1s;
}

.stagger-2 {
    transition-delay: 0.2s;
}

.stagger-3 {
    transition-delay: 0.3s;
}

.stagger-4 {
    transition-delay: 0.4s;
}

.stagger-5 {
    transition-delay: 0.5s;
}

.stagger-6 {
    transition-delay: 0.6s;
}

.stagger-7 {
    transition-delay: 0.7s;
}

.stagger-8 {
    transition-delay: 0.8s;
}

/* Legacy reveal-text support */
.reveal-text {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Delay variants for reveal-text */
.reveal-text.delay-100 {
    transition-delay: 0.1s;
}

.reveal-text.delay-200 {
    transition-delay: 0.2s;
}

.reveal-text.delay-300 {
    transition-delay: 0.3s;
}

.reveal-text.delay-400 {
    transition-delay: 0.4s;
}

.reveal-text.delay-500 {
    transition-delay: 0.5s;
}

/* ===== CURSOR STYLES ===== */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(221, 65, 50, 0.5);
    z-index: 99999;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        background-color 0.3s ease;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-brand-accent);
    z-index: 999999;
}

/* Interactive Elements Cursor Hover Effect */
.hover-trigger:hover~.cursor-outline,
a:hover~.cursor-outline,
button:hover~.cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(221, 65, 50, 0.05);
    border-color: var(--color-brand-accent);
}

/* ===== ENHANCED TRANSITIONS ===== */

/* Smooth link transitions */
a {
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* Image hover zoom - smoother */
.hover-zoom {
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-zoom:hover,
.group:hover .hover-zoom {
    transform: scale(1.05);
}

/* Line expand animation */
.line-expand {
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Border glow on hover - subtle */
.hover-border-glow {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hover-border-glow:hover {
    border-color: var(--color-brand-accent);
    box-shadow: 0 0 20px rgba(221, 65, 50, 0.1);
}

/* Gradient divider */
.divider-gradient {
    background: linear-gradient(to right,
            transparent,
            var(--theme-divider) 20%,
            var(--theme-divider) 80%,
            transparent);
}

/* Divider with accent hint */
.divider-accent {
    background: linear-gradient(to right,
            transparent,
            rgba(221, 65, 50, 0.2) 50%,
            transparent);
}

/* ===== PROSE / MARKDOWN STYLES ===== */
.prose-custom {
    color: var(--theme-text-secondary);
    line-height: 1.8;
    font-size: 1.0625rem;
}

.prose-custom h2 {
    color: var(--theme-text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 3.5rem;
    margin-bottom: 1.25rem;
    scroll-margin-top: 6rem;
}

.prose-custom h3 {
    color: var(--theme-text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    scroll-margin-top: 6rem;
}

.prose-custom h4 {
    color: var(--theme-text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 6rem;
}

.prose-custom p {
    margin-bottom: 1.5rem;
}

.prose-custom a {
    color: var(--color-brand-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.prose-custom a:hover {
    text-decoration: underline;
}

.prose-custom strong {
    color: var(--theme-text-primary);
    font-weight: 600;
}

.prose-custom em {
    color: var(--theme-text-secondary);
    font-style: italic;
}

.prose-custom ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.prose-custom ul li {
    margin-bottom: 0.5rem;
}

.prose-custom ol {
    list-style: decimal;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.prose-custom ol li {
    margin-bottom: 0.5rem;
}

/* Blockquotes - Clean left border only */
.prose-custom blockquote {
    border-left: 3px solid var(--theme-border-strong);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--theme-text-muted);
}

.prose-custom blockquote p {
    margin-bottom: 0;
}

.prose-custom blockquote p:last-child {
    margin-bottom: 0;
}

/* Inline code */
.prose-custom code {
    color: var(--color-brand-accent);
    background-color: var(--theme-code-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* Code blocks */
.prose-custom pre {
    background-color: var(--theme-bg-secondary);
    border: 1px solid var(--theme-border-primary);
    border-radius: 4px;
    padding: 1.25rem;
    margin: 2rem 0;
    overflow-x: auto;
}

.prose-custom pre code {
    background: none;
    padding: 0;
    color: var(--theme-text-secondary);
    border-radius: 0;
}

/* Horizontal rules */
.prose-custom hr {
    border: none;
    height: 1px;
    background: var(--theme-border-primary);
    margin: 3rem 0;
}

/* Images */
.prose-custom img {
    border-radius: 4px;
    margin: 2rem 0;
}

/* Image Captions */
.prose-custom figure {
    margin: 2rem 0;
}

.prose-custom figure img {
    margin: 0;
}

.prose-custom figcaption {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
    margin-top: 0.75rem;
}

/* Video containers */
.prose-custom .video-container {
    margin: 2rem 0;
}

.prose-custom .video-container video {
    width: 100%;
    border-radius: 4px;
}

.prose-custom .video-container p {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
    margin-top: 0.75rem;
    margin-bottom: 0;
}

/* Tables */
.prose-custom table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.prose-custom thead {
    border-bottom: 1px solid var(--theme-border-primary);
}

.prose-custom th {
    font-weight: 600;
    color: var(--theme-text-primary);
    padding: 0.75rem 1rem;
    text-align: left;
}

.prose-custom td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--theme-border-secondary);
    color: var(--theme-text-secondary);
}

/* ===== THEME-AWARE UTILITY CLASSES ===== */

/* Background colors */
.bg-theme-primary {
    background-color: var(--theme-bg-primary);
}

.bg-theme-secondary {
    background-color: var(--theme-bg-secondary);
}

.bg-theme-tertiary {
    background-color: var(--theme-bg-tertiary);
}

/* Text colors */
.text-theme-primary {
    color: var(--theme-text-primary);
}

.text-theme-secondary {
    color: var(--theme-text-secondary);
}

.text-theme-muted {
    color: var(--theme-text-muted);
}

/* Border colors */
.border-theme-primary {
    border-color: var(--theme-border-primary);
}

.border-theme-secondary {
    border-color: var(--theme-border-secondary);
}
