:root {
    --bg: #efefec;
    --text: #111111;
    --muted: #b8b8b4;
    --white: #ffffff;
    --line: #d9d9d4;
    --page-pad: 28px;
    --card-gap: 5px;
    --overlay: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.74) 0%,
        rgba(0, 0, 0, 0.38) 42%,
        rgba(0, 0, 0, 0.12) 100%
    );
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a,
button {
    color: inherit;
    font: inherit;
    text-decoration: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

.index-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 18px var(--page-pad) 14px;
}

.index-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 40px;
    list-style: none;
}

.index-row + .index-row {
    margin-top: 8px;
}

.index-link {
    display: inline-flex;
    align-items: center;
    font-size: clamp(1.1rem, 1.9vw, 1.5rem);
    line-height: 1.2;
    font-weight: 400;
    color: var(--muted);
    transition: color 0.2s ease;
    white-space: nowrap;
}

.index-link:hover,
.index-link.is-active {
    color: var(--text);
}

.feature-grid-wrap {
    padding-bottom: 18px;
}

.feature-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--card-gap);
    width: 100%;
}

.feature-card {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: calc((100% - (3 * var(--card-gap))) / 4);
    height: 0;
    padding-top: calc((100% - (3 * var(--card-gap))) / 4);
    overflow: hidden;
    color: var(--white);
    background: #d8d8d2;
}

.feature-card.is-hidden {
    display: none;
}

.feature-card__bg,
.feature-card__overlay,
.feature-card__content {
    position: absolute;
    inset: 0;
}

.feature-card__bg {
    background-size: cover;
    background-position: center;
    transform: scale(1.01);
    transition: transform 0.35s ease;
}

.feature-card:hover .feature-card__bg {
    transform: scale(1.04);
}

.feature-card__overlay {
    background: var(--overlay);
}

.feature-card__overlay {
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.feature-card:hover .feature-card__overlay {
    opacity: 1;
}

.feature-card__content {
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px 17px 15px;
}

.feature-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 13px;
    font-size: 0.86rem;
    line-height: 1.28;
    font-weight: 400;
}

.feature-card__title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(1.95rem, 2.55vw, 2.8rem);
    line-height: 0.94;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 11px;
    /* max-width: 12ch; */
}

.feature-card__excerpt {
    font-size: 0.92rem;
    line-height: 1.4;
    max-width: 29ch;
    opacity: 0.98;
}

.empty-state {
    display: none;
    padding: 28px var(--page-pad) 0;
    color: #6e6e68;
    font-size: 0.98rem;
}

.empty-state.is-visible {
    display: block;
}

@media (max-width: 1280px) {
    .feature-card {
        width: calc((100% - var(--card-gap)) / 2);
        padding-top: calc((100% - var(--card-gap)) / 2);
    }
}

@media (max-width: 780px) {
    :root {
        --page-pad: 18px;
        --card-gap: 8px;
    }

    .index-nav {
        padding-top: 14px;
        padding-bottom: 12px;
    }

    .index-row {
        gap: 10px 22px;
    }

    .feature-card {
        width: 100%;
        padding-top: 100%;
    }

    .feature-card__content {
        padding: 16px 15px 14px;
    }

    .feature-card__title {
        font-size: 2.05rem;
    }
}
