@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg: #0a0a0b;
    --bg-subtle: #111113;
    --surface: #18181b;
    --surface-hover: #1e1e22;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-1: #6366f1;
    --accent-2: #8b5cf6;
    --accent-3: #ec4899;
    --gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    --glow: 0 0 80px rgba(99, 102, 241, 0.15);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

/* ─── Layout Container ─── */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

/* ─── Header ─── */
header {
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border-bottom: 1px solid var(--border);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.04em;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.85;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--surface);
}

.nav-links a.active {
    color: var(--text);
    background: var(--surface);
}

/* ─── Hero Section ─── */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.06) 40%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero h1 .gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ─── Section Titles ─── */
.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-1);
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

/* ─── Apps Grid ─── */
.apps-section {
    padding-bottom: 4rem;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.app-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, rgba(99, 102, 241, 0.3), rgba(236, 72, 153, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.app-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--glow);
    border-color: var(--border-hover);
}

.app-card:hover::before {
    opacity: 1;
}

.app-image-container {
    width: 100%;
    height: 260px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-subtle);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.app-image-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, var(--surface), transparent);
    pointer-events: none;
}

.app-screenshot {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: var(--radius-sm);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-card:hover .app-screenshot {
    transform: scale(1.03);
}

.app-info {
    padding: 1.25rem 1.5rem 1.5rem;
}

.app-info h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-info h3 .emoji {
    font-size: 1.2rem;
}

.app-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 0;
}

.app-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-2);
    background: rgba(139, 92, 246, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 0.75rem;
}

/* ─── Footer ─── */
footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

footer .social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

footer .social-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}

footer .social-links a:hover {
    color: var(--text);
}

/* ─── Portfolio Page Styles ─── */
.page-header {
    padding: 3rem 0 2rem;
}

.page-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    padding-bottom: 3rem;
}

.video-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background-color: var(--bg-subtle);
    display: block;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s;
}

.video-wrapper:hover .video-thumbnail {
    opacity: 0.8;
    transform: scale(1.03);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    transition: all 0.3s;
}

.video-wrapper:hover .play-button {
    background: var(--accent-1);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-button svg {
    width: 22px;
    height: 22px;
    fill: white;
    margin-left: 3px;
}

.video-info {
    padding: 1.25rem;
}

.video-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.video-year {
    font-size: 0.7rem;
    color: var(--accent-2);
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 7px;
    border-radius: 6px;
    margin-left: 8px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.video-info p {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.channel-link {
    text-align: center;
    padding: 2rem 0 4rem;
}

.channel-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-1);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.05);
    transition: all 0.2s;
}

.channel-link a:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
}

/* ─── Responsive ─── */
@media (max-width: 700px) {
    .hero {
        padding: 3rem 0 2.5rem;
    }
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .app-image-container {
        height: 200px;
    }
    .video-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .apps-grid {
        grid-template-columns: 1fr;
    }
}
