/* ============================================
   FULL STYLESHEET — Async loaded
   Aryan Sharma — Personal Website
   ============================================ */

/* ---- Intro ---- */
.intro {
    padding: var(--space-8) 0 var(--space-8);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.intro p {
    font-size: var(--font-size-sm);
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: var(--space-1);
}

.intro p:first-child {
    font-size: var(--font-size-base);
    color: var(--fg);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.intro a {
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.intro-hint {
    margin-top: var(--space-2);
}

.intro kbd {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1px 5px;
}

.inline-gpu-btn {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--fg);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1;
    vertical-align: baseline;
}
.inline-gpu-btn:hover {
    background: var(--fg);
    color: var(--bg);
}

/* ---- Blog Post Rows ---- */
.blog-posts {
    display: flex;
    flex-direction: column;
}

.blog-post {
    border-bottom: 1px solid var(--border);
}

.blog-post:last-child { border-bottom: none; }

.blog-post-link {
    display: block;
    padding: var(--space-4) var(--space-3);
    transition: background var(--transition), border-radius var(--transition);
    border-radius: var(--radius-md);
}

.blog-post-link:hover {
    background: var(--accent-dim);
}

.blog-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-4);
    margin-bottom: var(--space-1);
}

.blog-post-title {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--fg);
    line-height: 1.4;
}

.blog-post-date {
    font-size: var(--font-size-sm);
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.blog-post-excerpt {
    font-size: var(--font-size-sm);
    color: var(--muted);
    line-height: 1.6;
    margin-top: var(--space-2);
}

/* ---- Experience Cards ---- */
.experience-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.experience-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.experience-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.experience-header h3 {
    font-size: var(--font-size-base);
    font-weight: 400;
    line-height: 1.4;
}

.experience-header .company {
    font-size: var(--font-size-sm);
    color: var(--accent);
    margin-top: var(--space-1);
}

.experience-header .company a {
    color: var(--accent);
}
.experience-header .company a:hover {
    text-decoration: underline;
}

.experience-header .duration {
    font-size: var(--font-size-sm);
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Expandable sub-sections */
.exp-details {
    border-top: 1px solid var(--border);
    margin-top: var(--space-3);
}

.exp-details summary {
    font-size: var(--font-size-sm);
    font-weight: 400;
    padding: var(--space-3) 0;
    cursor: pointer;
    color: var(--fg);
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: color var(--transition);
}

.exp-details summary::-webkit-details-marker { display: none; }

.exp-details summary::before {
    content: '▸';
    font-size: var(--font-size-xs);
    color: var(--accent);
    transition: transform var(--transition);
    display: inline-block;
    width: 1em;
}

.exp-details[open] summary::before {
    transform: rotate(90deg);
}

.exp-details summary:hover { color: var(--accent); }

.exp-details-content {
    padding: 0 0 var(--space-4) 1.25rem;
}

/* Experience bullet list */
.exp-list {
    list-style: none;
    padding: 0;
}

.exp-list li {
    font-size: var(--font-size-sm);
    color: var(--muted);
    line-height: 1.75;
    padding: var(--space-2) 0;
    padding-left: var(--space-4);
    position: relative;
}

.exp-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--muted);
}

/* Metric highlights */
.metric {
    color: var(--fg);
    font-weight: 500;
    white-space: nowrap;
}

/* ---- Education ---- */
.education-block {
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.education-block h3 {
    font-size: var(--font-size-sm);
    font-weight: 400;
}

.education-block p {
    font-size: var(--font-size-sm);
    color: var(--muted);
}

/* ---- Contact ---- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
}

@media (max-width: 640px) {
    .contact-grid { grid-template-columns: 1fr; }
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.contact-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--muted);
    padding: var(--space-2) 0;
    transition: color var(--transition);
}
.contact-link:hover { color: var(--accent); }

.contact-link .label {
    font-size: var(--font-size-sm);
    color: var(--muted);
    min-width: 5.5rem;
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.form-group { display: flex; flex-direction: column; gap: var(--space-1); }

.form-group label {
    font-size: var(--font-size-sm);
    color: var(--muted);
}

.form-group input,
.form-group textarea {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    color: var(--fg);
    transition: border-color var(--transition);
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-submit {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-6);
    color: var(--fg);
    cursor: pointer;
    transition: all var(--transition);
    align-self: flex-start;
}

.form-submit:hover {
    background: var(--fg);
    color: var(--bg);
}

.form-notice {
    font-size: var(--font-size-xs);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    display: none;
}
.form-notice.success {
    display: block;
    color: var(--success);
    border: 1px solid var(--success);
}
.form-notice.error {
    display: block;
    color: var(--error);
    border: 1px solid var(--error);
}

/* ---- Experience Summary (index page) ---- */
.exp-summary-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.exp-summary-item {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border);
}

.exp-summary-item:last-child { border-bottom: none; }

.exp-summary-item .role { font-weight: 400; color: var(--fg); }
.exp-summary-item .at { color: var(--muted); }
.exp-summary-item .org { color: var(--accent); }
.exp-summary-item .period {
    margin-left: auto;
    color: var(--muted);
    white-space: nowrap;
}

/* ---- Skills ---- */
.skills-line {
    font-size: var(--font-size-sm);
    color: var(--muted);
    line-height: 2.0;
    word-spacing: 0.1em;
}

.skills-line span {
    color: var(--fg);
}

/* ---- Side Index (vertical track) ---- */
.side-index {
    position: fixed;
    left: var(--space-8);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.side-index-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    position: relative;
    padding: var(--space-4) 0;
    padding-left: 20px;
    transition: all var(--transition);
}

.side-index-item::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
    transition: background var(--transition);
}

.side-index-item:first-child::before { top: 50%; }
.side-index-item:last-child::before { bottom: 50%; }

.side-index-item.active::before {
    background: var(--accent);
}

.side-index-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    border: 1.5px solid var(--bg);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: all var(--transition);
    flex-shrink: 0;
    z-index: 1;
}

.side-index-label {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    transition: color var(--transition);
    letter-spacing: 0.02em;
}

.side-index-item:hover .side-index-dot {
    background: var(--fg);
    border-color: var(--fg);
}

.side-index-item:hover .side-index-label {
    color: var(--fg);
}

.side-index-item.active .side-index-dot {
    background: var(--fg);
    border-color: var(--fg);
}

.side-index-item.active .side-index-label {
    color: var(--fg);
    font-weight: 500;
}

@media (max-width: 1200px) {
    .side-index { display: none; }
}

/* ---- Back to Top ---- */
.back-to-top {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

/* ---- RSS ---- */
.rss-link {
    margin-top: var(--space-2);
}

.rss-copy-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--muted);
}
.rss-copy-link:hover { color: var(--accent); }

.rss-icon { vertical-align: middle; }

.rss-popup {
    position: fixed;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--panel);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-xs);
    color: var(--accent);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}
.rss-popup.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   GPU DASHBOARD EASTER EGG
   ============================================ */

/* Terminal boot */
.gpu-terminal {
    min-height: 200px;
    padding: 4px 0;
}

.gpu-term-line {
    font-size: 12px;
    line-height: 1.7;
    color: #8b8b8b;
    white-space: pre-wrap;
    word-break: break-all;
}

.gpu-term-cmd { color: #e8e6e3; font-weight: 700; }
.gpu-term-info { color: #9ca3af; }
.gpu-term-dim { color: #6b7280; }
.gpu-term-accent { color: var(--accent); font-weight: 700; }

.gpu-dash-content {
    animation: dashFadeIn 0.4s ease;
}

@keyframes dashFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* nvidia-smi output */
.gpu-smi-output {
    font-size: 11px;
    line-height: 1.4;
    color: #c8c8c8;
    background: #0d0f14;
    border: 1px solid #1a1b22;
    border-radius: 4px;
    padding: 12px;
    overflow-x: auto;
    white-space: pre;
    margin: 0;
}

/* GPU-poor mode */
.gpu-poor-msg {
    margin-top: 16px;
    padding: 16px;
    border: 1px dashed #2a2b33;
    border-radius: 6px;
}

.gpu-poor-headline {
    font-size: 14px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.gpu-poor-sub {
    font-size: 11px;
    color: #8b8b8b;
    line-height: 1.6;
    margin-bottom: 4px;
}

.gpu-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.gpu-overlay.open { display: flex; }

.gpu-dashboard {
    background: #0a0c10;
    border: 1px solid #2a2b33;
    border-radius: var(--radius-lg);
    width: 95%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #c8c8c8;
    padding: 0;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.gpu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #2a2b33;
    background: #0d0f14;
}

.gpu-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gpu-prompt {
    color: var(--accent);
    font-weight: 700;
}

.gpu-title {
    color: #8b8b8b;
}

.gpu-close {
    background: none;
    border: 1px solid #2a2b33;
    border-radius: 4px;
    color: #8b8b8b;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.gpu-close:hover {
    border-color: #f87171;
    color: #f87171;
}

.gpu-body { padding: 16px; }

.gpu-section {
    margin-bottom: 20px;
}

.gpu-section:last-child { margin-bottom: 0; }

.gpu-section-title {
    font-size: 11px;
    color: #8b8b8b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid #1a1b22;
}

/* GPU info row */
.gpu-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12px;
}

.gpu-info-label { color: #8b8b8b; min-width: 80px; }
.gpu-info-value { color: #e8e6e3; font-weight: 700; }

/* Progress bars */
.gpu-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.gpu-bar-label {
    font-size: 11px;
    color: #8b8b8b;
    min-width: 70px;
}

.gpu-bar {
    flex: 1;
    height: 14px;
    background: #1a1b22;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.gpu-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    width: 0;
}

.gpu-bar-fill.util { background: var(--accent); }
.gpu-bar-fill.memory { background: #60a5fa; }
.gpu-bar-fill.throughput { background: #fbbf24; }

.gpu-bar-value {
    font-size: 11px;
    color: #e8e6e3;
    min-width: 45px;
    text-align: right;
    font-weight: 700;
}

/* Process table */
.gpu-process-table {
    width: 100%;
    border-collapse: collapse;
}

.gpu-process-table th {
    font-size: 10px;
    color: #6b7280;
    text-align: left;
    padding: 4px 8px;
    border-bottom: 1px solid #1a1b22;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 400;
}

.gpu-process-table td {
    font-size: 12px;
    padding: 6px 8px;
    border-bottom: 1px solid #111318;
}

.gpu-process-table tr:last-child td { border-bottom: none; }

.gpu-process-name { color: var(--accent); font-weight: 600; }
.gpu-process-value { color: #e8e6e3; }
.gpu-process-unit { color: #6b7280; font-size: 10px; }

/* Sparkline */
.gpu-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 32px;
    margin-top: 6px;
}

.gpu-spark-bar {
    width: 6px;
    background: var(--accent);
    border-radius: 1px;
    opacity: 0.7;
    transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    height: 0;
}

/* Stats row */
.gpu-stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.gpu-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gpu-stat-label {
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gpu-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #e8e6e3;
}

.gpu-stat-value .count-up { color: var(--accent); }

.gpu-footer {
    padding: 8px 16px;
    border-top: 1px solid #1a1b22;
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #4b5563;
}

/* ============================================
   BLOG ARTICLE CONTENT
   ============================================ */

.blog-article {
    max-width: 800px;
}

.blog-article-header {
    margin-bottom: var(--space-8);
}

.blog-article-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: var(--space-2);
}

.blog-article-date {
    font-size: var(--font-size-xs);
    color: var(--muted);
}

.blog-back {
    font-size: var(--font-size-sm);
    color: var(--muted);
    margin-bottom: var(--space-6);
    display: inline-block;
}
.blog-back:hover { color: var(--accent); }

/* Blog content typography */
.blog-content h2 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.02em;
}

.blog-content h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--accent);
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
}

.blog-content h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: var(--space-6);
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
}

.blog-content p {
    font-size: var(--font-size-base);
    line-height: 1.8;
    margin-bottom: var(--space-4);
    color: var(--fg);
}

.blog-content ul,
.blog-content ol {
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
}

.blog-content li {
    font-size: var(--font-size-base);
    line-height: 1.75;
    margin-bottom: var(--space-2);
}

.blog-content blockquote {
    border-left: 3px solid var(--accent);
    padding: var(--space-3) var(--space-4);
    margin: var(--space-4) 0;
    background: var(--accent-dim);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--muted);
}

.blog-content blockquote p { margin-bottom: 0; }

.blog-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--panel);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
}

.blog-content pre {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    overflow-x: auto;
    margin: var(--space-4) 0;
    line-height: 1.6;
}

.blog-content pre code {
    background: none;
    padding: 0;
    font-size: var(--font-size-xs);
}

.blog-content strong {
    font-weight: 700;
    color: var(--fg);
}

.blog-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--space-4) 0;
    border: 1px solid var(--border);
}

.blog-content .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-4) 0;
}

.blog-content table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.blog-content th,
.blog-content td {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    text-align: left;
}

.blog-content th {
    background: var(--panel);
    font-weight: 600;
}

/* Diagram containers */
.diagram-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-6) 0;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel);
}

.diagram-img {
    display: block;
    width: 100%;
    min-width: 480px;
    height: auto;
}

[data-theme="light"] .diagram-img {
    filter: invert(1) hue-rotate(180deg);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .hero-name { font-size: 1.75rem; }

    .blog-post-meta {
        flex-direction: column;
        gap: var(--space-1);
    }

    .experience-header {
        flex-direction: column;
        gap: var(--space-2);
    }

    .metric { white-space: normal; }

    .exp-details summary {
        word-break: break-word;
        line-height: 1.5;
    }

    .gpu-dashboard { font-size: 11px; }
    .gpu-stats-row { gap: 12px; }
    .gpu-stat-value { font-size: 14px; }

    .exp-summary-item {
        flex-direction: column;
        gap: var(--space-1);
    }

    .exp-summary-item .period { margin-left: 0; }
}

/* ---- Print ---- */
@media print {
    .header, .footer, .back-to-top, .gpu-overlay { display: none !important; }
    body { color: #000; background: #fff; }
    a { color: #000; text-decoration: underline; }
    .experience-card { border-color: #ccc; box-shadow: none; transform: none; }
}
