/* tiun atlas v2: the home page. Four views in one ink frame, each with a small drawing of itself. Needs base.css.
   Motion: the drawings assemble once when the page loads (card by card, left to right), and answer the pointer or
   the keyboard focus after that. Nothing loops. */
.sheet { max-width: 1360px; margin: 0 auto; padding-top: 26px; }
.bar .present { margin-left: auto; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 13px; border: 1.5px solid var(--ink); border-radius: 9px; background: var(--sheet); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color 140ms var(--ease), translate 140ms var(--ease), box-shadow 140ms var(--ease); }
.btn:hover { translate: 0 -1px; box-shadow: 0 3px 8px -4px rgba(20, 22, 28, 0.45); }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #2a2e3a; }

.lead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; }
.lead__t { margin: 0; font-size: clamp(38px, 5.2vw, 64px); line-height: 1.02; font-weight: 660; letter-spacing: -0.035em; text-wrap: balance; }
.lead__s { margin: 14px 0 0; max-width: 58ch; text-wrap: pretty; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.lead__go { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 14px; color: var(--ink-2); }
.lead__go > span { max-width: 22ch; line-height: 1.35; }

/* ---- the family: one frame, four cards */
.fam { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 28px 0 0; padding: 0; list-style: none; border: 3px solid var(--ink); background: var(--sheet); }
.fam__item { display: flex; border-left: 1.5px solid var(--ink); }
.fam__item:first-child { border-left: 0; }
.fam__card { display: flex; flex-direction: column; flex: 1; min-width: 0; color: var(--ink); text-decoration: none; }
.fam__card:focus-visible { outline-offset: -5px; }
.fam__scene { display: block; overflow: hidden; border-bottom: 1.5px solid var(--ink); background: var(--ground); }
.sc { display: block; width: 100%; height: auto; aspect-ratio: 320 / 232; }
.fam__text { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.fam__t { font-size: 26px; line-height: 1.15; font-weight: 650; letter-spacing: -0.022em; }
.fam__s { margin-top: 6px; font-size: 16px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.fam__n { margin-top: auto; padding-top: 18px; font-size: 14px; font-weight: 560; font-variant-numeric: tabular-nums; }
.fam__card:hover .fam__t, .fam__card:focus-visible .fam__t { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---- the drawings: how each part arrives on load. The drawings are complete as they stand; home.js adds .is-live on
   the first frame the browser really draws, so a page that is never animated (no script, a background tab, a
   print) still shows everything. */
.sc .in, .sc .c-rest { transform-box: fill-box; transform-origin: center; }
.is-live .sc .in { animation: sc-in 620ms var(--ease) backwards; animation-delay: calc(var(--d, 0ms) + 160ms + var(--i, 0) * 70ms); }
@keyframes sc-in { from { opacity: 0; translate: 0 16px; scale: 0.9; } }
.is-live .sc .note { animation-name: sc-drop; }
@keyframes sc-drop { from { opacity: 0; translate: 0 -14px; scale: 1.25; rotate: var(--lift); } }
.is-live .sc .j-dot { animation-name: sc-pop; animation-duration: 420ms; animation-delay: calc(var(--d, 0ms) + 260ms + var(--i, 0) * 75ms); }
@keyframes sc-pop { from { opacity: 0; scale: 0.2; } }
.sc .j-line { stroke-dasharray: 1; }
.is-live .sc .j-line { animation: sc-draw 1150ms cubic-bezier(0.45, 0, 0.2, 1) backwards; animation-delay: calc(var(--d, 0ms) + 300ms); }
@keyframes sc-draw { from { stroke-dashoffset: 1; } }
.sc .c-bar { transform-origin: left center; }
.is-live .sc .c-bar { animation-name: sc-grow; animation-duration: 700ms; }
@keyframes sc-grow { from { scale: 0 1; } }

/* ---- and how each answers the pointer or the keyboard focus */
.sc .p-face, .sc .note, .sc .j-low, .sc .c-rest { transition: rotate 360ms var(--ease), scale 360ms var(--ease), translate 520ms var(--ease); }
.fam__card:hover .p-face, .fam__card:focus-visible .p-face { rotate: var(--tilt); scale: 1.07; transition-delay: calc(var(--i) * 45ms); }
.fam__card:hover .note, .fam__card:focus-visible .note { rotate: var(--lift); translate: 0 -4px; transition-delay: calc(var(--i) * 35ms); }
.is-live .fam__card:hover .j-line, .is-live .fam__card:focus-visible .j-line { animation: sc-redraw 1000ms cubic-bezier(0.45, 0, 0.2, 1); }
@keyframes sc-redraw { from { stroke-dashoffset: 1; } }
.fam__card:hover .j-low, .fam__card:focus-visible .j-low { scale: 1.35; transition-delay: 620ms; }
.fam__card:hover .c-rest, .fam__card:focus-visible .c-rest { translate: -68px 0; }

/* ---- narrower screens: two by two, then one column */
@media (max-width: 1000px) {
  .fam { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fam__item:nth-child(odd) { border-left: 0; }
  .fam__item:nth-child(n + 3) { border-top: 1.5px solid var(--ink); }
}
@media (max-width: 700px) {
  .sheet { padding-top: 18px; }
  .lead__s { font-size: 16px; }
  .fam { grid-template-columns: 1fr; margin-top: 22px; }
  .fam__item, .fam__item:nth-child(odd) { border-left: 0; border-top: 1.5px solid var(--ink); }
  .fam__item:first-child { border-top: 0; }
  .fam__text { padding: 14px 16px 18px; }
  .fam__t { font-size: 23px; }
  .fam__n { padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .is-live .sc .in, .is-live .sc .j-line, .is-live .fam__card:hover .j-line, .is-live .fam__card:focus-visible .j-line { animation: none; }
  .sc .p-face, .sc .note, .sc .j-low, .sc .c-rest, .btn { transition-duration: 1ms; transition-delay: 0ms; }
}
