/* ============================================
   Design Tokens — matching usectrl.ai
   ============================================ */
:root {
    --bg: #fcfcfc;
    --foreground: #0a0a0a;
    --muted: #737373;
    --border: rgba(0, 0, 0, 0.08);
    --card-hover: rgba(0, 0, 0, 0.02);
    --placeholder: #f0f0f0;
    --overlay-bg: rgba(252, 252, 252, 0.7);
    --glow-1: #14b8a6;
    --glow-2: #eab308;
    --glow-3: #f43f5e;
    --glow-4: #6366f1;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --radius: 16px;
    --container: 1200px;
    --transition: 0.2s ease;
}

html.dark {
    --bg: #0a0a0a;
    --foreground: #fcfcfc;
    --muted: #a1a1a1;
    --border: rgba(255, 255, 255, 0.08);
    --card-hover: rgba(255, 255, 255, 0.04);
    --placeholder: #1a1a1a;
    --overlay-bg: rgba(10, 10, 10, 0.7);
    --glow-1: #14b8a6;
    --glow-2: #eab308;
    --glow-3: #f43f5e;
    --glow-4: #6366f1;
}

/* ============================================
   Reset
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background-color: transparent;
    color: var(--foreground);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "liga" 1, "calt" 1;
    line-height: 1.5;
    transition: color 0.3s ease;
}

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

::selection {
    background: rgba(0, 0, 0, 0.08);
    color: var(--foreground);
}

/* ============================================
   Page Layout
   ============================================ */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 92px;
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

/* ============================================
   Header
   ============================================ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    letter-spacing: -0.01em;
}

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color var(--transition), background-color var(--transition);
}

.theme-toggle:hover {
    color: var(--foreground);
    background-color: var(--card-hover);
}

.icon-moon { display: none; }
.icon-sun  { display: block; }

html.dark .icon-moon { display: block; }
html.dark .icon-sun  { display: none; }

.header-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-social {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--muted);
    transition: color var(--transition), background-color var(--transition);
}

.header-social:hover {
    color: var(--foreground);
    background-color: var(--card-hover);
}

/* ============================================
   Hero
   ============================================ */
.hero {
    padding-top: 48px;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1000px;
}

.hero-name {
    font-size: clamp(1.875rem, 5vw, 3.75rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.025em;
    color: var(--foreground);
}

.hero-tagline {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--muted);
    font-weight: 400;
}

/* ============================================
   Tiles
   ============================================ */
.tiles-section {
    width: 100%;
}

.tiles-grid {
    display: flex;
    gap: 12px;
    width: 100%;
}

.tile {
    position: relative;
    flex: 1;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.tile:hover {
    /* Main hover is managed by the JS 3D tilt effect */
}

/* Tile image container */
.tile-image {
    width: 100%;
    height: 100%;
    background-color: var(--placeholder);
    overflow: hidden;
}

.tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.tile:hover .tile-image img {
    transform: scale(1.05);
}

/* Tile text overlay island */
.tile-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    max-width: 320px;
    padding: 24px 20px;
    background-color: var(--overlay-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 6px;
    z-index: 10;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.tile:hover .tile-text {
    transform: translate(-50%, -50%) scale(1.03);
}

.tile-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--foreground);
    line-height: 1.4;
}

.tile-desc {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
    font-weight: 400;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: 48px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .main {
        gap: 48px;
    }

    .hero {
        padding-top: 24px;
    }

    .tiles-grid {
        flex-direction: column;
        gap: 32px;
    }

    .tile {
        aspect-ratio: 4 / 3;
    }

    .tile-image {
        aspect-ratio: auto;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .main {
        gap: 64px;
    }

    .tiles-grid {
        gap: 12px;
    }
}

/* ============================================
   Fluid Background Glow
   ============================================ */
.background-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-color: var(--bg);
    overflow: hidden;
    pointer-events: none;
    transition: background-color 0.3s ease;
}

.glow-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    -webkit-filter: blur(140px);
    opacity: 0.12; /* Subtle, delicate light theme glow */
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

html.dark .glow-blob {
    opacity: 0.05; /* Extremely dark, mysterious, subtle dark theme glow */
}

.glow-1 {
    top: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background-color: var(--glow-1);
    animation: drift-1 16s infinite alternate ease-in-out;
}

.glow-2 {
    bottom: -15%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background-color: var(--glow-2);
    animation: drift-2 20s infinite alternate ease-in-out;
}

.glow-3 {
    top: 30%;
    right: 15%;
    width: 45vw;
    height: 45vw;
    background-color: var(--glow-3);
    animation: drift-3 24s infinite alternate ease-in-out;
}

.glow-4 {
    top: -15%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background-color: var(--glow-4);
    animation: drift-4 12s infinite alternate ease-in-out;
}

@keyframes drift-1 {
    0% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(16vw, 20vh) scale(1.1);
    }
    66% {
        transform: translate(-10vw, 30vh) scale(0.9);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes drift-2 {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-25vw, -15vh) scale(0.85);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes drift-3 {
    0% {
        transform: translate(0, 0) scale(1);
    }
    40% {
        transform: translate(20vw, -25vh) scale(1.15);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes drift-4 {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(18vw, 15vh) scale(1.12);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}
