/* Shared Styles for Kenichi Studio */
/* Paths are relative to the CSS file location */

:root {
    /* Palette: Deep Zinc & Electric Blue */
    --bg: #09090b;
    /* Zinc 950 */
    --surface: rgba(24, 24, 27, 0.6);
    /* Zinc 900 Glass */
    --surface-card: rgba(39, 39, 42, 0.4);
    /* Zinc 800 Glass */
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --text-main: #ffffff;
    --text-muted: #a1a1aa;

    --accent: #3b82f6;
    /* Blue 500 */
    --accent-glow: rgba(59, 130, 246, 0.4);

    --ease-out: cubic-bezier(0.25, 0.4, 0.25, 1);
    --ease-elastic: cubic-bezier(0.5, 1.75, 0.75, 1);
}

[data-theme="light"] {
    --bg: #FAFAFA;
    --surface: rgba(255, 255, 255, 0.7);
    --surface-card: rgba(244, 244, 245, 0.5);
    --border: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.12);
    --text-main: #09090b;
    --text-muted: #52525b;
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.2);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

h1,
h2,
h3,
.brand-font {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* --- Navigation --- */
.nav-pill {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 2rem;
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 99px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-brand {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

/* --- Hero Section --- */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding-top: 6rem;
}

.hero-min {
    min-height: 60vh;
}

/* Animated Background Mesh */
.bg-mesh {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.3;
    background: radial-gradient(circle at 50% 50%, var(--accent-glow) 0%, transparent 60%);
    filter: blur(80px);
    pointer-events: none;
}

.hero-mark {
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
    animation: heroFloat 8s ease-in-out infinite;
}

@keyframes heroFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(2deg);
    }
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: slideUp 0.8s var(--ease-out) forwards;
    animation-delay: 0.2s;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 580px;
    margin-bottom: 3rem;
    opacity: 0;
    animation: slideUp 0.8s var(--ease-out) forwards;
    animation-delay: 0.4s;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s var(--ease-out);
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px var(--accent-glow);
}

.btn-glass {
    background: var(--surface-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    color: var(--text-main);
}

.btn-glass:hover {
    background: var(--border-hover);
    transform: translateY(-2px);
}

/* --- Bento Grid / Cards --- */
.bento-section {
    padding: 4rem 0 8rem;
}

.section-header {
    margin-bottom: 4rem;
    text-align: center;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 350px);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }
}

/* Force 1 column layout for tablets and mobile to prevent squished cards */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card {
        padding: 1.5rem;
        /* Reduce padding from 2.5rem */
        border-radius: 24px;
    }

    .card-content h3 {
        font-size: 1.25rem;
    }

    .card-visual img {
        max-height: 140px;
        /* Smaller images */
    }

    /* Reset spans for 1-column layout */
    .col-span-2,
    .row-span-2 {
        grid-column: auto;
        grid-row: auto;
    }
}

.card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--ease-out);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Card Sizes */
.col-span-2 {
    grid-column: span 2;
}

.row-span-2 {
    grid-row: span 2;
}

/* Card Content */
.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.card-visual {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
}

.card-visual img {
    max-width: 100%;
    height: auto;
    max-height: 180px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
    transition: transform 0.5s var(--ease-elastic);
}

.card:hover .card-visual img {
    transform: scale(1.1);
}

.card-link {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    background: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s var(--ease-out);
}

.card:hover .card-link {
    opacity: 1;
    transform: scale(1);
}

/* --- About & Text Layouts --- */
.text-block {
    max-width: 800px;
    margin: 0 auto 4rem;
    line-height: 1.8;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.text-block h2 {
    color: var(--text-main);
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

/* --- Scroll Reveal Animation --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-out);
}

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

/* --- Animations --- */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

/* --- Mobile Navigation & Responsive Tweaks --- */

/* Mobile Menu Button - Hidden by default */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
}

/* Mobile Layout (< 768px) */
@media (max-width: 768px) {
    .nav-pill {
        width: 90%;
        max-width: 400px;
        justify-content: space-between;
        padding: 0.75rem 1.5rem;
    }

    /* Hide standard nav links */
    .nav-links {
        display: none;
        /* We will use a separate mobile menu container or toggle this */
    }

    /* Show hamburger */
    .mobile-toggle {
        display: flex;
    }

    /* Mobile Menu Overlay */
    .mobile-menu {
        position: fixed;
        top: 5rem;
        /* Below the nav pill */
        left: 50%;
        transform: translateX(-50%) translateY(-20px);
        width: 90%;
        max-width: 400px;
        background: var(--surface);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border);
        border-radius: 24px;
        padding: 1.5rem;
        flex-direction: column;
        gap: 1rem;
        display: none;
        /* Hidden by default */
        opacity: 0;
        transition: all 0.3s var(--ease-out);
        z-index: 999;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }

    .mobile-menu.active {
        display: flex;
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .mobile-menu a {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-muted);
        text-align: center;
        padding: 0.75rem;
        border-radius: 12px;
        transition: background 0.2s;
    }

    .mobile-menu a:hover,
    .mobile-menu a.active {
        color: var(--text-main);
        background: var(--surface-card);
    }

    /* Helper class to show desktop nav links in mobile menu if needed, 
       but we will likely duplicate them in HTML for cleaner DOM manipulation 
       or toggle the .nav-links class itself if simpler. 
       Let's stick to a separate container in HTML for safety. */

    /* Hero Responsive */
    .hero h1 {
        font-size: 3rem;
        /* Smaller for mobile */
    }

    .hero p {
        padding: 0 1rem;
    }

    /* Stack buttons */
    .hero div[style*="flex"] {
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    /* Force Reset explicitly at the end to override any previous rules */
    .col-span-2,
    .row-span-2 {
        grid-column: auto !important;
        grid-row: auto !important;
    }
}