:root {
    @import url('https://fonts.googleapis.com/css2?family=Sono:wght@200..800&display=swap');

    /* Light theme variables */
    --background: hsla(0, 0%, 100%, 0.24);
    --foreground: hsl(0, 0%, 100%);
    --card: hsla(0, 0%, 36%, 0.254);
    --card-foreground: hsl(222.2 84% 4.9%);
    --popover: hsl(0 0% 100%);
    --popover-foreground: hsl(222.2 84% 4.9%);
    --primary: hsl(222.2 47.4% 11.2%);
    --primary-foreground: hsl(210 40% 98%);
    --secondary: hsla(0, 0%, 100%, 0.142);
    --secondary-foreground: hsl(0, 0%, 100%);
    --muted: hsla(0, 0%, 36%, 0.605);
    --muted-foreground: hsl(0, 0%, 100%);
    --accent: hsl(210 40% 96.1%);
    --accent-foreground: hsl(222.2 47.4% 11.2%);
    --destructive: hsl(0 84.2% 60.2%);
    --destructive-foreground: hsl(210 40% 98%);
    --border: hsla(0, 0%, 100%, 0.249);
    --input: hsl(214.3 31.8% 91.4%);
    --ring: hsl(222.2 84% 4.9%);
    --radius: 0.5rem;
}

.dark {
    --foreground: hsl(0, 0%, 100%);
    --card-foreground: hsl(222.2 84% 4.9%);
    --popover: hsl(0 0% 100%);
    --popover-foreground: hsl(222.2 84% 4.9%);
    --primary: hsl(222.2 47.4% 11.2%);
    --primary-foreground: hsl(210 40% 98%);
    --secondary: hsla(0, 0%, 100%, 0.142);
    --secondary-foreground: hsl(0, 0%, 100%);
    --muted: hsla(0, 0%, 36%, 0.605);
    --muted-foreground: hsl(0, 0%, 100%);
    --accent: hsl(210 40% 96.1%);
    --accent-foreground: hsl(222.2 47.4% 11.2%);
    --destructive: hsl(0 84.2% 60.2%);
    --destructive-foreground: hsl(210 40% 98%);
    --border: hsla(0, 0%, 100%, 0.249);
    --input: hsl(214.3 31.8% 91.4%);
    --ring: hsl(222.2 84% 4.9%);
}

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

body {
    font-family: 'Sono', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
}

.container {
    max-width: 64rem;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 4rem;
}


header {
    margin-bottom: 2rem;
}

h1 {
    font-family: 'Instrument Serif', serif;
    font-size: 5rem;
    font-weight: 400; /* Instrument Serif looks better at regular weight */
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    max-width: 100%;
    width: 100%;
    text-wrap: wrap;
    opacity: 0.7;
    grid-column: 1 / -1;
    grid-row: 2;
    padding-left: 32px; /* 24px for emoji width + 8px gap */
}

.links {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.card {
    background-color: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section {
    margin-bottom: 0.5rem;
}

.section h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary-foreground);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: var(--muted-foreground);
}

.link-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.link-button {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--muted-foreground);
    padding: 8px;
    margin: 0 -8px;  /* Compensate for padding to maintain alignment */
    border-radius: var(--radius);
    transition: background-color 0.2s, color 0.2s;
}

.link-button:hover {
    background-color: var(--secondary);
    color: var(--foreground);
    box-shadow: 0 0 0 0.5px var(--border);    
}


.external-link {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.link-button:hover .external-link {
    opacity: 1;
}

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

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    /* h1 {
        font-size: 3rem;
    } */
}



.button-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    backdrop-filter: blur(10px);
}

.button:hover {
    background-color: var(--muted);
    text-decoration: none;
}

.button i {
    font-size: 16px;
}

.divider {
    border: 0;
    height: 1px;
    background-color: var(--border);
    margin: 0.5rem 0;
}


/* Style for non-link text items to maintain alignment */
.text-item {
    display: grid;
    grid-template-columns: 24px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin: 0 -8px;
}


.emoji {
    width: 24px;
    text-align: center;
}

/* For link buttons, adjust to accommodate the external link icon */
.link-button {
    grid-template-columns: 24px 1fr auto;
}

#title-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

#title-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-bottom: 20px;
}

#title {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 20px;
    mix-blend-mode: exclusion;
    color: rgb(63, 63, 63);
}
/* 
.fade-in {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

#title-container {
    transition-delay: 0.2s;
}

.nav-links {
    transition-delay: 0.4s;
}

.section:nth-child(1) {
    transition-delay: 0.6s;
}

.section:nth-child(2) {
    transition-delay: 0.7s;
}

.section:nth-child(3) {
    transition-delay: 0.8s;
}

.section:nth-child(4) {
    transition-delay: 0.9s;
}

.section:nth-child(5) {
    transition-delay: 1.1s;
} */

.button-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    justify-content: space-between; /* This will push the theme toggle to the right */
}

.theme-toggle {
    font-family: "Sono", sans-serif;
    margin-left: auto; /* Alternative way to push to the right */
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background-color: var(--card);
    color: var(--foreground);
}

.theme-toggle:hover {
    background-color: var(--muted);
}

/* Icon swap for dark/light mode */
.light .theme-toggle .fa:before {
    content: "\f186"; /* moon icon */
}

.dark .theme-toggle .fa:before {
    content: "\f185"; /* sun icon */
}

.explorations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(800px, 1fr)); /* Increased from 300px */
    gap: 2rem;
    width: 100%;
    padding: 1rem 0;
}

.exploration-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}


.exploration-header {
    display: flex;
    flex-direction: row; /* Force horizontal layout */
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    height: 32px; /* Fixed height to ensure single line */
    
}

.exploration-title {
    margin: 0;
    font-size: 1rem;
    color: var(--foreground);
    text-transform: capitalize;
    flex-grow: 1; /* Take up remaining space */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reload-button {
    margin-left: auto; /* Force button to far right */
    width: 32px;
    height: 32px;
    flex-shrink: 0; /* Prevent button from shrinking */
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.2rem;
}

.reload-button:hover {
    color: var(--foreground);
    background: var(--secondary);
}


@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.reload-button:active {
    animation: rotate 0.5s ease;
}



.exploration-frame {
    width: 100%;
    height: 500px; /* Fixed height instead of aspect-ratio */
    border: none;
    border-radius: 8px;
    background: var(--card);
    transition: transform 0.2s ease;
    overflow: hidden; /* Prevents content from spilling out */
}

/* Optional: Add responsive adjustments */
@media (max-width: 768px) {
    .explorations-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }

    .exploration-frame {
        height: 400px; /* Slightly smaller on mobile */
    }
}

/* Optional: Add a subtle border */
.exploration-frame {
    border: 1px solid var(--border);
}

/* Optional: Add hover effect */
.exploration-wrapper:hover .exploration-frame {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}



.loading-state, 
.error-state {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    color: var(--muted-foreground);
}

.loading-state .emoji,
.error-state .emoji {
    font-size: 1.2em;
}

