/* The Piqabu site. The base is readable words in normal flow, for a browser that can't run the world. html.world turns them into one
   fixed stage over a tall scroll track, with the grain world behind. */
@font-face { font-family: 'Geist Variable'; src: url(assets/fonts/geist-latin-wght.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Newsreader Variable'; src: url(assets/fonts/newsreader-latin-opsz.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Space Mono'; src: url(assets/fonts/space-mono-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Space Mono'; src: url(assets/fonts/space-mono-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --void: #060709; --bone: #F5F3EB; --fog: #E9E8E4; --bronze: #B0894F;
  --bg: var(--void); --hi: var(--bone); --ink: #E2E0D9; --dim: #9A9995; --line: #313232;
  --gut: max(20px, 6vw); --kb: 0px;
  --sans: 'Geist Variable', -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Newsreader Variable', Georgia, serif;
  --mono: 'Space Mono', ui-monospace, monospace;
}
html.day { --bg: var(--fog); --hi: #060709; --ink: #1E1F20; --dim: #4F4F4C; --line: #B9B8B3; }

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 300 17px/1.5 var(--sans); -webkit-font-smoothing: antialiased; transition: background-color 1.2s, color .7s; }
a { color: inherit; }
img { display: block; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#gl, #clean, #pad, .mind, #gone { display: none; }
html:not(.world) .world-only { display: none !important; }
.coarse { display: none; }
@media (pointer: coarse) { .coarse { display: inline; } .fine { display: none; } }

/* ---------- the bar ---------- */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) var(--gut) 14px; background: var(--bg); }
.bar-logo img { height: 22px; width: auto; }
.bar-logo .on-day { display: none; }
html.day .bar-logo .on-day { display: block; }
html.day .bar-logo .on-night { display: none; }
.bar-tools { display: flex; gap: 2px; align-items: center; }
.tool { appearance: none; background: none; border: 0; padding: 10px 8px; min-height: 40px; font: 400 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); text-decoration: none; cursor: pointer; }
.tool:hover, .tool[aria-pressed="true"] { color: var(--hi); }
.tool[aria-pressed="true"]::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 7px; border-radius: 50%; background: var(--bronze); vertical-align: 2px; }

.tool-get { color: var(--hi); }
.menu { position: relative; }
.menu summary { list-style: none; display: flex; align-items: center; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: 100%; min-width: 190px; display: flex; flex-direction: column; align-items: stretch; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.menu-panel .tool { display: flex !important; align-items: center; min-height: 44px; padding: 0 10px; text-align: left; }
.menu-panel .tool[hidden] { display: none !important; }
.world-section { display: none; }
html.world .world-section { display: block; }

/* ---------- words ---------- */
main { max-width: 760px; padding: 0 var(--gut); margin: 0 auto; }
section { padding: 44px 0; border-bottom: 1px solid var(--line); }
section:last-child { border: 0; }
h1, h2 { font-weight: 300; color: var(--hi); margin: 0 0 12px; letter-spacing: -.02em; }
h1.line, h2.line, h2.form { font-size: clamp(30px, 5vw, 56px); line-height: 1.08; }
p { margin: 0 0 12px; max-width: 34em; }
.label { font: 700 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; }
.line-s { font-size: clamp(19px, 2.2vw, 24px); color: var(--hi); line-height: 1.3; }
.hint { font: 400 12px/1.5 var(--mono); letter-spacing: .02em; color: var(--dim); }
.btn, .chip { appearance: none; display: inline-flex; align-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--hi); text-decoration: none; cursor: pointer; }
.btn { padding: 0 22px; font-size: 15px; font-weight: 400; }
.btn.solid { background: var(--hi); color: var(--bg); border-color: var(--hi); }
.chip { padding: 0 16px; font-size: 14px; }
.btn:hover, .chip:hover { border-color: var(--hi); }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: none; margin-top: 14px; }
.foot { display: flex; flex-wrap: wrap; gap: 4px 18px; font: 400 11px/2 var(--mono); color: var(--dim); max-width: none; margin: 16px 0 0; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--hi); }
#say-form { display: flex; gap: 8px; margin-top: 14px; max-width: 560px; }
#say-input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; font: 300 16px var(--sans); color: var(--hi); background: rgba(245, 243, 235, .05); border: 1px solid var(--line); border-radius: 999px; outline: none; }
#say-input:focus { border-color: var(--hi); }

/* ---------- the world ---------- */
html.world { scrollbar-width: none; }
html.world::-webkit-scrollbar { display: none; }
html.world .world-only { display: inline-block; }
html.world p.world-only, html.world form.world-only { display: block; }
html.world p.chips.world-only { display: flex; }
html.world #say-form { display: flex; }
html.world body { overscroll-behavior-y: none; }
html.world .bar { position: fixed; left: 0; right: 0; background: none; }
html.world main { max-width: none; padding: 0; margin: 0; }
html.world section { height: calc(var(--len) * 1vh); height: calc(var(--len) * 1svh); padding: 0; border: 0; pointer-events: none; }
html.world h2.form { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

html.world #gl, html.world #clean { display: block; position: fixed; left: 0; top: 0; width: 100vw; pointer-events: none; }
html.world #gl { z-index: 0; }
html.world #clean { z-index: 1; opacity: 0; transition: opacity .45s; }
html.world #clean.on { opacity: 1; }
html.world #pad { display: block; position: fixed; inset: 0; z-index: 2; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.world #pad.lock { touch-action: none; }

/* The quiet field: one fixed block of words at the foot of the stage. It opens where it is and never slides. */
html.world .quiet { display: block; position: fixed; z-index: 3; left: var(--gut); right: var(--gut); bottom: calc(max(58px, env(safe-area-inset-bottom) + 50px) + var(--kb)); max-width: 620px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .7s, visibility 0s linear .7s; }
html.world .quiet.on { opacity: 1; visibility: visible; transition: opacity .9s .15s, visibility 0s; }
html.world .quiet.on a, html.world .quiet.on button, html.world .quiet.on input { pointer-events: auto; }
html.world .quiet h1.line, html.world .quiet h2.line { font-size: clamp(25px, 3.1vw, 46px); }
html.world .quiet p { margin-bottom: 8px; }
html.world .quiet .chips { margin-top: 12px; }
html.world #gone { display: block; }
html.world #gone[hidden] { display: none !important; }
/* The cue: a thread at the foot of the screen. It appears when you pause, says the word only until you have the idea,
   and while you move it fills, so a swipe always has an answer even when the moment hasn't changed yet. */
html.world #cue { position: fixed; z-index: 4; left: 50%; bottom: max(6px, env(safe-area-inset-bottom)); width: 96px; height: 46px; margin-left: -48px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; background: none; border: 0; cursor: pointer; opacity: 0; visibility: hidden; transition: opacity .6s, visibility 0s linear .6s; }
html.world #cue.show { opacity: 1; visibility: visible; transition: opacity .7s, visibility 0s; }
.cue-word { font: 400 10px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); opacity: 0; transition: opacity .5s; }
#cue.word .cue-word { opacity: 1; }
.cue-line { position: relative; display: block; width: 1px; height: 22px; overflow: hidden; background: var(--line); }
.cue-line i { position: absolute; left: 0; width: 1px; display: block; background: var(--hi); }
#cue.wait .cue-line i { top: 0; height: 7px; animation: cue-down 1.9s cubic-bezier(.65, 0, .35, 1) infinite; }
@media (pointer: coarse) { #cue.wait .cue-line i { animation-name: cue-up; } }
#cue.move .cue-line i { top: 0; height: 100%; transform-origin: top; transform: scaleY(var(--p, 0)); }
@keyframes cue-down { 0% { transform: translateY(-8px); opacity: 0; } 25% { opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(22px); opacity: 0; } }
@keyframes cue-up { 0% { transform: translateY(22px); opacity: 0; } 25% { opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(-8px); opacity: 0; } }
html.world .mind { display: block; position: fixed; left: 0; top: 0; z-index: 2; width: 74px; height: 74px; margin: -37px 0 0 -37px; border: 1px solid var(--hi); border-radius: 50%; opacity: 0; pointer-events: none; transition: opacity .5s; }
html.world .mind.on { opacity: .5; }
html.world .bar { z-index: 4; }

/* A faint film of grain over everything, the same on every screen. */
html.world body::after { content: ''; position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .05; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- connect ---------- */
dialog { --hi: #F5F3EB; --bg: #0F1114; --ink: #E2E0D9; --dim: #9A9995; --line: #313232; width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 22px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 16px; overflow: auto; }
dialog::backdrop { background: rgba(6, 7, 9, .82); }
.c-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.c-head .label { margin: 0; }
.c-step h2 { font-size: 27px; margin: 0 0 14px; color: var(--hi); }
.c-step[hidden] { display: none !important; }
.c-who { appearance: none; display: block; width: 100%; min-height: 64px; margin-bottom: 8px; padding: 12px 16px; text-align: left; background: none; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.c-who:hover, .c-who:focus-visible { border-color: var(--hi); }
.c-who b { display: block; font-weight: 400; font-size: 16px; color: var(--hi); }
.c-who span { display: block; font-size: 14px; color: var(--dim); }
.c-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .c-row { grid-template-columns: 1fr; gap: 0; } }
.c-f { display: block; margin-bottom: 12px; font: 400 11px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.c-f input, .c-f textarea { display: block; width: 100%; margin-top: 5px; padding: 12px 14px; font: 300 16px/1.4 var(--sans); letter-spacing: 0; text-transform: none; color: var(--hi); background: #060709; border: 1px solid var(--line); border-radius: 10px; }
.c-f input:focus, .c-f textarea:focus { outline: none; border-color: var(--hi); }
.c-chips { margin-top: 6px; letter-spacing: 0; text-transform: none; }
.chip[aria-pressed="true"] { background: var(--hi); color: var(--bg); border-color: var(--hi); }
.c-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.c-note { font-size: 13px; color: var(--dim); }
.c-send-note { margin: 12px 0 0; }

/* ---------- sit in on one ---------- */
html.sitting { overflow: hidden; }
html.sitting .bar { visibility: hidden; }
#sit { position: fixed; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; touch-action: none; -webkit-user-select: none; user-select: none; }
#sit[hidden] { display: none !important; }
.sit-top { width: 100%; height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 max(14px, 2vw); font: 400 10px/1.3 var(--mono); letter-spacing: .06em; color: var(--dim); }
.sit-top .tool { min-height: 44px; color: var(--hi); }
#sit-stage { position: relative; margin: auto; overflow: hidden; opacity: 0; transition: opacity .9s; background: #060709; }
#sit-stage.on { opacity: 1; }
#sit-stage.device { box-shadow: 0 0 0 1px rgba(245, 243, 235, .18); }
#sit-c { display: block; width: 100%; height: 100%; }
#sit-choices { position: absolute; left: 3.4%; right: 3.4%; display: grid; gap: 8px; }
#sit-choices[hidden] { display: none !important; }
.sit-choice { appearance: none; min-height: 48px; padding: 10px 16px; text-align: left; font: 300 15px/1.3 var(--sans); color: #F5F3EB; background: #0F1114; border: 1px solid rgba(245, 243, 235, .18); border-radius: 14px; cursor: pointer; }
.sit-choice:hover, .sit-choice:focus-visible { border-color: #F5F3EB; }
#sit-hint { position: absolute; left: 4%; right: 4%; margin: 0; font: 400 11px/1.5 var(--mono); color: rgba(245, 243, 235, .62); max-width: none; }
#sit-mic { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; padding: 0; background: none; border: 0; border-radius: 50%; cursor: pointer; }
#sit.after .sit-top { color: var(--dim); }
#sit-after { position: absolute; left: 0; right: 0; bottom: max(40px, env(safe-area-inset-bottom)); display: flex; justify-content: center; }
#sit-after[hidden] { display: none !important; }
