/* ============================================================
   Redesigned Homepage Styles
   Font: Inter
   ============================================================ */

:root {
    --bg:          #ebecef;
    --surface:     #ffffff;
    --text:        #1d1d1f;
    --text-dim:    #86868b;
    --border:      #d2d2d7;
    --accent:      #f04d23; /* vibrant orange */
    --navy:        #15151e; /* dark text color */
    --dark-surface: #26262a;
    --dark-text:   #f5f5f7;
    --radius:      16px;
    --radius-large: 32px;
}

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

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--navy);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* ---- Decorative Background ---- */
.bg-decorations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.grid-line {
    position: absolute;
    background-color: var(--border);
    opacity: 0.6;
}

.h-line-1 {
    top: 35%;
    left: 0;
    right: 0;
    height: 1px;
}

.h-line-2 {
    top: 65%;
    left: 0;
    right: 0;
    height: 1px;
}

.v-line-1 {
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
}

.circle-outline {
    position: absolute;
    top: -15%;
    left: 10%;
    width: 800px;
    height: 800px;
    border: 1px solid rgba(210, 210, 215, 0.6);
    border-radius: 50%;
}

/* ---- Layout ---- */
.layout-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 48px;
    gap: 40px;
}

/* ---- Sidebar ---- */
.sidebar {
    grid-column: 1;
    grid-row: 1 / span 2;
    padding-top: 16px;
}

.sidebar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.2s;
}

.sidebar a:hover {
    color: var(--navy);
}

/* ---- Top Header ---- */
.top-header {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 24px;
    width: 100%;
}

.top-subtitle {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 400;
}

.mobile-nav {
    display: none;
}

.mobile-nav a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 400;
    transition: color 0.2s;
}

.mobile-nav a:hover {
    color: var(--navy);
}

.btn-pill-dark {
    background: var(--dark-surface);
    color: var(--dark-text);
    border: none;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    display: inline-block;
    text-decoration: none;
}

.btn-pill-dark:hover {
    background: #000;
}

/* ---- Hero Area ---- */
.hero-area {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    position: relative;
    padding-bottom: 16px;
    width: 100%;
    z-index: 1; /* Establish lower stacking context */
}

.hero-left {
    position: absolute;
    top: 48%; /* Visually centered */
    left: 30%; /* Shifted to left, aligning with sidebar and center */
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none; /* Let clicks pass through to underneath elements if any, interaction is global */
}

.hero-title {
    font-size: clamp(3rem, 6vw, 8rem);
    line-height: 0.9;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--navy);
    margin: 0;
    text-align: right;
    position: relative;
    z-index: 2; /* Keep text above the sphere */
}

.dot {
    color: var(--accent);
}

.hero-right {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    flex: 1 1 100%;
    min-width: 0;
    z-index: 2;
}

#sphere-container {
    width: clamp(400px, 60vw, 900px);
    height: clamp(400px, 60vw, 900px);
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.05));
}

#sphere-container:active {
    cursor: grabbing;
}


/* ---- Bottom Area (Cards) ---- */
.bottom-area {
    grid-column: 1 / -1;
    grid-row: 3;
    padding-top: 24px;
    position: relative;
    z-index: 10; /* Strictly above the hero area and sphere */
}

.bottom-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--text-dim);
    padding: 0 16px;
}

.cross-icon {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

#cards-grid {
    display: grid;
    /* Grid adapts to card count, default 4 cols for 4 cards */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

/* ---- Card styles ---- */
.card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    text-decoration: none;
    color: var(--navy);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 28px rgba(0, 0, 0, 0.07);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                border-color 0.2s ease,
                background 0.2s ease;
}

.card:hover {
    transform: translateY(-8px) scale(1.015);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08),
                0 20px 56px rgba(0, 0, 0, 0.13),
                0 1px 4px rgba(0, 0, 0, 0.05);
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.38);
}

.card-number {
    align-self: flex-end;
    font-size: 1rem;
    color: var(--border);
    font-weight: 500;
}

.card-content {
    margin-top: auto;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--navy);
}

.card-desc {
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-dim);
    margin-top: 8px;
}

.card-pending {
    cursor: default;
}

/* Special styling for the inverted/dark card */
.card.card-dark {
    background: rgba(30, 30, 35, 0.35);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--dark-text);
    border-radius: var(--radius-large) var(--radius) var(--radius) var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18), 0 8px 28px rgba(0, 0, 0, 0.20);
}

.card.card-dark:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22),
                0 20px 56px rgba(0, 0, 0, 0.32),
                0 1px 4px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(30, 30, 35, 0.50);
}

.card.card-dark .card-number {
    color: rgba(255, 255, 255, 0.2);
}

.card.card-dark .card-title {
    color: var(--dark-text);
    font-size: 0.9rem;
    opacity: 0.9;
}

.card.card-dark .card-desc {
    color: rgba(255, 255, 255, 0.6);
}

/* ---- Stub pages (about / blog / projects / contact) ---- */
.page-stub {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.stub-main {
    max-width: 600px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.back-link {
    display: inline-block;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 24px;
    transition: color 0.2s;
}

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

.stub-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--navy);
    margin-bottom: 16px;
}

.stub-desc {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .layout-container {
        grid-template-columns: 1fr;
        padding: 32px 24px;
        width: 100%;
        max-width: 100vw;
    }
    .sidebar {
        display: none;
    }
    .mobile-nav {
        display: flex;
        gap: 20px;
        align-items: center;
    }
    .top-header {
        grid-column: 1;
        width: 100%;
        justify-content: space-between;
    }
    .hero-area {
        grid-column: 1;
        flex-direction: column-reverse;
        align-items: flex-end;
        gap: 40px;
        width: 100%;
    }
    .hero-right {
        justify-content: flex-start;
    }
    .hero-title {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }
    .hero-desc {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        margin-top: 16px;
    }
    .hero-right {
        align-self: flex-end;
        padding-right: 0;
    }
    .hero-left {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        align-self: center;
        pointer-events: auto;
    }
    #sphere-container {
        margin-right: 0;
        width: clamp(280px, 60vw, 480px);
        height: clamp(280px, 60vw, 480px);
    }
    .bg-decorations {
        display: none;
    }
    #cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 600px) {
    .layout-container {
        padding: 24px 16px;
    }
    .top-header {
        padding-bottom: 32px;
    }
    .hero-title {
        font-size: clamp(2rem, 9.5vw, 3.5rem);
    }
    #sphere-container {
        width: calc(100vw - 24px);
        height: calc(100vw - 24px);
        max-width: 560px;
        max-height: 560px;
    }
    #cards-grid {
        grid-template-columns: 1fr; /* Force single column on mobile */
    }
    .card {
        padding: 24px 20px;
    }
}

