:root {
    /* Light Mode Default */
    --bg-color: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --card-bg: rgba(255, 255, 255, 0.65);
    --card-border: rgba(0, 0, 0, 0.04);
    --card-border-hover: rgba(0, 0, 0, 0.12);
    --ios-blue: #007AFF;
    --tag-bg: rgba(0, 0, 0, 0.05);
    --tag-border: rgba(0, 0, 0, 0.05);
    --btn-primary-bg: #1d1d1f;
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: rgba(0, 0, 0, 0.05);
    --shadow-subtle: 0 4px 24px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.08);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
    /* Dark Mode */
    --bg-color: #000000;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --card-bg: rgba(28, 28, 30, 0.65);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-border-hover: rgba(255, 255, 255, 0.2);
    --tag-bg: rgba(255, 255, 255, 0.1);
    --tag-border: rgba(255, 255, 255, 0.1);
    --btn-primary-bg: #f5f5f7;
    --btn-primary-text: #000000;
    --btn-secondary-bg: rgba(255, 255, 255, 0.12);
    --shadow-subtle: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Mesh */
.background-mesh {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(0, 122, 255, 0.08), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(52, 199, 89, 0.08), transparent 25%);
    filter: blur(60px);
    animation: meshPulse 15s ease-in-out infinite alternate;
}
@keyframes meshPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}
[data-theme="dark"] .background-mesh {
    background: radial-gradient(circle at 15% 50%, rgba(0, 122, 255, 0.15), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(52, 199, 89, 0.15), transparent 25%);
}

.container {
    max-width: 1200px;
    width: 100%;
    padding: 5rem 2rem;
    margin: 0 auto;
}

.section-block {
    margin-bottom: 6rem;
}

.section-header {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 2.25rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* GRIDS */
.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.wip-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* CARDS - Apple Glassmorphism */
.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 2rem; /* Softer, Apple-like radii */
    padding: 2.5rem; /* Increased Whitespace */
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: var(--shadow-subtle);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.4s ease, 
                box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.bento-card:hover {
    transform: translateY(-4px) scale(1.005);
    border-color: var(--card-border-hover);
    box-shadow: var(--shadow-hover);
}

.bento-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: radial-gradient(
        600px circle at var(--mouse-x, 0) var(--mouse-y, 0),
        rgba(255, 255, 255, 0.15),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.bento-card:hover::before {
    opacity: 1;
}

/* About Card Placements */
.card-main { grid-column: span 3; }
.card-sap { grid-column: span 3; }
.card-hobby { grid-column: span 2; }
.card-athlete { grid-column: span 1; }

/* Typography */
h1 { font-size: 3.5rem; margin: 0 0 0.5rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; }
h2.card-title { font-size: 1.5rem; margin: 0 0 1.25rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); }
h3 { font-size: 1.35rem; margin: 0 0 0.5rem; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; font-weight: 600; color: var(--text-primary); }
p { color: var(--text-secondary); line-height: 1.6; margin: 0 0 1rem; font-size: 1rem; }
p:last-child { margin-bottom: 0; }

.role-text { font-size: 1.25rem; color: var(--text-secondary); margin-bottom: 2.5rem; font-weight: 500; }
.role-text a { color: var(--ios-blue); text-decoration: none; transition: opacity 0.2s; }
.role-text a:hover { opacity: 0.8; text-decoration: underline; }

/* Tags & Badges - Strictly Monochrome */
.tags { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.tag {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    color: var(--text-primary);
    font-weight: 500;
}

@keyframes pulseWip {
    0% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(255, 149, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0); }
}

.badge-wip {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: var(--tag-bg);
    color: var(--text-primary);
    border: 1px solid var(--tag-border);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    animation: pulseWip 2s infinite;
}

/* Links & Buttons */
.links { display: flex; gap: 1rem; margin-top: auto; flex-wrap: wrap; padding-top: 2rem; }
.link-btn {
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}
.btn-primary:hover { opacity: 0.9; transform: scale(1.02); }
.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--text-primary);
}
.btn-secondary:hover { filter: brightness(0.95); }

[data-theme="dark"] .btn-secondary:hover { filter: brightness(1.15); }

.project-links { margin-top: auto; padding-top: 1.5rem; display: flex; gap: 1.25rem; align-items: center; }
.icon-link {
    color: var(--ios-blue);
    text-decoration: none;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
}
.icon-link:hover { opacity: 0.8; }
.icon-link svg { width: 18px; height: 18px; }

.project-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary); /* Default */
    box-shadow: 0 4px 12px var(--icon-glow, transparent);
    transition: box-shadow 0.3s ease;
}
.bento-card:hover .project-icon {
    box-shadow: 0 8px 24px var(--icon-glow, transparent);
}
.project-icon svg { width: 28px; height: 28px; }

/* App Icon Minimal Highlights */
.text-apple-blue { color: #007AFF; --icon-glow: rgba(0, 122, 255, 0.2); }
.text-apple-green { color: #34C759; --icon-glow: rgba(52, 199, 89, 0.2); }
.text-apple-red { color: #FF3B30; --icon-glow: rgba(255, 59, 48, 0.2); }
.text-apple-amber { color: #FF9500; --icon-glow: rgba(255, 149, 0, 0.2); }
.text-purple-400 { color: #AF52DE; --icon-glow: rgba(175, 82, 222, 0.2); }

.sap-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}
.sap-list-item {
    margin-bottom: 1.25rem;
}
.sap-list-item strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .about-grid { grid-template-columns: 1fr; }
    .card-main, .card-sap, .card-hobby, .card-athlete { grid-column: span 1; }
    .wip-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    h1 { font-size: 2.75rem; }
    .section-header h2 { font-size: 1.75rem; }
    .sap-lists { grid-template-columns: 1fr; }
    .container { padding: 3rem 1.5rem; }
    .bento-card { padding: 2rem; }
}

/* Utilities */
.text-sm { font-size: 1rem; }
.text-secondary { color: var(--text-secondary); }
.font-normal { font-weight: 400; }
.w-full { width: 100%; }
.justify-center { justify-content: center; }

/* Theme Toggle */
.theme-toggle-container {
    display: flex;
    justify-content: flex-end;
    padding: 1.5rem 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}
.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(12px);
    width: 44px;
    height: 44px;
}
.theme-toggle:hover {
    background: var(--tag-bg);
    transform: scale(1.05);
}
.theme-toggle svg {
    width: 20px;
    height: 20px;
}
[data-theme="dark"] .icon-moon { display: none; }
html:not([data-theme="dark"]) .icon-sun { display: none; }

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem;
    margin-top: auto;
    border-top: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    z-index: 10;
}
.site-footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}
.site-footer a:hover {
    text-decoration: underline;
}
