/* THE PROFILE (profile.js). Our tokens: Jost for the interface, EB Garamond for the one warm sentence, the same gold the
   passport and the wordmark spend (#e9c46a), ink and rule from the app's own scale. Dark is the app; light is for a phone
   set to it (the only page here that follows the setting, so it names its own ground rather than inheriting the map's). */
#profile{
  --pf-bg:#070a09; --pf-ink:rgba(255,255,255,.92); --pf-dim:rgba(255,255,255,.62); --pf-rule:rgba(190,214,236,.14);
  --pf-tile:#1a221d; --pf-tile-2:#0b100d; --pf-gold:#e9c46a; --pf-gold-ink:#1a1405; --pf-glass:rgba(7,10,9,.72);
  position:fixed; inset:0; z-index:100; overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(233,196,106,.10), transparent 60%),
    var(--pf-bg);
  color:var(--pf-ink); font-family:"Jost","Avenir Next","Helvetica Neue",-apple-system,sans-serif;
  -webkit-font-smoothing:antialiased; -webkit-text-size-adjust:100%;
  animation:pfIn .28s cubic-bezier(.2,.8,.2,1);
}
#profile[hidden]{display:none}
@keyframes pfIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){#profile{animation:none}}
@media (prefers-color-scheme:light){
  #profile{
    --pf-bg:#f6f2e8; --pf-ink:#181a17; --pf-dim:rgba(24,26,23,.62); --pf-rule:rgba(24,26,23,.13);
    --pf-tile:#e6e0d1; --pf-tile-2:#cfc6b0; --pf-gold:#8a6a14; --pf-gold-ink:#fff8e6; --pf-glass:rgba(246,242,232,.8);
    background:radial-gradient(120% 60% at 50% -10%, rgba(201,162,58,.16), transparent 60%), var(--pf-bg);
  }
}
body.profile-open{overflow:hidden}

#profile *{box-sizing:border-box}
.pfIn{position:relative; max-width:560px; margin:0 auto; min-height:100%;
  padding:calc(30px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left))}

.pfX{position:absolute; top:calc(8px + env(safe-area-inset-top)); right:max(8px, env(safe-area-inset-right)); width:44px; height:44px; padding:0;
  border:0; border-radius:50%; background:var(--pf-glass); color:var(--pf-ink); font:300 28px/1 "Jost",sans-serif; cursor:pointer;
  -webkit-tap-highlight-color:transparent; display:flex; align-items:center; justify-content:center; padding-bottom:3px}
.pfX:active{transform:scale(.94)}
#profile :focus-visible{outline:2px solid var(--pf-gold); outline-offset:3px}

/* the top: avatar, name, two counts, one button. Centred, not an Instagram row of three counts beside a thumb. */
.pfTop{display:grid; justify-items:center; text-align:center; gap:0; padding:14px 0 26px}
.pfAv{position:relative; width:104px; height:104px; border-radius:50%; display:grid; place-items:center; overflow:hidden;
  background:linear-gradient(145deg, rgba(233,196,106,.28), rgba(233,196,106,.06)); box-shadow:0 0 0 2px var(--pf-bg), 0 0 0 4px var(--pf-gold), 0 10px 34px rgba(233,196,106,.18)}
.pfAv b{font:300 34px/1 "Jost",sans-serif; letter-spacing:.06em; color:var(--pf-gold)}
.pfAv img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; border-radius:50%}
.pfWho{margin-top:20px; min-width:0; max-width:100%}
.pfWho h2{margin:0; font:400 26px/1.15 "Jost",sans-serif; letter-spacing:.01em; overflow-wrap:anywhere}
.pfWho p{margin:5px 0 0; font-size:13px; letter-spacing:.06em; color:var(--pf-dim); overflow-wrap:anywhere}
.pfCounts{list-style:none; margin:22px 0 0; padding:0; display:flex; justify-content:center; gap:0}
.pfCounts li{display:grid; gap:3px; padding:0 22px; min-width:0}
.pfCounts li + li{border-left:1px solid var(--pf-rule)}
.pfCounts b{font:300 30px/1 "Jost",sans-serif; letter-spacing:.01em}
.pfCounts span{font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:var(--pf-dim)}

.pfGo{display:inline-flex; align-items:center; justify-content:center; min-height:46px; padding:0 28px; border:0; border-radius:999px;
  background:var(--pf-gold); color:var(--pf-gold-ink); font:500 12px/1 "Jost",sans-serif; letter-spacing:.2em; text-transform:uppercase; text-decoration:none;
  cursor:pointer; -webkit-tap-highlight-color:transparent; box-shadow:0 6px 22px rgba(233,196,106,.22)}
.pfGo:active{transform:scale(.97)}
.pfUp{margin-top:24px}

/* the grid: portrait tiles on rounded corners, three across; four when there is room */
.pfGrid{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:6px; border-top:1px solid var(--pf-rule); padding-top:22px}
@media (min-width:520px){.pfGrid{grid-template-columns:repeat(4, minmax(0,1fr))}}
/* never a bare box: a clip with no poster, or a still that failed, sits on this and the play glyph (11 Nov screenshot: one white tile, one black) */
.pfTile{position:relative; aspect-ratio:4/5; border-radius:10px; overflow:hidden; background:linear-gradient(160deg, var(--pf-tile), var(--pf-tile-2, #0b100d)); isolation:isolate}
.pfTile.bare::after{content:""; position:absolute; left:50%; top:46%; width:0; height:0; transform:translate(-40%,-50%); border-style:solid; border-width:11px 0 11px 18px; border-color:transparent transparent transparent rgba(255,255,255,.55)}
.pfTile img,.pfTile video{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block}
.pfTile span{position:absolute; left:0; right:0; bottom:0; padding:18px 7px 6px; font-size:10px; line-height:1.2; letter-spacing:.06em; color:#fff;
  background:linear-gradient(to top, rgba(0,0,0,.66), transparent); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; pointer-events:none}
.pfTile em{position:absolute; top:6px; left:6px; padding:3px 7px; border-radius:999px; font-style:normal; font-size:9px; letter-spacing:.12em; text-transform:uppercase;
  background:rgba(7,10,9,.74); color:#fff; backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px)}
.pfPlay{position:absolute; top:50%; left:50%; width:34px; height:34px; margin:-17px 0 0 -17px; border-radius:50%; background:rgba(7,10,9,.55);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px)}
.pfPlay::after{content:''; position:absolute; left:13px; top:10px; border-left:11px solid #fff; border-top:7px solid transparent; border-bottom:7px solid transparent}
.pfWait .pfTile{background:linear-gradient(100deg, var(--pf-tile) 30%, rgba(233,196,106,.10) 50%, var(--pf-tile) 70%); background-size:220% 100%; animation:pfShim 1.4s linear infinite}
@keyframes pfShim{from{background-position:120% 0}to{background-position:-120% 0}}
@media (prefers-reduced-motion:reduce){.pfWait .pfTile{animation:none}}

/* nothing yet, signed out, or a failed read: one warm sentence and one button */
.pfMsg{display:grid; justify-items:center; text-align:center; gap:22px; padding:34px 6px 10px; border-top:1px solid var(--pf-rule)}
.pfMsg p{margin:0; max-width:30ch; font:italic 400 21px/1.45 "EB Garamond",Georgia,serif; color:var(--pf-ink)}

/* the Me button: in the bar's row, in Find me's own type, at the left edge of the camera and Find me (profile.js placeMe) */
#meBtn{position:fixed; z-index:41; display:flex; align-items:center; justify-content:center; padding:0 8px; margin:0; min-height:0 !important; border:0; border-radius:3px; background:transparent;
  color:#fff; font:500 11px/1 "Jost",system-ui,sans-serif; letter-spacing:.14em; text-transform:uppercase; cursor:pointer; -webkit-tap-highlight-color:transparent; box-sizing:border-box;
  text-shadow:0 0 3px rgba(0,0,0,.6)}
/* the markup's hidden must beat display:flex until profile.js has placed it */
#meBtn[hidden]{display:none}
#meBtn::before{content:''; position:absolute; inset:-7px -3px}
#meBtn[aria-expanded="true"]{color:#e9c46a}
body.profile-open #meBtn{visibility:hidden}
/* a desktop bar has no free space beside the camera: the search box gives up 52 px to it */
@media (min-width:761px){
  body.has-me{--d-r-search:calc(var(--d-r-cam) + 42px + 46px); --d-r-nav:calc(var(--d-r-search) + var(--d-sw) + 14px)}
}

/* ---- your photo, changed in place (11 Nov) ---- */
button.pfAvBtn{padding:0; border:0; font:inherit; cursor:pointer; -webkit-appearance:none; appearance:none; color:inherit}
button.pfAvBtn:focus-visible{outline:3px solid var(--pf-gold); outline-offset:6px}
.pfNote{margin:10px 0 0; font:italic 400 15px/1.4 "EB Garamond",Georgia,serif; color:var(--pf-dim)}
.pfSheet{position:fixed; inset:0; z-index:5; display:grid; align-items:end; background:rgba(0,0,0,.55); animation:pfIn .22s ease-out}
.pfSheetIn{display:grid; gap:10px; justify-items:center; max-width:560px; margin:0 auto; width:100%; box-sizing:border-box; padding:22px 20px calc(22px + env(safe-area-inset-bottom)); border-radius:22px 22px 0 0; background:var(--pf-bg); color:var(--pf-ink)}
@media (min-width:560px){.pfSheet{align-items:center}.pfSheetIn{border-radius:22px}}
.pfSheetIn h3{margin:0 0 2px; font:400 22px/1.2 "EB Garamond",Georgia,serif}
.pfPublic{margin:0 0 8px; font:italic 400 15px/1.4 "EB Garamond",Georgia,serif; color:var(--pf-dim)}
.pfOpt{width:100%; min-height:48px; border:1px solid var(--pf-rule); border-radius:14px; background:transparent; color:var(--pf-ink); font:500 15px/1 "Jost",sans-serif; letter-spacing:.06em; text-transform:uppercase}
.pfOpt.pfQuiet{border-color:transparent; color:var(--pf-dim)}
.pfRow{display:grid; grid-template-columns:1fr 1fr; gap:10px; width:100%}
.pfCam{width:280px; height:280px; border-radius:50%; overflow:hidden; background:#000}
.pfCam video{width:100%; height:100%; object-fit:cover; transform:scaleX(-1)}
.pfCrop{position:relative; width:280px; height:280px; touch-action:none; cursor:grab; border-radius:14px; overflow:hidden; background:#000}
.pfCrop canvas{display:block; width:280px; height:280px}
.pfCrop i{position:absolute; inset:0; pointer-events:none; border-radius:50%; border:2px solid var(--pf-gold); box-shadow:0 0 0 999px rgba(0,0,0,.55)}   /* the corners outside the circle go dark; .pfCrop clips the shadow */
.pfZoom{width:280px; accent-color:var(--pf-gold)}

/* ---- the viewer: a clip, its hearts, its thread, Share (11 Nov) ---- */
.pfCounts.pfFour li{padding:0 10px}
.pfCounts.pfFour span{font-size:10px; letter-spacing:.1em}
@media (max-width:359px){.pfCounts.pfFour{flex-wrap:wrap; row-gap:14px}.pfCounts.pfFour li:nth-child(3){border-left:0}}
.pfOpen{position:absolute; inset:0; z-index:2; border:0; padding:0; background:transparent; cursor:pointer; -webkit-appearance:none; appearance:none; border-radius:10px}
.pfOpen:focus-visible{outline:3px solid var(--pf-gold); outline-offset:-3px}
.pfView{position:fixed; inset:0; z-index:4; display:grid; grid-template-rows:1fr auto auto; background:#000; color:#fff; animation:pfIn .2s ease-out}
.pfView .pfX{position:absolute; top:calc(10px + env(safe-area-inset-top)); right:12px; z-index:2}
.pfStage{position:relative; min-height:0; display:grid; place-items:center; background:#000}
.pfStage video,.pfStage img{max-width:100%; max-height:100%; width:100%; height:100%; object-fit:contain; display:block}
.pfSound{position:absolute; right:12px; bottom:12px; width:40px; height:40px; border-radius:50%; border:1px solid rgba(255,255,255,.35); background:rgba(0,0,0,.45); color:#fff}
.pfSound::before{content:"\1F507"; font-size:17px; line-height:40px}
.pfSound[aria-pressed="true"]::before{content:"\1F50A"}
.pfMeta{padding:12px 18px 0; text-align:center}
.pfMeta h3{margin:0; font:400 22px/1.2 "EB Garamond",Georgia,serif}
.pfMeta p{margin:3px 0 0; font:400 12px/1.4 "Jost",sans-serif; letter-spacing:.1em; text-transform:uppercase; color:rgba(255,255,255,.6)}
.pfActs{display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; padding:12px 14px calc(16px + env(safe-area-inset-bottom))}
.pfActs button{display:grid; justify-items:center; gap:3px; min-height:54px; border:0; border-radius:14px; background:rgba(255,255,255,.08); color:#fff; font:500 11px/1 "Jost",sans-serif; letter-spacing:.12em; text-transform:uppercase; padding:8px 4px}
.pfActs button i{font-size:20px; font-style:normal; line-height:1}
.pfActs button b{font-weight:500; font-size:13px; min-height:13px}
.pfActs button b:empty{display:none}
.pfActs button[aria-pressed="true"] i{color:var(--pf-gold)}
.pfActs button[aria-disabled="true"]{opacity:.45}
.pfThread .pfSheetIn{max-height:80vh; overflow:auto; justify-items:stretch; text-align:left}
.pfList{display:grid; gap:10px; min-height:60px}
.pfC p{margin:0; font:400 16px/1.4 "EB Garamond",Georgia,serif}
.pfC .pfDim,.pfDim{font:400 12px/1.5 "Jost",sans-serif; letter-spacing:.04em; color:var(--pf-dim)}
.pfDim a{color:var(--pf-gold)}
.pfLink{border:0; padding:0; background:transparent; color:var(--pf-gold); font:inherit; letter-spacing:inherit; cursor:pointer}
.pfPost{display:grid; grid-template-columns:1fr auto; gap:8px}
.pfPost input{min-height:44px; border:1px solid var(--pf-rule); border-radius:12px; padding:0 12px; background:transparent; color:var(--pf-ink); font:400 16px/1 "EB Garamond",Georgia,serif}
.pfPost .pfGo{min-height:44px; padding:0 18px}

/* ---- the signed-out landing (16 Nov): a strip along the bottom edge, never a panel over the map ---- */
.pfNudge{position:fixed; z-index:95; left:50%; bottom:calc(12px + env(safe-area-inset-bottom, 0px)); transform:translate(-50%, 16px);
  display:flex; align-items:center; gap:10px; width:calc(100% - 24px); max-width:440px; padding:10px 8px 10px 16px; box-sizing:border-box;
  border:1px solid rgba(233,196,106,.35); border-radius:999px; background:rgba(7,10,9,.86); color:rgba(255,255,255,.92);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); box-shadow:0 10px 30px rgba(0,0,0,.45);
  font-family:"Jost","Avenir Next","Helvetica Neue",-apple-system,sans-serif; opacity:0; transition:opacity .3s ease, transform .3s ease; pointer-events:none}
/* pointer-events follow the visible state: at opacity 0 the strip still took the hit (1280x800, 16 Nov: a tap on the leaf
   track at y 770 opened Sign in while nothing was on screen yet; post-deploy QA failed 2 of 58) */
.pfNudge.on{opacity:1; transform:translate(-50%, 0); pointer-events:auto}
.pfNudge.off{opacity:0; transform:translate(-50%, 16px); pointer-events:none}
.pfNudge p{flex:1 1 auto; margin:0; min-width:0; font:italic 400 15px/1.3 "EB Garamond",Georgia,serif}
.pfNudge .pfNudgeGo{flex:none; display:inline-flex; align-items:center; min-height:34px; padding:0 16px; border-radius:999px;
  background:#e9c46a; color:#1a1405; text-decoration:none; font:500 11px/1 "Jost",system-ui,sans-serif; letter-spacing:.14em; text-transform:uppercase}
.pfNudge .pfNudgeX{flex:none; width:34px; height:34px; padding:0; border:0; border-radius:50%; background:transparent; color:rgba(255,255,255,.7);
  font:300 22px/1 "Jost",system-ui,sans-serif; cursor:pointer; -webkit-tap-highlight-color:transparent}
@media (prefers-reduced-motion:reduce){.pfNudge{transition:none}}
