/* ============================================================
   Alexchandar Joshva — Minimal Portfolio
   Karpathy-style: white paper, clean text, nothing else
   ============================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    background: #fff;
    overflow-x: hidden;
}

/* Page */
.page {
    max-width: 700px;
    margin: 0 auto;
    padding: 50px 24px 80px;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Links */
a {
    color: #0969da;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
.head {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 20px;
}

.pic img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 60%;
}

.info h1 {
    font-size: 1.55rem;
    font-weight: 600;
    color: #111;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.bio {
    font-size: 0.95rem;
    color: #555;
    margin-top: 4px;
}

.links {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.85rem;
}

.links a {
    color: #0969da;
}

.loc {
    color: #888;
}

/* Horizontal rule */
hr {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 24px 0;
}

/* Headings */
h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

/* Paragraphs */
p {
    color: #444;
    margin-bottom: 12px;
}

p:last-child {
    margin-bottom: 0;
}

strong {
    color: #222;
    font-weight: 600;
}

em {
    color: #888;
}

/* Entries (projects, education) */
.entry {
    margin-bottom: 20px;
}

.entry:last-child {
    margin-bottom: 0;
}

.entry-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-bottom: 4px;
}

.entry-head strong {
    font-size: 0.95rem;
    color: #111;
}

.entry-aside {
    font-size: 0.82rem;
    color: #888;
}

.entry-aside a {
    color: #0969da;
    word-break: break-all;
}

/* Screenshots */
.screenshot {
    display: block;
    width: 100%;
    margin-top: 12px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.screenshots-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.screenshots-row .screenshot {
    margin-top: 0;
}

.screenshot {
    cursor: zoom-in;
    transition: opacity 0.2s;
}

.screenshot:hover {
    opacity: 0.9;
}

.img-hint {
    font-size: 0.75rem;
    color: #888;
    text-align: center;
    margin-top: 6px;
    font-style: italic;
}

/* Horizontal Scroll Gallery */
.gallery-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-top: 16px;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.gallery-scroll::-webkit-scrollbar {
    display: none; /* Hide scrollbar WebKit */
}

.gallery-scroll .thumb {
    margin-top: 0;
    height: 160px;
    width: auto;
    flex-shrink: 0;
    border-radius: 12px;
    border: 1px solid #eee;
}

@media (max-width: 520px) {
    .gallery-scroll .thumb {
        height: 140px;
    }
}

/* Lightbox Overlay */
.lightbox-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox-bg.active {
    opacity: 1;
    pointer-events: auto;
    cursor: zoom-out;
}

.lightbox-clone {
    position: fixed;
    z-index: 1000;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: zoom-out;
    object-fit: contain;
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Button Styles */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.btn-primary:hover, .btn-secondary:hover {
    opacity: 0.9;
}

.btn-primary {
    background: #0969da;
    color: #fff;
}

.btn-secondary {
    background: #24292f;
    color: #fff;
}

/* Markdown Generated Content */
.report-content {
    margin-top: 30px;
}

.report-content ul, .report-content ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.report-content li {
    margin-bottom: 6px;
}

.report-content h1 {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.report-content h2, .report-content h3, .report-content h4 {
    margin-top: 32px;
    margin-bottom: 12px;
    font-weight: 600;
}

.report-content p {
    margin-bottom: 16px;
}

.report-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

.report-content th, .report-content td {
    padding: 10px 12px;
    border: 1px solid #eaeaea;
    text-align: left;
}

.report-content th {
    background-color: #f6f8fa;
    font-weight: 600;
}

.report-content tr:nth-child(even) {
    background-color: #fbfcfd;
}

.report-content img {
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid #eaeaea;
    margin: 20px 0;
}

/* ========== Responsive ========== */

/* Large screens (1200px+) — wider reading column */
@media (min-width: 1200px) {
    .page {
        max-width: 760px;
        padding: 60px 32px 100px;
    }

    body {
        font-size: 16px;
    }

    .info h1 {
        font-size: 1.7rem;
    }

    .pic img {
        width: 110px;
        height: 110px;
    }
}

/* Medium screens / tablets (521px – 768px) */
@media (max-width: 768px) {
    .page {
        max-width: 100%;
        padding: 40px 24px 70px;
    }

    body {
        font-size: 15px;
    }

    .info h1 {
        font-size: 1.4rem;
    }

    .head {
        gap: 20px;
    }

    .pic img {
        width: 88px;
        height: 88px;
    }

    h2 {
        font-size: 1rem;
    }
}

/* Small phones (520px and below) */
@media (max-width: 520px) {

    .page {
        padding: 28px 18px 50px;
    }

    body {
        font-size: 14px;
    }

    .head {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 14px;
    }

    .info h1 {
        font-size: 1.3rem;
    }

    .bio {
        font-size: 0.88rem;
    }

    .links {
        justify-content: center;
        font-size: 0.82rem;
    }

    .pic img {
        width: 90px;
        height: 90px;
    }

    .entry-head {
        flex-direction: column;
        gap: 2px;
    }

    .screenshots-row {
        grid-template-columns: 1fr;
    }

    h2 {
        font-size: 0.95rem;
    }

    .report-content h1 {
        font-size: 1.25rem;
        margin-top: 24px;
    }

    .report-content h2 {
        font-size: 1.05rem;
        margin-top: 24px;
    }

    .report-content h3, .report-content h4 {
        font-size: 0.95rem;
        margin-top: 20px;
    }

    .report-content table {
        font-size: 0.8rem;
    }

    .report-content th, .report-content td {
        padding: 8px 10px;
    }

    .btn-primary, .btn-secondary {
        padding: 5px 12px;
        font-size: 0.82rem;
    }

    hr {
        margin: 20px 0;
    }
}

/* Extra small phones (360px and below) */
@media (max-width: 360px) {
    .page {
        padding: 24px 14px 40px;
    }

    body {
        font-size: 13px;
    }

    .info h1 {
        font-size: 1.15rem;
    }

    .pic img {
        width: 76px;
        height: 76px;
    }

    .links {
        gap: 4px 10px;
        font-size: 0.78rem;
    }

    .report-content h1 {
        font-size: 1.15rem;
    }

    .report-content h2 {
        font-size: 1rem;
    }

    .report-content h3, .report-content h4 {
        font-size: 0.9rem;
    }

    .btn-primary, .btn-secondary {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
}
