/* punk-close.css — the close key, its question and its goodbye (punk-close.js; PUNK.md call 45).
   Every ink here is a token on a token's ground (the sheet's, the goodbye's veil of --ground), so the light turns both. */

/* the key beside the tab bar (index.html): the bar steps aside by the key's width and the two stand centred together,
   as iOS 26 sets a round key beside its tabs; the key goes with the bar when a sheet or the briefing sends it away */
@media (max-width: 959.98px) {
  html.has-close .tabbar { width: min(380px, calc(100% - 32px - var(--tabbar-h) - 10px)); left: calc(50% - (var(--tabbar-h) + 10px) / 2); }
}
.punk-close--float {
  position: fixed; z-index: 40; width: var(--tabbar-h); height: var(--tabbar-h); padding: 0;
  bottom: calc(max(var(--sab), 10px) + 6px);
  left: calc(50% - (var(--tabbar-h) + 10px) / 2 + min(380px, calc(100% - 32px - var(--tabbar-h) - 10px)) / 2 + 10px);
  transition: transform var(--t-slow) var(--spring), opacity var(--t) ease;
}
.punk-close--float.glass { background-color: var(--glass-strong-fill); --glass-blur: 36px; }
.punk-close--float.away { transform: translateY(140%); opacity: 0; pointer-events: none; }
.punk-close svg { width: 22px; height: 22px; display: block; margin: auto; }
.punk-close--float svg { width: 24px; height: 24px; }
html[data-intro="on"] .punk-close--float, html.vibe-open .punk-close--float, html.punk-bye-open .punk-close--float { visibility: hidden; }
/* a desk: the bar is a rail at the left (frap.css, 960–1099px), and the key stands under it at the foot of the screen */
@media (min-width: 960px) {
  .punk-close--float { width: 60px; height: 60px; left: calc(max(var(--sal), 22px) + 12px); bottom: 28px; }
  .punk-close--float.away { transform: translateX(-160%); }
}
/* a MacBook: the bar is a labelled sidebar (frap.css, from 1100px), and the key its last row, over the level at its foot
   (.side: frap.css draws it here alone) */
.side__close { font: inherit; border: 0; background: none; cursor: pointer; text-align: left; }
@media (min-width: 1100px) {
  .punk-close--float { display: none; }
  .side__close {
    margin-top: auto; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 14px;
    font-size: 15px; font-weight: 600; letter-spacing: -.005em; color: var(--ink-2); transition: background var(--t) ease, color var(--t) ease;
  }
  .side__close svg { width: 20px; height: 20px; flex: none; }
  .side__close:hover { background: rgba(var(--tint), .05); color: var(--ink); }
  .side__close + .side__foot { margin-top: 0; }
}
/* a story's header (read.html): the key as its neighbours */
#al-close svg { width: 20px; height: 20px; }

/* ── the question (a sheet) ─────────────────────────────────────────────────────────────────────────────── */
.punk-ask { text-align: center; padding-top: 6px; }
.punk-ask__eyebrow { margin: 0 0 8px; color: var(--ink-3); }
.punk-ask__n { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; outline: none; }
.punk-ask__n b { font-size: 64px; line-height: 1; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.punk-ask__n span { font-size: 17px; color: var(--ink-2); }
.punk-ask__say { margin: 14px auto 2px; max-width: 32ch; }
.punk-ask__foot { display: grid; gap: 8px; }

/* ── the goodbye: today's count and the five days to today; then the closed screen where the app cannot quit ── */
.punk-bye {
  position: fixed; inset: 0; z-index: 9995; display: grid; place-items: center; padding: 24px;
  padding-top: calc(var(--sat, 0px) + 24px); padding-bottom: calc(var(--sab, 0px) + 24px);
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(1.1); backdrop-filter: blur(24px) saturate(1.1);
  opacity: 0; transition: opacity .35s ease; cursor: default; -webkit-tap-highlight-color: transparent;
}
.punk-bye.on { opacity: 1; }
.punk-bye.off { opacity: 0; transition: opacity .45s ease; }
.punk-bye__in { width: min(380px, 100%); text-align: center; }
.punk-bye__eyebrow { margin: 0 0 6px; color: var(--ink-3); }
.punk-bye__n { margin: 0; }
.punk-bye__n b { display: block; font-size: clamp(76px, 24vw, 120px); line-height: .95; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.punk-bye__n span { display: block; margin-top: 4px; font-size: 18px; color: var(--ink-2); }
.punk-bye__bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; height: 168px; margin: 30px 0 16px; }
.punk-bye__col { display: grid; grid-template-rows: auto 1fr auto; gap: 6px; min-width: 0; }
.punk-bye__v { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .4s ease calc(.55s + var(--i) * .08s); }
.punk-bye.on .punk-bye__v { opacity: 1; }
.punk-bye__track { position: relative; }
.punk-bye__bar {
  position: absolute; left: 16%; right: 16%; bottom: 0; height: max(4px, calc(var(--h) * 100%)); border-radius: 9px;
  background: var(--ink-3); opacity: .5; transform-origin: 50% 100%; transform: scaleY(0);
  transition: transform .75s cubic-bezier(.2, .8, .2, 1) calc(.2s + var(--i) * .08s);
}
.punk-bye.on .punk-bye__bar { transform: scaleY(1); }
.punk-bye__col.is-today .punk-bye__bar { background: rgb(var(--acc-rgb)); opacity: 1; box-shadow: 0 0 24px rgba(var(--acc-rgb), .4); }
.punk-bye__d { font-size: 12px; letter-spacing: .04em; color: var(--ink-3); white-space: nowrap; }
.punk-bye__col.is-today .punk-bye__d, .punk-bye__col.is-today .punk-bye__v { color: var(--ink); font-weight: 600; }
.punk-bye__line { margin: 4px 0 0; min-height: 1.45em; color: var(--ink-2); }
.punk-bye--still, .punk-bye--still .punk-bye__bar, .punk-bye--still .punk-bye__v { transition: none; }
.punk-bye--still .punk-bye__bar { transform: none; }
.punk-bye--still .punk-bye__v { opacity: 1; }
.punk-bye--rest { background: var(--ground); -webkit-backdrop-filter: none; backdrop-filter: none; }
.punk-bye__arms { display: block; width: 92px; height: auto; margin: 0 auto 20px; opacity: .92; }
.punk-bye__soon { margin: 0 0 18px; color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .punk-bye, .punk-bye.off, .punk-bye__bar, .punk-bye__v { transition: none; }
  .punk-bye__bar { transform: none; }
  .punk-bye__v { opacity: 1; }
}
