/* Home page specific styles */
.new-project-btn {
    padding: 0 1rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    min-width: 160px;
    gap: 8px;
}

.new-project-btn:hover {
    background-color: #218838;
}

.credits-badge {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 600;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.projects-loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.loading-throbber {
    width: 80px;
    height: 80px;
    opacity: 0.6;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 20px;
    padding: 20px 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.projects-grid.loading {
    display: none;
}

.project-box {
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid #e9ecef;
}

.project-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: #fff;
}

.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: #212529;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #495057;
    margin-top: auto;
}

.project-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-draft {
    background-color: #e9ecef;
    color: #495057;
}

.status-in-progress {
    background-color: #cff4fc;
    color: #055160;
}

.status-completed {
    background-color: #d1e7dd;
    color: #0f5132;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.project-tag {
    background-color: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.header-content {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.intro-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding-top: 0;
    max-width: 720px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.intro-logo-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.intro-logo {
    width: clamp(140px, 24vw + 60px, 200px);
    height: auto;
    object-fit: contain;
}

.intro-title-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
    flex-direction: column;
    gap: 0.5rem;
}

.intro-section h1 {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* Collapsed by default: smoothly hide pronunciation and origin (allow tagline to move up) */
.intro-title-container .title-anchor .pronunciation-row,
.intro-title-container .origin-block {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 400ms ease, opacity 400ms ease;
}

/* Keep Fictional Noun in flow but hidden by default */
.intro-title-container .title-anchor .title-hint {
    opacity: 0;
}

/* Ensure all auxiliary pieces fade smoothly */
/* Title hint fades only; remains in flow */
.intro-title-container .title-anchor .title-hint {
    transition: opacity 400ms ease;
}

.title-anchor {
    position: relative;
    display: inline-block;
    width: max-content; /* shrink to title width */
    max-width: 100%;
    align-self: center; /* center the title block */
}

.intro-title {
    margin: 0; /* reduce extra space around the title */
    line-height: 1.1;
}

.title-text {
    display: inline-grid;
    grid-auto-flow: column;
    align-items: center;
    gap: 0.35rem;
    grid-template-columns: 22px auto 22px; /* spacer, title, caret */
}

.title-caret {
    width: 22px;
    height: 22px;
    opacity: 1;
    transition: transform 200ms ease;
    transform: rotate(180deg); /* default down */
    cursor: pointer;
}

/* Expanded state: reveal content with height + opacity */
.intro-title-container.is-expanded .title-anchor .pronunciation-row {
    max-height: 60px; /* enough for one line */
    opacity: 1;
}

.intro-title-container.is-expanded .origin-block {
    max-height: 500px; /* enough for block text */
    opacity: 1;
}

.intro-title-container.is-expanded .title-hint {
    opacity: 1;
}

.intro-title-container.is-expanded .title-caret {
    transform: rotate(0deg); /* up */
}

.title-spacer {
    width: 22px;
    height: 22px;
    display: inline-block;
}

.title-hint {
    color: #555;
    font-weight: 500;
}

.pronunciation-row {
    top: 100%;
    display: flex;
    align-items: baseline;
    justify-content: space-between; /* sides align to title edges */
    gap: 1rem;
}

.syllables {
    color: #333;
}

.ipa {
    color: #666;
}

.origin-block {
    max-width: 600px;
    margin-top: 1.25rem; /* more space between origin and title area */
    align-self: stretch; /* left-align within the 600px container */
    text-align: left;
}

.origin-block h5 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    color: #666;
}

.origin-block p {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: #777;
    line-height: 1.5;
}

.intro-section h2 {
    font-size: 1.5rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
}

.intro-text {
    flex: 1;
}

.intro-text h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #fff;
    font-weight: 300;
}

.intro-text p {
    font-size: 1.2rem;
    color: #ccc;
    line-height: 1.6;
}

/* Tagline styling */

/* Refined tagline */
.intro-tagline {
    font-size: 1rem;
    font-weight: 300;
    color: #b8b8b8;
    margin: 0;
    max-width: 60ch;
}

/* Removed verbum-info styles */

/* Homepage header platform info container */
.platform-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Homepage header slogan */
.header-slogan {
    font-size: 0.75rem;
    color: #adadad;
    font-weight: 300;
    line-height: 1;
    transition: opacity 0.5s ease-in-out;
}

/* Common container styles */
main {
    max-width: 1200px;
    margin: 1.5rem auto 2rem;
    padding: 0 1rem;
}

@media (max-width: 720px) {
    .intro-section {
        max-width: 100%;
        gap: 0.65rem;
    }

    main {
        padding: 0 0.75rem;
        margin: 1rem auto 1.75rem;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
        gap: 16px;
        padding: 16px 0;
    }

    .project-box {
        padding: 16px;
    }

    .intro-title-container {
        text-align: center;
    }

    .intro-tagline {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .title-text {
        grid-template-columns: auto auto;
        gap: 0.5rem;
    }

    .title-spacer {
        display: none;
    }
}

@media (max-width: 520px) {
    main {
        padding: 0 0.6rem;
        margin: 0.75rem auto 1.5rem;
    }

    .projects-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        padding: 14px 0;
    }

    .project-box {
        padding: 14px;
    }
}

@media (min-width: 900px) {
    .intro-section {
        max-width: 960px;
    }

    .intro-section.definition-open {
        display: grid;
        grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
        column-gap: 2rem;
        row-gap: 1rem;
        text-align: left;
        align-items: start;
    }

    .intro-section.definition-open .intro-logo-container {
        grid-row: 1 / span 2;
        justify-content: center;
    }

    .intro-section.definition-open .intro-title-container {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .intro-section.definition-open .intro-tagline {
        grid-column: 1 / span 2;
        margin-top: 0.5rem;
        text-align: left;
    }
}
