:root {
  /* cards, labels and panels use the KapeOS palette (same values as --kos-* in os/os.css) */
  --ink: #F6F2EA;
  --ink-soft: #A79D91;
  --paper: #211D19;
  --paper-edge: rgb(246 242 234 / 0.10);
  --accent: #F0A726;
  --on-accent: #12100E;
  --tint-1: rgb(246 242 234 / 0.06);
  --tint-2: rgb(246 242 234 / 0.12);
  --room: #05060a;
  --chalk: #f3f1ea;
  --chalk-dim: rgba(243, 241, 234, 0.62);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--room); overflow: hidden; font-family: var(--sans); color: var(--chalk); }
#stage { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; touch-action: none; cursor: default; }
#stage.can-click { cursor: pointer; }

#mark { position: fixed; left: 28px; top: 24px; pointer-events: none; transition: opacity .5s var(--ease); }
#mark p, #mark h1 { margin: 0; }
/* text version of the room: kept in the DOM for search engines and screen readers, not painted */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.mark-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.mark-sub { font-family: var(--mono); font-size: 11px; color: var(--chalk-dim); margin-top: 3px !important; letter-spacing: 0.02em; }
#hint { position: fixed; left: 28px; bottom: 22px; margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; color: var(--chalk-dim); pointer-events: none; transition: opacity .5s var(--ease); }
body.in-os #mark, body.in-os #hint, body.flying #hint, body.flying #mark { opacity: 0; }

#spots { position: fixed; inset: 0; pointer-events: none; transition: opacity .4s var(--ease); }
body.in-os #spots, body.flying #spots { opacity: 0; }
.spot { position: absolute; left: 0; top: 0; will-change: transform; }
.spot i { display: block; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 1.25px solid var(--chalk); background: radial-gradient(circle, var(--chalk) 0 1.8px, transparent 2.2px); }
.spot b { position: absolute; left: 12px; top: -11px; white-space: nowrap; font: 500 12px/1 var(--sans); color: var(--ink); background: var(--paper); padding: 6px 9px; border-radius: 7px; opacity: 0; transform: translateX(-6px) scale(.96); transform-origin: left center; transition: opacity .18s var(--ease), transform .3s var(--spring); }
.spot.hot i { opacity: 1; animation: none; }
.spot.hot b { opacity: 1; transform: none; }
.spot.off { display: none; }
.spot.flip b { left: auto; right: 12px; transform-origin: right center; }
/* KAPE's speech bubble: main.js moves it with transform, so the pop uses the separate scale property */
#kape-say { display: none; position: fixed; left: 0; top: 0; margin: 0; max-width: 230px; padding: 9px 12px; border-radius: 10px; background: var(--paper); color: var(--ink); font: 500 12.5px/1.35 var(--mono); text-align: center; pointer-events: none; transform-origin: 50% 100%; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28); }
#kape-say::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; background: var(--paper); rotate: 45deg; }
#kape-say.show { display: block; animation: say-pop .38s var(--spring) both; }
body.in-os #kape-say, body.flying #kape-say { display: none; }
@keyframes say-pop { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

#card { position: fixed; right: 36px; top: 50%; width: min(360px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); border-radius: 18px; padding: 26px 26px 24px; border: 1px solid var(--paper-edge); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); transform: translateY(-50%) translateX(24px) scale(.97); opacity: 0; transition: opacity .25s var(--ease), transform .45s var(--spring); }
#card[hidden] { display: none; }
#card.show { opacity: 1; transform: translateY(-50%); }
#card-kind { margin: 0 0 10px; font: 500 11px/1 var(--mono); letter-spacing: 0.03em; color: var(--accent); }
#card-title { margin: 0 0 12px; font-size: 26px; line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
#card-body { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); text-wrap: pretty; }
#card-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; padding: 9px 14px; border-radius: 10px; font: 500 13px/1 var(--sans); color: var(--on-accent); text-decoration: none; background: var(--accent); transition: transform .3s var(--spring); }
#card-link:hover { transform: translateY(-1px) scale(1.02); }
#card-link:empty { display: none; }
#card-close { position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border: 0; border-radius: 9px; background: var(--tint-1); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform .3s var(--spring), background .2s; }
#card-close:hover { background: var(--tint-2); transform: scale(1.06); }
@media (max-width: 720px) {
  #card { right: 16px; left: 16px; top: auto; bottom: 16px; width: auto; transform: translateY(24px) scale(.97); }
  #card.show { transform: none; }
  #mark { left: 16px; top: 16px; } #hint { left: 16px; bottom: 14px; }
}

#os-root { position: fixed; inset: 0; opacity: 0; pointer-events: none; transition: opacity .32s linear; }
#os-root.on { opacity: 1; pointer-events: auto; }
#os-fallback { position: absolute; inset: 0; display: grid; place-items: center; background: var(--paper); color: var(--ink); font: 500 15px var(--sans); }

#card-specs { margin: 16px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; padding-top: 16px; border-top: 1px solid var(--paper-edge); }
#card-specs:empty { display: none; }
#card-specs dt { font: 500 11px/1.5 var(--mono); letter-spacing: 0.02em; color: var(--accent); }
#card-specs dd { margin: 0; font-size: 14px; line-height: 1.4; font-weight: 500; color: var(--ink); }

/* typing test (opens from the keyboard) */
#typer { --key: #f1ecdc; --key-edge: #d6ceb6; --key-dark: #34363a; position: fixed; left: 50%; bottom: 28px; width: min(760px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); border-radius: 20px; padding: 24px 26px 22px; border: 1px solid var(--paper-edge); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); transform: translate(-50%, 28px) scale(.97); opacity: 0; transition: opacity .25s var(--ease), transform .45s var(--spring); }
#typer[hidden] { display: none; }
#typer.show { opacity: 1; transform: translate(-50%, 0); }
#typer button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.ty-head { display: flex; justify-content: space-between; align-items: flex-start; }
.ty-kind { margin: 0 0 8px; font: 500 11px/1 var(--mono); letter-spacing: 0.03em; color: var(--accent); }
.ty-title { margin: 0; font-size: 22px; line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; }
#typer .ty-close { width: 30px; height: 30px; border-radius: 9px; background: var(--tint-1); display: grid; place-items: center; transition: transform .3s var(--spring), background .2s; }
#typer .ty-close:hover { background: var(--tint-2); transform: scale(1.06); }
.ty-bar { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 12px; }
.ty-modes { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--tint-1); }
#typer .ty-mode { padding: 6px 11px; border-radius: 8px; font: 500 12px/1 var(--mono); color: var(--ink-soft); transition: background .2s, color .2s; }
#typer .ty-mode.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.ty-stat { font: 500 13px/1 var(--mono); color: var(--ink-soft); display: flex; gap: 16px; align-items: baseline; font-variant-numeric: tabular-nums; }
.ty-clock { font-size: 22px; color: var(--accent); font-weight: 600; }
.ty-stage { height: 108px; overflow: hidden; }  /* exactly three 36px lines */
.ty-stage[hidden], .ty-result[hidden], .ty-tip[hidden] { display: none; }
.ty-words { position: relative; display: flex; flex-wrap: wrap; font: 400 21px/36px var(--mono); color: var(--ink-soft); transition: transform .24s var(--ease); will-change: transform; }
.ty-caret { position: absolute; left: -1px; top: 7px; width: 2px; height: 22px; border-radius: 2px; background: var(--accent); transition: transform .1s cubic-bezier(.2, .8, .2, 1); will-change: transform; animation: ty-blink 1s steps(2, start) infinite; }
.ty-caret.busy { animation: none; }
.ty-w.wrong { text-decoration: underline; text-decoration-color: #d8453a; text-underline-offset: 4px; }
.ty-c { transition: color .08s linear; }
.ty-c.ok { color: var(--ink); }
.ty-c.bad { color: #d8453a; }
.ty-c.extra { color: #b9342a; opacity: .7; }
.ty-w { position: relative; height: 36px; margin-right: 0.62em; white-space: nowrap; }
@keyframes ty-blink { to { opacity: 0; } }
.ty-tip { margin: 8px 0 0; font: 400 11px/1 var(--mono); color: var(--ink-soft); }
.ty-result { height: 108px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; }
.ty-big { margin: 0; font-size: 44px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; }
.ty-sub { margin: 0; font-size: 14px; color: var(--ink-soft); }
#typer .ty-again { margin-top: 6px; padding: 8px 14px; border-radius: 10px; font: 500 13px/1 var(--sans); color: var(--on-accent); background: var(--accent); transition: transform .3s var(--spring); }
#typer .ty-again:hover { transform: translateY(-1px) scale(1.02); }
.ty-kb { margin-top: 16px; padding: 12px; border-radius: 14px; background: #d6ceb6; display: grid; gap: 6px; }
.ty-row { display: flex; gap: 6px; }
#typer .ty-key { flex: 1 1 0; max-width: 58px; height: 38px; border-radius: 8px; background: var(--key); box-shadow: 0 2px 0 var(--key-edge), inset 0 0 0 1px rgba(255, 255, 255, 0.6); font: 500 12px/1 var(--mono); color: #4b4638; text-transform: uppercase; transition: transform .12s var(--spring), background .1s, color .1s; }
#typer .ty-key.ty-wide { max-width: 92px; flex-grow: 1.6; background: var(--key-dark); color: #e9e4d2; box-shadow: 0 2px 0 #1d1e21; text-transform: none; }
#typer .ty-key.ty-space { max-width: none; margin: 0 16%; text-transform: none; color: #8a836f; }
#typer .ty-key.down { background: #35ff5a; color: #0b3d18; transform: translateY(2px); }
body.in-os #typer, body.flying #typer { display: none; }
@media (max-width: 720px) {
  #typer { bottom: 12px; padding: 18px 16px 16px; }
  .ty-words { font-size: 17px; line-height: 30px; } .ty-w { height: 30px; } .ty-caret { top: 6px; height: 18px; } .ty-stage, .ty-result { height: 90px; }
  #typer .ty-key { height: 34px; font-size: 11px; } .ty-row { gap: 4px; padding-left: 0 !important; }
}

/* ---- the phone, opened from the desk (src/phone.js) */
#phone { --ph-w: min(290px, 62vw); position: fixed; right: max(36px, 9vw); top: 50%; display: grid; justify-items: center; gap: 12px; opacity: 0; transform: translateY(-46%) scale(.94); transition: opacity .3s var(--ease), transform .5s var(--spring); }
#phone[hidden] { display: none; }
#phone.show { opacity: 1; transform: translateY(-50%); }
.ph { width: var(--ph-w); aspect-ratio: 9 / 19.6; padding: 7px; border-radius: 40px; background: var(--room); box-shadow: 0 0 0 1.5px rgba(243, 241, 234, 0.2), 0 30px 70px rgba(0, 0, 0, 0.55); }
.ph-screen { position: relative; width: 100%; height: 100%; border-radius: 33px; overflow: hidden; background: var(--room); color: var(--paper); font-family: var(--sans); }
.ph-wall { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .45s var(--ease), transform .6s var(--ease); }
.ph-homewall { opacity: 0; transform: scale(1.06); }
.ph-screen[data-view="home"] .ph-homewall { opacity: 1; transform: none; }
.ph-screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(5, 6, 10, 0.42), rgba(5, 6, 10, 0) 34%, rgba(5, 6, 10, 0) 66%, rgba(5, 6, 10, 0.5)); pointer-events: none; }
.ph-cam { position: absolute; z-index: 3; left: 50%; top: 11px; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: var(--room); box-shadow: inset 0 0 0 2px rgba(243, 241, 234, 0.08); }
.ph-status { position: absolute; z-index: 2; left: 0; right: 0; top: 0; padding: 10px 20px 0; display: flex; align-items: center; gap: 6px; font: 600 11px/1 var(--sans); }
.ph-status .ph-t { margin-right: auto; font-weight: 600; }
.ph-batt { width: 20px; height: 10px; border-radius: 3px; border: 1.2px solid currentColor; background: linear-gradient(currentColor, currentColor) 1.5px 50% / 72% 5px no-repeat; }
.ph-lock, .ph-home { position: absolute; z-index: 2; inset: 0; transition: opacity .35s var(--ease), transform .5s var(--spring); }
.ph-lock { border: 0; background: none; color: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; padding: 15% 0 9%; font: inherit; }
.ph-big { display: grid; font: 600 calc(var(--ph-w) * 0.2) / 0.88 var(--sans); letter-spacing: -0.04em; text-shadow: 0 4px 24px rgba(5, 6, 10, 0.35); }
.ph-date { margin-top: 12px; font: 500 14px/1 var(--sans); text-shadow: 0 1px 8px rgba(5, 6, 10, 0.5); }
.ph-hint { margin-top: auto; font: 500 11px/1 var(--mono); letter-spacing: 0.04em; opacity: .85; animation: ph-nudge 2.2s var(--ease) infinite; }
.ph-home { opacity: 0; transform: scale(1.08); pointer-events: none; display: flex; flex-direction: column; padding: 15% 8% 5%; }
.ph-screen[data-view="home"] .ph-lock { opacity: 0; transform: translateY(-10%); pointer-events: none; }
.ph-screen[data-view="home"] .ph-home { opacity: 1; transform: none; pointer-events: auto; }
.ph-wtime { margin: 0; display: grid; gap: 6px; text-shadow: 0 2px 14px rgba(5, 6, 10, 0.45); }
.ph-wtime .ph-t { font: 600 44px/1 var(--sans); letter-spacing: -0.03em; }
.ph-wtime .ph-date { margin: 0; font-size: 13px; }
.ph-dock { margin-top: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 10px; border-radius: 24px; background: rgba(243, 241, 234, 0.2); backdrop-filter: blur(14px); }
.ph-app { aspect-ratio: 1; border-radius: 15px; background: rgba(5, 6, 10, 0.55); display: grid; place-items: center; }
.ph-app svg { width: 52%; height: 52%; }
.ph-bar { margin: 12px auto 0; width: 36%; height: 16px; border: 0; background: linear-gradient(var(--paper), var(--paper)) 50% 50% / 100% 4px no-repeat; border-radius: 4px; cursor: pointer; opacity: .9; }
.ph-name { margin: 0; font: 500 11px/1 var(--mono); letter-spacing: 0.02em; color: var(--chalk-dim); }
.ph-close { position: absolute; right: -14px; top: -14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--paper); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform .3s var(--spring); }
.ph-close:hover { transform: scale(1.1) rotate(90deg); }
.ph-close svg { width: 16px; height: 16px; }
@keyframes ph-nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-5px); } }
@media (max-width: 720px) { #phone { --ph-w: min(250px, 60vw); right: 50%; top: auto; bottom: 44px; transform: translate(50%, 6%) scale(.94); } #phone.show { transform: translate(50%, 0); } .ph-close { right: -8px; top: -8px; } }

/* KAPE's bubble carries two real links, so it takes clicks while it is up */
#kape-say.show { pointer-events: auto; display: grid; gap: 9px; max-width: 250px; }
.ks-links { display: grid; gap: 6px; }
.ks-btn { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border-radius: 8px; background: var(--ink); color: var(--paper); font: 500 12px/1 var(--sans); text-decoration: none; transition: transform .3s var(--spring); }
.ks-btn:hover { transform: scale(1.04); }
.ks-btn img { width: 16px; height: 16px; }

/* ---- the intro (src/intro.js): KapeOS boots while the room loads, then the room opens out of the lit monitor.
   #veil carries class "kos", so the colours and fonts are the KapeOS tokens from os/os.css. */
@property --hole { syntax: '<length>'; inherits: false; initial-value: 0px; }
#veil { position: fixed; inset: 0; z-index: 50; background: var(--kos-ink); pointer-events: none; --x: 50vw; --y: 55vh; --hole: 0px;
  -webkit-mask-image: radial-gradient(circle at var(--x) var(--y), transparent calc(var(--hole) - 1px), #000 var(--hole));
  mask-image: radial-gradient(circle at var(--x) var(--y), transparent calc(var(--hole) - 1px), #000 var(--hole));
  transition: --hole 1.05s cubic-bezier(0.7, 0, 0.2, 1), opacity .25s linear 1s, visibility 0s linear 1.3s; }
#veil::after { content: ''; position: absolute; inset: 0; background: url('../os/assets/textures/grain.png') 0 0 / 160px; opacity: .5; mix-blend-mode: overlay; }
#veil.gone { --hole: 150vmax; opacity: 0; visibility: hidden; }
#veil.skip { transition: opacity .4s linear, visibility 0s linear .4s; }
#veil.skip > * { display: none; }
#veil p { margin: 0; }
.in-copy { position: absolute; left: clamp(20px, 6vw, 110px); top: clamp(56px, 13vh, 150px); }
.in-sub { font: 700 clamp(10px, 0.95vw, 13px)/1 var(--kos-mono); letter-spacing: .34em; text-transform: uppercase; color: var(--kos-clay); }
.in-name { font: 400 clamp(34px, 4.4vw, 76px)/1 var(--kos-display); letter-spacing: -0.01em; margin-top: clamp(12px, 1.4vw, 22px) !important; }
.in-line { font: 500 clamp(14px, 1.3vw, 20px)/1.3 var(--kos-font); color: var(--kos-clay); margin-top: clamp(12px, 1.4vw, 22px) !important; }
.in-line b { color: var(--kos-amber); font-weight: 600; }
.in-term { position: absolute; left: clamp(20px, 6vw, 110px); bottom: clamp(64px, 12vh, 130px); font: 500 clamp(12px, 1.15vw, 17px)/1.9 var(--kos-mono); color: var(--kos-clay); }
.in-term p { white-space: pre; opacity: 0; }
.in-term p.on { opacity: 1; }
.in-term b { color: var(--kos-amber); font-weight: 700; }
.in-term i { color: var(--kos-paper); font-style: normal; }
.in-cur { display: inline-block; width: .65em; height: 1.05em; background: var(--kos-amber); vertical-align: -0.18em; animation: in-blink 1s steps(2) infinite; }
@keyframes in-blink { 50% { opacity: 0; } }
.in-pct { position: absolute; right: clamp(20px, 2.4vw, 44px); bottom: clamp(22px, 2vw, 34px); font: 700 clamp(11px, 1vw, 15px)/1 var(--kos-mono); letter-spacing: .08em; color: var(--kos-clay); }
.in-pct b { color: var(--kos-paper); }
.in-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--kos-hair); }
.in-bar i { display: block; height: 100%; background: var(--kos-amber); transform-origin: 0 50%; transform: scaleX(0); transition: transform .3s linear; }   /* the glide runs off the main thread, so it stays smooth while the room is being set up */
@media (prefers-reduced-motion: reduce) { #veil { transition: opacity .4s linear, visibility 0s linear .4s; } #veil.gone { --hole: 0px; } .in-cur { animation: none; } }

/* ---- no 3D on this device (WebGL off or broken): the text version of the room becomes the page */
body.no-gl { overflow: auto; height: auto; background: #12100E; }
html:has(body.no-gl) { overflow: auto; height: auto; }
body.no-gl #stage, body.no-gl #veil, body.no-gl #hint, body.no-gl #spots, body.no-gl #mark { display: none; }
body.no-gl #index { position: static; width: auto; height: auto; margin: 0 auto; padding: 56px 20px 72px; max-width: 680px; overflow: visible; clip-path: none; white-space: normal; color: var(--ink); line-height: 1.6; }
body.no-gl #index::before { content: "Kenneth Villar - BrewedOps studio. This device cannot show the 3D room, so here is everything in it."; display: block; margin-bottom: 28px; font: 500 12px/1.5 var(--mono); color: var(--accent); }
body.no-gl #index article { padding: 18px 0; border-top: 1px solid var(--paper-edge); }
body.no-gl #index .kind { margin: 0 0 4px; font: 500 11px/1 var(--mono); color: var(--ink-soft); }
body.no-gl #index h2 { font-size: 22px; margin: 32px 0 12px; } body.no-gl #index h3 { font-size: 18px; margin: 0 0 6px; }
body.no-gl #index p { margin: 0 0 8px; color: var(--ink-soft); } body.no-gl #index a { color: var(--accent); }

/* ---- like button (src/like.js): bottom centre of the room, KapeOS palette */
#like { position: fixed; left: 50%; bottom: 18px; z-index: 3; display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 15px 0 12px; border-radius: 999px;
  border: 1px solid var(--paper-edge); background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--ink); font: 500 13px/1 var(--sans); cursor: pointer; translate: -50% 0; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  transition: opacity .4s var(--ease), scale .35s var(--spring), border-color .2s, background .2s; -webkit-tap-highlight-color: transparent; }
#like[hidden] { display: none; }
#like:hover { scale: 1.05; border-color: var(--tint-2); }
#like:active { scale: .95; }
#like:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#like.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); cursor: default; }
body.in-os #like, body.flying #like { opacity: 0; pointer-events: none; }
.lk-heart { position: relative; display: grid; place-items: center; width: 20px; height: 20px; }
.lk-heart svg { display: block; fill: transparent; stroke: var(--ink); stroke-width: 1.7; stroke-linejoin: round; transition: fill .25s, stroke .25s; }
#like.on .lk-heart svg { fill: var(--accent); stroke: var(--accent); }
#like.pop .lk-heart svg { animation: lk-beat .62s var(--spring) both; }
#like.pop .lk-heart::before { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--accent); animation: lk-ring .6s var(--ease) both; }
#like.nudge { animation: lk-nudge .36s var(--ease); }
.lk-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.lk-burst i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; background: var(--accent); opacity: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.5s-7.5-4.6-7.5-10.2A4.3 4.3 0 0 1 12 7.6a4.3 4.3 0 0 1 7.5 2.7c0 5.6-7.5 10.2-7.5 10.2z'/%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'%3E%3Cpath d='M12 20.5s-7.5-4.6-7.5-10.2A4.3 4.3 0 0 1 12 7.6a4.3 4.3 0 0 1 7.5 2.7c0 5.6-7.5 10.2-7.5 10.2z'/%3E%3C/svg%3E") center / contain no-repeat; }
#like.pop .lk-burst i { animation: lk-fly .75s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.lk-word { letter-spacing: -0.005em; }
.lk-num { position: relative; display: inline-grid; overflow: hidden; height: 18px; padding-left: 9px; border-left: 1px solid var(--paper-edge); font: 500 12.5px/18px var(--mono); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
#like.on .lk-num { color: var(--accent); }
.lk-num span { grid-area: 1 / 1; }
.lk-num span.out { animation: lk-out .38s var(--ease) both; }
.lk-num span.in { animation: lk-in .46s var(--spring) both; }
@keyframes lk-beat { 0% { scale: 1; } 25% { scale: .55; } 60% { scale: 1.4; } 100% { scale: 1; } }
@keyframes lk-ring { from { scale: .4; opacity: .9; } to { scale: 1.9; opacity: 0; } }
@keyframes lk-fly { 0% { translate: 0 0; scale: 0; opacity: 0; } 20% { opacity: 1; } 100% { translate: var(--dx) var(--dy); scale: var(--s); opacity: 0; } }
@keyframes lk-out { to { translate: 0 -100%; opacity: 0; } }
@keyframes lk-in { from { translate: 0 100%; opacity: 0; } }
@keyframes lk-nudge { 25% { translate: calc(-50% - 4px) 0; } 60% { translate: calc(-50% + 3px) 0; } }
@media (max-width: 720px) { #like { left: auto; right: 14px; bottom: 12px; translate: 0 0; } #hint { max-width: 56%; line-height: 1.5; }
  @keyframes lk-nudge { 25% { translate: -4px 0; } 60% { translate: 3px 0; } } }
@media (prefers-reduced-motion: reduce) { #like.pop .lk-heart svg, #like.pop .lk-heart::before, #like.pop .lk-burst i, .lk-num span.out, .lk-num span.in, #like.nudge { animation: none; } .lk-num span.out { display: none; } }
