/* exp-lite.css: the light touch for long-form pages (landing pages, Field Notes, WorkSuite). Decoration only: nothing here hides or moves text.
   The one thing that runs without JavaScript is the headline's focus-pull, a plain CSS animation that ends exactly where the page already is.
   Tokens are the site's own (--cream, --hairline); --exp-bronze is the home page globe's inner-mesh colour. */

/* ---- fonts: a fallback sized like each web font, so the text wraps the same before and after the web font arrives. The page swaps its fonts in about a second after the first paint; the text used to
   re-wrap and the page jumped (refund-policy 0.2 at tablet width, the Work suite page 0.14). The numbers are measured in a browser: size-adjust = the web font's width over the fallback's on the site's own text;
   ascent and descent = the web font's divided by size-adjust. The site's own stacks (--serif, --sans, --mono) are repeated with the fallback slotted in after the web font. ---- */
@font-face { font-family: "Instrument Serif Fallback"; src: local("Times New Roman"), local("TimesNewRomanPSMT"); size-adjust: 82.75%; ascent-override: 119.64%; descent-override: 37.46%; line-gap-override: 0%; }
@font-face { font-family: "Instrument Serif Fallback"; font-style: italic; src: local("Times New Roman Italic"), local("TimesNewRomanPS-ItalicMT"); size-adjust: 87.61%; ascent-override: 113%; descent-override: 35.38%; line-gap-override: 0%; }
@font-face { font-family: "Inter Fallback"; font-weight: 300; src: local("Arial"), local("ArialMT"); size-adjust: 104.77%; ascent-override: 92.46%; descent-override: 23.02%; line-gap-override: 0%; }
@font-face { font-family: "Inter Fallback"; font-weight: 400; src: local("Arial"), local("ArialMT"); size-adjust: 106.68%; ascent-override: 90.81%; descent-override: 22.61%; line-gap-override: 0%; }
@font-face { font-family: "Inter Fallback"; font-weight: 500; src: local("Arial"), local("ArialMT"); size-adjust: 107.83%; ascent-override: 89.84%; descent-override: 22.37%; line-gap-override: 0%; }
@font-face { font-family: "Inter Fallback"; font-weight: 600 700; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 101.46%; ascent-override: 95.48%; descent-override: 23.77%; line-gap-override: 0%; }
@font-face { font-family: "Space Mono Fallback"; font-weight: 400; src: local("Courier New"), local("CourierNewPSMT"); size-adjust: 101.98%; ascent-override: 109.83%; descent-override: 35.3%; line-gap-override: 0%; }
@font-face { font-family: "Space Mono Fallback"; font-weight: 700; src: local("Courier New Bold"), local("CourierNewPS-BoldMT"); size-adjust: 101.98%; ascent-override: 109.83%; descent-override: 35.3%; line-gap-override: 0%; }
:root { --serif: "Instrument Serif", "Instrument Serif Fallback", "Times New Roman", serif; --sans: "Inter", "Inter Fallback", system-ui, sans-serif; --mono: "Space Mono", "Space Mono Fallback", "JetBrains Mono", monospace; }
/* the long-form pages also name Inter and Space Mono in inline styles of their own, outside the variables (the landing pages, the Field Notes posts, the Work suite page): the same selectors again with the fallback in
   front of the generic family; "html body" in front so that the order of the page's own style blocks does not matter */
html body, html body .article-body h3 { font-family: "Inter", "Inter Fallback", sans-serif; }
html body .crumbs ol, html body .article-hero .kicker, html body .article-meta, html body .swipe-hint, html body .checklist li::before { font-family: "Space Mono", "Space Mono Fallback", monospace; }
html body .ws-app, html body .ws-panel, html body .ws-phone-screen { font-family: "Inter", "Inter Fallback", system-ui, sans-serif; }
:root { --exp-bronze: #b86b3c; --exp-ease: cubic-bezier(.16, 1, .3, 1); }

/* the diagonal arrows (the site's up-right arrow character) are drawn, not typed: an iPhone swaps that character for a grey colour-emoji box whatever fonts the page asks for.
   The character stays in the page (for readers, and for anyone without this file), is pushed out of a clipped box, and a mask in the text colour is drawn in its place; size follows the font size as the glyph did.
   Only where masks work (the arrow would otherwise be a solid square), and the URL is written out in each declaration (no var(): a failed lookup would leave the same square). */
@supports ((-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.1'%3E%3Cpath d='M3 21 21 3M13 3h8v8'/%3E%3C/svg%3E")) or (mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.1'%3E%3Cpath d='M3 21 21 3M13 3h8v8'/%3E%3C/svg%3E"))) {
  .svc-arr, .ind-arr, .marr, .arr-d { display: inline-block; position: relative; width: 1em; height: 1em; overflow: hidden; text-indent: 100em; white-space: nowrap; }
  .svc-arr::before, .ind-arr::before, .marr::before, .arr-d::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.1'%3E%3Cpath d='M3 21 21 3M13 3h8v8'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.1'%3E%3Cpath d='M3 21 21 3M13 3h8v8'/%3E%3C/svg%3E") center / contain no-repeat; }
  .arr-d { vertical-align: -.12em; }
}

/* the headline pulls into focus once, on load */
@keyframes exp-fp { from { filter: blur(9px); opacity: .45; } to { filter: none; opacity: 1; } }
[data-exp] :is(.article-hero, .blog-hero-content, .blog-index-header) h1 { animation: exp-fp 1.3s .1s var(--exp-ease) backwards; }   /* backwards: nothing is left applied afterwards */

/* the reading line */
.exp-prog { position: fixed; left: 0; top: 0; width: 100%; height: 2px; z-index: 130; pointer-events: none; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--exp-bronze), var(--cream, #efeae0)); }

/* corner marks: the one motif */
.exp-corners { position: absolute; pointer-events: none; z-index: 3; --cs: 22px; }
.exp-corners i { position: absolute; width: var(--cs); height: var(--cs); border: 0 solid var(--cream, #efeae0); opacity: 0; transition: opacity .7s var(--exp-ease), transform 1.1s var(--exp-ease), border-color .5s; }
.exp-corners .tl { left: 0; top: 0; border-width: 1px 0 0 1px; transform: translate(-16px, -16px); }
.exp-corners .tr { right: 0; top: 0; border-width: 1px 1px 0 0; transform: translate(16px, -16px); }
.exp-corners .bl { left: 0; bottom: 0; border-width: 0 0 1px 1px; transform: translate(-16px, 16px); }
.exp-corners .br { right: 0; bottom: 0; border-width: 0 1px 1px 0; transform: translate(16px, 16px); }
.exp-corners.on i { opacity: .8; transform: none; }
.exp-corners.on.confirm i { animation: exp-confirm 1.3s .15s ease both; }
@keyframes exp-confirm { 0% { border-color: var(--cream, #efeae0); } 30% { border-color: var(--exp-bronze); } 100% { border-color: var(--cream, #efeae0); } }
.exp-hero-frame { --cs: 24px; }
.exp-box { inset: 10px; --cs: 14px; }

/* one soft light sweep across the headline */
.exp-leak { position: absolute; left: 0; width: 100%; z-index: 3; pointer-events: none; overflow: hidden; }
.exp-leak i { position: absolute; inset: 0; opacity: 0; transform: translateX(-70%) skewX(-14deg);
  background: linear-gradient(100deg, transparent 32%, rgba(255, 214, 170, .13) 50%, transparent 68%); }
.exp-leak.go i { animation: exp-leak 2.2s cubic-bezier(.3, .1, .2, 1) both; }
@keyframes exp-leak { 0% { opacity: 0; transform: translateX(-70%) skewX(-14deg); } 12% { opacity: 1; } 100% { opacity: 0; transform: translateX(70%) skewX(-14deg); } }

/* a hairline above each section heading draws as it arrives */
[data-exp] h2.exp-hr { position: relative; }
[data-exp] h2.exp-hr::before { content: ""; position: absolute; left: 0; top: -22px; width: 100%; height: 1px; background: var(--cream, #efeae0); opacity: .28; transform-origin: 0 50%; transition: transform 1.4s var(--exp-ease); }
[data-exp] h2.exp-hr.exp-pre:not(.exp-in)::before { transform: scaleX(0); }

/* cards: the one you point at comes forward */
@media (hover: hover) {
  [data-exp] .blog-index-card, [data-exp] .blog-related-card { transition: opacity .35s, background .2s; }
  [data-exp] .blog-index-list:has(.blog-index-card:hover) .blog-index-card:not(:hover), [data-exp] .blog-related-grid:has(.blog-related-card:hover) .blog-related-card:not(:hover) { opacity: .5; }
}

@media (prefers-reduced-motion: reduce) {
  [data-exp] :is(.article-hero, .blog-hero-content, .blog-index-header) h1 { animation: none; }
  .exp-corners i { transition: none !important; opacity: .8 !important; transform: none !important; animation: none !important; }
  [data-exp] h2.exp-hr::before { transition: none; transform: none !important; }
  .exp-leak { display: none !important; }
}
