/* =====================================================================
   LINKS PAGE  -  /links/links.css   (same family as the rest of the site)
   ===================================================================== */

.site-title, .site-title:visited { color: inherit; text-decoration: none; }

main.lk-main {
    --lk-ink: #1b1a17;
    --lk-muted: #6b665c;
    --lk-faint: #9a948a;
    --lk-rule: #e4dfd5;
    --lk-accent: #8a2b1d;
    display: block;
    grid-template-columns: none;
    width: 100%;
    max-width: 900px;
    margin: 6px auto 0;
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
    color: var(--lk-ink);
}
main.lk-main p { margin: 0; font-size: inherit; line-height: 1.5; color: inherit; }

/* ---- heading ---- */
.lk-hero { text-align: center; padding: 26px 0 30px; }
main.lk-main .lk-kicker {
    margin: 0 0 6px;
    font-size: 0.8rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--lk-accent);
}
main.lk-main .lk-title { font-size: clamp(1.9rem, 4.2vw, 2.9rem); font-style: italic; line-height: 1.15; }
main.lk-main .lk-intro { max-width: 32em; margin: 12px auto 0; font-size: 1.02rem; color: var(--lk-muted); }
.lk-hero::after {
    content: "";
    display: block;
    width: 64px;
    height: 1px;
    margin: 24px auto 0;
    background: var(--lk-accent);
    opacity: 0.6;
    transform-origin: center;
    animation: lk-rule 1s cubic-bezier(.2, .7, .2, 1) 0.2s both;
}
@keyframes lk-rule { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- search (shows up once there are lots of links) ---- */
.lk-tools[hidden] { display: none; }
.lk-tools { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.lk-search { position: relative; display: flex; align-items: center; width: min(320px, 100%); }
.lk-search svg { position: absolute; left: 12px; fill: none; stroke: var(--lk-faint); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.lk-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border: 1px solid #d9d3c7;
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 0.95rem;
    color: var(--lk-ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.lk-search input::placeholder { color: var(--lk-faint); font-style: italic; }
.lk-search input:focus { outline: none; border-color: var(--lk-accent); box-shadow: 0 0 0 3px rgba(138, 43, 29, 0.12); }
main.lk-main .lk-status { font-size: 0.88rem; font-style: italic; color: var(--lk-faint); }

/* ---- sections ---- */
.lk-section { margin: 26px 0 34px; }
.lk-section[hidden] { display: none; }
main.lk-main .lk-h {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--lk-rule);
    font-size: 1.28rem;
    font-weight: 600;
    font-style: normal;
    color: var(--lk-ink);
}
.lk-num { font-style: italic; font-weight: normal; color: var(--lk-accent); }
.lk-count {
    margin-left: auto;
    font-size: 0.78rem;
    font-weight: normal;
    letter-spacing: 0.1em;
    color: var(--lk-faint);
}

.lk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* ---- one link ---- */
a.lk-card, a.lk-card:visited {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--lk-rule);
    border-radius: 12px;
    background: #fff;
    color: var(--lk-ink);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(27, 26, 23, 0.03);
    transition: transform 0.35s cubic-bezier(.2, .7, .2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}
a.lk-card[hidden] { display: none; }
a.lk-card:hover, a.lk-card:focus-visible {
    transform: translateY(-2px);
    border-color: hsl(var(--h) 30% 78%);
    box-shadow: 0 10px 24px rgba(27, 26, 23, 0.08);
    outline: none;
}

.lk-mono {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: hsl(var(--h) 38% 93%);
    color: hsl(var(--h) 42% 30%);
    font-size: 1.15rem;
    font-weight: 600;
    transition: transform 0.45s cubic-bezier(.3, 1.4, .5, 1), background-color 0.35s ease, color 0.35s ease;
}
a.lk-card:hover .lk-mono, a.lk-card:focus-visible .lk-mono {
    transform: rotate(-8deg) scale(1.06);
    background: hsl(var(--h) 42% 34%);
    color: #fff;
}

.lk-body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.lk-name {
    font-size: 1.04rem;
    font-weight: 600;
    line-height: 1.3;
    background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
    transition: background-size 0.4s ease;
    align-self: flex-start;
}
a.lk-card:hover .lk-name, a.lk-card:focus-visible .lk-name { background-size: 100% 1px; }
.lk-note { margin-top: 2px; font-size: 0.9rem; line-height: 1.35; color: var(--lk-muted); }
.lk-domain { margin-top: 3px; font-size: 0.76rem; letter-spacing: 0.03em; color: var(--lk-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.lk-card:visited .lk-name { color: var(--lk-accent); }

.lk-arrow { flex: 0 0 auto; color: var(--lk-faint); transition: transform 0.35s ease, color 0.35s ease; }
.lk-arrow svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
a.lk-card:hover .lk-arrow, a.lk-card:focus-visible .lk-arrow { transform: translate(2px, -2px); color: var(--lk-ink); }

/* cards rise in, one after another, when their section scrolls into view */
.lk-section .lk-card { opacity: 0; transform: translateY(10px); }
.lk-section.is-in .lk-card {
    opacity: 1;
    transform: none;
    animation: lk-rise 0.7s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms) backwards;
}
.lk-section.is-in .lk-card:hover, .lk-section.is-in .lk-card:focus-visible { transform: translateY(-2px); }
@keyframes lk-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.lk-section .lk-h { opacity: 0; transition: opacity 0.6s ease; }
.lk-section.is-in .lk-h { opacity: 1; }

main.lk-main .lk-loading { text-align: center; font-style: italic; color: var(--lk-faint); padding: 20px 0; }
main.lk-main .lk-colophon {
    max-width: 34em;
    margin: 30px auto 0;
    text-align: center;
    font-size: 0.86rem;
    font-style: italic;
    color: var(--lk-faint);
}

@media (max-width: 640px) {
    .lk-grid { grid-template-columns: 1fr; }
    .lk-hero { padding: 14px 0 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .lk-hero::after, .lk-section.is-in .lk-card { animation: none; }
    .lk-section .lk-card, .lk-section .lk-h { opacity: 1; transform: none; }
    a.lk-card, .lk-mono, .lk-arrow, .lk-name { transition: none; }
}
