:root {
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #0066cc;
    --accent-hover: #004499;
    --danger-color: #ff3b30;
    --border-radius: 12px;
    --spacing-unit: 20px;
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Nav */
nav {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: 52px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

nav h1 {
    font-size: 20px;
    font-weight: 600;
}

nav button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
}

nav button:hover {
    color: var(--accent-color);
}

/* Main Layout */
main {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

/* Homepage Overrides */
main.home-container {
    display: block;
    max-width: 980px;
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
}

/* Sidebar (Aside) */
aside {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

aside > div {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

aside h4 {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

aside p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Forms */
.form-example {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}

input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

input[type="submit"], .btn-primary {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    align-self: flex-start;
}

input[type="submit"]:hover, .btn-primary:hover {
    background-color: var(--accent-hover);
}

/* Projects Section */
.projectsBox {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.projectsBox > div {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.projectsBox > div:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.projectsBox h5 {
    font-size: 17px;
    font-weight: 600;
}

.projectsBox p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Code Box */
.code-box {
    background: #fbfbfd;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
}

.code-box pre {
    margin: 0;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
    color: #333;
    white-space: pre-wrap;
    word-break: break-all;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.projectsBox button {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #e5e5e5;
    background: white;
    color: var(--text-primary);
    transition: all 0.2s;
}

.projectsBox button:hover {
    background: #f5f5f7;
}

.projectsBox button.delete-btn {
    color: var(--danger-color);
    border-color: rgba(255, 59, 48, 0.2);
}

.projectsBox button.delete-btn:hover {
    background: rgba(255, 59, 48, 0.05);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    width: 90%;
    max-width: 450px;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal h3 {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.btn-secondary {
    background: #e5e5ea;
    color: var(--text-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 18px;
    font-size: 14px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #d1d1d6;
}

/* Homepage Styles */

/* Hero Section */
.hero {
    margin-bottom: 80px;
    animation: fadeIm 0.8s ease-out;
}

@keyframes fadeIm {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero p.subtitle {
    font-size: 21px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-image-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f7 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 18px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.hero-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    text-align: left;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
}

.feature-card:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 30px rgba(0,0,0,0.08);
}

.feature-card .icon {
    font-size: 40px;
    color: var(--accent-color);
    margin-bottom: 20px;
    display: block;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.4;
}
