/* site header wrapper */
.site {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    padding: 0.75rem 1rem 1rem;
    background: linear-gradient(to bottom, var(--bg), transparent);
}

/* pill nav container */
.tabs {
    background: var(--pill);
    padding: 0.25rem;
    border-radius: var(--radius-pill);
    display: flex;
    gap: 0.25rem;
    box-shadow: var(--shadow);
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* hide scrollbar on WebKit */
.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    text-decoration: none;
    color: var(--ink);
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-pill);
    display: inline-block;
    white-space: nowrap;
    font-size: 0.9rem;
    flex: 0 0 auto; /* pills don’t squish */
}

.tab:is(:hover, :focus-visible) {
    background: var(--accent-alt);
    color: #fff;
}

.tab.is-active {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow);
}

/* --- larger screens --- */
@media (min-width: 720px) {
    .site {
        padding: var(--space-6) var(--space-3);
    }

    .tabs {
        padding: var(--space-1);
        gap: var(--space-1);
        justify-content: center;
        max-width: fit-content;
        overflow-x: visible;
    }

    .tab {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
}

/* --- mobile nav tweaks --- */
@media (max-width: 640px) {
  .site {
    padding: 1rem 0.75rem;
  }

  .tabs {
    width: 100%;
    justify-content: space-between;
    gap: 0.25rem;
    padding: 0.25rem;
  }

  .tab {
    flex: 1 1 0;
    text-align: center;
    padding: 0.45rem 0.25rem;
    font-size: 0.9rem;
    white-space: nowrap; /* keeps labels on one line */
  }
}
