/* The card, live: the feed on / and the card on /c/<id>. Ported from the approved mock-up
   (public/mock/swipe.css, modes 7 and 8). Loaded only by index.html and card.html, after
   site.css and cards.css, so it also undoes what those leak (the bar, .sheet, .home, h1). */
:root { --tone: #ff7a59; --side: 0; }

/* The glow rises from the bottom edge only while a card is swiped, leaning to the side it's swiped to. */
.rise { position: fixed; left: 0; right: 0; bottom: 0; height: 62vh; z-index: 30; pointer-events: none; mix-blend-mode: screen;
  opacity: var(--pull); transform-origin: 50% 100%; transform: scaleY(calc(.3 + .7 * var(--pull)));
  background: radial-gradient(120% 100% at calc(50% + 50% * var(--side)) 100%, var(--tone) 0%, color-mix(in srgb, var(--tone) 50%, transparent) 30%, transparent 72%); }
.rise::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #fff; box-shadow: 0 0 26px 8px var(--tone); }
.rise.go { transition: transform .34s cubic-bezier(.3,.7,.3,1), opacity .2s; transform: scaleY(2.2); opacity: 1; }
.rise.ebb { transition: opacity .5s ease, transform .5s ease; }
body.feedpage .shade { box-shadow: none; background: rgba(8,8,10,.46); }

/* The top row: the ¢ top and centre (as X does its logo), Check a claim on the left, the account on the right.
   common.js renders the bar; cards.css makes it relative/sticky, so it is pinned here. */
body.feedpage .bar { position: fixed; top: 0; left: 0; right: 0; z-index: 9; height: calc(env(safe-area-inset-top) + 52px);
  padding: env(safe-area-inset-top) 16px 0; background: none; }
body.feedpage .bar .logo { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 2px); transform: translateX(-50%);
  font: 400 2.75rem/1 "Source Serif 4", Georgia, serif; color: #fff; padding: 4px 14px; }
body.feedpage .bar .where { flex: 1; }
/* The pinned bar is click-through: only what's in it takes taps (on a phone it holds just the ¢, over the mast row). */
body.feedpage .bar { pointer-events: none; }
body.feedpage .bar > *, body.feedpage .bar .where a { pointer-events: auto; }
body.feedpage .bar .where { pointer-events: none; }
body.feedpage .bar .where a { color: #fff; font: 600 .875rem/1 var(--ui); text-decoration: underline; text-decoration-color: rgba(255,255,255,.5); text-decoration-thickness: 1.5px; text-underline-offset: 4px; padding: 10px 0; }
@media (max-width: 480px) { .mastrow .acct > span, .mastrow .acct .bell { display: none; } }

#screen.feed { position: relative; z-index: 2; height: 100vh; height: 100dvh; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  touch-action: pan-y; scrollbar-width: none; scroll-snap-type: y mandatory; }
#screen.feed::-webkit-scrollbar { display: none; }
body.cardpage #screen.feed { scroll-snap-type: y proximity; }
.mast { padding: calc(env(safe-area-inset-top) + 62px) 20px 0; text-align: center; }
/* Phone: Check a claim and the account sit in the mast either side of where the ¢ is, and scroll away with the line
   (feed.js moves them here below 900 px), so the pinned top row is the ¢ alone and never sits on a card. */
.mastrow { position: absolute; top: env(safe-area-inset-top); left: 16px; right: 16px; height: 52px; display: flex; align-items: center; gap: .7rem;
  font: 600 .8125rem/1 var(--ui); color: rgba(255,255,255,.7); white-space: nowrap; }
/* The top of the page is a snap point of its own, so a short feed opens at the top, not on the end. */
.mast { position: relative; scroll-snap-align: start; }
.mastrow .where { flex: 1; min-width: 0; text-align: left; } /* the mast centres its text; the link sits at the left edge */
.mastrow .where a { color: #fff; font: 600 .875rem/1 var(--ui); text-decoration: underline; text-decoration-color: rgba(255,255,255,.5); text-decoration-thickness: 1.5px; text-underline-offset: 4px; padding: 10px 0; }
.mastrow .acct { display: inline-flex; gap: .7rem; align-items: baseline; }
.mastrow .acct button.link { font: inherit; color: rgba(255,255,255,.7); text-decoration: none; }
.mastrow .acct .me { color: #fff; }
.mastrow:empty { display: none; }
body.feedpage .catch { margin: 0; padding: 4px 0; color: #fff; font: 600 1.5rem/1.15 "Source Serif 4", Georgia, serif; letter-spacing: -.02em; text-wrap: balance; }
body.desk .catch { font-size: 1.875rem; }

/* The cards: one in the middle, the next showing below it. */
.item { display: flex; flex-direction: column; align-items: center; padding: 16px 14px 22px; }
section.item:last-of-type { padding-bottom: 34dvh; }
.item .fit { width: min(100%, 27rem, (100dvh - 230px) * 1008 / 1278); scroll-snap-align: center; opacity: .45; transition: opacity .3s; }
.item.now .fit { opacity: 1; }
body.desk .item .fit { width: min(29rem, (100dvh - 150px) * 1008 / 1278); scroll-snap-stop: always; }
.item .behind { width: min(100%, 27rem); scroll-snap-align: start; scroll-margin-top: calc(env(safe-area-inset-top) + 150px); padding: 0 6px 30px; }
.face { display: block; width: min(100cqw, 100cqh * 1008 / 1278); height: auto; aspect-ratio: 1008 / 1278; border-radius: 7.54% / 5.95%; box-shadow: 0 24px 60px rgba(0,0,0,.4); -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.slab { position: relative; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
body.desk .slab { cursor: pointer; }
.slab.settle { transition: transform .42s var(--spring); }
.slab .face { width: 100%; transition: filter .25s; }
/* The two ratings on the card's footer are buttons laid over the drawn columns. */
/* Each button's box comes from cardimg.js (faceArt().boxes.columns), set in feed.js. */
.hits { position: absolute; inset: 0; pointer-events: none; }
.hits button { position: absolute; pointer-events: auto; appearance: none; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 12px; }
.hits button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.voting { position: absolute; left: 0; right: 0; top: 30%; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s; font: 600 5.5rem/1 "Source Serif 4", Georgia, serif; letter-spacing: -.03em; color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.45); }
/* Each card's way to its own page: top right, level with the drawn ¢. */
.view { position: absolute; top: 8.6%; right: 7.9%; color: #fff; font: 600 .875rem/1 var(--ui); text-decoration: underline; text-decoration-color: rgba(255,255,255,.5); text-decoration-thickness: 1.5px; text-underline-offset: 4px; padding: 10px 0 10px 10px; }
.view:active { opacity: .6; }
.view.low { position: static; align-self: center; padding: 10px; font-size: 1rem; }
/* The source line's drawn underline carries a real link; its box is faceArt().boxes.source, padded here for a finger. */
.from { position: absolute; border-radius: 6px; }
.from:not(.inline)::after { content: ""; position: absolute; inset: -10px -8px; }
.from:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.from.inline { display: inline; position: static; height: auto; color: #fff; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255,255,255,.5); text-underline-offset: 3px; }

/* The question under the card, with its two answers at the edges where the thumbs are. */
.ask { display: grid; grid-template-columns: auto 1fr auto; align-items: center; margin-top: 6px; }
.ask[hidden] { display: none; }
.ask span { text-align: center; font: 600 .9375rem/1.25 var(--ui); color: rgba(255,255,255,.78); font-variant-numeric: tabular-nums; }
.ask button { appearance: none; background: none; border: 0; cursor: pointer; color: #fff; font: 600 1.375rem/1 "Source Serif 4", Georgia, serif; letter-spacing: -.01em; min-width: 76px; height: 52px; padding: 0 10px; text-align: left; }
.ask button:last-child { text-align: right; }
.ask button:active { opacity: .6; }
.ask button:disabled { visibility: hidden; }
.ask button.on { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.ask button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; border-radius: 10px; }
.item:not(.now) .ask { visibility: hidden; }

/* What's behind a rating, under the card on a phone and in the lightbox on a desktop. */
.full { display: flex; flex-direction: column; gap: 10px; }
.full h2 { font: 600 1.75rem/1.05 "Source Serif 4", Georgia, serif; letter-spacing: -.02em; margin: 0; display: flex; align-items: center; gap: 12px; }
.full h2 img { width: 44px; height: 44px; flex: none; }
.full .word { font: 700 1.0625rem/1.6 var(--ui); margin: 0; color: #fff; }
.full .word mark { background: var(--glow); color: #0c0c0e; padding: .1em .4em .14em; border-radius: 5px; margin-right: .4em; }
.full .src { list-style: none; margin: 0; padding: 0; }
.full .src li { border-top: 1px solid rgba(255,255,255,.16); padding: 10px 0; }
.full .src a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); text-underline-offset: 3px; }
.full .src b { font-weight: 700; }
.full .src em { font-style: normal; font-size: .8125rem; font-weight: 600; color: #ffb4a2; margin-left: .5em; }
.full .src em.y { color: #9df0c8; }
.full .src p { margin: 2px 0 0; font-size: .9375rem; color: rgba(255,255,255,.82); }
.full .bar3 { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: rgba(255,255,255,.14); }
.full .bar3 i { transition: flex-grow .5s var(--spring); }
.full .bar3 .y { background: #3ddc97; } .full .bar3 .n { background: #ff7a59; }
.full .counts { display: flex; justify-content: space-between; margin: 0; font-size: .875rem; color: rgba(255,255,255,.78); font-variant-numeric: tabular-nums; }
.full .dis { margin: 4px 0 0; padding: 0 0 0 14px; border-left: 3px solid #ff7a59; }
.full .dis.y { border-left-color: #3ddc97; }
.full .dis small { display: block; font: 600 .8125rem/1.2 var(--ui); color: rgba(255,255,255,.7); margin-bottom: 4px; }
.full .dis p { margin: 0; font: 400 1.0625rem/1.4 "Source Serif 4", Georgia, serif; color: #fff; }
.full .why { margin: 0; font-size: .9375rem; color: rgba(255,255,255,.75); }
.full .why a { color: #fff; font-weight: 600; text-underline-offset: 3px; }
.full.behind { flex: none; margin-top: 16px; animation: behind .34s var(--spring); }
.full.behind[hidden] { display: none; }
@keyframes behind { from { opacity: 0; transform: translateY(-8px); } }

/* "Vote first", for a beat, in the middle of the screen. */
.said { position: fixed; z-index: 40; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; animation: said 1.6s ease both; width: max-content; max-width: calc(100vw - 32px); }
.said b { display: block; font: 600 2.5rem/1.05 "Source Serif 4", Georgia, serif; letter-spacing: -.02em; color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.45); }
.said span { font: 600 1rem/1.3 var(--ui); color: rgba(255,255,255,.85); }
@keyframes said { 0% { opacity: 0; transform: translate(-50%, -30%); } 18%, 75% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; } }

/* A card opened. On a phone: the card large, swipe up to share. */
.lightbox { position: fixed; inset: 0; z-index: 20; touch-action: none; background: rgba(8,8,10,.82); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  display: flex; flex-direction: column; gap: 14px; padding: calc(env(safe-area-inset-top) + 56px) 16px calc(env(safe-area-inset-bottom) + 16px); animation: lb .22s ease; }
.lightbox .c { flex: 1 1 0; min-height: 120px; display: grid; place-items: center; container-type: size; }
.lightbox .face.settle { transition: transform .42s var(--spring); }
.shut { position: absolute; top: calc(env(safe-area-inset-top) + 6px); left: 8px; appearance: none; border: 0; background: none; color: #fff; font: 600 1.0625rem/1 var(--ui); height: 48px; padding: 0 12px; cursor: pointer; }
.shut:active { opacity: .6; }
.lightbox .hint { appearance: none; background: none; border: 0; color: #fff; cursor: grab; flex: none; padding: 2px 0 0; width: 100%;
  display: flex; flex-direction: column; align-items: center; font: 600 1.0625rem/1.2 var(--ui); letter-spacing: -.01em; }
.lightbox .hint svg { width: 28px; height: 28px; animation: bob 1.5s ease-in-out infinite; }
@keyframes lb { from { opacity: 0; } }

/* On a desktop: the card on the left; on the right a fixed top row, the ratings scrolling, the vote fixed at the bottom. */
.lightbox.wide { touch-action: auto; align-items: center; justify-content: center; padding: 28px; }
.wide .pane { display: flex; align-items: stretch; height: min(100dvh - 56px, 54rem); max-width: 100%; }
.wide .pane > .face { height: 100%; width: auto; flex: none; border-radius: 22px 0 0 22px; box-shadow: none; }
.detail { width: 27rem; min-width: 0; background: #141416; border-radius: 0 22px 22px 0; display: flex; flex-direction: column; overflow: hidden; }
.detail .lbar { display: flex; align-items: center; gap: 4px; padding: 6px 10px 6px 24px; border-bottom: 1px solid rgba(255,255,255,.14); }
.detail .view, .detail .shut, .detail .share { position: static; padding: 0 12px; height: 44px; display: flex; align-items: center; font: 600 .9375rem/1 var(--ui); color: #fff; }
.detail .view { padding-left: 0; margin-right: auto; }
.detail .share { appearance: none; background: none; border: 0; cursor: pointer; color: rgba(255,255,255,.8); }
.detail .reel { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; padding: 22px 24px 28px; display: flex; flex-direction: column; gap: 30px; }
.detail .ask { margin: 0; padding: 4px 14px; border-top: 1px solid rgba(255,255,255,.14); }
.detail .full.behind { animation: none; margin: 0; padding: 0; width: auto; gap: 12px; scroll-margin-top: 20px; }
.detail .full h2 { font-size: 1.375rem; gap: 10px; } .detail .full h2 img { width: 40px; height: 40px; }
.detail .full .word { font-size: .9375rem; line-height: 1.5; }
.detail .src li { padding: 12px 0; } .detail .src li:last-child { padding-bottom: 0; }
.detail .src p { margin-top: 3px; line-height: 1.4; }
.detail .dis p { font-size: 1rem; }
.detail .claimed, .detail .wait { margin: 0; font: 500 .9375rem/1.45 var(--ui); color: rgba(255,255,255,.75); }
.detail .wait { font: 600 1.375rem/1.3 "Source Serif 4", Georgia, serif; color: #fff; }
.detail .claimed { margin-bottom: -12px; }

/* The end of the feed, and the card page's discussion. */
/* Its own snap point once the cards are in (feed.js sets .ready), so the end and the footer can be reached;
   before that it would be the only snap point and the page would open on it. */
#screen.ready .feedend { scroll-snap-align: end; }
.feedend { text-align: center; padding: 8px 20px calc(env(safe-area-inset-bottom) + 24px); color: rgba(255,255,255,.7); font-size: .9375rem; }
.feedend p { margin: 0 0 1rem; }
.feedend a { color: #fff; font-weight: 600; }
.feedend .idiom-foot { padding: 1.5rem 0 0; }
body.cardpage .talkwrap { position: relative; max-width: 27rem; margin: 0 auto; padding: 0 20px 40px; }
body.cardpage .talkwrap h2 { font: 600 1.75rem/1.05 "Source Serif 4", Georgia, serif; letter-spacing: -.02em; margin: 0 0 .9rem; }
body.cardpage .talkwrap h2 small { font: 500 .9375rem/1 var(--ui); color: rgba(255,255,255,.6); margin-left: .35rem; }
body.cardpage .talkwrap .more { display: block; margin-top: 2rem; color: #fff; font-weight: 600; text-underline-offset: 4px; }

@media (prefers-reduced-motion: reduce) { .full.behind, .lightbox, .said, .lightbox .hint svg { animation: none; } }
