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

:root {
    --bg:        #080b12;
    --border:    rgba(255,255,255,0.08);
    --text:      #c9d1d9;
    --muted:     #4a5568;
    --accent:    #7c6af7;
    --accent2:   #60a5fa;
    --green:     #4ade80;
    --md-color:  #2d3748;
    --font-mono: 'Courier New', Courier, monospace;

    --glass-bg:     rgba(255,255,255,0.04);
    --glass-border: rgba(255,255,255,0.09);
    --glass-blur:   blur(18px);
}

body {
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: scroll;
}

a {
    color: var(--accent2);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* =====================
   Animated background blobs
   ===================== */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.18;
    animation: blobFloat 14s ease-in-out infinite;
}

.blob-1 {
    width: 550px; height: 550px;
    background: #6c3cbe;
    top: -150px; left: -150px;
    animation-delay: 0s;
}
.blob-2 {
    width: 420px; height: 420px;
    background: #1a5cbe;
    bottom: -80px; right: -80px;
    animation-delay: -5s;
}
.blob-3 {
    width: 320px; height: 320px;
    background: #be3c8c;
    top: 45%; left: 55%;
    animation-delay: -9s;
}

@keyframes blobFloat {
    0%,100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(25px, -25px) scale(1.04); }
    66%      { transform: translate(-18px, 18px) scale(0.97); }
}

/* =====================
   Layout
   ===================== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 4rem 1.5rem;
}

/* Everything above the blobs */
header, main, footer {
    position: relative;
    z-index: 1;
}

/* =====================
   Glass utility
   ===================== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

/* =====================
   Header / Nav
   ===================== */
header {
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
}

.logo {
    color: var(--accent);
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-shadow: 0 0 20px rgba(124,106,247,0.4);
}

header ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

header ul a {
    color: var(--muted);
    font-size: 0.85rem;
    transition: color 0.2s;
}
header ul a:hover {
    color: var(--text);
    text-decoration: none;
}
header ul a.nav-active {
    color: var(--accent);
}

/* =====================
   Markdown decorators
   ===================== */
.md-prefix {
    color: var(--md-color);
    user-select: none;
}

.md-bold {
    color: var(--md-color);
    user-select: none;
}

/* =====================
   About Section
   ===================== */
h1 {
    font-size: 1.8rem;
    font-weight: bold;
    color: #e6edf3;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.subsubtitle {
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
    opacity: 0.75;
}

.about-img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.about-block {
    border-radius: 12px;
    padding: 1.5rem 1.8rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--text);
    border-left: 2px solid rgba(124,106,247,0.4);
}

.about-meta {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.95rem;
    color: var(--muted);
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
}

.about-meta .highlight {
    color: var(--text);
}

/* Pulsing green dot for status */
.available {
    color: var(--green);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.available::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.75); }
}

/* =====================
   Tree toggle buttons
   ===================== */
.tree-btns {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tree-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: border-color 0.2s, color 0.2s;
}
.tree-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.tree-btn.active {
    border-color: var(--accent);
    color: var(--accent);
}
.tree-btn-icon {
    display: inline-block;
    font-size: 0.6rem;
    transition: transform 0.2s;
    color: var(--muted);
}
.tree-btn.active .tree-btn-icon {
    transform: rotate(90deg);
    color: var(--accent);
}

/* =====================
   Tree section content
   ===================== */
.tree-section {
    margin-bottom: 1.5rem;
    animation: treeOpen 0.2s ease-out;
}
@keyframes treeOpen {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tree-card {
    border-radius: 12px;
    padding: 1.4rem 1.8rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border-left: 2px solid rgba(124,106,247,0.4);
    line-height: 2;
}

.tree-root {
    color: var(--accent);
    margin-bottom: 0.2rem;
}

.tree-entry {
    display: flex;
    flex-direction: column;
}

.tree-line {
    color: var(--muted);
    user-select: none;
    margin-right: 0.4rem;
}

.tree-folder {
    color: var(--accent2);
    margin-bottom: 0.1rem;
}

.tree-children {
    display: flex;
    flex-direction: column;
}

.tree-child {
    color: var(--text);
}

.tree-indent {
    color: var(--muted);
    user-select: none;
    white-space: pre;
}

/* =====================
   Project Tree
   ===================== */
.proj-tree {
    border-radius: 12px;
    padding: 1.4rem 1.8rem;
    border-left: 2px solid rgba(124,106,247,0.4);
    font-size: 0.9rem;
    line-height: 2;
    margin-top: 2rem;
}

/* Remove default <details>/<summary> markers */
.proj-group > summary,
.proj-item > summary {
    list-style: none;
}
.proj-group > summary::-webkit-details-marker,
.proj-item > summary::-webkit-details-marker {
    display: none;
}

.proj-group-header,
.proj-item-header {
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    width: 100%;
    transition: color 0.2s;
    line-height: 2;
}

.proj-group-header:hover,
.proj-item-header:hover {
    color: var(--accent2);
}

.proj-group[open] > summary .tree-folder,
.proj-item[open] > summary .tree-folder {
    color: var(--accent2);
}

.proj-arrow {
    display: inline-block;
    font-size: 0.55rem;
    color: var(--muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.proj-group[open] > summary .proj-arrow,
.proj-item[open] > summary .proj-arrow {
    transform: rotate(90deg);
    color: var(--accent2);
}


.proj-group-body,
.proj-detail {
    animation: treeOpen 0.2s ease-out;
}

.proj-indent {
    color: var(--muted);
    user-select: none;
}

.proj-detail-card {
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    margin: 0.2rem 0 0.4rem 3.5rem;
    border-left: 2px solid rgba(96,165,250,0.35);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Rendered Markdown inside project fields */
.proj-md p {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.75;
    margin: 0 0 0.5rem 0;
}
.proj-md p:last-child { margin-bottom: 0; }

.proj-md ul, .proj-md ol {
    color: var(--text);
    font-size: 0.9rem;
    padding-left: 1.2rem;
    margin: 0;
}
.proj-md li { line-height: 1.8; }

.proj-md code {
    color: var(--accent2);
    background: rgba(96,165,250,0.1);
    border: 1px solid rgba(96,165,250,0.2);
    padding: 0.1em 0.45em;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: var(--font-mono);
}

.proj-md strong { color: #e6edf3; }
.proj-md em    { color: var(--muted); font-style: italic; }

.proj-md h1, .proj-md h2, .proj-md h3 {
    color: #e6edf3;
    font-size: 0.95rem;
    font-weight: bold;
    margin: 0.6rem 0 0.3rem 0;
}
.proj-md h1:first-child,
.proj-md h2:first-child,
.proj-md h3:first-child { margin-top: 0; }

.proj-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.proj-label {
    color: var(--muted);
    font-size: 0.8rem;
}

.proj-label::before {
    content: '── ';
    user-select: none;
}

.proj-text {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.75;
    padding-left: 1rem;
}

.proj-tech-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    padding-left: 1rem;
}

.proj-tech-list li {
    font-size: 0.85rem;
}

/* =====================
   Footer
   ===================== */
footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}
