/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Shimmering Background */
@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

body {
    font-family: Monaco, Consolas, 'Courier New', monospace;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: linear-gradient(45deg, #c8b4ff, #ffb4c8, #ffc896, #b4ffc8);
    background-size: 400% 400%;
    animation: shimmer 15s ease infinite;
}

/* Cutout effect - shows body background through black overlay */
.cutout {
    background: linear-gradient(45deg, #c8b4ff, #ffb4c8, #ffc896, #b4ffc8);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 15s ease infinite;
}

/* Header */
.main-header {
    background: #000000;
    padding: 0.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    grid-template-rows: min-content min-content min-content;
    column-gap: 2rem;
    row-gap: 0;
    align-items: center;
}

/* Name */
.transparent-text {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: bold;
    letter-spacing: 0.01em;
    margin: 0;
    line-height: 1;
    grid-column: 1;
    grid-row: 1 / 4;
    display: flex;
    align-items: center;
}

.header-link {
    text-decoration: none;
    color: inherit;
}

.header-link .letter {
    display: inline-block;
    transition: text-transform 0.1s ease-in, text-transform 0.4s ease-out 0.2s;
}

.header-link .letter:hover {
    text-transform: lowercase;
    transition: text-transform 0.1s ease-in;
}

.name-space {
    display: inline-block;
    width: 0.3em;
}

.name-word {
    display: inline-block;
    white-space: nowrap;
}

/* Tagline Items */
.tagline-item {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    white-space: nowrap;
    cursor: pointer;
    grid-column: 2;
    line-height: 0.85;
    margin: 0;
    padding: 0;
}

.tagline-item:nth-child(2) { grid-row: 1; }
.tagline-item:nth-child(4) { grid-row: 2; }
.tagline-item:nth-child(6) { grid-row: 3; }

.tagline-base {
    font-size: clamp(0.72rem, 1.8vw, 0.9rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 0.85;
}

.tagline-extend {
    font-size: clamp(0.72rem, 1.8vw, 0.9rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    margin-left: 0;
    transition: max-width 0.3s ease, opacity 0.3s ease, margin-left 0.3s ease;
    line-height: 0.85;
}

.tagline-item:hover .tagline-extend {
    max-width: 15ch;
    opacity: 1;
    margin-left: 0.5em;
}

/* Social Icons */
.social-icon {
    width: clamp(0.72rem, 1.8vw, 0.9rem);
    height: calc(clamp(0.72rem, 1.8vw, 0.9rem) * 1.1);
    grid-column: 4;
    align-self: center;
    background: linear-gradient(45deg, #c8b4ff, #ffb4c8, #ffc896, #b4ffc8);
    background-size: 400% 400%;
    animation: shimmer 15s ease infinite;
    -webkit-mask-size: contain;
    mask-size: contain;
    margin: 0;
    padding: 0;
    display: block;
}

/* GitHub icon - row 1 */
.social-icon:nth-child(3) {
    grid-row: 1;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z'/%3E%3C/svg%3E") no-repeat center;
}

/* PyPI icon - row 2 */
.social-icon:nth-child(5) {
    grid-row: 2;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C5.37 0 0 5.37 0 12c0 6.63 5.37 12 12 12s12-5.37 12-12S18.63 0 12 0zm-1.5 3h3v3h-3V3zm-3 3h3v3h-3V6zm0 3h3v3h-3V9zm0 3h3v3h-3v-3zm3 3h3v3h-3v-3zm3 0h3v3h-3v-3zm0-3h3v3h-3v-3zm0-3h3V6h-3v3zm-3 0h3V6h-3v3z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C5.37 0 0 5.37 0 12c0 6.63 5.37 12 12 12s12-5.37 12-12S18.63 0 12 0zm-1.5 3h3v3h-3V3zm-3 3h3v3h-3V6zm0 3h3v3h-3V9zm0 3h3v3h-3v-3zm3 3h3v3h-3v-3zm3 0h3v3h-3v-3zm0-3h3v3h-3v-3zm0-3h3V6h-3v3zm-3 0h3V6h-3v3z'/%3E%3C/svg%3E") no-repeat center;
}

/* LinkedIn icon - row 3 */
.social-icon:nth-child(7) {
    grid-row: 3;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z'/%3E%3C/svg%3E") no-repeat center;
}

.social-icon svg {
    display: none;
}

.social-icon:hover {
    filter: invert(1);
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.main-nav a {
    color: #FFD700;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: #FFC700;
}

/* Main Content */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Homepage Styles */
.home-content {
    padding: 2rem;
}

.home-content h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #333;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.thumbnail-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.thumbnail-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.thumbnail-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    display: block;
}

.thumbnail-item h3 {
    padding: 1.25rem 1.25rem 0.75rem;
    margin: 0;
}

.thumbnail-item h3 a {
    color: #333;
    text-decoration: none;
    font-weight: 900;
    font-size: 1.25rem;
}

.thumbnail-item h3 a:hover {
    color: #000;
}

.thumbnail-description {
    padding: 0 1.25rem 1.5rem;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}


.placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #666;
}

.placeholder code {
    display: block;
    margin-top: 1rem;
    background: #000;
    color: #fff;
    padding: 0.5rem;
    border-radius: 4px;
}

/* List and Single Pages */
.list-content,
.single-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* List Formatting */
ul, ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

blockquote {
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: #000 !important;
    color: #fff !important;
    border-left: 4px solid #333;
    margin-left: 0;
}

blockquote::before,
blockquote::after {
    content: none;
    display: none;
}

blockquote ul, blockquote ol {
    margin-left: 2rem;
    margin-bottom: 0;
}

.single-content blockquote,
.list-content blockquote {
    background: #000 !important;
    color: #fff !important;
}

.items-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.item-card {
    background: #f5f5f5;
    padding: 1.5rem;
    border-radius: 8px;
}

.item-card h3 a {
    color: #333;
    text-decoration: none;
}

.item-card h3 a:hover {
    color: #FFD700;
}

.item-card time {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.item-card .summary {
    margin-top: 0.5rem;
    color: #666;
}

.single-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.single-content .meta {
    color: #666;
    margin-bottom: 2rem;
}

.single-content .content {
    line-height: 1.8;
}

.single-content .content h1 {
    margin-bottom: 1.5rem;
}

.single-content .content h2,
.single-content .content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.single-content .content p {
    margin-bottom: 1rem;
}

.single-content .content code {
    background: #000;
    color: #fff;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.single-content .content pre {
    background: #000 !important;
    color: #fff !important;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.single-content .content pre::before,
.single-content .content pre::after {
    content: none;
    display: none;
}

.single-content .content .highlight pre {
    background: #000 !important;
}

.single-content .content pre code {
    background: transparent;
    padding: 0;
}

.single-content .content blockquote {
    background: #000 !important;
    color: #fff !important;
}

/* Footer and Contact Form */
.main-footer {
    background: #000000;
    padding: 3rem 2rem 1rem;
    margin-top: auto;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.contact-form h3 {
    text-align: left;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.cutout-border {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid #c8b4ff;
    color: #fff;
    font-family: Monaco, Consolas, 'Courier New', monospace;
}

.cutout-border:focus {
    outline: none;
    border-color: #ffb4c8;
}

.contact-form button {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(
        45deg,
        #c8b4ff,
        #ffb4c8,
        #ffc896,
        #b4ffc8
    );
    background-size: 400% 400%;
    color: #000;
    border: none;
    border-radius: 4px;
    font-family: Monaco, Consolas, 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    animation: shimmer 15s ease infinite;
}

.copyright {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .transparent-text {
        letter-spacing: 2px;
    }

    .main-nav {
        gap: 1rem;
    }

    main {
        padding: 1rem;
    }

    .home-content,
    .list-content,
    .single-content {
        padding: 1.5rem;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Tabbed Interface System */
.tab-container {
    width: 100%;
    margin: 2rem 0 0 0;
}

.tab-buttons {
    display: flex;
    width: 100%;
    margin-bottom: 0;
}

.tab-btn {
    flex: 1;
    background: #000;
    color: #fff;
    border: 2px solid #000;
    padding: 0.5rem 1rem;
    font-family: Monaco, Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    margin-left: -2px;
}

.tab-btn:first-child {
    margin-left: 0;
}

.tab-btn:hover {
    background: #fff;
    color: #000;
}

.tab-btn.active {
    background: #fff;
    color: #000;
    font-weight: bold;
}

/* Tab content box */
.tab-content {
    border: 2px solid #000;
    padding: 2rem;
    background: #fff;
    margin: 0;
}

/* Active tab connects seamlessly to content box */
.tab-container.has-content-box .tab-btn.active {
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
    position: relative;
    z-index: 1;
}

/* Add bottom margin only to standalone tab containers (no content box) */
.tab-container:not(.has-content-box) {
    margin-bottom: 2rem;
}

/* Image Layout System for Project Pages */

/* Full-width images (default) */
.tab-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Image captions */
.image-caption {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

/* Right-aligned images (float right, text wraps left) */
.image-right {
    float: right;
    max-width: 50%;
    margin: 0 0 1.5rem 1.5rem;
}

.image-right img {
    width: 100%;
    margin: 0;
}

.image-right .image-caption {
    text-align: right;
}

/* Left-aligned images (float left, text wraps right) */
.image-left {
    float: left;
    max-width: 50%;
    margin: 0 1.5rem 1.5rem 0;
}

.image-left img {
    width: 100%;
    margin: 0;
}

.image-left .image-caption {
    text-align: left;
}

/* Two-column image grid */
.image-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.image-grid-2 img {
    margin: 0;
}

/* Clear floats after image sections */
.clear-float::after {
    content: "";
    display: table;
    clear: both;
}

/* Placeholder styling for development */
.image-placeholder {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
    color: #666;
}

.image-placeholder p {
    margin: 0;
}

/* Responsive: Stack floated images on mobile */
@media (max-width: 768px) {
    .image-right,
    .image-left {
        float: none;
        max-width: 100%;
        margin: 2rem 0;
    }

    .image-right .image-caption,
    .image-left .image-caption {
        text-align: center;
    }

    .image-grid-2 {
        grid-template-columns: 1fr;
    }
}
