/* Homepage "Made with Stickman Studio": 16:9 films as cards that stack on scroll.
   Each card pins under the nav; the next one slides up over it while the one beneath eases back.
   Left of every film: the script that was pasted to make it, so the card reads script -> film. */
.fstack-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; margin-bottom: 36px; }
.fstack-head h2 { margin: 10px 0 10px; font-size: clamp(28px, 3.6vw, 44px); line-height: 1.08; letter-spacing: -0.02em; color: var(--ink); max-width: 18ch; }
.fstack-head p { margin: 0; color: var(--ink-2); max-width: 58ch; line-height: 1.6; }
.fstack-count { text-decoration: none; font-weight: 600; font-family: var(--font-mono); font-size: 12px; color: var(--aqua); white-space: nowrap; }

/* a pinned card must fit the window: cap the stack so a 16:9 film plus the script column is never
   taller than the space under the nav (otherwise the next card covers the first one's controls) */
.fstack { position: relative; max-width: calc((100vh - 150px) * 16 / 9 + 300px); margin: 0 auto; }
@supports (height: 100svh) { .fstack { max-width: calc((100svh - 150px) * 16 / 9 + 300px); } }
.fcard {
  position: sticky; top: calc(88px + var(--i, 0) * 14px);
  display: grid; grid-template-columns: clamp(240px, 26%, 300px) minmax(0, 1fr); gap: 0;
  background: var(--sidebar); color: #e8f1ec;
  border-radius: 26px; overflow: hidden; margin-bottom: 64px;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.06) inset, 0 40px 80px -40px rgba(14, 36, 27, 0.55);
  transform-origin: 50% 0; will-change: transform;
  transition: filter 0.3s ease;
}
.fcard:last-child { margin-bottom: 0; }

/* left: the pasted script */
/* height 0 + min-height 100%: the 16:9 film sets the row height and the script column fits inside it
   (the pasted text shrinks and fades), so there is never dead space under the video */
.fcard-script { display: flex; flex-direction: column; gap: 12px; padding: 22px 22px; border-right: 1px solid rgba(255, 255, 255, 0.08); min-width: 0; height: 0; min-height: 100%; box-sizing: border-box; overflow: hidden; }
.fcard-script > * { flex: none; }
.fcard-script > .fcard-paste { flex: 1 1 auto; min-height: 48px; }
.fcard-tag { align-self: flex-start; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sidebar); background: var(--mint); padding: 5px 10px; border-radius: 999px; }
.fcard-title { margin: 0; font-size: 21px; line-height: 1.2; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.fcard-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sidebar-muted); }
.fcard-paste {
  position: relative; margin: 0; padding: 14px 14px 30px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.05); border: 1px dashed rgba(255, 255, 255, 0.16);
  font-size: 13px; line-height: 1.6; color: #cfe0d7; flex: 1; overflow: hidden;
}
.fcard-paste::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(transparent, #13301f); border-radius: 0 0 14px 14px; }
.fcard-specs { display: flex; flex-wrap: wrap; gap: 6px; }
.fcard-specs span { font-family: var(--font-mono); font-size: 11px; color: #cfe0d7; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); }

/* right: the film */
.fcard-film { position: relative; aspect-ratio: 16 / 9; background: #0a1a13; min-width: 0; }
.fcard-film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #0a1a13; cursor: pointer; }
.fcard-play {
  position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.94); color: var(--sidebar);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.fcard-play:hover { transform: scale(1.06); }
.fcard.playing .fcard-play { opacity: 0; pointer-events: none; }
.fcard-ctl {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px;
  padding: 26px 16px 12px; background: linear-gradient(transparent, rgba(5, 14, 10, 0.72));
  opacity: 0; transition: opacity 0.2s ease;
}
.fcard-film:hover .fcard-ctl, .fcard-film:focus-within .fcard-ctl, .fcard:not(.playing) .fcard-ctl { opacity: 1; }
.fcard-ctl button { flex: none; width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.fcard-ctl button:hover { background: rgba(255, 255, 255, 0.24); }
.fcard-bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); overflow: hidden; cursor: pointer; }
.fcard-bar i { display: block; height: 100%; width: 0; background: var(--mint); }
.fcard-time { font-family: var(--font-mono); font-size: 11.5px; color: #e8f1ec; min-width: 76px; text-align: right; }
.fcard :focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

.fstack-foot { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.fstack-foot p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; max-width: 70ch; }
.fstack-foot b { color: var(--ink); }

@media (max-width: 900px) {
  .fstack { max-width: max(320px, calc((100svh - 330px) * 16 / 9)); }
  .fstack-head { grid-template-columns: 1fr; }
  .fcard { grid-template-columns: 1fr; top: calc(76px + var(--i, 0) * 10px); border-radius: 20px; margin-bottom: 40px; }
  .fcard-film { order: -1; }
  .fcard-script { border-right: 0; border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 18px; gap: 10px; height: auto; min-height: 0; }
  .fcard-paste { max-height: 96px; font-size: 12.5px; }
  .fcard-play { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
}
@media (max-width: 560px) {
  /* phones: a plain list; pinned cards would cover the whole screen */
  .fcard { position: relative; top: auto; }
  .fcard-paste { display: none; }
  .fcard-script .fcard-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fcard { position: relative; top: auto; transform: none !important; filter: none !important; }
}
.fcard-recipe { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--mint); text-decoration: none; border-bottom: 1px solid rgba(199, 234, 214, 0.4); padding-bottom: 2px; }
.fcard-recipe:hover { color: #fff; border-color: #fff; }
@media (max-width: 560px) { .fstack { max-width: none; } }
