/* Found Letters · the font sheet (font-sheet.js).
   A hero font tile opens its font page as a sheet from the bottom of the
   window, the way an iPhone presents a page sheet: the landing page behind
   shrinks back a little ("indent"), with rounded corners and black round it,
   and dims. The sheet holds the font page in an iframe; inside it the page
   runs in sheet mode (html.font-sheet-mode, bottom of this file). */

/* ---------- the landing page ---------- */
.font-sheet{
 --fs-top:40px;--fs-radius:28px;--fs-page-radius:14px;--fs-scale:.94;--fs-ox:50vw;--fs-oy:50vh;
 position:fixed;inset:0;z-index:2147483000;overflow:hidden;
 visibility:hidden;pointer-events:none;
 -webkit-tap-highlight-color:transparent;
}
.font-sheet.is-shown{visibility:visible;pointer-events:auto}
/* While the sheet is up the page keeps its scroll position but can't scroll.
   The space a scrollbar leaves is kept (no reflow) and painted black like the
   rest of the surround; the body still paints the page's own white. */
html.fs-lock{overflow:hidden!important;scrollbar-gutter:stable;overscroll-behavior:none;background:#000}

/* The frame drawn over the shrunken page: transparent dim inside a rounded
   rectangle, black outside it. It is the window's size and scales about the
   same point as the page, so its edges stay on the page's edges. */
.fs-frame{
 position:absolute;inset:0;
 border-radius:calc(var(--fs-page-radius) / var(--fs-scale));
 background:rgb(0 0 0 / .24);box-shadow:0 0 0 100vmax #000;
 transform-origin:var(--fs-ox) var(--fs-oy);
 opacity:0;pointer-events:none;
}
.font-sheet.is-reduced .fs-frame{border-radius:0;box-shadow:none;background:rgb(0 0 0 / .32)}

.fs-panel{
 position:absolute;left:0;right:0;top:var(--fs-top);bottom:0;
 width:100%;margin:0;
 border-radius:var(--fs-radius) var(--fs-radius) 0 0;
 background:#fff;overflow:hidden;isolation:isolate;
 box-shadow:0 -1px 0 rgb(0 0 0 / .04),0 -10px 44px rgb(0 0 0 / .14);
 transform:translateY(calc(100% + 60px));
}
.fs-panel iframe{position:absolute;inset:0;display:block;width:100%;height:100%;border:0;background:#fff;color-scheme:light}

/* The grabber: drag it (or the strip it sits in) down to put the sheet away. */
.fs-handle{
 position:absolute;z-index:2;top:0;left:0;right:0;height:26px;
 display:flex;justify-content:center;padding-top:9px;box-sizing:border-box;
 touch-action:none;cursor:grab;
}
.fs-handle:active{cursor:grabbing}
.fs-handle span{display:block;width:38px;height:5px;border-radius:5px;background:#d1d1d6}

.fs-close{
 position:absolute;z-index:3;top:18px;right:20px;
 display:grid;place-items:center;width:36px;height:36px;padding:0;margin:0;
 border:0;border-radius:50%;background:#efeff1;color:#3a3a3c;cursor:pointer;
 transition:background-color .15s ease,transform .15s ease;
}
.fs-close:hover{background:#e5e5e8}
.fs-close:active{transform:scale(.94)}
.fs-close:focus{outline:none}
.fs-close:focus-visible{outline:2px solid #171717;outline-offset:2px}
.fs-close svg{display:block}

/* A light stand-in for the font page until it is ready: plain white at
   first (the page is usually ready within the slide), then soft placeholder
   blocks if it is taking a moment. */
.fs-loading{position:absolute;z-index:1;inset:0;background:#fff;transition:opacity .2s ease}
.fs-loading[hidden]{display:none}
.fs-loading.is-done{opacity:0;pointer-events:none}
.fs-sk{
 height:100%;padding:72px max(24px,calc((100% - 1312px) / 2)) 0;box-sizing:border-box;
 display:flex;flex-direction:column;gap:30px;
 opacity:0;animation:fs-in .3s ease .35s forwards;
}
.fs-sk i{display:block;border-radius:20px;background:#f3f3f5;animation:fs-pulse 1.4s ease-in-out .65s infinite}
.fs-sk .fs-sk-title{width:min(280px,60%);height:46px;border-radius:12px}
.fs-sk .fs-sk-surface{height:min(560px,58vh);animation-delay:.8s}
@keyframes fs-in{to{opacity:1}}
@keyframes fs-pulse{50%{opacity:.55}}

@media (max-width:700px){
 .font-sheet{--fs-top:18px;--fs-radius:24px;--fs-page-radius:12px}
 .fs-close{top:14px;right:14px;width:34px;height:34px}
 .fs-sk{padding:64px 16px 0;gap:22px}
 .fs-sk .fs-sk-title{height:34px}
 .fs-sk .fs-sk-surface{height:min(420px,52vh);border-radius:24px}
}
@media (prefers-reduced-motion:reduce){
 .fs-sk i{animation:none}
 .fs-close{transition:none}
}

/* ---------- the font page inside the sheet ---------- */
/* The sheet has its own close button and grabber, so the page leaves out the
   site's header, footer and the rest of the landing page. */
html.font-sheet-mode{overscroll-behavior:contain;scroll-padding-top:0;background:#fff}
html.font-sheet-mode body>header,
html.font-sheet-mode .page-foot,
html.font-sheet-mode .hero-examples,
html.font-sheet-mode #landingIntro,
html.font-sheet-mode #landingContent,
html.font-sheet-mode .overline,
html.font-sheet-mode .under-note,
html.font-sheet-mode .example-cursor{display:none!important}
/* Nothing shows until the font is open: the sheet covers this with its own
   loading state. */
html.font-sheet-mode body:not(.result-mode) main{visibility:hidden}
html.font-sheet-mode body.result-mode main{margin-top:56px}
@media (max-width:700px){
 html.font-sheet-mode body.result-mode main{margin-top:52px}
}
