:root {
    --app-bg: #ffffff;
    --text-main: #37352f;
    --text-muted: #9b9b9b;
    --hover-bg: rgba(0, 0, 0, 0.04);
    --active-bg: rgba(0, 0, 0, 0.08);
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --card-bg: #ffffff;
    --card-border: #eeeeee;
    --timeline-line: #f0f0f0;
    --timeline-dot-bg: #ffffff;
}

body.dark-mode {
    --app-bg: #191919;
    --text-main: #e0e0e0;
    --text-muted: #888888;
    --hover-bg: rgba(255, 255, 255, 0.05);
    --active-bg: rgba(255, 255, 255, 0.1);
    --card-bg: #252525;
    --card-border: #333333;
    --timeline-line: #333333;
    --timeline-dot-bg: #191919;
}

* {
    box-sizing: border-box;
    outline: none;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100vw;
    background: var(--app-bg);
    font-family: var(--font-stack);
    overflow-x: hidden;
}

/* App Window */
.app-window {
    width: 100%;
    min-height: 100vh;
    background: var(--app-bg);
    position: relative;
}

/* Top Navigation */
.top-nav {
    position: sticky;
    top: 0;
    background: var(--app-bg);
    border-bottom: 1px solid var(--card-border);
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-bar {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 16px 40px;
    max-width: 720px;
    margin: 0 auto;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    perspective: 1000px;
}

.cube {
    position: relative;
    width: 100px;
    height: 30px;
    transform-style: preserve-3d;
    transform: rotateX(0deg);
    transition: transform 4s;
}

.nav-btn:hover .cube {
    transform: rotateX(360deg);
    animation: rotateCube 4s linear infinite;
}

@keyframes rotateCube {
    0% { transform: rotateX(0deg); }
    25% { transform: rotateX(90deg); }
    50% { transform: rotateX(180deg); }
    75% { transform: rotateX(270deg); }
    100% { transform: rotateX(360deg); }
}

.face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    background: var(--app-bg);
    font-family: sans-serif;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
    transition: 0.5s;
    border: 2px solid var(--text-muted);
    box-sizing: border-box;
    box-shadow: inset 0 20px 50px rgba(0, 0, 0, 0.2);
    backface-visibility: hidden;
}

.nav-btn:hover .face {
    color: #fff;
    background: rgba(3, 169, 244, 0.8);
}

.face:nth-child(1) {
    transform: rotateX(360deg) translateZ(15px);
}

.face:nth-child(2) {
    transform: rotateX(270deg) translateZ(15px);
}

.face:nth-child(3) {
    transform: rotateX(180deg) translateZ(15px);
}

.face:nth-child(4) {
    transform: rotateX(90deg) translateZ(15px);
}

.nav-btn.active .face,
.nav-btn.active span {
    background: var(--active-bg);
    font-weight: 600;
}

.nav-btn svg {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.nav-btn.active svg {
    opacity: 1;
}

/* Main Content Area */
.main-content {
    width: 100%;
    min-height: 100vh;
    background: var(--app-bg);
}

.editor-container {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 40px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.05);
    animation: fadeIn 0.6s ease-out;
    margin-top: 20px;
    margin-bottom: 40px;
    will-change: opacity, transform;
}

/* Typography & Editor Styling */
.post-title {
    font-size: 40px;
    font-weight: 700;
    color: var(--text-main);
    border: none;
    width: 100%;
    margin-bottom: 24px;
    line-height: 1.2;
    background: transparent;
    resize: none;
}

.post-body {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-main);
    min-height: 300px;
}

.post-body p {
    margin-bottom: 1em;
}

.post-body h2 {
    font-size: 24px;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

[contenteditable]:empty:before {
    content: attr(placeholder);
    color: #d1d1d1;
    cursor: text;
}

/* Projects Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card:hover {
    background: var(--hover-bg);
    border-color: var(--text-muted);
}

.project-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.project-link {
    font-size: 12px;
    color: #0066cc;
    margin-top: 10px;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 32px;
    margin-top: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--timeline-line);
    transform-origin: top;
    animation: growLine 5.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    animation: slideInRight 0.5s ease forwards;
    opacity: 0;
    will-change: opacity, transform;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.3s;
}

.timeline-dot {
    position: absolute;
    left: -38px;
    top: 0;
    width: 14px;
    height: 14px;
    background: var(--timeline-dot-bg);
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    transition: background 0.3s;
}

.timeline-item:hover .timeline-dot {
    background: var(--text-main);
    border-color: var(--text-main);
}

.timeline-date {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-company {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.timeline-role {
    font-size: 14px;
    color: #555;
}

/* Settings */
.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--sidebar-border);
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: #ccc;
    border-radius: 11px;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch.active {
    background: #28c840;
}

.toggle-switch.active::after {
    left: 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes growLine {
    from {
        transform: scaleY(0);
    }
    to {
        transform: scaleY(1);
    }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.2);
}

/* Mobile Support */
@media (max-width: 768px) {
    .editor-container {
        padding: 40px 20px;
        margin-top: 10px;
        margin-bottom: 20px;
    }

    .post-title {
        font-size: 32px;
    }

    .top-nav {
        padding: 16px 20px;
    }

    .nav-bar {
        gap: 16px;
        padding: 16px 20px;
    }

    .nav-btn {
        font-size: 13px;
        padding: 6px 12px;
    }

    .nav-btn svg {
        width: 16px;
        height: 16px;
    }
}