/* ═══════════════════════════════════════════════════════════════
   Portfolio Template - Styles
   Based on nikhilbhima.com design
   
   Fonts: Space Mono (headings/mono) + DM Sans (body/sans)
   Theme: Dark/Light with CSS custom properties
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   CSS Custom Properties (Design Tokens)
   🔧 CUSTOMIZE: Edit colors here
   ───────────────────────────────────────── */
:root {
    --background: #fff;
    --foreground: #0a0a0a;
    --muted: #71717a;
    --border: rgba(228, 228, 231, 0.6);
    --border-strong: rgba(10, 10, 10, 0.35);
    --card: #fafafa;
    --grid-color: rgba(128, 128, 128, 0.035);
    --cta-bg: #f4f4f5;

    --font-mono: "Space Mono", ui-monospace, monospace;
    --font-sans: "DM Sans", system-ui, sans-serif;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --spacing: 0.25rem;
}

.dark {
    --background: #0a0a0a;
    --foreground: #ededed;
    --muted: #a1a1aa;
    --border: rgba(63, 63, 70, 0.5);
    --border-strong: rgba(237, 237, 237, 0.35);
    --card: #18181b;
    --grid-color: rgba(255, 255, 255, 0.008);
    --cta-bg: #e4e4e7;
}

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

html {
    scroll-behavior: smooth;
    color-scheme: light dark;
    -webkit-text-size-adjust: 100%;
}

@media (min-width: 1024px) {
    html {
        zoom: 1.05;
    }
}

body {
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-mono);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: inherit;
}

img, svg, video {
    display: block;
    vertical-align: middle;
}

img, video {
    max-width: 100%;
    height: auto;
}

button {
    font: inherit;
    color: inherit;
    background: transparent;
    border: none;
    cursor: pointer;
}

ol, ul, menu {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
}

/* Smooth theme transitions */
* {
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

::selection {
    background: rgba(128, 128, 128, 0.2);
}

/* ─────────────────────────────────────────
   Grid Background
   ───────────────────────────────────────── */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image:
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.3s;
}

/* ─────────────────────────────────────────
   Layout
   ───────────────────────────────────────── */
.relative { position: relative; }
.z-10 { z-index: 10; }

.main-container {
    min-height: 100vh;
    color: var(--foreground);
}

.content-wrapper {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 1rem;
}

@media (min-width: 640px) {
    .content-wrapper {
        padding: 3rem 1.25rem;
    }
}

.sections-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ─────────────────────────────────────────
   Card Component (Profile Card)
   ───────────────────────────────────────── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--background);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.75rem;
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
}

.window-dots {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.dot {
    height: 0.625rem;
    width: 0.625rem;
    border-radius: 50%;
}
.dot-red { background-color: #fb2c36; }
.dot-yellow { background-color: #edb200; }
.dot-green { background-color: #00c758; }

.theme-toggle {
    height: 1.25rem;
    width: 1.25rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: color 0.15s;
}
.theme-toggle:hover {
    color: var(--foreground);
}
.theme-toggle svg {
    height: 1rem;
    width: 1rem;
}

/* Show/hide sun/moon based on theme */
.dark .icon-sun { display: block; }
.dark .icon-moon { display: none; }
:root:not(.dark) .icon-sun { display: none; }
:root:not(.dark) .icon-moon { display: block; }

.card-body {
    padding: 1rem;
}

/* ─────────────────────────────────────────
   Profile Section
   ───────────────────────────────────────── */
.profile-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.profile-image-wrapper {
    height: 6rem;
    width: 6rem;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
    user-select: none;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 80%;
    pointer-events: none;
    filter: saturate(1.35);
}

.profile-image-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    background: rgba(128, 128, 128, 0.98);
    mix-blend-mode: saturation;
}

.profile-image-wrapper:hover .profile-image-overlay {
    opacity: 0;
}

.profile-name {
    font-size: 1.125rem;
    line-height: 1.75;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.verified-badge {
    height: 1.25rem;
    width: 1.25rem;
}

.role-ticker {
    font-size: 0.875rem;
    height: 1.25rem;
    overflow: hidden;
}

.role-text {
    color: var(--muted);
    display: inline-block;
    animation: roleTick 6s infinite;
}

@keyframes roleTick {
    0%, 20% { opacity: 1; transform: translateY(0); }
    25%, 30% { opacity: 0; transform: translateY(-10px); }
    35%, 55% { opacity: 1; transform: translateY(0); }
    60%, 65% { opacity: 0; transform: translateY(-10px); }
    70%, 90% { opacity: 1; transform: translateY(0); }
    95%, 100% { opacity: 0; transform: translateY(-10px); }
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.status-dot-wrapper {
    position: relative;
    display: flex;
    height: 0.5rem;
    width: 0.5rem;
}

.status-dot-ping {
    position: absolute;
    display: inline-flex;
    height: 100%;
    width: 100%;
    border-radius: 50%;
    background-color: #00c758;
    opacity: 0.75;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.status-dot-solid {
    position: relative;
    display: inline-flex;
    height: 0.5rem;
    width: 0.5rem;
    border-radius: 50%;
    background-color: #00c758;
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.status-text {
    font-size: 0.75rem;
    color: var(--muted);
}

/* ─────────────────────────────────────────
   Bio Section
   ───────────────────────────────────────── */
.bio-section {
    margin-bottom: 0.5rem;
}

.bio-text {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.625;
}

/* ─────────────────────────────────────────
   Social Links Grid
   ───────────────────────────────────────── */
.social-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
}

@media (min-width: 640px) {
    .social-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.375rem;
    }
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0.5rem;
    font-size: 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: background-color 0.15s;
}

@media (min-width: 640px) {
    .social-btn {
        gap: 0.375rem;
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }
}

.social-btn:hover {
    background-color: var(--card);
}

.social-icon {
    height: 0.75rem;
    width: 0.75rem;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .social-icon {
        height: 0.875rem;
        width: 0.875rem;
    }
}

/* ─────────────────────────────────────────
   Sections (Dashed Border Style)
   ───────────────────────────────────────── */
.section-dashed {
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─────────────────────────────────────────
   Contributions
   ───────────────────────────────────────── */
.github-section {
    transition: background-color 0.15s, border-color 0.15s, border-style 0.15s;
}
.github-section:hover {
    background-color: var(--card);
    border-style: solid;
    border-color: var(--border-strong);
}

.github-graph-header {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}
.github-graph-header strong {
    color: var(--foreground);
    font-weight: 600;
}

.github-graph-body {
    display: flex;
    gap: 0.5rem;
}

.github-labels-y {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 10px;
    color: var(--muted);
    flex-shrink: 0;
    padding-top: 16px; /* offset past month labels row + gap */
}
@media (min-width: 640px) {
    .github-labels-y {
        gap: 2px;
    }
}
.github-labels-y span {
    height: 5px;
    line-height: 5px;
    display: flex;
    align-items: center;
}
@media (min-width: 640px) {
    .github-labels-y span {
        height: 9px;
        line-height: 9px;
    }
}

.github-graph-main {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    overflow: hidden;
}

.github-labels-x {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--muted);
    padding-left: 2px;
    padding-right: 2px;
}
.github-labels-x span {
    line-height: 1;
}

.contributions-loading {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--muted);
}

.contributions-grid {
    display: flex;
    gap: 1px;
    overflow: hidden;
}

@media (min-width: 640px) {
    .contributions-grid {
        gap: 2px;
    }
}

.contrib-column {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

@media (min-width: 640px) {
    .contrib-column {
        gap: 2px;
    }
}

.contrib-cell {
    width: 5px;
    height: 5px;
    border-radius: 1px;
}

@media (min-width: 640px) {
    .contrib-cell {
        width: 9px;
        height: 9px;
        border-radius: 2px;
    }
}

/* GitHub contribution colors */
.contrib-0 { background-color: #161b22; }
.contrib-1 { background-color: #0e4429; }
.contrib-2 { background-color: #006d32; }
.contrib-3 { background-color: #26a641; }
.contrib-4 { background-color: #39d353; }

.light .contrib-0 { background-color: #ebedf0; }
.light .contrib-1 { background-color: #9be9a8; }
.light .contrib-2 { background-color: #40c463; }
.light .contrib-3 { background-color: #30a14e; }
.light .contrib-4 { background-color: #216e39; }

/* ─────────────────────────────────────────
   Projects Grid
   ───────────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.project-card {
    display: block;
    height: 100%;
    padding: 0.75rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    transition: background-color 0.15s, border-color 0.15s, border-style 0.15s;
}

.project-card:hover {
    background-color: var(--card);
    border-style: solid;
    border-color: var(--border-strong);
}

.project-card-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    height: 100%;
}

.project-info {
    min-width: 0;
}

.project-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-icon-wrapper {
    height: 1.25rem;
    width: 1.25rem;
    flex-shrink: 0;
    border-radius: 0.25rem;
    background: white;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.project-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.project-desc {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.375rem;
    line-height: 1.625;
}

.project-arrow {
    height: 1rem;
    width: 1rem;
    color: var(--muted);
    flex-shrink: 0;
    margin-top: 0.125rem;
    transition: transform 0.15s;
}

.project-card:hover .project-arrow {
    transform: translate(2px, -2px);
}

/* ─────────────────────────────────────────
   Experience Section
   ───────────────────────────────────────── */
.experience-item {
    border-bottom: 1px dashed var(--border);
    padding: 1rem 0;
}

.experience-item:first-child {
    padding-top: 0;
}

.experience-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.exp-row {
    display: flex;
    gap: 0.75rem;
}

.exp-logo-wrapper {
    height: 2.5rem;
    width: 2.5rem;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    background: white;
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
}

.exp-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.25rem;
}

.exp-content {
    flex: 1;
    min-width: 0;
}

.exp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.exp-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exp-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.exp-badge-current {
    font-size: 10px;
    background-color: #00bb7f;
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.exp-company {
    font-size: 0.875rem;
    color: var(--muted);
}

.exp-date-mobile {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.125rem;
}

@media (min-width: 640px) {
    .exp-date-mobile { display: none; }
}

.exp-date-desktop {
    display: none;
    text-align: right;
    font-size: 0.75rem;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .exp-date-desktop { display: block; }
}

.exp-date-range {
    font-weight: 600;
    color: var(--foreground);
}

.exp-date-location {
    color: var(--muted);
}

.exp-toggle {
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s;
}

.exp-toggle:hover {
    background-color: var(--card);
}

.exp-toggle .chevron-icon {
    height: 1rem;
    width: 1rem;
    color: var(--muted);
    transition: transform 0.3s;
}

.exp-toggle.expanded .chevron-icon {
    transform: rotate(180deg);
}

.exp-details {
    overflow: hidden;
    height: 0;
    opacity: 0;
    transition: height 0.3s ease, opacity 0.3s ease;
}

.exp-details.open {
    height: auto;
    opacity: 1;
    margin-top: 0.75rem;
}

.exp-bullets {
    font-size: 0.875rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.exp-bullet {
    display: flex;
    gap: 0.5rem;
}

.exp-bullet-dash {
    flex-shrink: 0;
    color: var(--muted);
}

.exp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.exp-tag {
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 9999px;
}

/* Show More Button */
.show-more-wrapper {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: background-color 0.15s;
}

.show-more-btn:hover {
    background-color: var(--card);
}

.show-more-btn .chevron-icon {
    height: 1rem;
    width: 1rem;
    transition: transform 0.3s;
}

.show-more-btn.expanded .chevron-icon {
    transform: rotate(180deg);
}

/* ─────────────────────────────────────────
   Featured Video
   ───────────────────────────────────────── */
.video-wrapper {
    aspect-ratio: 5/2;
    overflow: hidden;
    border-radius: var(--radius-lg);
    position: relative;
}

.featured-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    user-select: none;
}

/* Hide native video controls */
video::-webkit-media-controls { display: none !important; }
video::-webkit-media-controls-panel { display: none !important; }
video::-webkit-media-controls-play-button { display: none !important; }
video::-webkit-media-controls-start-playback-button { display: none !important; }
video::-webkit-media-controls-enclosure { display: none !important; }
video::-moz-media-controls { display: none !important; }

.video-mute-btn {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: background-color 0.15s;
    color: white;
}

.video-mute-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.video-mute-btn svg {
    height: 1rem;
    width: 1rem;
}

/* ─────────────────────────────────────────
   Footer
   ───────────────────────────────────────── */
.footer-section {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-socials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
}

@media (min-width: 640px) {
    .footer-socials { gap: 0.75rem; }
}

.footer-social-link {
    padding: 0.625rem;
    color: var(--muted);
    transition: color 0.15s;
}

@media (min-width: 640px) {
    .footer-social-link { padding: 0.75rem; }
}

.footer-social-link:hover {
    color: var(--foreground);
}

.footer-social-link svg {
    height: 1.25rem;
    width: 1.25rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    background-color: var(--cta-bg);
    color: #18181b;
    border-radius: var(--radius-lg);
    font-weight: 500;
    transition: opacity 0.15s;
}

.cta-button:hover {
    opacity: 0.9;
}

.cta-icon {
    height: 1rem;
    width: 1rem;
}

.cta-icon svg {
    height: 100%;
    width: 100%;
}

.copyright {
    font-size: 0.75rem;
    color: var(--muted);
}
