/* The homepage feature cards (Pages/Shared/HomeFeatures, drawn by tools/home-features/gen-home-features.mjs).
   Every card uses the .specimen frame from site.css. This file holds what differs: each card's own colors, and the
   one short animation each picture plays when it appears. */

/* ---- The tile at the top left: one record, in the card's own color ---- */
.hf .hf-tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 194px; padding: 18px 22px; }
.hf .hf-tile span { font: .75rem/1.5 var(--mono); }
.hf .hf-tile strong { font-size: 2.55rem; letter-spacing: -.045em; font-weight: 500; line-height: 1.02; }
/* Two short labels share the top of a tile; on a narrow tile the second drops under the first, whole. */
.hf .element-top { flex-wrap: wrap; column-gap: 12px; }
.hf .element-top span { white-space: nowrap; }
/* The heading's link covers the whole card (site.css). It sits above everything in the card, so every part of the card is
   the link; only the link at the foot, which goes to the same place, sits above it. */
.hf .specimen-link::after { z-index: 2; }
.hf .specimen-footer > a { z-index: 3; }
.hf .specimen-footer { align-items: baseline; }
.hf .specimen-footer > a { white-space: nowrap; }
.hf svg.hf-art { overflow: hidden; }

.hf-titanic { border-top-color: #14263d; }
.hf-titanic .hf-tile { background: #f0b955; color: #1d2230; }
.hf-titanic .detail-rule { background: #b3402e; }

.hf-tools { border-top-color: #0f172a; }
.hf-tools .hf-tile { background: #0f172a; color: #cbd5e1; }
.hf-tools .hf-tile strong { font: 500 4.6rem/1 var(--mono); letter-spacing: -.12em; color: #6ee7b7; }
.hf-tools .hf-tile .element-top span:first-child { color: #7dd3fc; }
.hf-tools .detail-rule { background: #10b981; }

.hf-quiz { border-top-color: #14764a; }
.hf-quiz .hf-tile { background: #f4e373; color: #23212a; }
.hf-quiz .hf-score { position: relative; align-self: flex-start; line-height: 1; padding: 6px 14px 8px 4px; }
.hf-quiz .hf-score b { font-size: 5.6rem; font-weight: 500; letter-spacing: -.075em; }
.hf-quiz .hf-score i { font-style: normal; font-size: 1.9rem; font-weight: 500; color: #4b4a3c; margin-left: 6px; }
.hf-quiz .hf-loop { position: absolute; inset: -12px -18px -10px -16px; width: calc(100% + 34px); height: calc(100% + 22px); overflow: visible; }
.hf-quiz .detail-rule { background: #14764a; }
/* In place of a big figure: the topics, in a sentence. */
.hf .hf-say { margin: 15px 0; font-size: 1.12rem; line-height: 1.4; font-weight: 500; letter-spacing: -.015em; color: var(--ink); }

.hf-history { border-top-color: #1f5f5b; }
.hf-history .hf-tile { background: #1f5f5b; color: #f4efe2; }
.hf-history .hf-tile .element-top span:last-child { color: #f3c98b; }
.hf-history .detail-rule { background: #e2553d; }

.hf-nobel { border-top-color: #6b1e3a; }
.hf-nobel .hf-tile { background: #6b1e3a; color: #f7efe1; }
.hf-nobel .hf-tile strong { font-size: 2.2rem; line-height: 1.04; }
.hf-nobel .hf-tile .element-top span:last-child, .hf-nobel .hf-tile > span:last-child { color: #f1cf73; }
.hf-nobel .detail-rule { background: #c99a1e; }

.hf-amendments { border-top-color: #a63d2f; }
.hf-amendments .hf-tile { background: #1f3a6e; color: #f6efdd; }
.hf-amendments .hf-tile strong { font-size: 5.6rem; letter-spacing: -.075em; line-height: 1; }
.hf-amendments .hf-tile .element-top span:last-child { color: #f1cf73; }
.hf-amendments .detail-rule { background: #a63d2f; }

.hf-pen { fill: none; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 640px) {
    .hf .hf-tile { min-height: 175px; padding: 16px; }
    .hf .hf-tile strong { font-size: 2.05rem; }
    .hf-nobel .hf-tile strong { font-size: 1.7rem; }
    .hf-tools .hf-tile strong { font-size: 3.9rem; }
    .hf-amendments .hf-tile strong, .hf-quiz .hf-score b { font-size: 4.7rem; }
    .hf-quiz .hf-score i { font-size: 1.5rem; }
    .hf .hf-say { font-size: .98rem; }
}
@media (max-width: 380px) {
    .hf .hf-tile strong { font-size: 1.8rem; }
    .hf-nobel .hf-tile strong { font-size: 1.45rem; }
    .hf-quiz .hf-score b { font-size: 4rem; }
}

/* ---- Motion: each picture plays once when the card appears. --d is the delay in milliseconds. ----
   Only opacity and transform change, so nothing on the page moves around the card. */
.hf-an { opacity: 0; animation: hf-in .55s ease forwards; animation-delay: calc(var(--d, 0) * 1ms); }
.hf-grow { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); animation: hf-grow .85s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--d, 0) * 1ms); }
.hf-drop { transform-box: fill-box; transform-origin: center top; opacity: 0; transform: translateY(-16px) rotate(-5deg); animation: hf-drop .6s cubic-bezier(.2, .8, .3, 1.2) forwards; animation-delay: calc(var(--d, 0) * 1ms); }
.hf-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: hf-draw .7s ease forwards; animation-delay: calc(var(--d, 0) * 1ms); }
.hf-blink { animation: hf-blink 1s steps(1) 5; animation-delay: 2s; }
/* The periodic table's Aluminum arrives with its cell, then steps forward once the table is full (--p). */
.hf-an.hf-pop { transform-box: fill-box; transform-origin: center; animation: hf-in .55s ease forwards, hf-pop .5s ease-out; animation-delay: calc(var(--d, 0) * 1ms), calc(var(--p, 0) * 1ms); }
/* Titanic: smoke from the three working funnels keeps drifting astern, slowly. */
.hf-smoke { opacity: 0; transform-box: fill-box; transform-origin: center; filter: blur(1.6px); animation: hf-smoke 5.4s linear infinite; animation-delay: calc(var(--d, 0) * 1ms); }
.hf-smoke-still { display: none; }
/* While the editor types (wwwroot/js/home-feature.js), its lines are simply there; the script reveals the characters. */
.hf-typing .hf-line, .hf-typing .hf-status { animation: none; opacity: 1; }
.hf-typing .hf-cursor { animation: none; }
.hf-typing .hf-status { opacity: 0; transition: opacity .4s; }
.hf-typing.hf-typed .hf-status { opacity: 1; }
.hf-typing.hf-typed .hf-cursor { animation: hf-blink 1s steps(1) 5; }
@keyframes hf-in { to { opacity: 1; } }
@keyframes hf-grow { to { transform: none; } }
@keyframes hf-drop { to { opacity: 1; transform: none; } }
@keyframes hf-draw { to { stroke-dashoffset: 0; } }
@keyframes hf-blink { 50% { opacity: 0; } }
@keyframes hf-pop { 0% { transform: scale(1); } 45% { transform: scale(1.55); } 100% { transform: scale(1); } }
@keyframes hf-smoke { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 12% { opacity: .55; } 100% { opacity: 0; transform: translate(-120px, -40px) scale(3.6); } }
/* Visitors who ask for less motion get each picture finished and still, with the smoke drawn in place. */
@media (prefers-reduced-motion: reduce) {
    .hf-an, .hf-grow, .hf-drop, .hf-draw, .hf-blink, .hf-an.hf-pop { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0; }
    .hf-smoke { animation: none; opacity: 0; }
    .hf-smoke-still { display: block; }
}
@media print {
    .hf-an, .hf-grow, .hf-drop, .hf-draw, .hf-blink, .hf-an.hf-pop { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0; }
    .hf-smoke { display: none; }
    .hf-smoke-still { display: block; }
}
