


@property --at-l { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --at-r { syntax: "<number>"; inherits: true; initial-value: 0; }

.at {
  --at-n: 4;              
  --at-span: 7;           
  --at-set: 26;           
  --at-least: 1.125rem;   
  --at-back: 55%;         
  --at-head: 10.9;        
  --at-in: .08em;         
  --at-shape: 1.5;        
  --at-thumb: 3;          
  --at-held: 14.4;        
  --at-upright: .75;      
  --at-flat: 2.4;         
  --at-share: 56svh;      
  --at-gap: var(--s-8);   
  --at-k: 1;              
  --at-hand: 0;           
  
  --at-c: 100cqi;
  --at-col: calc((var(--at-span) * var(--at-c) - (12 - var(--at-span)) * var(--gap)) / 12);       
  --at-wide: calc(var(--at-c) - var(--at-col) - var(--gap));                                       
  --at-small: calc((var(--at-thumb) * var(--at-c) - (12 - var(--at-thumb)) * var(--gap)) / 12);    
  --at-text: calc(var(--at-c) - var(--at-small) - var(--gap));                                     
  
  --at-view: calc(100svh - var(--bar-h) - var(--hair));
  --at-room: calc(var(--at-view) - var(--fs-h2) * var(--lh-heading) - var(--at-gap) - var(--s-4) - var(--s-6));
  --at-over: calc(var(--fs-label) * var(--lh-label) + var(--s-2));      
  --at-type: max(var(--at-least), min(var(--at-col) / var(--at-set), var(--fs-h3), (var(--at-room) / var(--at-n) - var(--at-over) - 2 * var(--s-4)) / (2 * var(--lh-heading))));
  --at-line: calc(var(--at-type) * var(--lh-heading));                  
  --at-air: clamp(var(--s-4), (var(--at-room) / var(--at-n) - var(--at-over) - 2 * var(--at-line)) / 2, var(--s-5));
  --at-row: calc(2 * var(--at-air) + var(--at-over) + 2 * var(--at-line));
  --at-quiet: color-mix(in srgb, var(--fg) var(--at-back), var(--bg));      
  padding-block: var(--section-y);
}


.at__in { container-type: inline-size; display: grid; grid-template: "head go" "list list" / minmax(0, 1fr) auto; align-items: center; gap: var(--at-gap) var(--s-5); }
.at__head { grid-area: head; margin-left: calc(var(--at-in) * -1); font-size: min(var(--fs-h2), var(--at-c) / var(--at-head)); }
.at__go { grid-area: go; }
.at__list { grid-area: list; }


.at__link { --hot: 0; --low: calc(var(--at-hand) * (1 - var(--lit))); --at-cut: inset(0 calc(var(--at-r, 0) * 100%) 0 calc(var(--at-l, 0) * 100%)); display: block; color: var(--fg); text-decoration: none; outline: 0; }
.at__pic img { object-position: var(--at-x, 50%) 50%; }
.at__date { display: block; color: color-mix(in srgb, var(--at-quiet) calc(var(--low) * 100%), var(--fg-2)); font-variant-numeric: tabular-nums; transition: color var(--dur-hover) var(--ease); }
.at__title { font-size: var(--at-type); color: color-mix(in srgb, var(--at-quiet) calc(var(--low) * 100%), var(--fg)); transition: color var(--dur-hover) var(--ease); }
.at__words::before, .at__words::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; }
.at__words::before { height: var(--hair); background: var(--line); transform-origin: 0 50%; }
.at__words::after { height: var(--rule); background: var(--accent); clip-path: var(--at-cut); }



.at__link:is(:focus-visible, :active) { --hot: 1; }
.at:has(.at__link:is(:focus-visible, :active)) { --at-hand: 1; }
@media (hover: hover) and (pointer: fine) {
  .at__link:hover { --hot: 1; }
  .at:has(.at__link:hover) { --at-hand: 1; }
}


@media (min-width: 1000px) {
  
  .at__list { position: relative; display: grid; grid-auto-rows: 1fr; min-height: calc(var(--at-n) * var(--at-row)); padding-right: calc(var(--at-wide) + var(--gap)); }
  .at__list::before { content: ""; position: absolute; left: 0; right: calc(var(--at-wide) + var(--gap)); top: 0; height: var(--hair); background: var(--line); transform-origin: 0 50%; }
  
  .at__row {
    --d: clamp(-1, var(--at-k) - var(--i), 1);
    --lit: calc(1 - max(var(--d), -1 * var(--d)));
    --at-l: max(0, var(--d)); --at-r: max(0, -1 * var(--d));
    display: grid; transition: --at-l var(--dur-change) var(--ease), --at-r var(--dur-change) var(--ease);
  }
  
  .at__link { display: grid; scroll-margin-block: calc((var(--i) - 1) * var(--at-row) + var(--fs-h2) * var(--lh-heading) + var(--at-gap) + var(--s-4)) calc((var(--at-n) - var(--i)) * var(--at-row) + var(--s-6)); }
  .at__words { position: relative; display: grid; align-content: start; row-gap: var(--s-2); padding-block: var(--at-air); }
  .at__link:focus-visible .at__words { outline: var(--rule) solid var(--focus); outline-offset: var(--s-1); }
  
  .at__pic { position: absolute; inset: 0 0 0 auto; width: var(--at-wide); aspect-ratio: auto; background: none; pointer-events: none; }
  .at__row:first-child .at__pic { background: var(--bg-2); }
  .at__pic img { -webkit-mask: var(--stroke) 0 0 / calc((1 - var(--at-r, 0)) * 100%) 100% no-repeat; mask: var(--stroke) 0 0 / calc((1 - var(--at-r, 0)) * 100%) 100% no-repeat; }
  .at__link::before { content: ""; position: absolute; inset: 0 0 0 auto; width: calc(var(--lit) * var(--at-wide)); }

  
  @media (hover: hover) and (pointer: fine) {
    .at:not(.is-live):has(.at__row:nth-child(2) .at__link:hover) { --at-k: 2; }
    .at:not(.is-live):has(.at__row:nth-child(3) .at__link:hover) { --at-k: 3; }
    .at:not(.is-live):has(.at__row:nth-child(4) .at__link:hover) { --at-k: 4; }
  }
  .at:not(.is-live):has(.at__row:nth-child(1) .at__link:is(:focus-visible, :active)) { --at-k: 1; }
  .at:not(.is-live):has(.at__row:nth-child(2) .at__link:is(:focus-visible, :active)) { --at-k: 2; }
  .at:not(.is-live):has(.at__row:nth-child(3) .at__link:is(:focus-visible, :active)) { --at-k: 3; }
  .at:not(.is-live):has(.at__row:nth-child(4) .at__link:is(:focus-visible, :active)) { --at-k: 4; }
}


@media (min-width: 1000px) and (max-height: 720px) {
  .at { --at-gap: var(--s-5); scroll-margin-top: calc(var(--s-4) - var(--section-y)); }
}


@media (max-width: 999px) {
  .at { --at-gap: var(--s-6); }
  
  .at__in { grid-template: "head" "list" "go" / minmax(0, 1fr); reading-flow: grid-rows; }
  .at__go { justify-self: start; }
  
  .at__link { --lit: var(--hot); --at-l: 0; --at-r: calc(1 - var(--hot)); position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--at-small); column-gap: var(--gap); align-items: start; padding-block: var(--s-5); transition: --at-r var(--dur-change) var(--ease); }
  .at__link:active { transition-duration: var(--dur-press); }
  .at__link:focus-visible { outline: var(--rule) solid var(--focus); outline-offset: var(--s-1); }
  .at__pic { grid-area: 1 / 2; aspect-ratio: var(--at-shape); }
  .at__words { grid-area: 1 / 1; display: grid; row-gap: var(--s-2); }
  .at__title { font-size: clamp(var(--fs-body), var(--at-text) / var(--at-held), var(--fs-lead)); }
  
  .at__row:first-child .at__link { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-4); padding-top: 0; }
  .at__row:first-child .at__pic { grid-area: 1 / 1; aspect-ratio: auto; height: clamp(var(--at-c) / var(--at-flat), var(--at-share), var(--at-c) / var(--at-shape)); }
  .at__row:first-child .at__words { grid-area: 2 / 1; }
  .at__row:first-child .at__title { font-size: var(--fs-h3); }
}

@media (max-width: 540px) {
  .at__row:not(:first-child) .at__pic { aspect-ratio: var(--at-upright); }
  .at__go { justify-self: stretch; --flood: 80; }
}


@media (prefers-reduced-motion: no-preference) {
  .at__list.is-wait :is(.at__pic, .at__date, .at__title) { opacity: 0; }
  .at__list.is-wait::before, .at__list.is-wait .at__words::before { transform: scaleX(0); }
  .at__list.is-wait .at__words::after { clip-path: inset(0 100% 0 0); }
  .at__list.is-in .at__pic { animation: at-open var(--dur-enter) var(--ease) calc((var(--i) - 1) * var(--stagger)) backwards; }
  .at__list.is-in::before { animation: at-rule var(--dur-enter) var(--ease) backwards; }
  .at__list.is-in .at__words::before { animation: at-rule var(--dur-enter) var(--ease) calc((var(--i) - 1) * var(--stagger)) backwards; }
  .at__list.is-in .at__words::after { animation: at-draw var(--dur-enter) var(--ease) calc((var(--i) - 1) * var(--stagger)) backwards; }
  .at__list.is-in :is(.at__date, .at__title) { animation: at-show var(--dur-enter) var(--ease) calc(var(--i) * var(--stagger)) backwards; }
}
@keyframes at-open { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes at-draw { from { clip-path: inset(0 100% 0 0); } }
@keyframes at-rule { from { transform: scaleX(0); } }
@keyframes at-show { from { opacity: 0; } }
