/*
 * The landing page: a hero, four figures, and two cards.
 *
 * Every value here comes from `shared/tokens.css`, which is loaded before this
 * file. The page used to declare its own navy, its own grey and its own radius,
 * on the reasoning that a page whose only job is to point at two apps should
 * not break when one of them restyles — but the result was a third copy of the
 * same six values, and it had already drifted from both.
 */

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

body {
    font-family: var(--font-ui);
    font-size: var(--text-base);
    line-height: var(--lh-normal);
    color: var(--c-ink);
    background: var(--c-page);
    -webkit-font-smoothing: antialiased;
    text-wrap: pretty;
}

a {
    color: var(--c-accent);
}

a:hover {
    color: var(--c-accent-strong);
}

:focus-visible {
    outline: 2px solid var(--c-focus);
    outline-offset: 3px;
}

.landing {
    max-width: var(--w-page);
    margin: 0 auto;
    padding: var(--s-16) var(--s-8) var(--s-10);
}

/* ------------------------------------------------------------------ Hero */

.hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: var(--s-16);
    align-items: start;
}

/*
 * The eyebrow: an orange square from the logo, then the institute's name. The
 * square is decorative — the name beside it is the content — so it is drawn
 * with a pseudo-element rather than an element a screen reader has to skip.
 */
.eyebrow {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-bottom: var(--s-5);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--c-ink-muted);
}

.eyebrow::before {
    content: '';
    flex: none;
    width: 7px;
    height: 7px;
    background: var(--c-frame);
}

.hero__title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: var(--weight-regular);
    line-height: var(--lh-tight);
    letter-spacing: -0.025em;
    color: var(--c-brand-strong);
}

.hero__lede {
    margin-top: var(--s-5);
    max-width: 44ch;
    font-family: var(--font-display);
    font-size: var(--text-md);
    line-height: 1.5;
    color: var(--c-ink-muted);
}

.hero__meta {
    margin-top: var(--s-6);
    font-size: var(--text-xs);
    color: var(--c-ink-soft);
    font-variant-numeric: var(--figures-tabular);
}

/* --------------------------------------------------------------- Figures */

/*
 * Four tiles in a 2×2, separated by the background showing through a 1px grid
 * gap rather than by borders — so no two adjacent tiles ever draw a 2px rule
 * between them.
 */
.figures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--c-line);
    border: 1px solid var(--c-line);
}

.figure {
    position: relative;
    padding: var(--s-5) var(--s-5) var(--s-4);
    background: var(--c-surface);
}

/* One square, on the first tile, tying the block to the mark. */
.figure:first-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--c-frame);
}

.figure__value {
    font-size: var(--text-xl);
    line-height: 1;
    letter-spacing: var(--track-tight);
    color: var(--c-brand-strong);
    font-variant-numeric: var(--figures-tabular);
}

/* The en dash in a year span is punctuation between two figures, not a third
   figure; it recedes so the years read as the numbers they are. */
.figure__value .dash {
    color: var(--c-line-strong);
}

.figure__label {
    margin-top: var(--s-2);
    font-size: var(--text-2xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--c-ink-soft);
}

/* ----------------------------------------------------------------- Cards */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
    gap: var(--s-6);
    margin-top: var(--s-12);
}

/*
 * The whole card is the link, not a button inside it: a reader aiming at a
 * choice should not have to find the one word that is clickable.
 */
.card {
    display: flex;
    flex-direction: column;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-sm);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-1);
    transition:
        border-color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out);
}

.card:hover,
.card:focus-visible {
    border-color: var(--c-line-strong);
    box-shadow: var(--shadow-2);
}

/*
 * The preview. Each card shows a piece of the thing it links to, drawn from the
 * same data the app itself reads — a card that promised a word cloud and then
 * showed a bulleted list was asking the reader to take its word for it.
 */
.card__preview {
    height: 10.75rem;
    flex: none;
    background: var(--c-page);
    border-bottom: 1px solid var(--c-line);
    overflow: hidden;
}

/* Words, laid out as a line of type rather than as a real cloud: at this size a
   packed layout would be a texture, and the point is that they are readable. */
.card__cloud {
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    align-content: center;
    justify-content: center;
    gap: var(--s-1) var(--s-3);
    padding: var(--s-5) var(--s-6);
    font-family: var(--font-display);
    line-height: 1;
}

.card__spark {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: var(--s-6) var(--s-6) 0;
}

.card__bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    min-height: 0;
}

.card__bar {
    flex: 1;
    background: var(--c-bar);
    border-radius: 1px 1px 0 0;
}

.card__axis {
    display: flex;
    justify-content: space-between;
    padding: var(--s-1) 0 var(--s-2);
    border-top: 1px solid var(--c-line-strong);
    font-size: var(--text-2xs);
    color: var(--c-ink-faint);
    font-variant-numeric: var(--figures-tabular);
}

.card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--s-5) var(--s-6) var(--s-6);
}

.card__head {
    display: flex;
    align-items: baseline;
    gap: var(--s-3);
}

.card__index {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0.12em;
    color: var(--c-ink-faint);
    font-variant-numeric: var(--figures-tabular);
}

.card__title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-regular);
    line-height: var(--lh-snug);
    letter-spacing: -0.015em;
    color: var(--c-brand-strong);
}

.card__lede {
    margin-top: var(--s-2);
    color: var(--c-ink-muted);
}

.card__list {
    margin-top: var(--s-5);
    border-top: 1px solid var(--c-line-soft);
    list-style: none;
    font-size: var(--text-sm);
    color: var(--c-ink-muted);
}

.card__list li {
    display: grid;
    grid-template-columns: 6px 1fr;
    gap: var(--s-3);
    align-items: start;
    padding: var(--s-2) 0;
    border-bottom: 1px solid var(--c-line-soft);
    line-height: 1.45;
}

.card__list li:last-child {
    border-bottom: 0;
}

.card__list li::before {
    content: '';
    width: 6px;
    height: 6px;
    margin-top: 0.45em;
    background: var(--c-line);
}

.card__go {
    /* margin-top:auto pins the call to action to the bottom, so two cards of
       different length still line their links up. */
    margin-top: auto;
    padding-top: var(--s-5);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--c-accent);
}

.card__go::after {
    content: ' →';
    display: inline-block;
    font-weight: var(--weight-regular);
    transition: transform var(--dur-fast) var(--ease-out);
}

.card:hover .card__go::after {
    transform: translateX(3px);
}

/* ---------------------------------------------------------------- Footer */

.landing__footer {
    display: flex;
    justify-content: space-between;
    gap: var(--s-6);
    flex-wrap: wrap;
    margin-top: var(--s-12);
    padding-top: var(--s-4);
    border-top: 1px solid var(--c-line);
    font-size: var(--text-xs);
    line-height: 1.6;
    color: var(--c-ink-soft);
}

/* ------------------------------------------------------------ Breakpoints */

@media (max-width: 60rem) {
    .landing {
        padding: var(--s-10) var(--s-6) var(--s-8);
    }

    .hero {
        grid-template-columns: 1fr;
        gap: var(--s-8);
    }
}

@media (max-width: 34rem) {
    .landing {
        padding: var(--s-8) var(--s-4) var(--s-6);
    }

    /* Four tiles in a column would push the cards below the fold; two rows of
       two stay one glance. */
    .figures {
        grid-template-columns: 1fr 1fr;
    }

    .card__preview {
        height: 8.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
    }
}
