/* --- Color Palette & Variables (Markdown / Tech-Minimalist) --- */
:root {
    --bg-color: #fbfbfb;
    --text-color: #1a1a1a;
    --text-muted: #555555;
    --border-color: #e0e0e0;
    --accent-color: #647e73;

    --accent-hover: #577761;
    --code-bg: #f3f4f6;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* --- Global Reset & Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 2rem 1rem;
}

.container {
    max-width: 900px;
    /* Accommodates side-by-side project layouts beautifully */
    margin: 0 auto;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Header & Navigation --- */
header {
    border-bottom: 2px solid var(--text-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2.5rem;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.nav-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn-nav {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border: 2px solid var(--text-color);
    background-color: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-nav:hover,
.btn-nav.active {
    background-color: var(--text-color);
    color: var(--bg-color);
    text-decoration: none;
}

/* --- Landing Page Layout (Grid Split) --- */
.landing-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 3rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .landing-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Left Column: Bio & Focus */
.intro-column h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
}

.intro-column p {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.tech-tags {
    margin-top: 1.5rem;
}

.tech-tags h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background-color: var(--code-bg);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

/* Right Column: Profile details & Contact Info */
.meta-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-pic-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--code-bg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.info-card {
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    background-color: #ffffff;
}

.info-card h2 {
    font-size: 1rem;
    font-family: var(--font-mono);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.info-list {
    list-style: none;
    font-size: 0.95rem;
}

.info-list li {
    margin-bottom: 0.5rem;
}

.info-list li strong {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    display: inline-block;
    width: 80px;
}

/* --- Side-by-Side Projects Layout --- */
.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.project-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-start;
    margin: -1rem 0 3rem 0;
}

.project-card {
    display: flex;
    flex-direction: column-reverse;
    gap: 1.5rem;
    border: 1px solid var(--border-color);
    background: #ffffff;
    padding: 1.5rem;
    transition: border-color 0.15s ease;
    scroll-margin-top: 3rem;
}

.project-card:hover {
    border-color: var(--text-color);
}

/* Left Side: Text Details */
.project-text-content {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Right Side: Media Container */
.project-media-content {
    width: 100%;
}

.project-image-wrapper {
    position: relative;
    overflow: hidden;
}

.project-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-image-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.project-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.project-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.project-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.project-details {
    font-size: 0.95rem;
}

.detail-row {
    margin-bottom: 0.5rem;
}

.detail-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
}

.play-btn {
    position: absolute;
    bottom: 25px !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 0;
    /* filter: drop-shadow(0px 3px 6px rgba(0, 0, 0, 0.5)); */
    transition: transform 0.15s ease-in-out;
}

.play-btn svg {
    width: 100%;
    height: 100%;
    fill: #ffffff;
}

.play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(0, 0, 0, 0.8);
}

.project-image-wrapper.is-playing .play-btn {
    opacity: 0;
    pointer-events: auto;
}

.project-image-wrapper.is-playing:hover .play-btn {
    opacity: 1;
}

.carousel-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #1a1a1a;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
    display: none;
    justify-content: center;
    align-items: center;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
    display: block;
}

.carousel-slide img,
.carousel-slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.dot.active {
    background: #ffffff;
}

/* Hide the accessibility text from sight while keeping it readable for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.video-timeline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    z-index: 3;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.seek-slider {
    width: 100%;
    cursor: pointer;
    accent-color: var(--accent-color, #647e73);
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    transition: height 0.1s ease;
    -webkit-appearance: none;
    appearance: none;
}

.seek-slider:hover {
    height: 6px;
}

.seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.seek-slider::-moz-range-thumb {
    height: 12px;
    width: 12px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Back to Top Button base styling */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--accent-color, #647e73);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 99;

    /* Hidden state by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background-color 0.2s ease;
}

/* Shown state toggled via JS */
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hover effects */
.back-to-top:hover {
    background-color: #536960;
    /* Slightly darker shade of your accent color */
    transform: translateY(-3px);
}

.back-to-top:active {
    transform: translateY(0);
}

/* Responsive stack for tablets/mobile */
@media (max-width: 768px) {
    .project-card {
        gap: 1.25rem;
        padding: 1.25rem;
    }
}

/* --- Footer --- */
footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}